72 lines
1.6 KiB
PHP
72 lines
1.6 KiB
PHP
<?php
|
|
use Joomla\CMS\Helper\ModuleHelper;
|
|
use Joomla\CMS\HTML\HTMLHelper;
|
|
|
|
$hasChildren = $item->hasChildren();
|
|
$hasParent = $item->hasParent();
|
|
|
|
$itemParams = $item->getParams();
|
|
$class = 'item-' . $item->id;
|
|
$mi_class = 'nav-link';
|
|
$aattributes = '';
|
|
|
|
if ($hasParent)
|
|
{
|
|
$mi_class .= " dropdown-item";
|
|
} else {
|
|
// $class .= " nav-item";
|
|
}
|
|
$class .= " nav-item";
|
|
|
|
if ($hasChildren)
|
|
{
|
|
$class .= " dropdown";
|
|
$mi_class .= " dropdown-toggle";
|
|
$aattributes .= ' role="button"';
|
|
}
|
|
if ($item->type === 'separator')
|
|
{
|
|
$class .= ' divider';
|
|
}
|
|
if ($item->id == $default_id)
|
|
{
|
|
$class .= ' default';
|
|
}
|
|
|
|
if ($item->id == $active_id || ($item->type === 'alias' && $itemParams->get('aliasoptions') == $active_id))
|
|
{
|
|
$class .= ' current';
|
|
}
|
|
|
|
echo '<li class="' . $class . '">';
|
|
|
|
switch ($item->type) :
|
|
case 'heading':
|
|
require ModuleHelper::getLayoutPath('mod_menu', 'item-heading');
|
|
break;
|
|
case 'component':
|
|
case 'url':
|
|
require ModuleHelper::getLayoutPath('mod_menu', 'item-url');
|
|
break;
|
|
case 'separator':
|
|
default:
|
|
require ModuleHelper::getLayoutPath('mod_menu', 'item-heading');
|
|
break;
|
|
endswitch;
|
|
|
|
if ($item->hasChildren())
|
|
{
|
|
echo '<ul class="dropdown-menu" aria-labelledby="mi-'.$item->id.'">';
|
|
|
|
foreach ($item->getChildren() as $i => &$item)
|
|
{
|
|
|
|
require ModuleHelper::getLayoutPath('mod_menu', 'item');
|
|
}
|
|
|
|
echo "</ul>";
|
|
}
|
|
|
|
echo "</li>";
|
|
|
|
?>
|