当前位置: 首页>>代码示例>>PHP>>正文


PHP JoomFishManager::getActiveLanguages方法代码示例

本文整理汇总了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;
}
开发者ID:sangkasi,项目名称:joomla,代码行数:28,代码来源:sh404sef.class.php

示例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;
}
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:43,代码来源:sh404sef.class.php


注:本文中的JoomFishManager::getActiveLanguages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。