2014-02-05 12:35:44 +01:00
|
|
|
<?php
|
|
|
|
// @codingStandardsIgnoreStart
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
|
|
|
use Icinga\Web\Controller\ActionController;
|
2014-02-11 16:21:36 +01:00
|
|
|
use Icinga\Web\Hook;
|
2014-02-05 12:35:44 +01:00
|
|
|
use Icinga\Web\Menu;
|
|
|
|
use Icinga\Web\Url;
|
|
|
|
|
2014-02-11 16:21:36 +01:00
|
|
|
/**
|
|
|
|
* Create complex layout parts
|
|
|
|
*/
|
2014-02-05 12:35:44 +01:00
|
|
|
class LayoutController extends ActionController
|
|
|
|
{
|
2014-02-11 16:21:36 +01:00
|
|
|
/**
|
|
|
|
* Render the menu
|
|
|
|
*/
|
2014-02-05 12:35:44 +01:00
|
|
|
public function menuAction()
|
|
|
|
{
|
|
|
|
$this->view->url = Url::fromRequest()->getRelativeUrl();
|
|
|
|
$this->view->items = Menu::fromConfig()->getChildren();
|
|
|
|
$this->view->sub = false;
|
|
|
|
}
|
2014-02-11 16:21:36 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Render the top bar
|
|
|
|
*/
|
|
|
|
public function topbarAction()
|
|
|
|
{
|
|
|
|
$topbarHtmlParts = array();
|
|
|
|
|
|
|
|
/** @var Hook\Layout\TopBar $hook */
|
|
|
|
$hook = null;
|
|
|
|
|
2014-02-12 09:58:59 +01:00
|
|
|
foreach (Hook::all('TopBar') as $hook) {
|
2014-02-11 16:21:36 +01:00
|
|
|
$topbarHtmlParts[] = $hook->getHtml($this->getRequest(), $this->view);
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->view->topbarHtmlParts = $topbarHtmlParts;
|
|
|
|
|
|
|
|
|
|
|
|
$this->renderScript('parts/topbar.phtml');
|
|
|
|
}
|
2014-02-05 12:35:44 +01:00
|
|
|
}
|
|
|
|
// @codingStandardsIgnoreEnd
|