diff --git a/phpgwapi/inc/class.Template.inc.php b/phpgwapi/inc/class.Template.inc.php index bd33950a6d..923c072cff 100644 --- a/phpgwapi/inc/class.Template.inc.php +++ b/phpgwapi/inc/class.Template.inc.php @@ -333,8 +333,11 @@ $str = preg_replace('/{([^ \t\r\n}]+)}/', "", $str); break; } - - $str = str_replace (".gif", ".png",$str); + /* If they want NOGIF policy, then I do a global replace */ + if ($GLOBALS['phpgw_info']['server']['imgtype_preference'] == 2) + { + $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 883828d61d..5540d0f3ae 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -776,16 +776,18 @@ function find_image($appname,$image) { - - if (!isset($GLOBALS['phpgw_info']['server']['imgtype_preference_order'])) + switch($GLOBALS['phpgw_info']['server']['imgtype_preference']) { - $imgpref = Array('gif','jpg','png'); + case 1: + $imgpref = Array('gif','jpg','png'); + break; + case 2: + $imgpref = Array('png','jpg','nogifs'); + break; + default: + $imgpref = Array('png','jpg','gif'); } - else - { - $imgpref = $GLOBALS['phpgw_info']['server']['imgtype_preference_order']; - } - + if (!@is_array($this->found_files[$appname])) { $imagedir_olddefault = '/'.$appname.'/images';