forked from Wavyzz/dolibarr
Fix: possibility to use "img_picto()" with external module
This commit is contained in:
@@ -1101,9 +1101,18 @@ function img_object($alt, $object)
|
|||||||
function img_picto($alt, $picto, $options='', $pictoisfullpath=0)
|
function img_picto($alt, $picto, $options='', $pictoisfullpath=0)
|
||||||
{
|
{
|
||||||
global $conf;
|
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 (! 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:'').'>';
|
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:'').'>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user