diff options
author | Urban Müller | 2012-02-14 14:02:07 +0000 |
---|---|---|
committer | Urban Müller | 2012-02-14 14:02:07 +0000 |
commit | 608b37d764ddc6dbacd6329fb9a6cbedb1fc81cc (patch) | |
tree | 55065cabcba5058d6165ec2b676c45993a15b49e /it_text.class | |
parent | 2a037e9d238f5637c0068ddcd7c5f5a683d4936c (diff) | |
download | itools-608b37d764ddc6dbacd6329fb9a6cbedb1fc81cc.tar.gz itools-608b37d764ddc6dbacd6329fb9a6cbedb1fc81cc.tar.bz2 itools-608b37d764ddc6dbacd6329fb9a6cbedb1fc81cc.zip |
more compact code
Diffstat (limited to 'it_text.class')
-rw-r--r-- | it_text.class | 11 |
1 files 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; |