示例#1
0
 function get()
 {
     global $mainframe;
     // Lets get some variables we are going to need
     $menu = JToolBar::getInstance('submenu');
     $list = $menu->_bar;
     if (!is_array($list) || !count($list)) {
         $option = JRequest::getCmd('option');
         if ($option == 'com_categories') {
             $section = JRequest::getCmd('section');
             if ($section) {
                 if ($section != 'content') {
                     // special handling for specific core components
                     $map['com_contact_details'] = 'com_contact';
                     $map['com_banner'] = 'com_banners';
                     $option = isset($map[$section]) ? $map[$section] : $section;
                 }
             }
         }
         $list = JAdminSubMenu::_loadDBList($option);
     }
     if (!is_array($list) || !count($list)) {
         return null;
     }
     $hide = JRequest::getInt('hidemainmenu');
     $txt = "<ul id=\"submenu\">\n";
     /*
      * Iterate through the link items for building the menu items
      */
     foreach ($list as $item) {
         $txt .= "<li>\n";
         if ($hide) {
             if (isset($item[2]) && $item[2] == 1) {
                 $txt .= "<span class=\"nolink active\">" . $item[0] . "</span>\n";
             } else {
                 $txt .= "<span class=\"nolink\">" . $item[0] . "</span>\n";
             }
         } else {
             if (isset($item[2]) && $item[2] == 1) {
                 $txt .= "<a class=\"active\" href=\"" . JFilterOutput::ampReplace($item[1]) . "\">" . $item[0] . "</a>\n";
             } else {
                 $txt .= "<a href=\"" . JFilterOutput::ampReplace($item[1]) . "\">" . $item[0] . "</a>\n";
             }
         }
         $txt .= "</li>\n";
     }
     $txt .= "</ul>\n";
     return $txt;
 }
 function get()
 {
     global $mainframe;
     // Lets get some variables we are going to need
     $menu = JToolBar::getInstance('submenu');
     $list = $menu->_bar;
     if (!is_array($list) || !count($list)) {
         $option = JRequest::getCmd('option');
         $list = JAdminSubMenu::_loadDBList($option);
     }
     if (!is_array($list) || !count($list)) {
         return null;
     }
     $hide = JRequest::getInt('hidemainmenu');
     $txt = "<ul id=\"submenu\">\n";
     /*
      * Iterate through the link items for building the menu items
      */
     foreach ($list as $item) {
         $txt .= "<li>\n";
         if ($hide) {
             if (isset($item[2]) && $item[2] == 1) {
                 $txt .= "<span class=\"nolink active\">" . $item[0] . "</span>\n";
             } else {
                 $txt .= "<span class=\"nolink\">" . $item[0] . "</span>\n";
             }
         } else {
             if (isset($item[2]) && $item[2] == 1) {
                 $txt .= "<a class=\"active\" href=\"" . JFilterOutput::ampReplace($item[1]) . "\">" . $item[0] . "</a>\n";
             } else {
                 $txt .= "<a href=\"" . JFilterOutput::ampReplace($item[1]) . "\">" . $item[0] . "</a>\n";
             }
         }
         $txt .= "</li>\n";
     }
     $txt .= "</ul>\n";
     return $txt;
 }