tree->getCurrent(); // Build the CSS class suffix if (!$this->enabled) { $class = ' class="disabled"'; } elseif ($current instanceOf Separator) { $class = $current->get('title') ? ' class="menuitem-group"' : ' class="divider"'; } elseif ($current->hasChildren()) { if ($current->getLevel() == 1) { $class = ' class="dropdown"'; } elseif ($current->get('class') == 'scrollable-menu') { $class = ' class="dropdown scrollable-menu"'; } else { $class = ' class="dropdown-submenu"'; } } else { $class = ''; } // Print the item echo ''; // Print a link if it exists $linkClass = array(); $dataToggle = ''; $dropdownCaret = ''; if ($current->hasChildren()) { $linkClass[] = 'dropdown-toggle'; $dataToggle = ' data-toggle="dropdown"'; if ($current->getLevel() == 1) { $dropdownCaret = ' '; } } else { $linkClass[] = 'no-dropdown'; } if (!($current instanceof Separator) && ($current->getLevel() > 1)) { $iconClass = $this->tree->getIconClass(); if (trim($iconClass)) { $linkClass[] = $iconClass; } } // Implode out $linkClass for rendering $linkClass = ' class="' . implode(' ', $linkClass) . '" '; // Links: component/url/heading/container if ($link = $current->get('link')) { $icon = $current->get('icon'); if ($icon) { if (substr($icon, 0, 6) == 'class:') { $icon = ''; } elseif (substr($icon, 0, 6) == 'image:') { $icon = JHtml::_('image', substr($icon, 6), null, null, true); } else { $icon = JHtml::_('image', $icon, null); } } $target = $current->get('target') ? 'target="' . $current->get('target') . '"' : ''; echo '' . JText::_($current->get('title')) . $icon . $dropdownCaret . ''; } // Separator else { echo '' . JText::_($current->get('title')) . ''; } // Recurse through children if they exist if ($this->enabled && $current->hasChildren()) { if ($current->getLevel() > 1) { $id = $current->get('id') ? ' id="menu-' . strtolower($current->get('id')) . '"' : ''; echo '' . "\n"; } else { echo '\n"; } echo "\n";