From 0bd30b160aca78d778899caa84799eaedc29c06f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Feb 2019 11:45:29 +0100 Subject: [PATCH] Fix picto logout with fontawesome 5 --- htdocs/core/lib/functions.lib.php | 8 ++++++-- htdocs/main.inc.php | 11 +++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a678b141339..d9ed04d6770 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2976,7 +2976,7 @@ 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', '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' ) )) { @@ -3055,6 +3055,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = 'fa-caret-down'; $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') { $fakey = 'fa-chain-broken'; $facolor = '#555'; @@ -3093,7 +3097,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fa='fa'; if (! empty($conf->global->MAIN_USE_FONT_AWESOME_5)) $fa='fas'; - $enabledisablehtml = ''; if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $enabledisablehtml.= $titlealt; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2f5e53ecbf5..70279dec91e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1561,14 +1561,13 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead $logouthtmltext.=$langs->trans("Logout").'
'; $logouttext .=''; - //$logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); - $logouttext .=''; + $logouttext .=img_picto($langs->trans('Logout'), 'sign-out', '', false, 0, 0, '', 'atoplogin'); $logouttext .=''; } else { $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 =''; //$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"'); - $text.=''; + $text.=''; $text.=''; $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; $text =''; //$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"'); - $text.=''; + $text.=''; $text.=''; $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); $text.='">'; //$text.=img_picto('', 'helpdoc_top').' '; - $text.=''; + $text.=''; //$toprightmenu.=$langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help'); //if ($mode == 'wiki') $text.=' ('.dol_trunc(strtr($helppage,'_',' '),8).')'; $text.='';