mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
17/02/2010
|
||||
- removed restriction that modifiers did require surrounding parenthesis in some cases
|
||||
- added {$smarty.block.child} special variable for template inheritance
|
||||
|
||||
16/02/2010
|
||||
- bugfix on <?xml ... ?> tags for all php_handling modes
|
||||
- bugfix on parameter of variablefilter.htmlspecialchars.php plugin
|
||||
|
@@ -72,6 +72,17 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase {
|
||||
$this->compiler->trigger_template_error("\"" . $block_tag . "\" missing name attribute");
|
||||
} else {
|
||||
$_name = trim($_match[3], '\'"');
|
||||
// replace {$smarty.block.child}
|
||||
if (strpos($block_content, $this->smarty->left_delimiter . '$smarty.block.child' . $this->smarty->right_delimiter) !== false) {
|
||||
if (isset($this->smarty->block_data[$_name])) {
|
||||
$block_content = str_replace($this->smarty->left_delimiter . '$smarty.block.child' . $this->smarty->right_delimiter,
|
||||
$this->smarty->block_data[$_name]['source'], $block_content);
|
||||
unset($this->smarty->block_data[$_name]);
|
||||
} else {
|
||||
$block_content = str_replace($this->smarty->left_delimiter . '$smarty.block.child' . $this->smarty->right_delimiter,
|
||||
'', $block_content);
|
||||
}
|
||||
}
|
||||
if (isset($this->smarty->block_data[$_name])) {
|
||||
if (strpos($this->smarty->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
|
||||
$this->smarty->block_data[$_name]['source'] =
|
||||
|
@@ -134,6 +134,17 @@ class Smarty_Internal_Resource_Extends {
|
||||
$this->smarty->trigger_error("'{$block_tag}' missing name attribute in file '$_filepath'");
|
||||
} else {
|
||||
$_name = trim($_match[3], '\'"');
|
||||
// replace {$smarty.block.child}
|
||||
if (strpos($block_content, $this->smarty->left_delimiter . '$smarty.block.child' . $this->smarty->right_delimiter) !== false) {
|
||||
if (isset($this->smarty->block_data[$_name])) {
|
||||
$block_content = str_replace($this->smarty->left_delimiter . '$smarty.block.child' . $this->smarty->right_delimiter,
|
||||
$this->smarty->block_data[$_name]['source'], $block_content);
|
||||
unset($this->smarty->block_data[$_name]);
|
||||
} else {
|
||||
$block_content = str_replace($this->smarty->left_delimiter . '$smarty.block.child' . $this->smarty->right_delimiter,
|
||||
'', $block_content);
|
||||
}
|
||||
}
|
||||
if (isset($this->smarty->block_data[$_name])) {
|
||||
if (strpos($this->smarty->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
|
||||
$this->smarty->block_data[$_name]['source'] =
|
||||
@@ -195,4 +206,5 @@ class Smarty_Internal_Resource_Extends {
|
||||
return $_compile_dir . $_filepath . '.' . $_template->resource_type . '.' . basename($_files[count($_files)-1]) . $_cache . '.php';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user