diff --git a/change_log.txt b/change_log.txt index 357e1cd7..3802ea65 100644 --- a/change_log.txt +++ b/change_log.txt @@ -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 diff --git a/libs/sysplugins/smarty_internal_compile_eval.php b/libs/sysplugins/smarty_internal_compile_eval.php index c94a1aa7..6f17de77 100644 --- a/libs/sysplugins/smarty_internal_compile_eval.php +++ b/libs/sysplugins/smarty_internal_compile_eval.php @@ -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());"; diff --git a/libs/sysplugins/smarty_internal_compile_extends.php b/libs/sysplugins/smarty_internal_compile_extends.php index 436233bf..27437015 100644 --- a/libs/sysplugins/smarty_internal_compile_extends.php +++ b/libs/sysplugins/smarty_internal_compile_extends.php @@ -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; diff --git a/libs/sysplugins/smarty_internal_compile_function_call.php b/libs/sysplugins/smarty_internal_compile_function_call.php index 18371f2a..157842bc 100644 --- a/libs/sysplugins/smarty_internal_compile_function_call.php +++ b/libs/sysplugins/smarty_internal_compile_function_call.php @@ -34,7 +34,7 @@ class Smarty_Internal_Compile_Function_Call extends Smarty_Internal_CompileBase } $_name = trim($_attr['name'], "'"); // create template object - $_output = "smarty, \$_smarty_tpl);\n"; + $_output = "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 diff --git a/libs/sysplugins/smarty_internal_compile_include.php b/libs/sysplugins/smarty_internal_compile_include.php index e946ac01..cfa5cbc4 100644 --- a/libs/sysplugins/smarty_internal_compile_include.php +++ b/libs/sysplugins/smarty_internal_compile_include.php @@ -132,7 +132,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase { } } // create template object - $_output = "smarty, \$_smarty_tpl, \$_smarty_tpl->cache_id, \$_smarty_tpl->compile_id, $_caching, $_cache_lifetime);"; + $_output = "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