Skip to content

Commit

Permalink
Fix: broken feature (add more attr and css class)
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Nov 3, 2017
1 parent 55386a3 commit 2d4717b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions htdocs/core/lib/functions.lib.php
Expand Up @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit 2d4717b

Please sign in to comment.