Ejemplo n.º 1
0
 * Menus Submenu
**/
if ($user->authorise('core.manage', 'com_menus')) {
    $menu->addChild(new JMenuNode(JText::_('MOD_MENU_ADV_MENUS'), null, 'disabled'));
}
/**
 * Content Submenu
**/
if ($user->authorise('core.manage', 'com_content')) {
    $menu->addChild(new JMenuNode(JText::_('MOD_MENU_ADV_COM_CONTENT'), null, 'disabled'));
}
/**
 * Components Submenu
**/
// Get the authorised components and sub-menus.
$components = ModMenuAdvHelper::getComponents(true);
// Check if there are any components, otherwise, don't display the components menu item
if ($components) {
    $menu->addChild(new JMenuNode(JText::_('MOD_MENU_ADV_COMPONENTS'), null, 'disabled'));
}
/**
 * Extensions Submenu
**/
$im = $user->authorise('core.manage', 'com_installer');
$mm = $user->authorise('core.manage', 'com_modules');
$pm = $user->authorise('core.manage', 'com_plugins');
$tm = $user->authorise('core.manage', 'com_templates');
$lm = $user->authorise('core.manage', 'com_languages');
if ($im || $mm || $pm || $tm || $lm) {
    $menu->addChild(new JMenuNode(JText::_('MOD_MENU_ADV_EXTENSIONS_EXTENSIONS'), null, 'disabled'));
}
Ejemplo n.º 2
0
    }
    if ($tm) {
        $menu->addChild(new JMenuNode(JText::_('MOD_MENU_ADV_EXTENSIONS_TEMPLATE_MANAGER'), 'index.php?option=com_templates', 'class:themes'), true);
        // $menu->addChild(new JMenuNode(JText::_("MOD_MENU_ADV_EXTENSIONS_TEMPLATE_MANAGER_STYLES"), 'index.php?option=com_templates','list-styles'));
        $menu->addChild(new JMenuNode(JText::_("MOD_MENU_ADV_EXTENSIONS_TEMPLATE_MANAGER_STYLES"), 'index.php?option=com_templates', 'list-styles'), true);
        $styles = ModMenuAdvHelper::getStyles();
        foreach ($styles as $style) {
            $menuTitle = $style->title;
            if ($style->client_id == 1) {
                $menuTitle .= " [admin]";
            }
            $menu->addChild(new JMenuNode($menuTitle, 'index.php?option=com_templates&task=style.edit&id=' . $style->id));
        }
        $menu->getParent();
        $menu->addChild(new JMenuNode(JText::_("MOD_MENU_ADV_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES"), 'index.php?option=com_templates&view=templates', 'list-templates'), true);
        $templates = ModMenuAdvHelper::getTemplates();
        foreach ($templates as $tmpl) {
            $menuTitle = $tmpl->name;
            if ($tmpl->client_id == 1) {
                $menuTitle .= " [admin]";
            }
            $menu->addChild(new JMenuNode($menuTitle, 'index.php?option=com_templates&view=template&id=' . $tmpl->extension_id));
        }
        $menu->getParent();
        $menu->getParent();
    }
    if ($lm) {
        $menu->addChild(new JMenuNode(JText::_('MOD_MENU_ADV_EXTENSIONS_LANGUAGE_MANAGER'), 'index.php?option=com_languages', 'class:language'));
    }
    $menu->getParent();
}