From 675d070b86808bb4ca6b520f2e5bae456875b7fc Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 15 Apr 2015 15:33:00 +0200 Subject: [PATCH] Set the view property `compact' exactly once refs #7876 --- library/Icinga/Web/Controller/ActionController.php | 1 + .../monitoring/application/controllers/ChartController.php | 5 ----- .../monitoring/application/controllers/ListController.php | 1 - .../monitoring/application/controllers/ShowController.php | 2 -- .../monitoring/application/views/scripts/show/contact.phtml | 5 ++++- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php index 26e0e452a..b78090a7f 100644 --- a/library/Icinga/Web/Controller/ActionController.php +++ b/library/Icinga/Web/Controller/ActionController.php @@ -87,6 +87,7 @@ class ActionController extends Zend_Controller_Action $this->_helper->layout()->isIframe = $request->getUrl()->shift('isIframe'); $this->_helper->layout()->moduleName = false; + $this->view->compact = $request->getParam('view') === 'compact'; if ($this->rerenderLayout = $request->getUrl()->shift('renderLayout')) { $this->xhrLayout = 'body'; } diff --git a/modules/monitoring/application/controllers/ChartController.php b/modules/monitoring/application/controllers/ChartController.php index 08f9334ee..39f60c304 100644 --- a/modules/monitoring/application/controllers/ChartController.php +++ b/modules/monitoring/application/controllers/ChartController.php @@ -16,11 +16,6 @@ use Icinga\Chart\Unit\LinearUnit; class Monitoring_ChartController extends Controller { - public function init() - { - $this->view->compact = $this->_request->getParam('view') === 'compact'; - } - private function drawLogChart1() { $chart = new GridChart(); diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index e1726a68d..ac1d41590 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -21,7 +21,6 @@ class Monitoring_ListController extends Controller public function init() { $this->createTabs(); - $this->view->compact = $this->_request->getParam('view') === 'compact'; } /** diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 0d7df501a..fe5633ab2 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -167,8 +167,6 @@ class Monitoring_ShowController extends Controller )); $notifications->where('contact_object_id', $contact->contact_object_id); - - $this->view->compact = true; $this->view->notifications = $notifications->paginate(); } diff --git a/modules/monitoring/application/views/scripts/show/contact.phtml b/modules/monitoring/application/views/scripts/show/contact.phtml index c4142707a..1ad5eccf9 100644 --- a/modules/monitoring/application/views/scripts/show/contact.phtml +++ b/modules/monitoring/application/views/scripts/show/contact.phtml @@ -57,7 +57,10 @@ -render('list/notifications.phtml') ?> +partial('list/notifications.phtml', array( + 'notifications' => $notifications, + 'compact' => true +)); ?>
translate('No notifications have been sent for this contact') ?>