2
0
forked from Wavyzz/dolibarr

Fix: possibility to use "img_picto()" with external module

This commit is contained in:
Regis Houssin
2010-09-30 16:34:27 +00:00
parent 59a1f00ec4
commit 557fa249af

View File

@@ -1101,9 +1101,18 @@ function img_object($alt, $object)
function img_picto($alt, $picto, $options='', $pictoisfullpath=0)
{
global $conf;
$path = 'theme/'.$conf->theme;
if (preg_match('/^([^@]+)@([^@]+)$/i',$picto,$regs))
{
$picto = $regs[1];
$path = $regs[2];
}
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto.='.png';
if ($pictoisfullpath) return '<img src="'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>';
return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>';
return '<img src="'.DOL_URL_ROOT.'/'.$path.'/img/'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>';
}
/**