From 3d8a05a9f25f1ddc3afd57b08eb40d2a8a646eea Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 14 Feb 2012 14:41:34 +0000 Subject: more detailed error message --- it_text.class | 6 +++--- 1 file 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; -- cgit v1.2.3