diff --git a/change_log.txt b/change_log.txt index dcebfce4..b72bc2db 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,5 +1,6 @@ 12/16/2009 - update of changelog +- added {include file='foo.tpl' inline} inline option to merge compiled code of aubtemplate into the calling template 12/14/2009 - fixed sideefect of last modification (objects in array index did not work anymore) diff --git a/libs/sysplugins/smarty_internal_compile_include.php b/libs/sysplugins/smarty_internal_compile_include.php index cfa5cbc4..093e9d3c 100644 --- a/libs/sysplugins/smarty_internal_compile_include.php +++ b/libs/sysplugins/smarty_internal_compile_include.php @@ -30,7 +30,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase { // save posible attributes $include_file = $_attr['file']; $has_compiled_template = false; - if ($compiler->smarty->merge_compiled_includes) { + if ($compiler->smarty->merge_compiled_includes || isset($_attr['inline'])) { // check if compiled code can be merged (contains no variable part) if (!$compiler->has_variable_string && (substr_count($include_file, '"') == 2 or substr_count($include_file, "'") == 2) and substr_count($include_file, '(') == 0) { eval("\$tmp = $include_file;"); @@ -134,7 +134,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase { // create template object $_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']); + unset($_attr['file'], $_attr['assign'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope'], $_attr['inline']); // remaining attributes must be assigned as smarty variable if (!empty($_attr)) { if ($_parent_scope == SMARTY_LOCAL_SCOPE) {