本文整理汇总了PHP中JoomFishManager::getActiveLanguages方法的典型用法代码示例。如果您正苦于以下问题:PHP JoomFishManager::getActiveLanguages方法的具体用法?PHP JoomFishManager::getActiveLanguages怎么用?PHP JoomFishManager::getActiveLanguages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoomFishManager
的用法示例。
在下文中一共展示了JoomFishManager::getActiveLanguages方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shGetActiveLanguages
function shGetActiveLanguages()
{
global $mainframe;
static $shActiveLanguages = null;
// cache this, to reduce DB queries
if (!is_null($shActiveLanguages)) {
return $shActiveLanguages;
}
$shKind = shIsMultilingual();
if ($shKind == 'joomfish') {
$tempList = JoomFishManager::getActiveLanguages();
if (!empty($tempList)) {
foreach ($tempList as $language) {
$shLang = null;
$shLang->code = $language->code;
$shLang->iso = $language->shortcode;
$shActiveLanguages[] = $shLang;
}
} else {
$shKind = '';
}
}
if (empty($shKind)) {
// not multilingual
$shActiveLanguages = shGetFrontEndActiveLanguages();
}
return $shActiveLanguages;
}
示例2: shGetActiveLanguages
function shGetActiveLanguages() {
$mainframe = JFactory::getApplication();
static $shActiveLanguages = null; // cache this, to reduce DB queries
if (!is_null($shActiveLanguages))
return $shActiveLanguages;
$shKind = shIsMultilingual();
switch ($shKind) {
case 'joomfish':
$languages = JoomFishManager::getActiveLanguages();
if (!empty($languages)) {
foreach ($languages as $language) {
$shLang = null;
$shLang->code = $language->code;
$shLang->iso = $language->shortcode;
$shActiveLanguages[] = $shLang;
}
} else $shKind = '';
break;
case 'joomla':
jimport('joomla.language.helper');
$languages = JLanguageHelper::getLanguages();
if (!empty($languages)) {
foreach ($languages as $language) {
$shLang = null;
$shLang->code = $language->lang_code;
$shLang->iso = $language->sef;
if(empty($shLang->iso)) {
$shLang->iso = substr( $language->lang_code, 0, 2);
}
$shActiveLanguages[] = $shLang;
}
} else $shKind = '';
break;
}
if (empty($shKind)) {
// not multilingual
$shActiveLanguages = shGetFrontEndActiveLanguages();
}
return $shActiveLanguages;
}