- fixed bug of {nocache} tag in included templates

This commit is contained in:
Uwe.Tews
2009-05-08 11:34:21 +00:00
parent ff4619801a
commit 0a64988240
3 changed files with 20 additions and 6 deletions

View File

@@ -1,3 +1,6 @@
05/08/2009
- fixed bug of {nocache} tag in included templates
05/06/2009
- allow that plugins_dir folder names can end without directory separator

View File

@@ -45,7 +45,11 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase {
}
}
// default for included templates
$_caching = SMARTY_CACHING_OFF;
if ($compiler->template->caching) {
$_caching = SMARTY_CACHING_LIFETIME_CURRENT;
} else {
$_caching = SMARTY_CACHING_OFF;
}
/*
* if the {include} tag provides individual parameter for caching
* it will not be included into the common cache file and treated like
@@ -89,7 +93,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase {
if (isset($_assign)) {
$_output .= "\$_smarty_tpl->assign($_assign,\$_smarty_tpl->smarty->fetch(\$_template)); ?>";
} else {
$_output .= "echo \$_smarty_tpl->smarty->fetch(\$_template); ?>";
$_output .= "\$_template->processInclude(); ?>";
}
if ($_parent_scope != SMARTY_LOCAL_SCOPE) {
$_output .= "<?php \$_template->updateParentVariables($_parent_scope); ?>";

View File

@@ -90,9 +90,9 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
$this->security = $this->smarty->security;
$this->cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($this->caching_type);
$this->parent = $_parent;
$this->properties['file_dependency'] = array();
$this->properties['file_dependency'] = array();
// dummy local smarty variable
$this->tpl_vars['smarty'] = new Smarty_Variable;
$this->tpl_vars['smarty'] = new Smarty_Variable;
// Template resource
$this->template_resource = $template_resource;
// parse resource name
@@ -272,8 +272,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
$this->properties = unserialize($_matches[1]);
if (!empty($this->properties['function'])) {
foreach ($this->properties['function'] as $_name => $_data) {
$this->smarty->template_functions[$_name]['compiled'] = str_replace(array('_%n'), array("\n"), $_data['compiled']);
$this->smarty->template_functions[$_name]['parameter'] = $_data['parameter'];
$this->smarty->template_functions[$_name]['compiled'] = str_replace(array('_%n'), array("\n"), $_data['compiled']);
$this->smarty->template_functions[$_name]['parameter'] = $_data['parameter'];
}
}
}
@@ -472,6 +472,13 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
}
}
function processInclude()
{
$_smarty_tpl = $this;
$_start_time = $this->_get_time();
eval("?>" . $this->getCompiledTemplate());
$this->render_time += $this->_get_time() - $_start_time;
}
/**
* Returns the rendered HTML output
*