icingaweb2/application/layouts/scripts/parts/menu.phtml

34 lines
782 B
PHTML
Raw Normal View History

<?php
if (! $this->level) {
$this->level = 0;
}
?>
<ul<?= $this->level === 0 ? ' role="navigation"' : '' ?>>
2014-02-18 19:23:03 +01:00
<?php
foreach ($this->items as $item) {
printf(
' <li%s><a href="%s">%s%s</a>',
$this->href($this->url) === $this->href($item->getUrl()) ? ' class="active"' : '',
$item->getUrl() ? $this->href($item->getUrl()) : '#',
$item->getIcon() ? $this->img(
$item->getIcon(),
array('class' => 'icon')
2014-02-18 19:23:03 +01:00
) . ' ' : '',
2014-02-25 11:13:36 +01:00
$this->escape($item->getTitle())
2014-02-18 19:23:03 +01:00
);
if ($item->hasChildren()) {
echo $this->partial(
'parts/menu.phtml',
array('items' => $item->getChildren(), 'url' => $this->url, 'level' => $this->level + 1)
2014-02-18 19:23:03 +01:00
);
}
echo "</li>\n";
}
?>
</ul>