Set the view property `compact' exactly once

refs #7876
This commit is contained in:
Johannes Meyer 2015-04-15 15:33:00 +02:00
parent 32e8b606b4
commit 675d070b86
5 changed files with 5 additions and 9 deletions

View File

@ -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';
}

View File

@ -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();

View File

@ -21,7 +21,6 @@ class Monitoring_ListController extends Controller
public function init()
{
$this->createTabs();
$this->view->compact = $this->_request->getParam('view') === 'compact';
}
/**

View File

@ -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();
}

View File

@ -57,7 +57,10 @@
</div>
<?php if (count($notifications)): ?>
<?= $this->render('list/notifications.phtml') ?>
<?= $this->partial('list/notifications.phtml', array(
'notifications' => $notifications,
'compact' => true
)); ?>
<?php else: ?>
<div class="content"><?= $this->translate('No notifications have been sent for this contact') ?></div>
<?php endif ?>