if ($createContent) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_NEW_CATEGORY'), 'index.php?option=com_categories&task=category.add&extension=com_content', 'class:newarticle')); $menu->getParent(); } $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_FEATURED'), 'index.php?option=com_content&view=featured', 'class:featured')); if ($user->authorise('core.manage', 'com_media')) { $menu->addSeparator(); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MEDIA_MANAGER'), 'index.php?option=com_media', 'class:media')); } $menu->getParent(); } /* * Components Submenu */ // Get the authorised components and sub-menus. $components = ModMenuHelper::getComponents(true); // Check if there are any components, otherwise, don't render the menu if ($components) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COMPONENTS'), '#'), true); foreach ($components as &$component) { if (!empty($component->submenu)) { // This component has a db driven submenu. $menu->addChild(new JMenuNode($component->text, $component->link, $component->img), true); foreach ($component->submenu as $sub) { $menu->addChild(new JMenuNode($sub->text, $sub->link, $sub->img)); } $menu->getParent(); } else { $menu->addChild(new JMenuNode($component->text, $component->link, $component->img)); } }