示例#1
0
 public static function getRootPathway()
 {
     $app = JFactory::getApplication();
     $menus = $app->getMenu('site');
     $categoryRoot = JUDirectoryFrontHelperCategory::getRootCategory();
     $needles = array('tree' => array((int) $categoryRoot->id));
     $findMenuTreeRoot = JUDirectoryHelperRoute::findItemId($needles, true);
     $rootPathway = new stdClass();
     if ($findMenuTreeRoot) {
         $menuTreeRoot = $menus->getItem($findMenuTreeRoot);
         $rootPathway->name = $menuTreeRoot->title;
         $rootPathway->link = JRoute::_($menuTreeRoot->link);
     } else {
         $rootPathway->name = html_entity_decode(JText::_('COM_JUDIRECTORY_ROOT'), ENT_COMPAT, 'UTF-8');
         $rootPathway->link = JUDirectoryHelperRoute::getTreeRoute($categoryRoot->id);
     }
     return $rootPathway;
 }