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


PHP XenForo_Template_Helper_Core::getDefaultLanguage方法代码示例

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


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

示例1: prepareMailContents

 /**
  * Prepares the subject, plain text body, and HTML body.
  *
  * @param string|null $emailTitle Title of email to send. If not specified, uses value from consructor.
  * @param array|null $params Params to pass to email template. If not specified, uses value from constructor.
  *
  * @return array|false False if the template can't be found; otherwise array with subject, bodyText, and bodyHtml keys
  */
 public function prepareMailContents($emailTitle = null, array $params = null)
 {
     if ($emailTitle === null) {
         $emailTitle = $this->_emailTitle;
     }
     if ($params === null) {
         $params = $this->_params;
     }
     $__template = $this->_loadEmailTemplate($emailTitle);
     if (!$__template) {
         return false;
     }
     $__defaultLanguage = XenForo_Template_Helper_Core::getDefaultLanguage();
     $__languages = XenForo_Application::get('languages');
     if (isset($__languages[$this->_languageId])) {
         XenForo_Template_Helper_Core::setDefaultLanguage($__languages[$this->_languageId]);
     }
     $xenOptions = XenForo_Application::get('options')->getOptions();
     extract($params);
     $__oldErrors = error_reporting(E_ALL & ~E_NOTICE);
     XenForo_Application::disablePhpErrorHandler();
     // these variables come from the $__template
     $__subject = $__bodyText = $__bodyHtml = '';
     eval($__template);
     XenForo_Application::enablePhpErrorHandler();
     error_reporting($__oldErrors);
     XenForo_Template_Helper_Core::setDefaultLanguage($__defaultLanguage);
     return array('subject' => $__subject, 'bodyText' => $__bodyText, 'bodyHtml' => $__bodyHtml);
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:37,代码来源:Mail.php

示例2: prepareMailContents

 /**
  * Prepares the subject, plain text body, and HTML body.
  *
  * @param string|null $emailTitle Title of email to send. If not specified, uses value from consructor.
  * @param array|null $params Params to pass to email template. If not specified, uses value from constructor.
  *
  * @return array|false False if the template can't be found; otherwise array with subject, bodyText, and bodyHtml keys
  */
 public function prepareMailContents($emailTitle = null, array $params = null)
 {
     if ($emailTitle === null) {
         $emailTitle = $this->_emailTitle;
     }
     if ($params === null) {
         $params = $this->_params;
     }
     $__template = $this->_loadEmailTemplate($emailTitle);
     if (!$__template) {
         return false;
     }
     $__defaultLanguage = XenForo_Template_Helper_Core::getDefaultLanguage();
     $__languages = XenForo_Application::get('languages');
     if (isset($__languages[$this->_languageId])) {
         XenForo_Template_Helper_Core::setDefaultLanguage($__languages[$this->_languageId]);
     }
     $xenOptions = XenForo_Application::get('options')->getOptions();
     extract($params);
     $emailLanguage = XenForo_Template_Helper_Core::getDefaultLanguage();
     $emailIsRtl = isset($emailLanguage['text_direction']) && $emailLanguage['text_direction'] == 'RTL';
     $__oldErrors = error_reporting(E_ALL & ~E_NOTICE);
     XenForo_Application::disablePhpErrorHandler();
     // these variables come from the $__template
     $__subject = $__bodyText = $__bodyHtml = '';
     eval($__template);
     XenForo_Application::enablePhpErrorHandler();
     error_reporting($__oldErrors);
     XenForo_Template_Helper_Core::setDefaultLanguage($__defaultLanguage);
     if ($emailIsRtl) {
         $__bodyHtml = preg_replace_callback('/<rtlcss>(.*)<\\/rtlcss>/sU', array($this, '_replaceRtlCss'), $__bodyHtml);
     } else {
         $__bodyHtml = preg_replace('/<rtlcss>(.*)<\\/rtlcss>/sU', '\\1', $__bodyHtml);
     }
     return array('subject' => $__subject, 'bodyText' => $__bodyText, 'bodyHtml' => $__bodyHtml);
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:44,代码来源:Mail.php


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