diff options
-rw-r--r-- | it_text.class | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/it_text.class b/it_text.class index 50076a8..97bf352 100644 --- a/it_text.class +++ b/it_text.class @@ -157,7 +157,7 @@ function text($label, $language = null) */ function etext($label, $values = null, $language = null) { - return $this->transmogrify($this->text($label, $language), $values); + return $this->transmogrify($this->text($label, $language), $values, $label); } @@ -216,7 +216,7 @@ function set($label, $text = null, $language = null) * Replaces variables of the form {obj.var} with value, e.g. {user.name} * NOTE: Invalid object names or non-existing variables are simply deleted. */ -function transmogrify($text, $values = null) +function transmogrify($text, $values = null, $label = null) { foreach (preg_split('/{([\w.]+)}/', $text, -1, PREG_SPLIT_DELIM_CAPTURE) as $i => $part) { @@ -227,7 +227,7 @@ function transmogrify($text, $values = null) { $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\}"); + it::error(array('title' => "No value given for text variable {" . $key ."} in label $label", 'skipfiles' => "text|auto_prepend")); } $result .= $value; |