2013-06-14 13:51:44 +02:00
|
|
|
<?php
|
2013-08-20 20:12:40 +02:00
|
|
|
// determine current key
|
|
|
|
$url = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
|
|
|
|
$currentKey = isset($this->navkey) ? $this->navkey : $url;
|
2013-06-14 13:51:44 +02:00
|
|
|
|
2013-08-20 20:12:40 +02:00
|
|
|
$item = $this->navigation->keys("menu");
|
2013-06-14 13:51:44 +02:00
|
|
|
?>
|
2013-07-10 17:03:51 +02:00
|
|
|
<?php if ($this->auth()->isAuthenticated()): ?>
|
2013-09-11 17:19:18 +02:00
|
|
|
<ul class="nav nav-stacked" role="navigation" id="icinganavigation">
|
2013-08-21 16:11:22 +02:00
|
|
|
<?php
|
|
|
|
$activeSet = false;
|
|
|
|
foreach ($item as $itemName) {
|
|
|
|
if($itemName[0] == "_") {
|
|
|
|
?>
|
|
|
|
<li class="section-end"></li>
|
|
|
|
<?php
|
|
|
|
continue;
|
|
|
|
}
|
2013-06-14 13:51:44 +02:00
|
|
|
|
2013-08-21 16:11:22 +02:00
|
|
|
$item = $this->navigation->menu->$itemName;
|
|
|
|
$active = false;
|
|
|
|
$url = "";
|
2013-10-14 13:00:27 +02:00
|
|
|
$iconClass = '';
|
2013-06-14 13:51:44 +02:00
|
|
|
|
2013-08-21 16:11:22 +02:00
|
|
|
if (is_string($item)) {
|
|
|
|
$active = !$activeSet && $this->baseUrl($item) == $currentKey;
|
|
|
|
$url = $this->baseUrl($item);
|
|
|
|
} else {
|
|
|
|
$url = $this->baseUrl(isset($item->route) ? $item->route : "");
|
|
|
|
$itemName = isset($item->title) ? $item->title : $itemName;
|
|
|
|
$active = !$activeSet && (isset($item->key) ? $item->key : $url) === $currentKey;
|
2013-10-14 13:00:27 +02:00
|
|
|
if (isset($item->iconClass)) {
|
|
|
|
$iconClass = $item->iconClass;
|
|
|
|
}
|
2013-08-21 16:11:22 +02:00
|
|
|
}
|
|
|
|
$activeSet = $activeSet || $active;
|
|
|
|
?>
|
2013-10-16 14:48:22 +02:00
|
|
|
<li class="<?= $active ? "active" : "" ?>">
|
|
|
|
<a href="<?= $url ?>">
|
|
|
|
<?php if ($iconClass): ?>
|
|
|
|
<i class="<?= $iconClass; ?>"></i>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?= $itemName ?>
|
|
|
|
</a>
|
2013-08-21 16:11:22 +02:00
|
|
|
</li>
|
|
|
|
<?php
|
|
|
|
$class = "";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</ul>
|
2013-07-10 17:03:51 +02:00
|
|
|
<? endif ?>
|