function getSubMenuLinks($key) { $links = array(); $links['content'] = array(array('url' => 'index.php?option=com_sections&scope=content', 'text' => 'SECTIONS'), array('url' => 'index.php?option=com_categories&scope=content', 'text' => 'CATEGORIES'), array('url' => 'index.php?option=com_frontpage', 'text' => 'FRONTPAGE')); $links['templates'] = array(array('url' => 'index.php?option=com_templates&task=edit&cid[]=adminpraise3&client=1', 'text' => 'ADMIN TEMPLATE PARAMS'), array('url' => 'index.php?option=com_installer', 'text' => 'INSTALL TEMPLATES'), array('url' => 'index.php?option=com_installer&task=manage&type=templates', 'text' => 'MANAGE TEMPLATES')); $links['modules'] = array(array('url' => 'index.php?option=com_installer', 'text' => 'INSTALL MODULES'), array('url' => 'index.php?option=com_installer&task=manage&type=modules', 'text' => 'MANAGE MODULES')); $links['plugins'] = array(array('url' => 'index.php?option=com_installer', 'text' => 'INSTALL PLUGINS'), array('url' => 'index.php?option=com_installer&task=manage&type=plugins', 'text' => 'MANAGE PLUGINS')); $links['cpanel'] = array(array('url' => 'index.php?option=com_modules&client=1&task=add', 'text' => 'NEW DASHBOARD MODULE'), array('url' => 'index.php?option=com_modules&client=1', 'text' => 'MANAGE DASHBOARD MODULES')); $links['components'] = array(array('url' => 'index.php?option=com_installer', 'text' => 'INSTALL COMPONENTS'), array('url' => 'index.php?option=com_installer&task=manage&type=components', 'text' => 'MANAGE COMPONENTS')); $links['users'] = array(array('url' => 'index.php?option=com_users&filter_logged=1', 'text' => 'LOGGED IN USERS')); $adminLinks = AdminPraise3MenuHelper::getMainMenuLinks('admin'); $links['admin'] = $adminLinks['children']; array_shift($links['admin']); $pfLinks = AdminPraise3MenuHelper::getCustomComponentLinks('projectfork'); $pfChildren = $pfLinks['children']; $pfClasses = array('pf_button_controlpanel', 'pf_button_projects', 'pf_button_tasks', 'pf_button_time', 'pf_button_filemanager', 'pf_button_calendar', 'pf_button_board', 'pf_button_profile', 'pf_button_users', 'pf_button_groups', 'pf_button_config'); for ($i = 0; $i < count($pfChildren); $i++) { $pfChildren[$i]['li-class'] = $pfClasses[$i]; } $links['projectfork'] = $pfChildren; $vmLinks = AdminPraise3MenuHelper::getCustomComponentLinks('virtuemart'); $vmChildren = $vmLinks['children']; $links['virtuemart'] = $vmChildren; if (isset($links[$key])) { return $links[$key]; } else { return array(); } }
<?php defined('_JEXEC') or die('Restricted access'); $menu = AdminPraise3Menu::getInstance(); $html = null; if ($this->get('option') == "com_content" || $this->get('option') == "com_sections" || $this->get('option') == "com_categories" && $this->get('scope') == "content" || $this->get('option') == "com_frontpage") { $html .= $menu->renderSubmenu('content'); } if ($this->get('option') == "com_menus") { $menus = AdminPraise3MenuHelper::getMenus(); $links = array(); for ($i = 0; $i < count($menus); $i++) { $m = $menus[$i]; $url = 'index.php?option=com_menus&task=view&menutype=' . $m->menutype; $newLink = array('url' => $url, 'text' => $m->title); $newLink['children'] = array(array('url' => $url . '&task=newItem', 'text' => JText::_('NEW') . ' ' . $m->title . ' ' . JText::_('ITEM'))); $links[] = $newLink; } $html .= $menu->renderChildren($links, 0, false); } elseif ($this->get('option') == "com_templates") { $html .= $menu->renderSubmenu('templates'); } elseif ($this->get('option') == "com_modules") { $html .= $menu->renderSubmenu('modules'); } elseif ($this->get('option') == "com_plugins") { $html .= $menu->renderSubmenu('plugins'); } elseif ($this->get('ap_task') == "list_components") { $html .= $menu->renderSubmenu('components'); } elseif ($this->get('option') == "com_users") { $html .= $menu->renderSubmenu('users'); //elseif (($this->get('ap_task') == "admin") && ($this->_user->get('gid') > 24) || ($this->get('option') =="com_cpanel") && ($this->get('ap_task_set') !="list_components") && ($this->_user->get('gid') > 24)) : // $html .= $menu->renderSubmenu('cpanel');
function renderSubmenu($type) { $links = AdminPraise3MenuHelper::getSubMenuLinks($type); return $this->renderChildren($links); }
<?php defined('_JEXEC') or die('Restricted access'); $menu = AdminPraise3Menu::getInstance(); $components = AdminPraise3MenuHelper::getComponents(); require $tmpl_path . '/default.php';