2021-04-25 09:49:47 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/* Based on https://github.com/fabiopaiva/zf2-navigation-bootstrap3 */
|
|
|
|
|
|
|
|
/* @var $container Zend\Navigation\Navigation */
|
|
|
|
$container = $this->container;
|
|
|
|
$layoutAttributes = [
|
|
|
|
'dropdown' => 'class="dropdown menu" data-dropdown-menu',
|
|
|
|
'vertical' => 'class="vertical menu accordion-menu" data-accordion-menu data-submenu-toggle="true"',
|
|
|
|
]
|
|
|
|
?>
|
2021-04-25 22:12:03 +02:00
|
|
|
|
2021-04-25 09:49:47 +02:00
|
|
|
<ul <?php echo $layoutAttributes[$layout]; ?>>
|
|
|
|
<?php foreach ($container as $page): ?>
|
2021-04-26 12:37:54 +02:00
|
|
|
|
|
|
|
<?= $page->id; ?>
|
|
|
|
|
2021-04-25 09:49:47 +02:00
|
|
|
<?php if (!$this->navigation()->accept($page)) continue; ?>
|
|
|
|
<?php /* @var $page Zend\Navigation\Page\Mvc */ ?>
|
|
|
|
<?php $hasChildren = $page->hasPages() ?>
|
|
|
|
<?php $showChildren = $this->themeSetting('nav_show_levels'); ?>
|
|
|
|
<?php if (!$hasChildren || ($showChildren == 0)): ?>
|
2021-05-24 19:10:27 +02:00
|
|
|
<?php
|
|
|
|
$substring = "collections";
|
|
|
|
$length = strlen($substring);
|
|
|
|
if ( substr_compare($page->getHref(), $substring, -$length) === 0 ) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
?>
|
2021-04-25 09:49:47 +02:00
|
|
|
<li<?php if ($page->isActive()) echo ' class="active"' ?>>
|
2021-04-25 22:12:03 +02:00
|
|
|
<a
|
|
|
|
class="nav-header"
|
2021-04-25 09:49:47 +02:00
|
|
|
href="<?php echo $page->getHref() ?>"
|
|
|
|
<?php if ($page->getTarget() != ""): ?>
|
|
|
|
target="<?php echo $page->getTarget(); ?>"
|
|
|
|
<?php endif; ?>
|
|
|
|
>
|
|
|
|
<?php if ($page->get("icon") !== ""): ?>
|
|
|
|
<span class="<?php echo $page->get("icon"); ?>"></span>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php echo $this->escapeHtml($this->translate($page->getLabel(), $this->navigation($container)->getTranslatorTextDomain())); ?>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php else: ?>
|
|
|
|
<?php
|
|
|
|
//check if access is allowed at least one item
|
|
|
|
$access = false;
|
|
|
|
foreach ($page->getPages() as $child) {
|
|
|
|
if ($this->navigation()->accept($child) && $child->get("separator") !== true) {
|
|
|
|
$access = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($access) :
|
|
|
|
?>
|
|
|
|
<li class="dropdown<?php if ($page->isActive(true)) echo ' active' ?>">
|
|
|
|
<a class="dropdown-toggle" data-toggle="dropdown" href="<?php echo $page->getHref(); ?>">
|
|
|
|
<?php echo $this->escapeHtml($this->translate($page->getLabel(),$this->navigation($container)->getTranslatorTextDomain())); ?>
|
|
|
|
<b class="caret"></b>
|
|
|
|
</a>
|
|
|
|
<ul class="menu vertical nested">
|
|
|
|
<?php foreach ($page->getPages() as $child): ?>
|
|
|
|
<?php if (!$this->navigation()->accept($child)) continue; ?>
|
|
|
|
<?php if ($child->get("separator") === true): ?>
|
|
|
|
<li class="divider"></li>
|
|
|
|
<?php
|
|
|
|
continue;
|
|
|
|
endif;
|
|
|
|
?>
|
|
|
|
<li<?php if ($child->isActive()) echo ' class="active"' ?>>
|
2021-04-25 22:12:03 +02:00
|
|
|
<a
|
2021-04-25 09:49:47 +02:00
|
|
|
href="<?php echo $child->getHref() ?>"
|
|
|
|
<?php if ($child->getTarget() != ""): ?>
|
|
|
|
target="<?php echo $child->getTarget(); ?>"
|
|
|
|
<?php endif; ?> >
|
|
|
|
<?php if ($child->get("icon") !== ""): ?>
|
|
|
|
<span class="<?php echo $child->get("icon"); ?>"></span>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php echo $this->escapeHtml($this->translate($child->getLabel(),$this->navigation($container)->getTranslatorTextDomain())); ?>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</ul>
|
2021-04-25 22:12:03 +02:00
|
|
|
</li>
|
2021-04-25 09:49:47 +02:00
|
|
|
<?php endif; ?>
|
|
|
|
<?php endif ?>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</ul>
|