2014-02-05 06:35:44 -05:00
|
|
|
<?php
|
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
|
2014-07-03 09:46:46 -04:00
|
|
|
use Icinga\Web\MenuRenderer;
|
2014-02-05 06:35:44 -05:00
|
|
|
use Icinga\Web\Controller\ActionController;
|
2014-02-11 10:21:36 -05:00
|
|
|
use Icinga\Web\Hook;
|
2014-02-05 06:35:44 -05:00
|
|
|
use Icinga\Web\Menu;
|
|
|
|
|
use Icinga\Web\Url;
|
|
|
|
|
|
2014-02-11 10:21:36 -05:00
|
|
|
/**
|
|
|
|
|
* Create complex layout parts
|
|
|
|
|
*/
|
2014-02-05 06:35:44 -05:00
|
|
|
class LayoutController extends ActionController
|
|
|
|
|
{
|
2014-02-11 10:21:36 -05:00
|
|
|
/**
|
|
|
|
|
* Render the menu
|
|
|
|
|
*/
|
2014-02-05 06:35:44 -05:00
|
|
|
public function menuAction()
|
|
|
|
|
{
|
2014-09-08 09:21:14 -04:00
|
|
|
$this->setAutorefreshInterval(15);
|
2014-08-22 05:10:17 -04:00
|
|
|
$this->_helper->layout()->disableLayout();
|
2014-09-08 09:21:14 -04:00
|
|
|
|
2014-09-09 07:57:48 -04:00
|
|
|
$url = Url::fromRequest();
|
|
|
|
|
$menu = new MenuRenderer(Menu::load(), $url->getRelativeUrl());
|
2014-09-09 09:33:42 -04:00
|
|
|
$this->view->menuRenderer = $menu->useCustomRenderer();
|
2014-02-05 06:35:44 -05:00
|
|
|
}
|
2014-02-11 10:21:36 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Render the top bar
|
|
|
|
|
*/
|
|
|
|
|
public function topbarAction()
|
|
|
|
|
{
|
|
|
|
|
$topbarHtmlParts = array();
|
|
|
|
|
|
2014-08-27 05:28:31 -04:00
|
|
|
/** @var Hook\TopBarHook $hook */
|
2014-02-11 10:21:36 -05:00
|
|
|
$hook = null;
|
|
|
|
|
|
2014-02-12 03:58:59 -05:00
|
|
|
foreach (Hook::all('TopBar') as $hook) {
|
2014-08-27 05:28:31 -04:00
|
|
|
$topbarHtmlParts[] = $hook->getHtml($this->getRequest());
|
2014-02-11 10:21:36 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->view->topbarHtmlParts = $topbarHtmlParts;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->renderScript('parts/topbar.phtml');
|
|
|
|
|
}
|
2014-02-05 06:35:44 -05:00
|
|
|
}
|