1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-17 07:10:48 +03:00

возможность делегировать подключаемые шаблоны

This commit is contained in:
Mzhelskiy Maxim 2010-03-14 21:03:33 +00:00
parent 0751a641b8
commit 8c560d3638
2 changed files with 11 additions and 1 deletions

View file

@ -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').'/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/JSMin-1.1.1/jsmin.php');
@ -182,7 +183,7 @@ class LsViewer extends Module {
/**
* Создаём объект 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/');
/**
* Для каждого скина устанавливаем свою директорию компиляции шаблонов

View 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);
}
}