improve img_picto by returning ASAP
We do not need an else each time some times, return is good enough. I also remove some line of comments since it's only code in it. We have GIT to find the code back we do not need to put it in comment ;-).
This commit is contained in:
parent
9ccdd10a81
commit
70cd68ebef
@ -3297,15 +3297,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
if ($srconly) {
|
if ($srconly) {
|
||||||
return $fullpathpicto;
|
return $fullpathpicto;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
// tag title is used for tooltip on <a>, tag alt can be used with very simple text on image for bind people
|
// tag title is used for tooltip on <a>, tag alt can be used with very simple text on image for bind people
|
||||||
//$tmparray=array(0=>$titlealt);
|
return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.(($notitle || empty($titlealt))?'':' title="'.dol_escape_htmltag($titlealt).'"').($moreatt?' '.$moreatt:' class="inline-block'.($morecss?' '.$morecss:'').'"').'>'; // Alt is used for accessibility, title for popup
|
||||||
//if (empty($notitle) && preg_match('/:[^\s0-9]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB
|
|
||||||
//$title=$tmparray[0];
|
|
||||||
//$alt=empty($tmparray[1])?'':$tmparray[1];
|
|
||||||
$title = $titlealt;
|
|
||||||
return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.(($notitle || empty($title))?'':' title="'.dol_escape_htmltag($title).'"').($moreatt?' '.$moreatt:' class="inline-block'.($morecss?' '.$morecss:'').'"').'>'; // Alt is used for accessibility, title for popup
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user