From 8387d1ef6fbc9b7791c99e7ecf2dc5c4d140c49e Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Tue, 29 Sep 2009 21:40:30 +0000 Subject: [PATCH] - enabled short boolean attributes {some attr} equala {some attr=true} --- libs/sysplugins/internal.compile_print_expression.php | 7 ++++++- libs/sysplugins/internal.templateparser.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/sysplugins/internal.compile_print_expression.php b/libs/sysplugins/internal.compile_print_expression.php index 9a482a0f..5a3cc3d3 100644 --- a/libs/sysplugins/internal.compile_print_expression.php +++ b/libs/sysplugins/internal.compile_print_expression.php @@ -23,7 +23,7 @@ class Smarty_Internal_Compile_Print_Expression extends Smarty_Internal_CompileBa { $this->compiler = $compiler; $this->required_attributes = array('value'); - $this->optional_attributes = array('assign', 'nocache', 'filter'); + $this->optional_attributes = array('assign', 'nocache', 'filter', 'nofilter'); // check and get attributes $_attr = $this->_get_attributes($args); @@ -36,6 +36,11 @@ class Smarty_Internal_Compile_Print_Expression extends Smarty_Internal_CompileBa if (!isset($_attr['filter'])) { $_attr['filter'] = 'null'; } + if (isset($_attr['nofilter'])) { + if ($_attr['nofilter'] == 'true') { + $_attr['filter'] = 'false'; + } + } if (isset($_attr['assign'])) { // assign output to variable diff --git a/libs/sysplugins/internal.templateparser.php b/libs/sysplugins/internal.templateparser.php index bf94b480..ac4bc472 100644 --- a/libs/sysplugins/internal.templateparser.php +++ b/libs/sysplugins/internal.templateparser.php @@ -2088,7 +2088,7 @@ static public $yy_action = array( function yy_r30(){ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); } #line 2094 "internal.templateparser.php" #line 205 "internal.templateparser.y" - function yy_r31(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor=>null); } + function yy_r31(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor=>'true'); } #line 2097 "internal.templateparser.php" #line 210 "internal.templateparser.y" function yy_r32(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); }