2
0
forked from Wavyzz/dolibarr

Fix picto logout with fontawesome 5

This commit is contained in:
Laurent Destailleur
2019-02-11 11:45:29 +01:00
parent 7d20321b3b
commit 0bd30b160a
2 changed files with 11 additions and 8 deletions

View File

@@ -2976,7 +2976,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', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', 'note', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow',
'jabber','skype','twitter','facebook' 'jabber','skype','twitter','facebook'
) )
)) { )) {
@@ -3055,6 +3055,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$fakey = 'fa-caret-down'; $fakey = 'fa-caret-down';
$marginleftonlyshort = 1; $marginleftonlyshort = 1;
} }
elseif ($pictowithoutext == 'sign-out') {
$marginleftonlyshort=0;
if (! empty($conf->global->MAIN_USE_FONT_AWESOME_5)) $fakey = 'fa-sign-out-alt';
}
elseif ($pictowithoutext == 'unlink') { elseif ($pictowithoutext == 'unlink') {
$fakey = 'fa-chain-broken'; $fakey = 'fa-chain-broken';
$facolor = '#555'; $facolor = '#555';
@@ -3093,7 +3097,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$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') : ''); $enabledisablehtml = '<span class="' . $fa . ' ' . $fakey . ($marginleftonlyshort ? ($marginleftonlyshort == 1 ? ' marginleftonlyshort' : ' marginleftonly') : '');
$enabledisablehtml .= ' valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" style="' . ($fasize ? ('font-size: ' . $fasize . ';') : '') . ($facolor ? (' color: ' . $facolor . ';') : '') . ($morestyle ? ' ' . $morestyle : '') . '"' . (($notitle || empty($titlealt)) ? '' : ' title="' . dol_escape_htmltag($titlealt) . '"') . ($moreatt ? ' ' . $moreatt : '') . '>'; $enabledisablehtml .= ' valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" style="' . ($fasize ? ('font-size: ' . $fasize . ';') : '') . ($facolor ? (' color: ' . $facolor . ';') : '') . ($morestyle ? ' ' . $morestyle : '') . '"' . (($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;

View File

@@ -1561,14 +1561,13 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
$logouthtmltext.=$langs->trans("Logout").'<br>'; $logouthtmltext.=$langs->trans("Logout").'<br>';
$logouttext .='<a accesskey="l" href="'.DOL_URL_ROOT.'/user/logout.php">'; $logouttext .='<a accesskey="l" href="'.DOL_URL_ROOT.'/user/logout.php">';
//$logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); $logouttext .=img_picto($langs->trans('Logout'), 'sign-out', '', false, 0, 0, '', 'atoplogin');
$logouttext .='<span class="fa fa-sign-out atoplogin"></span>';
$logouttext .='</a>'; $logouttext .='</a>';
} }
else else
{ {
$logouthtmltext.=$langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]); $logouthtmltext.=$langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]);
$logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); $logouttext .= img_picto($langs->trans('Logout'), 'sign-out', '', false, 0, 0, '', 'atoplogin opacitymedium');
} }
} }
@@ -1607,7 +1606,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
{ {
$text ='<a href="'.DOL_URL_ROOT.'/modulebuilder/index.php?mainmenu=home&leftmenu=admintools" target="_modulebuilder">'; $text ='<a href="'.DOL_URL_ROOT.'/modulebuilder/index.php?mainmenu=home&leftmenu=admintools" target="_modulebuilder">';
//$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"'); //$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"');
$text.='<span class="fa fa-bug atoplogin"></span>'; $text.='<span class="fa fa-bug atoplogin valignmiddle"></span>';
$text.='</a>'; $text.='</a>';
$toprightmenu.=@Form::textwithtooltip('', $langs->trans("ModuleBuilder"), 2, 1, $text, 'login_block_elem', 2); $toprightmenu.=@Form::textwithtooltip('', $langs->trans("ModuleBuilder"), 2, 1, $text, 'login_block_elem', 2);
} }
@@ -1626,7 +1625,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
$qs.=(($qs && $morequerystring)?'&':'').$morequerystring; $qs.=(($qs && $morequerystring)?'&':'').$morequerystring;
$text ='<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.$qs.($qs?'&':'').'optioncss=print" target="_blank">'; $text ='<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.$qs.($qs?'&':'').'optioncss=print" target="_blank">';
//$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"'); //$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"');
$text.='<span class="fa fa-print atoplogin"></span>'; $text.='<span class="fa fa-print atoplogin valignmiddle"></span>';
$text.='</a>'; $text.='</a>';
$toprightmenu.=@Form::textwithtooltip('', $langs->trans("PrintContentArea"), 2, 1, $text, 'login_block_elem', 2); $toprightmenu.=@Form::textwithtooltip('', $langs->trans("PrintContentArea"), 2, 1, $text, 'login_block_elem', 2);
} }
@@ -1664,7 +1663,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
else $text.=sprintf($helpbaseurl, $helppage); else $text.=sprintf($helpbaseurl, $helppage);
$text.='">'; $text.='">';
//$text.=img_picto('', 'helpdoc_top').' '; //$text.=img_picto('', 'helpdoc_top').' ';
$text.='<span class="fa fa-question-circle atoplogin"></span>'; $text.='<span class="fa fa-question-circle atoplogin valignmiddle"></span>';
//$toprightmenu.=$langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help'); //$toprightmenu.=$langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help');
//if ($mode == 'wiki') $text.=' ('.dol_trunc(strtr($helppage,'_',' '),8).')'; //if ($mode == 'wiki') $text.=' ('.dol_trunc(strtr($helppage,'_',' '),8).')';
$text.='</a>'; $text.='</a>';