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


PHP Sh404sefHelperGeneral::getInstalledLanguagesList方法代碼示例

本文整理匯總了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;
 }
開發者ID:lautarodragan,項目名稱:ideary,代碼行數:27,代碼來源:html.php

示例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];
    }
}
開發者ID:sangkasi,項目名稱:joomla,代碼行數:21,代碼來源:sh404sef.class.php


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