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


PHP XenForo_Template_Abstract::setLanguageId方法代码示例

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


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

示例1: renderCss

 /**
  * Render the CSS version of the... CSS!
  *
  * @return string
  */
 public function renderCss()
 {
     XenForo_Template_Abstract::setLanguageId(0);
     $bbCodeCache = $this->_params['bbCodeCache'];
     $templateParams = array('displayStyles' => array(), 'smilieSprites' => $this->_params['smilieSprites'], 'xenOptions' => XenForo_Application::get('options')->getOptions(), 'customBbCodes' => !empty($bbCodeCache['bbCodes']) ? $bbCodeCache['bbCodes'] : array(), 'dir' => $this->_params['dir'], 'pageIsRtl' => $this->_params['dir'] == 'RTL');
     $templates = array();
     foreach ($this->_params['css'] as $cssTemplate) {
         if (strpos($cssTemplate, 'public:') === 0) {
             $templates[$cssTemplate] = new XenForo_Template_Public(substr($cssTemplate, strlen('public:')), $templateParams);
         } else {
             $templates[$cssTemplate] = $this->createTemplateObject($cssTemplate, $templateParams);
         }
     }
     if (XenForo_Application::isRegistered('adminStyleModifiedDate')) {
         $modifyDate = XenForo_Application::get('adminStyleModifiedDate');
     } else {
         $modifyDate = XenForo_Application::$time;
     }
     $this->_response->setHeader('Expires', 'Wed, 01 Jan 2020 00:00:00 GMT', true);
     $this->_response->setHeader('Last-Modified', gmdate('D, d M Y H:i:s', $modifyDate) . ' GMT', true);
     $this->_response->setHeader('Cache-Control', 'private', true);
     $css = XenForo_CssOutput::renderCssFromObjects($templates, true);
     $css = XenForo_CssOutput::prepareCssForOutput($css, $this->_params['dir'], false);
     return $css;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:30,代码来源:CssInternal.php

示例2: renderCss

 /**
  * Render the CSS version of the... CSS!
  *
  * @return string
  */
 public function renderCss()
 {
     $params = $this->_params;
     $styleModel = XenForo_Model::create('XenForo_Model_Style');
     $styleModel->setAdminStyles(true);
     $styles = XenForo_Application::isRegistered('adminStyles') ? XenForo_Application::get('adminStyles') : $styleModel->getAllStyles();
     $styleId = $params['styleId'];
     if (!empty($styleId) && isset($styles[$styleId])) {
         $style = $styles[$styleId];
     } else {
         $style = reset($styles);
     }
     $adminStyleProperties = XenForo_Application::get('adminStyleProperties');
     $properties = unserialize($style['properties']);
     $properties = is_array($properties) ? $properties : array();
     if (empty($properties)) {
         $properties = $adminStyleProperties;
     } else {
         $tmpAdminStyleProperties = array();
         if (!isset($properties['contentWidth']) && isset($tmpAdminStyleProperties['contentWidth'])) {
             $properties['contentWidth'] = $tmpAdminStyleProperties['contentWidth'];
         }
         if (!isset($properties['formWidth']) && isset($tmpAdminStyleProperties['formWidth'])) {
             $properties['formWidth'] = $tmpAdminStyleProperties['formWidth'];
         }
         if (!isset($properties['nonResponsiveMinWidth']) && isset($tmpAdminStyleProperties['nonResponsiveMinWidth'])) {
             $properties['nonResponsiveMinWidth'] = $tmpAdminStyleProperties['nonResponsiveMinWidth'];
         }
     }
     $styleId = $style['style_id'];
     $styleModifiedDate = $style['last_modified_date'];
     $defaultProperties = XenForo_Application::get('defaultStyleProperties');
     XenForo_Template_Helper_Core::setStyleProperties(XenForo_Application::mapMerge($defaultProperties, $properties));
     Brivium_AdminStyleSystem_Template_Admin::setStyleId($style['style_id']);
     XenForo_Template_Abstract::setLanguageId(0);
     $bbCodeCache = !empty($params['bbCodeCache']) ? $params['bbCodeCache'] : array();
     $templateParams = array('displayStyles' => array(), 'smilieSprites' => !empty($params['smilieSprites']) ? $params['smilieSprites'] : array(), 'xenOptions' => XenForo_Application::get('options')->getOptions(), 'customBbCodes' => !empty($bbCodeCache['bbCodes']) ? $bbCodeCache['bbCodes'] : array(), 'dir' => $this->_params['dir'], 'pageIsRtl' => $this->_params['dir'] == 'RTL');
     $templates = array();
     foreach ($this->_params['css'] as $cssTemplate) {
         if (strpos($cssTemplate, 'public:') === 0) {
             $templates[$cssTemplate] = new XenForo_Template_Public(substr($cssTemplate, strlen('public:')), $templateParams);
         } else {
             $templates[$cssTemplate] = new Brivium_AdminStyleSystem_Template_Admin($cssTemplate, $templateParams);
         }
     }
     if (XenForo_Application::isRegistered('adminStyleModifiedDate')) {
         $modifyDate = XenForo_Application::get('adminStyleModifiedDate');
     } else {
         $modifyDate = XenForo_Application::$time;
     }
     $this->_response->setHeader('Expires', 'Wed, 01 Jan 2020 00:00:00 GMT', true);
     $this->_response->setHeader('Last-Modified', gmdate('D, d M Y H:i:s', $modifyDate) . ' GMT', true);
     $this->_response->setHeader('Cache-Control', 'private', true);
     $css = XenForo_CssOutput::renderCssFromObjects($templates, true);
     $css = XenForo_CssOutput::prepareCssForOutput($css, $this->_params['dir'], false);
     return $css;
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:62,代码来源:CssInternal.php

示例3: renderHtml

 public function renderHtml()
 {
     $dep = $this->_renderer->getDependencyHandler();
     $oldClass = $dep->templateClass;
     $dep->templateClass = 'XenForo_Template_Admin';
     XenForo_Template_Abstract::setLanguageId(1);
     // this is the language that was created
     $this->_params['renderedOptions'] = XenForo_ViewAdmin_Helper_Option::renderPreparedOptionsHtml($this, $this->_params['options'], $this->_params['canEditOptionDefinition']);
     $dep->templateClass = $oldClass;
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:10,代码来源:Step4.php

示例4: renderCss

 /**
  * Render the CSS version of the... CSS!
  *
  * @return string
  */
 public function renderCss()
 {
     XenForo_Template_Abstract::setLanguageId(0);
     $templates = array();
     foreach ($this->_params['css'] as $cssTemplate) {
         if (strpos($cssTemplate, 'public:') === 0) {
             $templates[$cssTemplate] = new XenForo_Template_Public(substr($cssTemplate, strlen('public:')));
         } else {
             $templates[$cssTemplate] = $this->createTemplateObject($cssTemplate);
         }
     }
     if (XenForo_Application::isRegistered('adminStyleModifiedDate')) {
         $modifyDate = XenForo_Application::get('adminStyleModifiedDate');
     } else {
         $modifyDate = XenForo_Application::$time;
     }
     $this->_response->setHeader('Expires', 'Wed, 01 Jan 2020 00:00:00 GMT', true);
     $this->_response->setHeader('Last-Modified', gmdate('D, d M Y H:i:s', $modifyDate) . ' GMT', true);
     $this->_response->setHeader('Cache-Control', 'private', true);
     return XenForo_CssOutput::renderCssFromObjects($templates, true);
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:26,代码来源:CssInternal.php

示例5: preRenderView

 /**
  * Performs any pre-view rendering setup, such as getting style information and
  * ensuring the correct data is registered.
  *
  * @param XenForo_ControllerResponse_Abstract|null $controllerResponse
  */
 public function preRenderView(XenForo_ControllerResponse_Abstract $controllerResponse = null)
 {
     parent::preRenderView($controllerResponse);
     XenForo_Template_Abstract::setLanguageId(XenForo_Phrase::getLanguageId());
     $properties = XenForo_Application::get('adminStyleProperties');
     XenForo_Template_Helper_Core::setStyleProperties($properties);
     $this->_defaultTemplateParams['_styleModifiedDate'] = XenForo_Application::get('adminStyleModifiedDate');
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:14,代码来源:Admin.php

示例6: _prepareForOutput

 /**
  * Does any preparations necessary for outputting to be done.
  */
 protected function _prepareForOutput()
 {
     $this->_displayStyles = XenForo_Application::get('displayStyles');
     $styles = XenForo_Application::get('styles');
     $smilieSprites = XenForo_Model::create('XenForo_Model_DataRegistry')->get('smilieSprites');
     if (is_array($smilieSprites)) {
         $this->_smilieSprites = $smilieSprites;
     }
     if ($this->_styleId && isset($styles[$this->_styleId])) {
         $style = $styles[$this->_styleId];
     } else {
         $style = reset($styles);
     }
     if ($style) {
         $properties = unserialize($style['properties']);
         $this->_styleId = $style['style_id'];
         $this->_styleModifiedDate = $style['last_modified_date'];
     } else {
         $properties = array();
         $this->_styleId = 0;
     }
     $defaultProperties = XenForo_Application::get('defaultStyleProperties');
     XenForo_Template_Helper_Core::setStyleProperties(XenForo_Application::mapMerge($defaultProperties, $properties), false);
     XenForo_Template_Public::setStyleId($this->_styleId);
     XenForo_Template_Abstract::setLanguageId(0);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:29,代码来源:CssOutput.php

示例7: preRenderView

 /**
  * Performs any pre-view rendering setup, such as getting style information and
  * ensuring the correct data is registered.
  *
  * @param XenForo_ControllerResponse_Abstract|null $controllerResponse
  */
 public function preRenderView(XenForo_ControllerResponse_Abstract $controllerResponse = null)
 {
     parent::preRenderView($controllerResponse);
     if (!empty($this->_viewStateChanges['styleId'])) {
         $styleId = $this->_viewStateChanges['styleId'];
         $forceStyleId = true;
     } else {
         $user = XenForo_Visitor::getInstance();
         $styleId = !empty($user['style_id']) ? $user['style_id'] : 0;
         $forceStyleId = $user['is_admin'] ? true : false;
     }
     XenForo_Template_Abstract::setLanguageId(XenForo_Phrase::getLanguageId());
     $styles = XenForo_Application::isRegistered('styles') ? XenForo_Application::get('styles') : XenForo_Model::create('XenForo_Model_Style')->getAllStyles();
     if ($styleId && isset($styles[$styleId]) && ($styles[$styleId]['user_selectable'] || $forceStyleId)) {
         $style = $styles[$styleId];
     } else {
         $defaultStyleId = XenForo_Application::get('options')->defaultStyleId;
         $style = isset($styles[$defaultStyleId]) ? $styles[$defaultStyleId] : reset($styles);
     }
     $defaultProperties = XenForo_Application::get('defaultStyleProperties');
     if ($style) {
         $properties = XenForo_Helper_Php::safeUnserialize($style['properties']);
         XenForo_Template_Helper_Core::setStyleProperties(XenForo_Application::mapMerge($defaultProperties, $properties));
         XenForo_Template_Public::setStyleId($style['style_id']);
     } else {
         XenForo_Template_Helper_Core::setStyleProperties($defaultProperties);
     }
     // setup the default template params
     if ($style) {
         $this->_defaultTemplateParams['visitorStyle'] = $style;
     }
     // expose the user fields info array
     $this->_defaultTemplateParams['userFieldsInfo'] = XenForo_Application::get('userFieldsInfo');
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:40,代码来源:Public.php

示例8: _prepareForOutput

 /**
  * Does any preperations necessary for outputting to be done.
  */
 protected function _prepareForOutput()
 {
     $cacheData = XenForo_Model::create('XenForo_Model_DataRegistry')->getMulti(array('styles', 'displayStyles', 'options'));
     if (is_array($cacheData['displayStyles'])) {
         $this->_displayStyles = $cacheData['displayStyles'];
     }
     $styles = $cacheData['styles'];
     if (!is_array($styles)) {
         $styles = XenForo_Model::create('XenForo_Model_Style')->rebuildStyleCache();
     }
     if (!is_array($cacheData['options'])) {
         $cacheData['options'] = XenForo_Model::create('XenForo_Model_Option')->rebuildOptionCache();
     }
     $options = new XenForo_Options($cacheData['options']);
     XenForo_Application::setDefaultsFromOptions($options);
     XenForo_Application::set('options', $options);
     if ($this->_styleId && isset($styles[$this->_styleId])) {
         $style = $styles[$this->_styleId];
     } else {
         $style = reset($styles);
     }
     if ($style) {
         $properties = unserialize($style['properties']);
         $this->_styleId = $style['style_id'];
         $this->_styleModifiedDate = $style['last_modified_date'];
     } else {
         $properties = array();
         $this->_styleId = 0;
     }
     XenForo_Template_Helper_Core::setStyleProperties($properties, false);
     XenForo_Template_Public::setStyleId($this->_styleId);
     XenForo_Template_Abstract::setLanguageId(0);
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:36,代码来源:CssOutput.php

示例9: _prepareForOutput

 /**
  * Does any preperations necessary for outputting to be done.
  */
 protected function _prepareForOutput()
 {
     $styles = XenForo_Application::get('styles');
     if ($this->_styleId && isset($styles[$this->_styleId])) {
         $style = $styles[$this->_styleId];
     } else {
         $style = reset($styles);
     }
     if ($style) {
         $properties = unserialize($style['properties']);
         $this->_styleId = $style['style_id'];
         $this->_styleModifiedDate = $style['last_modified_date'];
     } else {
         $properties = array();
         $this->_styleId = 0;
     }
     $languages = XenForo_Application::get('languages');
     if ($this->_languageId && isset($languages[$this->_languageId])) {
         $language = $languages[$this->_languageId];
     } else {
         $language = reset($languages);
     }
     if ($language) {
         $this->_textDirection = $language['text_direction'];
         $this->_languageId = $language['language_id'];
     } else {
         $this->_textDirection = 'LTR';
         $this->_languageId = 0;
     }
     XenForo_Template_Helper_Core::setStyleProperties($properties, false);
     XenForo_Template_Public::setStyleId($this->_styleId);
     XenForo_Template_Abstract::setLanguageId($this->_languageId);
 }
开发者ID:ThemeHouse-XF,项目名称:SvgOutputa,代码行数:36,代码来源:20130522.php


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