This commit is contained in:
Uwe.Tews
2010-02-17 21:30:36 +00:00
parent 44feb88c19
commit 950c3a7307
4 changed files with 1095 additions and 1052 deletions

View File

@@ -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

View File

@@ -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'] =

View File

@@ -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