Fix regression

This commit is contained in:
Laurent Destailleur
2018-04-05 19:52:54 +02:00
parent 6c409b2670
commit 48ff89c63b
4 changed files with 19 additions and 9 deletions

View File

@@ -3059,7 +3059,7 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo
* Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img
* Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1)
* @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
* @param int $pictoisfullpath If 1, image path is a full path
* @param boolean|int $pictoisfullpath If true or 1, image path is a full path
* @param int $srconly Return only content of the src attribute of img.
* @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
* @param string $alt Force alt for bind peoplae
@@ -3082,13 +3082,13 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) {
$picto .= '.png';
}
$fullpathpicto = $url.'/'.$path.'/img/'.$picto;
$fullpathpicto = $picto;
}
else {
$pictowithoutext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
if (in_array($pictowithoutext, array('bank', 'delete', 'edit', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'switch_off', 'switch_on', 'unlink', 'uparrow'))) {
if (empty($srconly) && in_array($pictowithoutext, array('bank', 'delete', 'edit', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'switch_off', 'switch_on', 'unlink', 'uparrow'))) {
$fakey = $pictowithoutext;
$facolor = '';
$fasize = '';
@@ -3151,7 +3151,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (preg_match('/class="([^"]+)"/', $moreatt, $reg)) {
$morecss.= ($morecss?' ':'').$reg[1];
}
$enabledisablehtml = '<span class="fa '.$fakey.' marginleftonly valignmiddle'.($morecss?' '.$morecss:'').'" style="'.($fasize?('font-size: '.$fasize.';'):'').($facolor?(' color: '.$facolor.';'):'').'" alt="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'"'.($moreatt?' '.$moreatt:'').'">';
$enabledisablehtml = '<span class="fa '.$fakey.' marginleftonly valignmiddle'.($morecss?' '.$morecss:'').'" style="'.($fasize?('font-size: '.$fasize.';'):'').($facolor?(' color: '.$facolor.';'):'').'" alt="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'"'.($moreatt?' '.$moreatt:'').'>';
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$enabledisablehtml.= $titlealt;
}