Conform to coding guidelines

This commit is contained in:
Matthias Jentsch 2015-05-04 16:29:07 +02:00
parent 5477a2f18e
commit e5e3e80300
4 changed files with 65 additions and 33 deletions

View File

@ -11,8 +11,18 @@ use Icinga\Web\Widget\Tabextension\DashboardAction;
*/
class Monitoring_CommentController extends Controller
{
/**
* The fetched comment
*
* @var stdClass
*/
protected $comment;
/**
* Fetch the first comment with the given id and add tabs
*
* @throws Zend_Controller_Action_Exception
*/
public function init()
{
$commentId = $this->params->get('comment_id');
@ -36,8 +46,7 @@ class Monitoring_CommentController extends Controller
throw new Zend_Controller_Action_Exception($this->translate('Comment not found'));
}
$this->getTabs()
->add(
$this->getTabs()->add(
'comment',
array(
'title' => $this->translate(
@ -50,6 +59,9 @@ class Monitoring_CommentController extends Controller
)->activate('comment')->extend(new DashboardAction());
}
/**
* Display comment detail view
*/
public function showAction()
{
$this->view->comment = $this->comment;
@ -58,6 +70,11 @@ class Monitoring_CommentController extends Controller
}
}
/**
* Create a command form to delete a single comment
*
* @return DeleteCommentCommandForm
*/
private function createDelCommentForm()
{
$this->assertPermission('monitoring/command/comment/delete');

View File

@ -12,8 +12,18 @@ use Icinga\Data\Filter\Filter;
*/
class Monitoring_CommentsController extends Controller
{
/**
* The fetched comments
*
* @var array
*/
protected $comments;
/**
* Fetch all comments matching the current filter and add tabs
*
* @throws Zend_Controller_Action_Exception
*/
public function init()
{
$this->filter = Filter::fromQueryString(str_replace(
@ -40,8 +50,7 @@ class Monitoring_CommentsController extends Controller
throw new Zend_Controller_Action_Exception($this->translate('Comment not found'));
}
$this->getTabs()
->add(
$this->getTabs()->add(
'comments',
array(
'title' => $this->translate(
@ -54,6 +63,9 @@ class Monitoring_CommentsController extends Controller
)->activate('comments')->extend(new DashboardAction());
}
/**
* Display the detail view for a comment list
*/
public function showAction()
{
$this->view->comments = $this->comments;
@ -63,6 +75,9 @@ class Monitoring_CommentsController extends Controller
->setParams($this->params);
}
/**
* Display the form for removing a comment list
*/
public function removeAllAction()
{
$this->assertPermission('monitoring/command/comment/delete');

View File

@ -21,7 +21,7 @@
$this->comment->service_description,
$this->comment->service_display_name,
$this->comment->host_name,
$this->comment->host_display_name
$this->comment->host_display_names
); ?>
</td>
<?php else: ?>