diff --git a/source/webui/smarty/plugins/compiler.switch.php b/source/webui/smarty/plugins/compiler.switch.php index bf1cd55..b8afa8e 100644 --- a/source/webui/smarty/plugins/compiler.switch.php +++ b/source/webui/smarty/plugins/compiler.switch.php @@ -32,6 +32,8 @@ * Fixed a bug when chaining multiple {case} statements without a {break}. * Version 3.5: * Updated to work with Smarty 3.0 release. (Tested and working with 3.0.5, no longer compatible with 3.0rcx releases.) + * Version 3.6: + * Updated to work with Smarty 3.1 release. (Tested and working on 3.1.3, No longer compatible with 3.0 releases.) * * - Bugs/Notes: * @@ -112,10 +114,10 @@ class Smarty_Compiler_Switch extends Smarty_Internal_CompileBase { */ public function compile($args, $compiler){ $this->compiler = $compiler; - $attr = $this->_get_attributes($args); + $attr = $this->getAttributes($compiler, $args); $_output = ''; - $this->_open_tag('switch',array($compiler->tag_nocache)); + $this->openTag($compiler, 'switch',array($compiler->tag_nocache)); if (is_array($attr['var'])) { $_output .= "tpl_vars[".$attr['var']['var']."])) \$_smarty_tpl->tpl_vars[".$attr['var']['var']."] = new Smarty_Variable;"; @@ -144,18 +146,18 @@ class Smarty_Compiler_Case extends Smarty_Internal_CompileBase { */ public function compile($args, $compiler){ $this->compiler = $compiler; - $attr = $this->_get_attributes($args); + $attr = $this->getAttributes($compiler, $args); $_output = ''; list($last_tag, $last_attr) = $this->compiler->_tag_stack[count($this->compiler->_tag_stack) - 1]; if($last_tag == 'case') { - list($break, $compiler->tag_nocache) = $this->_close_tag(array('case')); + list($break, $compiler->tag_nocache) = $this->closeTag($compiler, array('case')); if($last_attr[0]) $_output .= ''; } - $this->_open_tag('case', array(isset($attr['break']) ? $attr['break'] : false, $compiler->tag_nocache)); + $this->openTag($compiler, 'case', array(isset($attr['break']) ? $attr['break'] : false, $compiler->tag_nocache)); if (is_array($attr['value'])) { $_output .= "tpl_vars[".$attr['value']['var']."])) \$_smarty_tpl->tpl_vars[".$attr['value']['var']."] = new Smarty_Variable;"; @@ -183,17 +185,17 @@ class Smarty_Compiler_Default extends Smarty_Internal_CompileBase { */ public function compile($args, $compiler){ $this->compiler = $compiler; - $attr = $this->_get_attributes($args); + $attr = $this->getAttributes($compiler, $args); $_output = ''; list($last_tag, $last_attr) = $this->compiler->_tag_stack[count($this->compiler->_tag_stack) - 1]; if($last_tag == 'case') { - list($break, $compiler->tag_nocache) = $this->_close_tag(array('case')); + list($break, $compiler->tag_nocache) = $this->closeTag($compiler, array('case')); if($last_attr[0]) $_output .= ''; } - $this->_open_tag('case', array(isset($attr['break']) ? $attr['break'] : false, $compiler->tag_nocache)); + $this->openTag($compiler, 'case', array(isset($attr['break']) ? $attr['break'] : false, $compiler->tag_nocache)); $_output .= ''; @@ -218,9 +220,9 @@ class Smarty_Compiler_Break extends Smarty_Internal_CompileBase { public function compile($args, $compiler){ $this->compiler = $compiler; - $attr = $this->_get_attributes($args); + $attr = $this->getAttributes($compiler, $args); - list($break, $compiler->tag_nocache) = $this->_close_tag(array('case')); + list($break, $compiler->tag_nocache) = $this->closeTag($compiler, array('case')); return ''; } @@ -242,9 +244,9 @@ class Smarty_Compiler_Caseclose extends Smarty_Internal_CompileBase { public function compile($args, $compiler){ $this->compiler = $compiler; - $attr = $this->_get_attributes($args); + $attr = $this->getAttributes($compiler, $args); - list($break, $compiler->tag_nocache) = $this->_close_tag(array('case')); + list($break, $compiler->tag_nocache) = $this->closeTag($compiler, array('case')); return ''; } @@ -265,12 +267,12 @@ class Smarty_Compiler_Switchclose extends Smarty_Internal_CompileBase { public function compile($args, $compiler){ $this->compiler = $compiler; - $attr = $this->_get_attributes($args); + $attr = $this->getAttributes($compiler, $args); list($last_tag, $last_attr) = $this->compiler->_tag_stack[count($this->compiler->_tag_stack) - 1]; if(($last_tag == 'case' || $last_tag == 'default')) - list($break, $compiler->tag_nocache) = $this->_close_tag(array('case')); - list($compiler->tag_nocache) = $this->_close_tag(array('switch')); + list($break, $compiler->tag_nocache) = $this->closeTag($compiler, array('case')); + list($compiler->tag_nocache) = $this->closeTag($compiler, array('switch')); return ''; } @@ -289,4 +291,4 @@ function smarty_postfilter_switch($compiled, &$smarty) { // Remove the extra spaces after the start of the switch tag and before the first case statement. return preg_replace('/({ ?\?>)\s+(<\?php case)/', "$1\n$2", $compiled); } -?> \ No newline at end of file +?>