diff --git a/change_log.txt b/change_log.txt index 2bee3d45..f8661b75 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +10/24/2009 +- fixed nocache vars at internal block tags + 10/23/2009 - fixed nocache var problem diff --git a/libs/sysplugins/internal.compile_for.php b/libs/sysplugins/internal.compile_for.php index 17055a37..07cd3f7d 100644 --- a/libs/sysplugins/internal.compile_for.php +++ b/libs/sysplugins/internal.compile_for.php @@ -38,7 +38,9 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->_get_attributes($args); - $this->_open_tag('for'); + $this->_open_tag('for', array('for',$this->compiler->nocache)); + // maybe nocache because of nocache variables + $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache; $output = "compiler = $compiler; // check and get attributes $_attr = $this->_get_attributes($args); + // must endblock be nocache? + if ($this->compiler->nocache) { + $this->compiler->tag_nocache = true; + } - $_open_tag = $this->_close_tag(array('for', 'forelse')); + list($_open_tag, $this->compiler->nocache) = $this->_close_tag(array('for', 'forelse')); if ($_open_tag == 'forelse') return ""; else diff --git a/libs/sysplugins/internal.compile_foreach.php b/libs/sysplugins/internal.compile_foreach.php index 20bd19df..8d12aded 100644 --- a/libs/sysplugins/internal.compile_foreach.php +++ b/libs/sysplugins/internal.compile_foreach.php @@ -28,7 +28,9 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->_get_attributes($args); - $this->_open_tag('foreach'); + $this->_open_tag('foreach', array('foreach',$this->compiler->nocache)); + // maybe nocache because of nocache variables + $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache; $from = $_attr['from']; $item = $_attr['item']; diff --git a/libs/sysplugins/internal.compile_foreachclose.php b/libs/sysplugins/internal.compile_foreachclose.php index 182f6eb0..adbaa8ee 100644 --- a/libs/sysplugins/internal.compile_foreachclose.php +++ b/libs/sysplugins/internal.compile_foreachclose.php @@ -24,7 +24,13 @@ class Smarty_Internal_Compile_ForeachClose extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->_get_attributes($args); - $_open_tag = $this->_close_tag(array('foreach', 'foreachelse')); + // must endblock be nocache? + if ($this->compiler->nocache) { + $this->compiler->tag_nocache = true; + } + + list($_open_tag, $this->compiler->nocache) = $this->_close_tag(array('foreach', 'foreachelse')); + if ($_open_tag == 'foreachelse') return ""; else diff --git a/libs/sysplugins/internal.compile_foreachelse.php b/libs/sysplugins/internal.compile_foreachelse.php index ff9b5ce5..6b9eba5b 100644 --- a/libs/sysplugins/internal.compile_foreachelse.php +++ b/libs/sysplugins/internal.compile_foreachelse.php @@ -24,8 +24,9 @@ class Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->_get_attributes($args); - $this->_close_tag('foreach'); - $this->_open_tag('foreachelse'); + list($_open_tag, $this->compiler->nocache) = $this->_close_tag(array('foreach')); + $this->_open_tag('foreachelse',array('foreachelse', $this->compiler->nocache)); + return ""; } } diff --git a/libs/sysplugins/internal.compile_forelse.php b/libs/sysplugins/internal.compile_forelse.php index f017d01d..c68b883e 100644 --- a/libs/sysplugins/internal.compile_forelse.php +++ b/libs/sysplugins/internal.compile_forelse.php @@ -25,8 +25,8 @@ class Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->_get_attributes($args); - $this->_close_tag(array('for')); - $this->_open_tag('forelse'); + list($_open_tag, $this->compiler->nocache) = $this->_close_tag(array('for')); + $this->_open_tag('forelse',array('forelse', $this->compiler->nocache)); return ""; } } diff --git a/libs/sysplugins/internal.compile_section.php b/libs/sysplugins/internal.compile_section.php index 6ee852d7..94b1c0f2 100644 --- a/libs/sysplugins/internal.compile_section.php +++ b/libs/sysplugins/internal.compile_section.php @@ -27,7 +27,9 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->_get_attributes($args); - $this->_open_tag('section'); + $this->_open_tag('section', array('section',$this->compiler->nocache)); + // maybe nocache because of nocache variables + $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache; $output = "_get_attributes($args); - $_open_tag = $this->_close_tag(array('section', 'sectionelse')); + // must endblock be nocache? + if ($this->compiler->nocache) { + $this->compiler->tag_nocache = true; + } + + list($_open_tag, $this->compiler->nocache) = $this->_close_tag(array('section', 'sectionelse')); + if ($_open_tag == 'sectionelse') return ""; else diff --git a/libs/sysplugins/internal.compile_sectionelse.php b/libs/sysplugins/internal.compile_sectionelse.php index 8061bcc3..d280c278 100644 --- a/libs/sysplugins/internal.compile_sectionelse.php +++ b/libs/sysplugins/internal.compile_sectionelse.php @@ -25,8 +25,9 @@ class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->_get_attributes($args); - $this->_close_tag('section'); - $this->_open_tag('sectionelse'); + list($_open_tag, $this->compiler->nocache) = $this->_close_tag(array('section')); + $this->_open_tag('sectionelse',array('sectionelse', $this->compiler->nocache)); + return ""; } } diff --git a/libs/sysplugins/internal.compile_while.php b/libs/sysplugins/internal.compile_while.php index 774204de..43cb8bb8 100644 --- a/libs/sysplugins/internal.compile_while.php +++ b/libs/sysplugins/internal.compile_while.php @@ -25,7 +25,12 @@ class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase { $this->required_attributes = array('if condition'); // check and get attributes $_attr = $this->_get_attributes($args); - $this->_open_tag('while'); + $this->_open_tag('while', $this->compiler->nocache); + + // maybe nocache because of nocache variables + $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache; + + if (is_array($args['if condition'])) { $_output = " tpl_vars[".$args['if condition']['var']."])) \$_smarty_tpl->tpl_vars[".$args['if condition']['var']."] = new Smarty_Variable;\n"; $_output .= " while (\$_smarty_tpl->tpl_vars[".$args['if condition']['var']."]->value = ".$args['if condition']['value'].") {\n ?>"; diff --git a/libs/sysplugins/internal.compile_whileclose.php b/libs/sysplugins/internal.compile_whileclose.php index dff36426..2e5976fc 100644 --- a/libs/sysplugins/internal.compile_whileclose.php +++ b/libs/sysplugins/internal.compile_whileclose.php @@ -23,7 +23,11 @@ class Smarty_Internal_Compile_WhileClose extends Smarty_Internal_CompileBase { public function compile($args, $compiler) { $this->compiler = $compiler; - $this->_close_tag(array('while')); + // must endblock be nocache? + if ($this->compiler->nocache) { + $this->compiler->tag_nocache = true; + } + $this->compiler->nocache = $this->_close_tag(array('while')); return ""; } }