24 lines
669 B
PHTML
24 lines
669 B
PHTML
<?php
|
|
|
|
use Icinga\Web\Url;
|
|
use Icinga\Web\Menu;
|
|
|
|
// Don't render a menu for unauthenticated users unless menu is auth aware
|
|
if (! $this->auth()->isAuthenticated()) {
|
|
return;
|
|
}
|
|
|
|
// Current url
|
|
$url = Url::fromRequest()->remove('_render')->getRelativeUrl();
|
|
$menu = Menu::fromConfig();
|
|
?>
|
|
<div id="menu" data-base-target="_main">
|
|
<form action="<?= $this->href('search') ?>" method="get">
|
|
<input type="text" name="q" class="search" placeholder="Search..." autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
|
|
</form>
|
|
<?= $this->partial('parts/menu.phtml', array(
|
|
'items' => $menu->getChildren(),
|
|
'url' => $url
|
|
)) ?>
|
|
</div>
|