mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
- bugfix for change of 08/09/2010 (final {block} tags in subtemplates did not produce correct results)
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
10/09/2010
|
||||
- bugfix for change of 08/09/2010 (final {block} tags in subtemplates did not produce correct results)
|
||||
|
||||
08/09/2010
|
||||
- allow multiple template inheritance branches starting in subtemplates
|
||||
|
||||
|
@@ -27,13 +27,15 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
|
||||
$this->optional_attributes = array('assign', 'nocache');
|
||||
// check and get attributes
|
||||
$_attr = $this->_get_attributes($args);
|
||||
$save = array($_attr, $compiler->parser->current_buffer, $this->compiler->nocache);
|
||||
$save = array($_attr, $compiler->parser->current_buffer, $this->compiler->nocache, $this->compiler->smarty->merge_compiled_includes);
|
||||
$this->_open_tag('block', $save);
|
||||
if (isset($_attr['nocache'])) {
|
||||
if ($_attr['nocache'] == 'true') {
|
||||
$compiler->nocache = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// must merge includes
|
||||
$this->compiler->smarty->merge_compiled_includes = true;
|
||||
|
||||
$compiler->parser->current_buffer = new _smarty_template_buffer($compiler->parser);
|
||||
$compiler->has_code = false;
|
||||
@@ -103,7 +105,8 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
|
||||
$_output = $compiler->parser->current_buffer->to_smarty_php();
|
||||
}
|
||||
$compiler->parser->current_buffer = $saved_data[1];
|
||||
$compiler->nocache = $saved_data[2];
|
||||
$compiler->nocache = $saved_data[2];
|
||||
$compiler->smarty->merge_compiled_includes = $saved_data[2];
|
||||
// $_output content has already nocache code processed
|
||||
$compiler->suppressNocacheProcessing = true;
|
||||
return $_output;
|
||||
|
@@ -105,7 +105,12 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
||||
// load cache resource
|
||||
if (!$this->resource_object->isEvaluated && ($this->caching == SMARTY_CACHING_LIFETIME_CURRENT || $this->caching == SMARTY_CACHING_LIFETIME_SAVED)) {
|
||||
$this->cache_resource_object = $this->smarty->cache->loadResource();
|
||||
}
|
||||
}
|
||||
// copy block data of template inheritance
|
||||
if ($this->parent instanceof Smarty_Template or $this->parent instanceof Smarty_Internal_Template) {
|
||||
$this->block_data = $this->parent->block_data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user