openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 65e53903414e8340b781dc589b5cf02b5ef0092d
parent bf292882ee1746976b1f57e0d19139ef93225da1
Author: dankert <devnull@localhost>
Date:   Wed, 29 Mar 2006 20:03:25 +0200

"present" ergibt true, wenn Variable vorhanden und leer ist.

Diffstat:
themes/default/include/html/if.inc.php | 19+++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/themes/default/include/html/if.inc.php b/themes/default/include/html/if.inc.php @@ -29,7 +29,7 @@ $exec = empty( $$attr_empty ); } - // Vergleich auf nicht-leer + // Vergleich auf Vorhandensein elseif ( !empty($attr_present) ) { if ( !isset($$attr_present) ) @@ -41,7 +41,22 @@ elseif ( is_numeric($$attr_present) ) $exec = $$attr_present>=0; else - $exec = !empty( $$attr_present ); + $exec = true; + } + + // Vergleich auf nicht-leer + elseif ( !empty($attr_notempty) ) + { + if ( !isset($$attr_notempty) ) + $exec = false; + elseif ( is_array($$attr_notempty) ) + $exec = (count($$attr_notempty)>0); + elseif ( is_bool($$attr_notempty) ) + $exec = true; + elseif ( is_numeric($$attr_notempty) ) + $exec = $$attr_notempty>=0; + else + $exec = !empty( $$attr_notempty ); } else {