priority between gif and png as set in config is now working

This commit is contained in:
alpeb 2004-02-13 01:25:30 +00:00
parent f8481d163a
commit 56309597dd

View File

@ -934,17 +934,28 @@
}
}
if(isset($this->found_files[$appname][$image.'.png']))
if (!$GLOBALS['phpgw_info']['server']['image_type'])
{
$imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files[$appname][$image.'.png'].'/'.$image.'.png';
// priority: GIF->JPG->PNG
$img_type=array('.gif','.jpg','.png');
}
elseif(isset($this->found_files[$appname][$image.'.jpg']))
else
{
$imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files[$appname][$image.'.jpg'].'/'.$image.'.jpg';
// priority: : PNG->JPG->GIF
$img_type=array('.png','.jpg','.gif');
}
elseif(isset($this->found_files[$appname][$image.'.gif']))
if(isset($this->found_files[$appname][$image.$img_type[0]]))
{
$imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files[$appname][$image.'.gif'].'/'.$image.'.gif';
$imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files[$appname][$image.$img_type[0]].'/'.$image.$img_type[0];
}
elseif(isset($this->found_files[$appname][$image.$img_type[1]]))
{
$imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files[$appname][$image.$img_type[1]].'/'.$image.$img_type[1];
}
elseif(isset($this->found_files[$appname][$image.$img_type[2]]))
{
$imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files[$appname][$image.$img_type[2]].'/'.$image.$img_type[2];
}
elseif(isset($this->found_files[$appname][$image]))
{
@ -958,17 +969,17 @@
$this->find_image('phpgwapi','');
}
if(isset($this->found_files['phpgwapi'][$image.'.png']))
if(isset($this->found_files['phpgwapi'][$image.$img_type[0]]))
{
$imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.'.png'].'/'.$image.'.png';
$imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.$img_type[0]].'/'.$image.$img_type[0];
}
elseif(isset($this->found_files['phpgwapi'][$image.'.jpg']))
elseif(isset($this->found_files['phpgwapi'][$image.$img_type[1]]))
{
$imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.'.jpg'].'/'.$image.'.jpg';
$imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.$img_type[1]].'/'.$image.$img_type[1];
}
elseif(isset($this->found_files['phpgwapi'][$image.'.gif']))
elseif(isset($this->found_files['phpgwapi'][$image.$img_type[2]]))
{
$imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.'.gif'].'/'.$image.'.gif';
$imgfile = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.$img_type[2]].'/'.$image.$img_type[2];
}
elseif(isset($this->found_files['phpgwapi'][$image]))
{