From da8ccaa6bb1dfaec68f0630859859ca5ce0b42cd Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 8 Apr 2005 18:31:55 +0000 Subject: [PATCH] allow to specify the app of an image by giving / instead just a --- etemplate/inc/class.uietemplate.inc.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/etemplate/inc/class.uietemplate.inc.php b/etemplate/inc/class.uietemplate.inc.php index fac9983111..45611a6621 100644 --- a/etemplate/inc/class.uietemplate.inc.php +++ b/etemplate/inc/class.uietemplate.inc.php @@ -1050,9 +1050,13 @@ break; case 'image': $image = $value != '' ? $value : $name; - $image = $this->html->image(substr($this->name,0,strpos($this->name,'.')), - $image,strlen($label) > 1 && !$cell['no_lang'] ? lang($label) : $label,'border="0"'); - $html .= $image; + list($app,$img) = explode('/',$image,2); + if (!$app || !$img || !is_dir(PHPGW_SERVER_ROOT.'/'.$app) || strstr($img,'/')) + { + $img = $image; + list($app) = explode('.',$this->name); + } + $html .= $this->html->image($app,$img,strlen($label) > 1 && !$cell['no_lang'] ? lang($label) : $label,'border="0"'); list($extra_link,$extra_link_target) = explode(',',$cell['size']); $extra_label = False; break;