From 26c465ad0c1d5b6801507ed190430f44ac92c672 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 6 Dec 2015 21:09:58 +0100 Subject: update smarty to 3.1.28-dev which fixes a bug where changes in a template are only visible on the second pageload which is annoying for developing --- .../sysplugins/smarty_internal_parsetree_dq.php | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'library/Smarty/libs/sysplugins/smarty_internal_parsetree_dq.php') diff --git a/library/Smarty/libs/sysplugins/smarty_internal_parsetree_dq.php b/library/Smarty/libs/sysplugins/smarty_internal_parsetree_dq.php index bdfa4c48f..607389cb5 100644 --- a/library/Smarty/libs/sysplugins/smarty_internal_parsetree_dq.php +++ b/library/Smarty/libs/sysplugins/smarty_internal_parsetree_dq.php @@ -25,43 +25,45 @@ class Smarty_Internal_ParseTree_Dq extends Smarty_Internal_ParseTree */ public function __construct($parser, Smarty_Internal_ParseTree $subtree) { - $this->parser = $parser; $this->subtrees[] = $subtree; if ($subtree instanceof Smarty_Internal_ParseTree_Tag) { - $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack); + $parser->block_nesting_level = count($parser->compiler->_tag_stack); } } /** * Append buffer to subtree * - * @param Smarty_Internal_ParseTree $subtree parse tree buffer + * @param \Smarty_Internal_Templateparser $parser + * @param Smarty_Internal_ParseTree $subtree parse tree buffer */ - public function append_subtree(Smarty_Internal_ParseTree $subtree) + public function append_subtree(Smarty_Internal_Templateparser $parser, Smarty_Internal_ParseTree $subtree) { $last_subtree = count($this->subtrees) - 1; - if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof Smarty_Internal_ParseTree_Tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) { + if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof Smarty_Internal_ParseTree_Tag && $this->subtrees[$last_subtree]->saved_block_nesting < $parser->block_nesting_level) { if ($subtree instanceof Smarty_Internal_ParseTree_Code) { - $this->subtrees[$last_subtree]->data = $this->parser->compiler->appendCode($this->subtrees[$last_subtree]->data, 'data . ';?>'); + $this->subtrees[$last_subtree]->data = $parser->compiler->appendCode($this->subtrees[$last_subtree]->data, 'data . ';?>'); } elseif ($subtree instanceof Smarty_Internal_ParseTree_DqContent) { - $this->subtrees[$last_subtree]->data = $this->parser->compiler->appendCode($this->subtrees[$last_subtree]->data, 'data . '";?>'); + $this->subtrees[$last_subtree]->data = $parser->compiler->appendCode($this->subtrees[$last_subtree]->data, 'data . '";?>'); } else { - $this->subtrees[$last_subtree]->data = $this->parser->compiler->appendCode($this->subtrees[$last_subtree]->data, $subtree->data); + $this->subtrees[$last_subtree]->data = $parser->compiler->appendCode($this->subtrees[$last_subtree]->data, $subtree->data); } } else { $this->subtrees[] = $subtree; } if ($subtree instanceof Smarty_Internal_ParseTree_Tag) { - $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack); + $parser->block_nesting_level = count($parser->compiler->_tag_stack); } } /** * Merge subtree buffer content together * + * @param \Smarty_Internal_Templateparser $parser + * * @return string compiled template code */ - public function to_smarty_php() + public function to_smarty_php(Smarty_Internal_Templateparser $parser) { $code = ''; foreach ($this->subtrees as $subtree) { @@ -69,15 +71,15 @@ class Smarty_Internal_ParseTree_Dq extends Smarty_Internal_ParseTree $code .= "."; } if ($subtree instanceof Smarty_Internal_ParseTree_Tag) { - $more_php = $subtree->assign_to_var(); + $more_php = $subtree->assign_to_var($parser); } else { - $more_php = $subtree->to_smarty_php(); + $more_php = $subtree->to_smarty_php($parser); } $code .= $more_php; if (!$subtree instanceof Smarty_Internal_ParseTree_DqContent) { - $this->parser->compiler->has_variable_string = true; + $parser->compiler->has_variable_string = true; } } -- cgit v1.2.3