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


PHP Vtiger_Viewer::currentLayout方法代码示例

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


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

示例1: dirname

 /**
  * Constructor - Sets the templateDir and compileDir for the Smarty files
  * @param <String> - $media Layout/Media name
  */
 function __construct($media = '')
 {
     parent::__construct();
     $THISDIR = dirname(__FILE__);
     $templatesDir = '';
     $compileDir = '';
     $templateDir = [];
     if (!empty($media)) {
         self::$currentLayout = $media;
         $customTemplatesDir = $THISDIR . '/../../custom/layouts/' . $media;
         $templateDir[] = $THISDIR . '/../../layouts/' . $media;
         $compileDir = $THISDIR . '/../../cache/templates_c/' . $media;
     }
     $defaultLayout = vglobal('defaultLayout');
     if ($defaultLayout && is_file(vglobal('root_directory') . '/layouts/' . $defaultLayout)) {
         $templateDir[] = $THISDIR . '/../../layouts/' . $defaultLayout;
     }
     if (empty($templatesDir) || !file_exists($templatesDir)) {
         self::$currentLayout = self::getDefaultLayoutName();
         $templateDir[] = $THISDIR . '/../../custom/layouts/' . self::getDefaultLayoutName();
         $templateDir[] = $THISDIR . '/../../layouts/' . self::getDefaultLayoutName();
         $compileDir = $THISDIR . '/../../cache/templates_c/' . self::getDefaultLayoutName();
     }
     if (!file_exists($compileDir)) {
         mkdir($compileDir, 0777, true);
     }
     $this->setTemplateDir($templateDir);
     $this->setCompileDir($compileDir);
     self::$debugViewer = SysDebug::get('DEBUG_VIEWER');
     // FOR SECURITY
     // Escape all {$variable} to overcome XSS
     // We need to use {$variable nofilter} to overcome double escaping
     // TODO: Until we review the use disabled.
     //$this->registerFilter('variable', array($this, 'safeHtmlFilter'));
     // FOR DEBUGGING: We need to have this only once.
     static $debugViewerURI = false;
     if (self::$debugViewer && $debugViewerURI === false) {
         $debugViewerURI = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
         if (!empty($_POST)) {
             $debugViewerURI .= '?' . http_build_query($_POST);
         } else {
             $debugViewerURI = $_SERVER['REQUEST_URI'];
         }
         $this->log("URI: {$debugViewerURI}, TYPE: " . $_SERVER['REQUEST_METHOD']);
     }
 }
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:50,代码来源:Viewer.php


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