2014-03-20 12:18:51 +01:00
|
|
|
<ul>
|
2014-02-05 12:35:44 +01:00
|
|
|
<?php foreach ($items as $item): ?>
|
|
|
|
<?php
|
|
|
|
$itemClass = '';
|
|
|
|
if ($sub) {
|
2014-03-20 12:18:51 +01:00
|
|
|
// $itemClass .= 'submenu ';
|
2014-02-05 12:35:44 +01:00
|
|
|
}
|
|
|
|
if ($this->href($url) === $this->href($item->getUrl())) {
|
|
|
|
$itemClass .= 'active ';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<li <?php if (!empty($itemClass)): ?>class="<?= $itemClass ?>"<?php endif ?>>
|
|
|
|
<?php if($item->getUrl()): ?>
|
2014-02-11 15:27:42 +01:00
|
|
|
<a href="<?= $this->href($item->getUrl()); ?>" <?php foreach($item->getAttribs() as $attrib => $value): ?> <?= $attrib ?>="<?= $value ?>"<?php endforeach?>>
|
2014-02-05 12:35:44 +01:00
|
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
|
|
if ($icon = $item->getIcon()) {
|
2014-02-11 16:35:36 +01:00
|
|
|
echo $this->img($icon, array('height' => 16, 'width' => 16));
|
2014-02-05 12:35:44 +01:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
<?php if ($iconClass = $item->getIconClass()): ?>
|
|
|
|
<i class="<?= $iconClass ?>"></i>
|
|
|
|
<?php endif ?>
|
|
|
|
<?= $item->getTitle();?>
|
|
|
|
<?php if($item->getUrl()): ?>
|
|
|
|
</a>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
|
|
if($item->hasChildren()) {
|
|
|
|
echo $this->partial(
|
|
|
|
'layout/menu.phtml',
|
|
|
|
'default',
|
|
|
|
array('items' => $item->getChildren(), 'sub' => true, 'url' => $this->url)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</li>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</ul>
|