mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-26 11:40:48 +03:00
возможность делегировать подключаемые шаблоны
This commit is contained in:
parent
0751a641b8
commit
8c560d3638
|
@ -16,6 +16,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(Config::Get('path.root.engine').'/lib/external/Smarty-2.6.19/libs/Smarty.class.php');
|
require_once(Config::Get('path.root.engine').'/lib/external/Smarty-2.6.19/libs/Smarty.class.php');
|
||||||
|
require_once(Config::Get('path.root.engine').'/modules/viewer/lsSmarty.class.php');
|
||||||
require_once(Config::Get('path.root.engine').'/lib/external/CSSTidy-1.3/class.csstidy.php');
|
require_once(Config::Get('path.root.engine').'/lib/external/CSSTidy-1.3/class.csstidy.php');
|
||||||
require_once(Config::Get('path.root.engine').'/lib/external/JSMin-1.1.1/jsmin.php');
|
require_once(Config::Get('path.root.engine').'/lib/external/JSMin-1.1.1/jsmin.php');
|
||||||
|
|
||||||
|
@ -182,7 +183,7 @@ class LsViewer extends Module {
|
||||||
/**
|
/**
|
||||||
* Создаём объект Smarty и устанавливаем необходиму параметры
|
* Создаём объект Smarty и устанавливаем необходиму параметры
|
||||||
*/
|
*/
|
||||||
$this->oSmarty = new Smarty();
|
$this->oSmarty = new lsSmarty();
|
||||||
$this->oSmarty->template_dir=array(Config::Get('path.smarty.template'),Config::Get('path.root.server').'/plugins/');
|
$this->oSmarty->template_dir=array(Config::Get('path.smarty.template'),Config::Get('path.root.server').'/plugins/');
|
||||||
/**
|
/**
|
||||||
* Для каждого скина устанавливаем свою директорию компиляции шаблонов
|
* Для каждого скина устанавливаем свою директорию компиляции шаблонов
|
||||||
|
|
9
engine/modules/viewer/lsSmarty.class.php
Normal file
9
engine/modules/viewer/lsSmarty.class.php
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
class lsSmarty extends Smarty {
|
||||||
|
function _smarty_include($params) {
|
||||||
|
if (isset($params['smarty_include_tpl_file'])) {
|
||||||
|
$params['smarty_include_tpl_file']=Engine::getInstance()->Plugin_GetDelegate('template',$params['smarty_include_tpl_file']);
|
||||||
|
}
|
||||||
|
parent::_smarty_include($params);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue