- use $template_class property for template class name when compiling {include},{eval} and {extends} tags

This commit is contained in:
Uwe.Tews
2009-12-01 22:24:31 +00:00
parent 7e45bcf527
commit 2c23dccf3b
5 changed files with 5 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
- removed direct access to constants in templates because of some syntax problems
- removed cache resource plugin for mysql from the distribution
- replaced most hard errors (exceptions) by softerrors(trigger_error) in plugins
- use $template_class property for template class name when compiling {include},{eval} and {extends} tags
11/30/2009
- map 'true' to SMARTY_CACHING_LIFETIME_CURRENT for the $smarty->caching parameter

View File

@@ -32,7 +32,7 @@ class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase {
}
// create template object
$_output = "\$_template = new Smarty_Template ('string:'.".$_attr['var'].", \$_smarty_tpl->smarty, \$_smarty_tpl);";
$_output = "\$_template = new {$compiler->smarty->template_class}('string:'.".$_attr['var'].", \$_smarty_tpl->smarty, \$_smarty_tpl);";
//was there an assign attribute?
if (isset($_assign)) {
$_output .= "\$_smarty_tpl->assign($_assign,\$_template->getRenderedTemplate());";

View File

@@ -31,7 +31,7 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase {
// $include_file = '';
eval('$include_file = ' . $_attr['file'] . ';');
// create template object
$_template = new Smarty_Template ($include_file, $this->smarty, $compiler->template);
$_template = new $compiler->smarty->template_class($include_file, $this->smarty, $compiler->template);
// save file dependency
$compiler->template->properties['file_dependency']['F' . abs(crc32($_template->getTemplateFilepath()))] = array($_template->getTemplateFilepath(), $_template->getTemplateTimestamp());
$_old_source = $compiler->template->template_source;

View File

@@ -34,7 +34,7 @@ class Smarty_Internal_Compile_Function_Call extends Smarty_Internal_CompileBase
}
$_name = trim($_attr['name'], "'");
// create template object
$_output = "<?php \$_template = new Smarty_Template ('string:', \$_smarty_tpl->smarty, \$_smarty_tpl);\n";
$_output = "<?php \$_template = new {$compiler->smarty->template_class} ('string:', \$_smarty_tpl->smarty, \$_smarty_tpl);\n";
// assign default paramter
if (isset($this->smarty->template_functions[$_name]['parameter'])) {
// function is already compiled

View File

@@ -132,7 +132,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase {
}
}
// create template object
$_output = "<?php \$_template = new Smarty_Template ($include_file, \$_smarty_tpl->smarty, \$_smarty_tpl, \$_smarty_tpl->cache_id, \$_smarty_tpl->compile_id, $_caching, $_cache_lifetime);";
$_output = "<?php \$_template = new {$compiler->smarty->template_class} ($include_file, \$_smarty_tpl->smarty, \$_smarty_tpl, \$_smarty_tpl->cache_id, \$_smarty_tpl->compile_id, $_caching, $_cache_lifetime);";
// delete {include} standard attributes
unset($_attr['file'], $_attr['assign'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope']);
// remaining attributes must be assigned as smarty variable