Code: Select all
if (!$this->IsFileTemplateCached($template, '', '', $name)) {
// some prepare code
}
echo $this->ProcessTemplate($template, '', true, $name);
In core code i found this:
/lib/classes/class.module.inc.php
Code: Select all
function ProcessTemplate($tpl_name, $designation = '', $cache = false, $cacheid = '')
{
$this->LoadTemplateMethods();
// ________________ Here cache is force off: $cache = false. I think, '= false' - is error _____________
return cms_module_ProcessTemplate($this, $tpl_name, $designation, $cache = false, $cacheid);
}
Code: Select all
function cms_module_IsFileTemplateCached(&$modinstance, $tpl_name, $designation = '', $timestamp = '', $cacheid = '')
{
$ok = (strpos($tpl_name, '..') === false);
if (!$ok) return;
global $gCms;
$smarty = &$gCms->GetSmarty();
$oldcache = $smarty->caching;
// _______________ here force cache off ___________________
$smarty->caching = false;
// _______________ and then check for cache - for what??? May be: $smarty->caching = true; ___________
$result = $smarty->is_cached('module_file_tpl:'.$modinstance->GetName().';'.$tpl_name, $cacheid, ($designation != ''?$designation:$modinstance->GetName()));
if ($result == true && $timestamp != '' && intval($smarty->_cache_info['timestamp']) < intval($timestamp))
{
$smarty->clear_cache('module_file_tpl:'.$modinstance->GetName().';'.$tpl_name, $cacheid, ($designation != ''?$designation:$modinstance->GetName()));
$result = false;
}
$smarty->caching = $oldcache;
return $result;
}
function cms_module_ProcessTemplate(&$modinstance, $tpl_name, $designation = '', $cache = false, $cacheid = '')
{
$ok = (strpos($tpl_name, '..') === false);
if (!$ok) return;
global $gCms;
$smarty = &$gCms->GetSmarty();
$oldcache = $smarty->caching;
// _______________ And here may be: $smarty->caching = $cache; ?____________________
$smarty->caching = false;
$result = $smarty->fetch('module_file_tpl:'.$modinstance->GetName().';'.$tpl_name, $cacheid, ($designation != ''?$designation:$modinstance->GetName()));
$smarty->caching = $oldcache;
return $result;
}