summaryrefslogtreecommitdiff
path: root/it_text.class
diff options
context:
space:
mode:
authorUrban Müller2012-02-14 14:02:07 +0000
committerUrban Müller2012-02-14 14:02:07 +0000
commit608b37d764ddc6dbacd6329fb9a6cbedb1fc81cc (patch)
tree55065cabcba5058d6165ec2b676c45993a15b49e /it_text.class
parent2a037e9d238f5637c0068ddcd7c5f5a683d4936c (diff)
downloaditools-608b37d764ddc6dbacd6329fb9a6cbedb1fc81cc.tar.gz
itools-608b37d764ddc6dbacd6329fb9a6cbedb1fc81cc.tar.bz2
itools-608b37d764ddc6dbacd6329fb9a6cbedb1fc81cc.zip
more compact code
Diffstat (limited to 'it_text.class')
-rw-r--r--it_text.class11
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;