- allow {function} tags within {block} tags

This commit is contained in:
Uwe.Tews
2009-11-30 19:56:17 +00:00
parent 319f0c88fb
commit 89e53f6372
4 changed files with 23 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
11/30/2009 11/30/2009
- map 'true' to SMARTY_CACHING_LIFETIME_CURRENT for the $smarty->caching parameter - map 'true' to SMARTY_CACHING_LIFETIME_CURRENT for the $smarty->caching parameter
- allow {function} tags within {block} tags
11/28/2009 11/28/2009
- ignore compile_id at debug template - ignore compile_id at debug template

View File

@@ -72,6 +72,13 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
} elseif (!empty($this->smarty->block_data[$_name])) { } elseif (!empty($this->smarty->block_data[$_name])) {
$_output = $this->smarty->block_data[$_name]['compiled']; $_output = $this->smarty->block_data[$_name]['compiled'];
} }
if (isset($this->smarty->block_data[$_name]['function'])) {
if (isset($compiler->template->properties['function'])) {
$compiler->template->properties['function'] = array_merge ($compiler->template->properties['function'], $this->smarty->block_data[$_name]['function']);
} else {
$compiler->template->properties['function'] = $this->smarty->block_data[$_name]['function'];
}
}
} else { } else {
$_output = $compiler->template->extracted_compiled_code; $_output = $compiler->template->extracted_compiled_code;
} }

View File

@@ -60,7 +60,6 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase {
$_tpl->template_filepath = $this->compiler->template->getTemplateFilepath(); $_tpl->template_filepath = $this->compiler->template->getTemplateFilepath();
$_tpl->forceNocache = true; $_tpl->forceNocache = true;
$_compiled_content = $_tpl->getCompiledTemplate(); $_compiled_content = $_tpl->getCompiledTemplate();
unset($_tpl);
$_name = trim($_match[3], "\"'}"); $_name = trim($_match[3], "\"'}");
if (isset($this->smarty->block_data[$_name])) { if (isset($this->smarty->block_data[$_name])) {
@@ -82,6 +81,10 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase {
} else { } else {
$this->smarty->block_data[$_name]['mode'] = 'replace'; $this->smarty->block_data[$_name]['mode'] = 'replace';
} }
if (isset($_tpl->properties['function'])) {
$this->smarty->block_data[$_name]['function'] = $_tpl->properties['function'];
}
unset($_tpl);
} }
} }
} }

View File

@@ -113,7 +113,6 @@ class Smarty_Internal_Resource_Extends {
$_tpl->template_filepath = $this->template->getTemplateFilepath(); $_tpl->template_filepath = $this->template->getTemplateFilepath();
$_tpl->forceNocache= true; $_tpl->forceNocache= true;
$_compiled_content = $_tpl->getCompiledTemplate(); $_compiled_content = $_tpl->getCompiledTemplate();
unset($_tpl);
$_name = trim($_match[3], "\"'}"); $_name = trim($_match[3], "\"'}");
if (isset($this->smarty->block_data[$_name])) { if (isset($this->smarty->block_data[$_name])) {
@@ -135,6 +134,10 @@ class Smarty_Internal_Resource_Extends {
} else { } else {
$this->smarty->block_data[$_name]['mode'] = 'replace'; $this->smarty->block_data[$_name]['mode'] = 'replace';
} }
if (isset($_tpl->properties['function'])) {
$this->smarty->block_data[$_name]['function'] = $_tpl->properties['function'];
}
unset($_tpl);
} }
} }