From 2aa000eac8d717132ae00f182a2f7e39c5a1ff7f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 18 Dec 2003 06:11:08 +0000 Subject: [PATCH] fixed fallback to images in the api-dir, did not work if no api-image was used before --- phpgwapi/inc/class.common.inc.php | 43 +++++++++++++++++++------------ 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index fe707533fb..e8e462e1be 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -935,25 +935,34 @@ { $imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files[$appname][$image].'/'.$image; } - elseif(isset($this->found_files['phpgwapi'][$image.'.png'])) - { - $imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.'.png'].'/'.$image.'.png'; - } - elseif(isset($this->found_files['phpgwapi'][$image.'.jpg'])) - { - $imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.'.jpg'].'/'.$image.'.jpg'; - } - elseif(isset($this->found_files['phpgwapi'][$image.'.gif'])) - { - $imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.'.gif'].'/'.$image.'.gif'; - } - elseif(isset($this->found_files['phpgwapi'][$image])) - { - $imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image].'/'.$image; - } else { - $imgfile = ''; + // searching the image in the api-dirs + if (!isset($this->found_files['phpgwapi'])) + { + $this->find_image('phpgwapi',''); + } + + if(isset($this->found_files['phpgwapi'][$image.'.png'])) + { + $imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.'.png'].'/'.$image.'.png'; + } + elseif(isset($this->found_files['phpgwapi'][$image.'.jpg'])) + { + $imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.'.jpg'].'/'.$image.'.jpg'; + } + elseif(isset($this->found_files['phpgwapi'][$image.'.gif'])) + { + $imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.'.gif'].'/'.$image.'.gif'; + } + elseif(isset($this->found_files['phpgwapi'][$image])) + { + $imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image].'/'.$image; + } + else + { + $imgfile = ''; + } } return $imgfile; }