當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JCategories::instances方法代碼示例

本文整理匯總了PHP中JCategories::instances方法的典型用法代碼示例。如果您正苦於以下問題:PHP JCategories::instances方法的具體用法?PHP JCategories::instances怎麽用?PHP JCategories::instances使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JCategories的用法示例。


在下文中一共展示了JCategories::instances方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getList


//.........這裏部分代碼省略.........
                 $tmpuri = clone $uri;
                 $router->parse($tmpuri);
                 $vars = $router->getVars();
                 $vars['lang'] = $language->sef;
                 $vars['Itemid'] = $itemid;
                 $url = 'index.php?' . JURI::buildQuery($vars);
                 if ($app->getCfg('sef') == '1') {
                     $language->link = JRoute::_($url);
                 } else {
                     $language->link = $url;
                 }
             } else {
                 //sef case
                 if ($app->getCfg('sef') == '1') {
                     //sefToolsEnabled
                     if ($sefToolsEnabled) {
                         $itemid = isset($homes[$language->lang_code]) ? $homes[$language->lang_code]->id : $homes['*']->id;
                         $language->link = JRoute::_('index.php?lang=' . $language->sef . '&Itemid=' . $itemid);
                         continue;
                     }
                     //$uri->setVar('lang',$language->sef);
                     $router = JApplication::getRouter();
                     $tmpuri = clone $uri;
                     $router->parse($tmpuri);
                     $vars = $router->getVars();
                     //workaround to fix index language
                     $vars['lang'] = $language->sef;
                     //since 2.2.1
                     //case of article category view
                     //set the language used to reload category with the right language
                     $jfm = FalangManager::getInstance();
                     if (!empty($vars['view']) && $vars['view'] == 'category' && !empty($vars['option']) && $vars['option'] == 'com_content') {
                         if ($language->lang_code != $default_lang || $lang->getTag() != $default_lang) {
                             JCategories::$instances = array();
                             $jfm->setLanguageForUrlTranslation($language->lang_code);
                         }
                     }
                     //end since 2.2.1
                     //case of category article
                     //set the language used to reload category with the right language
                     if (!empty($vars['view']) && $vars['view'] == 'article' && !empty($vars['option']) && $vars['option'] == 'com_content') {
                         //since 2.2.1
                         if ($language->lang_code != $default_lang || $lang->getTag() != $default_lang) {
                             JCategories::$instances = array();
                             $jfm->setLanguageForUrlTranslation($language->lang_code);
                         }
                         //end 2.2.1
                         if (FALANG_J30) {
                             JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel');
                             $model = JModelLegacy::getInstance('Article', 'ContentModel', array('ignore_request' => true));
                             $appParams = JFactory::getApplication()->getParams();
                         } else {
                             JModel::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel');
                             $model =& JModel::getInstance('Article', 'ContentModel', array('ignore_request' => true));
                             $appParams = JFactory::getApplication()->getParams();
                         }
                         $model->setState('params', $appParams);
                         //in sef some link have this url
                         //index.php/component/content/article?id=39
                         //id is not in vars but in $tmpuri
                         if (empty($vars['id'])) {
                             $tmpid = $tmpuri->getVar('id');
                             if (!empty($tmpid)) {
                                 $vars['id'] = $tmpuri->getVar('id');
                             } else {
                                 continue;
開發者ID:enjoy2000,項目名稱:714water,代碼行數:67,代碼來源:helper.php


注:本文中的JCategories::instances方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。