FIX title on picto no more visible

This commit is contained in:
ldestailleur
2019-01-04 15:22:59 +01:00
parent 66a99be097
commit b4fc4b0178

View File

@@ -2973,7 +2973,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
if (empty($srconly) && in_array($pictowithoutext, array( 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', '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', 'note', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow',
'jabber','skype','twitter','facebook' 'jabber','skype','twitter','facebook'
) )
)) { )) {
@@ -3066,18 +3066,22 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
elseif ($pictowithoutext == 'jabber') { elseif ($pictowithoutext == 'jabber') {
$fakey = 'fa-comment-o'; $fakey = 'fa-comment-o';
} }
elseif ($pictowithoutext == 'split') {
$fakey = 'fa-code-fork';
}
else { else {
$fakey = 'fa-'.$pictowithoutext; $fakey = 'fa-'.$pictowithoutext;
$facolor = '#444'; $facolor = '#444';
$marginleftonlyshort=0; $marginleftonlyshort=0;
} }
$reg=array();
if (preg_match('/class="([^"]+)"/', $moreatt, $reg)) { if (preg_match('/class="([^"]+)"/', $moreatt, $reg)) {
$morecss.= ($morecss?' ':'').$reg[1]; $morecss.= ($morecss?' ':'').$reg[1];
} }
$fa='fa'; $fa='fa';
if (! empty($conf->global->MAIN_USE_FONT_AWESOME_5)) $fa='fas'; if (! empty($conf->global->MAIN_USE_FONT_AWESOME_5)) $fa='fas';
$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)) { if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$enabledisablehtml.= $titlealt; $enabledisablehtml.= $titlealt;
} }
@@ -3093,11 +3097,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 $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'])) { 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 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]; $picto = $regs[1];
$path = $regs[2]; // $path is $mymodule $path = $regs[2]; // $path is $mymodule
} }