From 608b37d764ddc6dbacd6329fb9a6cbedb1fc81cc Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 14 Feb 2012 14:02:07 +0000 Subject: more compact code --- it_text.class | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/it_text.class b/it_text.class index 4fce590..50076a8 100644 --- a/it_text.class +++ b/it_text.class @@ -225,14 +225,9 @@ function transmogrify($text, $values = null) $value = $values ? $values : $GLOBALS; foreach (explode(".", $part) as $key) { - if (is_object($value)) - $value = $value->$key; - else - { - $value = $value[$key]; - if ($value === null && $values) - it::error("No value given for text variable \{$key\}"); - } + $value = is_object($value) ? $value->$key : $value[$key]; + if ($value === null && $values) # do not test in $GLOBALS mode + it::error("No value given for text variable \{$key\}"); } $result .= $value; -- cgit v1.2.3