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-08-21 16:11:22 +02:00
|
|
|
<ul class="nav nav-stacked" >
|
|
|
|
<?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-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;
|
|
|
|
}
|
|
|
|
$activeSet = $activeSet || $active;
|
|
|
|
?>
|
|
|
|
<li class="<?= $active ? "active" : "" ?>">
|
|
|
|
<a href="<?= $url ?>"><?= $itemName ?></a>
|
|
|
|
</li>
|
|
|
|
<?php
|
|
|
|
$class = "";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</ul>
|
2013-07-10 17:03:51 +02:00
|
|
|
<? endif ?>
|