diff options
| author | Urban Müller | 2012-02-14 14:41:34 +0000 | 
|---|---|---|
| committer | Urban Müller | 2012-02-14 14:41:34 +0000 | 
| commit | 3d8a05a9f25f1ddc3afd57b08eb40d2a8a646eea (patch) | |
| tree | 3d1cc657b0b6551397622df531f3ef51eb18896f | |
| parent | 4a778f1f2d1f5b41c02471c6b7749caa066ed2b8 (diff) | |
| download | itools-3d8a05a9f25f1ddc3afd57b08eb40d2a8a646eea.tar.gz itools-3d8a05a9f25f1ddc3afd57b08eb40d2a8a646eea.tar.bz2 itools-3d8a05a9f25f1ddc3afd57b08eb40d2a8a646eea.zip | |
more detailed error message
| -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; |