2
0
forked from Wavyzz/dolibarr

Remove constant MAIN_DISABLE_FONT_AWESOME_5

This commit is contained in:
Alexandre SPANGARO
2019-10-03 20:42:02 +02:00
parent 14381927c7
commit d0840b038f
3 changed files with 16 additions and 31 deletions

View File

@@ -3036,8 +3036,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda' 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda'
) )
)) { )) {
$fa='fa'; $fa='fas';
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) $fa='fas';
$fakey = $pictowithouttext; $fakey = $pictowithouttext;
$facolor = ''; $fasize = ''; $facolor = ''; $fasize = '';
@@ -3061,21 +3060,13 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext];
} }
elseif ($pictowithouttext == 'off') { elseif ($pictowithouttext == 'off') {
$fakey = 'fa-square-o';
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5))
{
$fakey = 'fa-square'; $fakey = 'fa-square';
$fa='far'; $fa='far';
}
$fasize = '1.3em'; $fasize = '1.3em';
} }
elseif ($pictowithouttext == 'on') { elseif ($pictowithouttext == 'on') {
$fakey = 'fa-check-square-o';
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5))
{
$fakey = 'fa-check-square'; $fakey = 'fa-check-square';
$fa='far'; $fa='far';
}
$fasize = '1.3em'; $fasize = '1.3em';
} }
elseif ($pictowithouttext == 'bank') { elseif ($pictowithouttext == 'bank') {
@@ -3088,12 +3079,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
} }
elseif ($pictowithouttext == 'edit') { elseif ($pictowithouttext == 'edit') {
$facolor = '#444'; $facolor = '#444';
$fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; $fakey = 'fa-pencil-alt';
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) $fakey = 'fa-pencil-alt';
} }
elseif ($pictowithouttext == 'grip_title' || $pictowithouttext == 'grip') { elseif ($pictowithouttext == 'grip_title' || $pictowithouttext == 'grip') {
$fakey = 'fa-arrows'; $fakey = 'fa-arrows-alt';
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) $fakey = 'fa-arrows-alt';
} }
elseif ($pictowithouttext == 'listlight') { elseif ($pictowithouttext == 'listlight') {
$fakey = 'fa-download'; $fakey = 'fa-download';
@@ -3110,11 +3099,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$facolor = '#444'; $facolor = '#444';
} }
elseif ($pictowithouttext == 'note') { elseif ($pictowithouttext == 'note') {
$fakey = 'fa-sticky-note-o'; $fakey = 'fa-sticky-note';
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) $fa = 'far';
{
$fakey = 'fa-sticky-note'; $fa = 'far';
}
$facolor = '#999'; $facolor = '#999';
$marginleftonlyshort=1; $marginleftonlyshort=1;
} }
@@ -3129,9 +3115,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$marginleftonlyshort = 1; $marginleftonlyshort = 1;
} }
elseif ($pictowithouttext == 'sign-out') { elseif ($pictowithouttext == 'sign-out') {
$fakey = 'fa-sign-out'; $fakey = 'fa-sign-out-alt';
$marginleftonlyshort=0; $marginleftonlyshort=0;
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) $fakey = 'fa-sign-out-alt';
} }
elseif ($pictowithouttext == 'unlink') { elseif ($pictowithouttext == 'unlink') {
$fakey = 'fa-chain-broken'; $fakey = 'fa-chain-broken';
@@ -3150,7 +3135,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
} }
elseif (in_array($pictowithouttext, array('skype', 'twitter', 'facebook', 'linkedin'))) { elseif (in_array($pictowithouttext, array('skype', 'twitter', 'facebook', 'linkedin'))) {
$fakey = 'fa-'.$pictowithouttext; $fakey = 'fa-'.$pictowithouttext;
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) $fa = 'fab'; $fa = 'fab';
} }
// Img for type of views // Img for type of views
elseif (in_array($pictowithouttext, array('object_list', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser'))) { elseif (in_array($pictowithouttext, array('object_list', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser'))) {

View File

@@ -1660,7 +1660,7 @@ a.tmenuimage:hover{
/* Do not load menu img for other if hidden to save bandwidth */ /* Do not load menu img for other if hidden to save bandwidth */
<?php if (empty($dol_hide_topmenu)) { ?> <?php if (empty($dol_hide_topmenu)) { ?>
<?php if (! defined('DISABLE_FONT_AWSOME') && empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) { ?> <?php if (! defined('DISABLE_FONT_AWSOME')) { ?>
<?php include dol_buildpath($path.'/theme/'.$theme.'/main_menu_fa_icons.inc.php', 0); ?> <?php include dol_buildpath($path.'/theme/'.$theme.'/main_menu_fa_icons.inc.php', 0); ?>
<?php } else { ?> <?php } else { ?>
div.mainmenu.home{ div.mainmenu.home{
@@ -1794,7 +1794,7 @@ a.tmenuimage:hover{
// Img file not found // Img file not found
if (! $found) if (! $found)
{ {
if (! defined('DISABLE_FONT_AWSOME') && empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) { if (! defined('DISABLE_FONT_AWSOME')) {
print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n"; print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
print 'div.mainmenu.'.$val.'::before { print 'div.mainmenu.'.$val.'::before {
content: "\f249"; content: "\f249";

View File

@@ -1786,7 +1786,7 @@ div.mainmenu {
/* Do not load menu img if hidden to save bandwidth */ /* Do not load menu img if hidden to save bandwidth */
<?php if (empty($dol_hide_topmenu)) { ?> <?php if (empty($dol_hide_topmenu)) { ?>
<?php if (! defined('DISABLE_FONT_AWSOME') && empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) { ?> <?php if (! defined('DISABLE_FONT_AWSOME')) { ?>
<?php include dol_buildpath($path.'/theme/'.$theme.'/main_menu_fa_icons.inc.php', 0); ?> <?php include dol_buildpath($path.'/theme/'.$theme.'/main_menu_fa_icons.inc.php', 0); ?>
<?php } ?> <?php } ?>
@@ -1926,7 +1926,7 @@ foreach($mainmenuusedarray as $val)
// Img file not found // Img file not found
if (! $found) if (! $found)
{ {
if (! defined('DISABLE_FONT_AWSOME') && empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) { if (! defined('DISABLE_FONT_AWSOME')) {
print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n"; print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
print 'div.mainmenu.'.$val.'::before { print 'div.mainmenu.'.$val.'::before {
content: "\f249"; content: "\f249";
@@ -5805,7 +5805,7 @@ border-top-right-radius: 6px;
<?php if (! defined('DISABLE_FONT_AWSOME') && empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) { ?> <?php if (! defined('DISABLE_FONT_AWSOME')) { ?>
<?php include dol_buildpath($path.'/theme/'.$theme.'/main_menu_fa_icons.inc.php', 0); ?> <?php include dol_buildpath($path.'/theme/'.$theme.'/main_menu_fa_icons.inc.php', 0); ?>
<?php } <?php }