FIX title on picto no more visible

Conflicts:
	htdocs/core/lib/functions.lib.php
This commit is contained in:
ldestailleur 2019-01-04 15:22:59 +01:00
parent 082b126c06
commit 5638ac8f4d

View File

@ -3015,8 +3015,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
if (empty($srconly) && in_array($pictowithoutext, array(
'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
'note','switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow',
'skype','twitter','facebook'
'note', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow',
'jabber','skype','twitter','facebook'
)
)) {
$fakey = $pictowithoutext;
@ -3103,16 +3103,23 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$fakey = 'fa-play';
$facolor = '#444';
}
elseif ($pictowithoutext == 'jabber') {
$fakey = 'fa-comment-o';
}
elseif ($pictowithoutext == 'split') {
$fakey = 'fa-code-fork';
}
else {
$fakey = 'fa-'.$pictowithoutext;
$facolor = '#444';
$marginleftonlyshort=0;
}
$reg=array();
if (preg_match('/class="([^"]+)"/', $moreatt, $reg)) {
$morecss.= ($morecss?' ':'').$reg[1];
}
$enabledisablehtml = '<span class="fa '.$fakey.' '.($marginleftonlyshort?($marginleftonlyshort==1?'marginleftonlyshort':'marginleftonly'):'').' valignmiddle'.($morecss?' '.$morecss:'').'" style="'.($fasize?('font-size: '.$fasize.';'):'').($facolor?(' color: '.$facolor.';'):'').'" alt="'.dol_escape_htmltag($titlealt).'"'.(($notitle || empty($title))?'':' title="'.dol_escape_htmltag($title).'"').($moreatt?' '.$moreatt:'').'>';
$enabledisablehtml = '<span class="fa '.$fakey.' '.($marginleftonlyshort?($marginleftonlyshort==1?'marginleftonlyshort':'marginleftonly'):'').' valignmiddle'.($morecss?' '.$morecss:'').'" style="'.($fasize?('font-size: '.$fasize.';'):'').($facolor?(' color: '.$facolor.';'):'').'" alt="'.dol_escape_htmltag($titlealt).'"'.(($notitle || empty($titlealt))?'':' title="'.dol_escape_htmltag($titlealt).'"').($moreatt?' '.$moreatt:'').'>';
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$enabledisablehtml.= $titlealt;
}
@ -3128,11 +3135,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$path = $conf->global->MAIN_OVERWRITE_THEME_RES.'/theme/'.$conf->global->MAIN_OVERWRITE_THEME_RES; // To allow an external module to overwrite image resources whatever is activated theme
}
else if (! empty($conf->modules_parts['theme']) && array_key_exists($theme, $conf->modules_parts['theme'])) {
$path = $theme.'/theme/'.$theme; // If the theme have the same name as the module
$path = $theme.'/theme/'.$theme; // If the theme have the same name as the module
}
// If we ask an image into $url/$mymodule/img (instead of default path)
if (preg_match('/^([^@]+)@([^@]+)$/i',$picto,$regs)) {
if (preg_match('/^([^@]+)@([^@]+)$/i', $picto, $regs)) {
$picto = $regs[1];
$path = $regs[2]; // $path is $mymodule
}