now only removes all gifs is policy is set

This commit is contained in:
seek3r 2002-01-21 19:04:57 +00:00
parent 0a001801f9
commit 3b939f5158
2 changed files with 15 additions and 10 deletions

View File

@ -333,8 +333,11 @@
$str = preg_replace('/{([^ \t\r\n}]+)}/', "<!-- Template $handle: Variable \\1 undefined -->", $str); $str = preg_replace('/{([^ \t\r\n}]+)}/', "<!-- Template $handle: Variable \\1 undefined -->", $str);
break; break;
} }
/* 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); $str = str_replace (".gif", ".png",$str);
}
return $str; return $str;
} }

View File

@ -776,14 +776,16 @@
function find_image($appname,$image) function find_image($appname,$image)
{ {
switch($GLOBALS['phpgw_info']['server']['imgtype_preference'])
if (!isset($GLOBALS['phpgw_info']['server']['imgtype_preference_order']))
{ {
case 1:
$imgpref = Array('gif','jpg','png'); $imgpref = Array('gif','jpg','png');
} break;
else case 2:
{ $imgpref = Array('png','jpg','nogifs');
$imgpref = $GLOBALS['phpgw_info']['server']['imgtype_preference_order']; break;
default:
$imgpref = Array('png','jpg','gif');
} }
if (!@is_array($this->found_files[$appname])) if (!@is_array($this->found_files[$appname]))