diff --git a/phpgwapi/inc/class.Template.inc.php b/phpgwapi/inc/class.Template.inc.php index dea24c6c44..131ccb6559 100644 --- a/phpgwapi/inc/class.Template.inc.php +++ b/phpgwapi/inc/class.Template.inc.php @@ -334,9 +334,9 @@ break; } /* If they want NOGIF policy, then I do a global replace */ - if ($GLOBALS['phpgw_info']['server']['image_type'] == 2) + if (@$GLOBALS['phpgw_info']['server']['image_type'] == 2) { - $str = str_replace ('.gif', '.png',$str); + $str = str_replace ('.gif','.png',$str); } return $str; } diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index 2f2122e57a..274b3290c4 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -776,18 +776,22 @@ function find_image($appname,$image) { - switch($GLOBALS['phpgw_info']['server']['image_type']) + static $imgpref; + if(! @$imgpref) { - case 1: - $imgpref = Array('png','jpg','gif'); - break; - case 2: - $imgpref = Array('png','jpg','nogifs'); - break; - default: - $imgpref = Array('gif','jpg','png'); + switch(@$GLOBALS['phpgw_info']['server']['image_type']) + { + case 1: + $imgpref = Array('png','jpg','gif'); + break; + case 2: + $imgpref = Array('png','jpg','nogifs'); + break; + default: + $imgpref = Array('gif','jpg','png'); + break; + } } - if (!@is_array($this->found_files[$appname])) { $imagedir_olddefault = '/'.$appname.'/images';