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


PHP JApplicationCms::setLanguageFilter方法代码示例

本文整理汇总了PHP中JApplicationCms::setLanguageFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP JApplicationCms::setLanguageFilter方法的具体用法?PHP JApplicationCms::setLanguageFilter怎么用?PHP JApplicationCms::setLanguageFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JApplicationCms的用法示例。


在下文中一共展示了JApplicationCms::setLanguageFilter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor.
  *
  * @param   object  &$subject  The object to observe
  * @param   array   $config    An optional associative array of configuration settings.
  *
  * @since   1.6
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->app = JFactory::getApplication();
     if ($this->app->isSite()) {
         // Setup language data.
         $router = $this->app->getRouter();
         $this->mode_sef = $router->getMode() == JROUTER_MODE_SEF;
         $this->sefs = JLanguageHelper::getLanguages('sef');
         $this->lang_codes = JLanguageHelper::getLanguages('lang_code');
         $levels = JFactory::getUser()->getAuthorisedViewLevels();
         foreach ($this->sefs as $sef => $language) {
             if (!in_array($language->access, $levels)) {
                 unset($this->lang_codes[$language->lang_code]);
                 unset($this->sefs[$language->sef]);
             }
         }
         $this->app->setLanguageFilter(true);
         // Detect browser feature.
         $this->app->setDetectBrowser($this->params->get('detect_browser', '1') == '1');
     }
 }
开发者ID:educakanchay,项目名称:kanchay,代码行数:30,代码来源:languagefilter.php

示例2: __construct

 /**
  * Constructor.
  *
  * @param   object  &$subject  The object to observe
  * @param   array   $config    An optional associative array of configuration settings.
  *
  * @since   1.6
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->app = JFactory::getApplication();
     if ($this->app->isSite()) {
         // Setup language data.
         $this->mode_sef = $this->app->get('sef', 0);
         $this->sefs = JLanguageHelper::getLanguages('sef');
         $this->lang_codes = JLanguageHelper::getLanguages('lang_code');
         $levels = JFactory::getUser()->getAuthorisedViewLevels();
         foreach ($this->sefs as $sef => $language) {
             // @todo: In Joomla 2.5.4 and earlier access wasn't set. Non modified Content Languages got 0 as access value
             if ($language->access && !in_array($language->access, $levels)) {
                 unset($this->lang_codes[$language->lang_code]);
                 unset($this->sefs[$language->sef]);
             }
         }
         $this->app->setLanguageFilter(true);
         // Detect browser feature.
         $this->app->setDetectBrowser($this->params->get('detect_browser', '1') == '1');
     }
 }
开发者ID:grchis,项目名称:Site-Auto,代码行数:30,代码来源:languagefilter.php

示例3: __construct

 /**
  * Constructor.
  *
  * @param   object  &$subject  The object to observe
  * @param   array   $config    An optional associative array of configuration settings.
  *
  * @since   1.6
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->app = JFactory::getApplication();
     if ($this->app->isSite()) {
         // Setup language data.
         $this->mode_sef = $this->app->get('sef', 0);
         $this->sefs = JLanguageHelper::getLanguages('sef');
         $this->lang_codes = JLanguageHelper::getLanguages('lang_code');
         $this->default_lang = JComponentHelper::getParams('com_languages')->get('site', 'en-GB');
         $levels = JFactory::getUser()->getAuthorisedViewLevels();
         foreach ($this->sefs as $sef => $language) {
             // @todo: In Joomla 2.5.4 and earlier access wasn't set. Non modified Content Languages got 0 as access value
             // we also check if frontend language exists and is enabled
             if ($language->access && !in_array($language->access, $levels) || !array_key_exists($language->lang_code, JLanguageMultilang::getSiteLangs())) {
                 unset($this->lang_codes[$language->lang_code]);
                 unset($this->sefs[$language->sef]);
             }
         }
         $this->app->setLanguageFilter(true);
         // Detect browser feature.
         $this->app->setDetectBrowser($this->params->get('detect_browser', '1') == '1');
     }
 }
开发者ID:N6REJ,项目名称:joomla-cms,代码行数:32,代码来源:languagefilter.php


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