コード例 #1
0
ファイル: breadcrumb.php プロジェクト: kosmosby/medicine-prof
	public static function getRootPathway()
	{
		$app              = JFactory::getApplication();
		$menus            = $app->getMenu('site');
		$categoryRoot     = JUDownloadFrontHelperCategory::getRootCategory();
		$needles          = array(
			'tree' => array((int) $categoryRoot->id)
		);
		$findMenuTreeRoot = JUDownloadHelperRoute::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_JUDOWNLOAD_ROOT'), ENT_COMPAT, 'UTF-8');
			$rootPathway->link = JUDownloadHelperRoute::getTreeRoute($categoryRoot->id);
		}

		return $rootPathway;
	}