Fix: broken feature (add more attr and css class)

This commit is contained in:
Regis Houssin 2017-11-03 14:46:45 +01:00
parent 55386a3ae2
commit 2d4717b745

View File

@ -2717,10 +2717,11 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo
* @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
* @param string $morecss Add more class css on img tag (For example 'myclascss')
* @return string Return img tag
* @see #img_object, #img_picto_common
*/
function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $srconly=0, $notitle=0, $alt='')
function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $srconly=0, $notitle=0, $alt='', $morecss='')
{
global $conf, $langs;
@ -2742,7 +2743,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if ($picto == 'off') { $fakey = 'fa-square-o'; $fasize='1.3em'; }
if ($picto == 'on') { $fakey = 'fa-check-square-o'; $fasize='1.3em'; }
$enabledisablehtml='';
$enabledisablehtml.='<span class="fa '.$fakey.' valignmiddle" style="'.($fasize?('font-size: '.$fasize.';'):'').($facolor?(' color: '.$facolor.';'):'').'" alt="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'">';
$enabledisablehtml.='<span class="fa '.$fakey.' 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;
$enabledisablehtml.='</span>';
return $enabledisablehtml;