diff --git a/change_log.txt b/change_log.txt index e77e7d40..1a26703d 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,6 +1,9 @@ 03/26/2009 - fixed parser not to create error on `word` in double quoted strings - allow PHP array(...) +- implemented $smarty.block.name.parent to access parent block content +- fixed smarty.class + 03/23/2009 - fixed {foreachelse} and {forelse} tags diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index d0a2b823..54b9ef38 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -406,7 +406,7 @@ class Smarty extends Smarty_Internal_TemplateBase { * @param string $code the error code */ class SmartyException { - public function printException($e) + public static function printException($e) { echo "Code: " . $e->getCode() . "
Error: " . htmlentities($e->getMessage()) . "
" . "File: " . $e->getFile() . "
" diff --git a/libs/sysplugins/internal.compile_smarty.php b/libs/sysplugins/internal.compile_smarty.php index 9a30885e..cfd4b2d0 100644 --- a/libs/sysplugins/internal.compile_smarty.php +++ b/libs/sysplugins/internal.compile_smarty.php @@ -83,7 +83,11 @@ class Smarty_Internal_Compile_Smarty extends Smarty_Internal_CompileBase { case 'global': return "\$_smarty_tpl->smarty->getGlobalVariable($_index[1])->value"; case 'block': - return "'".addcslashes($compiler->template->block_data[trim($_index[1],"'")]['source'],"'")."'"; + if ($_index[2] == '\'parent\'') { + return "'" . addcslashes($compiler->template->block_data[trim($_index[1], "'")]['source'], "'") . "'"; + } else { + return "''"; + } case 'ldelim': $_ldelim = $this->smarty->left_delimiter; return "'$_ldelim'"; @@ -97,8 +101,8 @@ class Smarty_Internal_Compile_Smarty extends Smarty_Internal_CompileBase { break; } if (isset($_index[1])) { - $compiled_ref = $compiled_ref . "[$_index[1]]"; - } + $compiled_ref = $compiled_ref . "[$_index[1]]"; + } return $compiled_ref; } }