本文整理汇总了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;