本文整理汇总了PHP中Sh404sefHelperGeneral::getInstalledLanguagesList方法的典型用法代码示例。如果您正苦于以下问题:PHP Sh404sefHelperGeneral::getInstalledLanguagesList方法的具体用法?PHP Sh404sefHelperGeneral::getInstalledLanguagesList怎么用?PHP Sh404sefHelperGeneral::getInstalledLanguagesList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sh404sefHelperGeneral
的用法示例。
在下文中一共展示了Sh404sefHelperGeneral::getInstalledLanguagesList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildLanguagesSelectList
/**
* Method to create a select list of the installed components
*
* @access public
* @param int ID of current item
* @param string name of select list
* @param boolean if true, changing selected item will submit the form (assume is an "adminForm")
* @param boolean, if true, a line 'Select all' is inserted at the start of the list
* @param string the "Select all" to be displayed, if $addSelectAll is true
* @return string HTML output
*/
public static function buildLanguagesSelectList($current, $name, $autoSubmit = false, $addSelectAll = false, $selectAllTitle = '', $customSubmit = '')
{
// load languages from DB
$languages = Sh404sefHelperGeneral::getInstalledLanguagesList();
// adjust to require format
$data = array();
if (!empty($languages)) {
foreach ($languages as $languages) {
$data[] = array('id' => $languages->shortcode, 'title' => $languages->name);
}
}
// use helper to build html
$list = self::buildSelectList($data, $current, $name, $autoSubmit, $addSelectAll, $selectAllTitle, $customSubmit);
// return list
return $list;
}
示例2: shGetNameFromIsoCode
function shGetNameFromIsoCode($langCode)
{
static $shLangNameCache = null;
global $shMosConfig_lang, $shMosConfig_locale, $shLangNameCache;
if (empty($shLangNameCache)) {
$type = shIsMultilingual();
if ($type !== false) {
$languages = Sh404sefHelperGeneral::getInstalledLanguagesList();
foreach ($languages as $language) {
$jfIsoCode = empty($language->shortcode) ? $language->iso : $language->shortcode;
$shLangNameCache[$jfIsoCode] = $language->code;
}
return empty($shLangNameCache[$langCode]) ? $shMosConfig_locale : $shLangNameCache[$langCode];
} else {
// no joomfish, so it has to be default language
return $shMosConfig_locale;
}
} else {
return empty($shLangNameCache[$langCode]) ? $shMosConfig_locale : $shLangNameCache[$langCode];
}
}