Browse Source

NEW Top menu support picto of modules that are font awesome picto.

Laurent Destailleur 1 year ago
parent
commit
c507adeef7
49 changed files with 246 additions and 394 deletions
  1. 0 11
      htdocs/admin/compta.php
  2. 2 2
      htdocs/admin/mails.php
  3. 2 2
      htdocs/admin/mails_emailing.php
  4. 2 2
      htdocs/admin/mails_ticket.php
  5. 3 3
      htdocs/admin/modules.php
  6. 1 1
      htdocs/admin/paymentbybanktransfer.php
  7. 1 1
      htdocs/admin/prelevement.php
  8. 1 1
      htdocs/admin/syslog.php
  9. 1 1
      htdocs/api/admin/explorer_withredoc.php
  10. 1 1
      htdocs/api/index.php
  11. 2 2
      htdocs/compta/localtax/clients.php
  12. 0 2
      htdocs/compta/localtax/index.php
  13. 1 1
      htdocs/compta/localtax/quadri_detail.php
  14. 1 1
      htdocs/compta/stats/byratecountry.php
  15. 1 1
      htdocs/compta/tva/clients.php
  16. 1 1
      htdocs/compta/tva/index.php
  17. 1 1
      htdocs/compta/tva/quadri_detail.php
  18. 1 1
      htdocs/core/class/html.formwebsite.class.php
  19. 1 1
      htdocs/core/class/interfaces.class.php
  20. 1 1
      htdocs/core/class/menu.class.php
  21. 1 1
      htdocs/core/class/menubase.class.php
  22. 1 1
      htdocs/core/lib/admin.lib.php
  23. 1 1
      htdocs/core/lib/functions.lib.php
  24. 1 1
      htdocs/core/lib/functionsnumtoword.lib.php
  25. 16 11
      htdocs/core/menus/standard/auguria.lib.php
  26. 1 1
      htdocs/core/menus/standard/auguria_menu.php
  27. 40 26
      htdocs/core/menus/standard/eldy.lib.php
  28. 1 1
      htdocs/core/menus/standard/eldy_menu.php
  29. 16 11
      htdocs/core/menus/standard/empty.php
  30. 38 28
      htdocs/core/modules/DolibarrModules.class.php
  31. 1 1
      htdocs/core/modules/modAgenda.class.php
  32. 1 1
      htdocs/core/modules/modBookCal.class.php
  33. 1 1
      htdocs/core/modules/modECM.class.php
  34. 1 1
      htdocs/core/modules/modExternalSite.class.php
  35. 1 1
      htdocs/core/modules/modFTP.class.php
  36. 0 1
      htdocs/core/modules/modHRM.class.php
  37. 0 1
      htdocs/core/modules/modHoliday.class.php
  38. 1 1
      htdocs/core/modules/modKnowledgeManagement.class.php
  39. 1 1
      htdocs/core/modules/modTakePos.class.php
  40. 1 1
      htdocs/core/modules/modWebhook.class.php
  41. 1 1
      htdocs/core/modules/modWebsite.class.php
  42. 1 1
      htdocs/modulebuilder/template/core/modules/modMyModule.class.php
  43. 32 25
      htdocs/theme/eldy/global.inc.php
  44. 10 10
      htdocs/theme/eldy/info-box.inc.php
  45. 5 108
      htdocs/theme/eldy/main_menu_fa_icons.inc.php
  46. 10 10
      htdocs/theme/md/info-box.inc.php
  47. 6 85
      htdocs/theme/md/main_menu_fa_icons.inc.php
  48. 30 22
      htdocs/theme/md/style.css.php
  49. 3 3
      htdocs/website/index.php

+ 0 - 11
htdocs/admin/compta.php

@@ -146,17 +146,6 @@ print '<td>'.$langs->trans('OptionMode').'</td><td>'.$langs->trans('Description'
 print "</tr>\n";
 print '<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>';
 print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
-// Write info on way to count VAT
-//if (!empty($conf->global->MAIN_MODULE_COMPTABILITE))
-//{
-//	//	print "<br>\n";
-//	//	print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite'));
-//}
-//else
-//{
-//	//	print "<br>\n";
-//	//	print nl2br($langs->trans('OptionModeTrueInfoExpert'));
-//}
 print "</td></tr>\n";
 print '<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode == 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeVirtual').'</td>';
 print '<td colspan="2">'.nl2br($langs->trans('OptionModeVirtualDesc'))."</td></tr>\n";

+ 2 - 2
htdocs/admin/mails.php

@@ -383,7 +383,7 @@ if ($action == 'edit') {
 	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>';
 
 	// SuperAdministrator access only
-	if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) {
+	if (!isModEnabled('multicompany')  || ($user->admin && !$user->entity)) {
 		print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'));
 	} else {
 		$text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE')];
@@ -516,7 +516,7 @@ if ($action == 'edit') {
 		print '<tr class="oddeven smtp_oauth_service"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>';
 
 		// SuperAdministrator access only
-		if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) {
+		if (!isModEnabled('multicompany')  || ($user->admin && !$user->entity)) {
 			print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE);
 		} else {
 			$text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE')];

+ 2 - 2
htdocs/admin/mails_emailing.php

@@ -318,7 +318,7 @@ if ($action == 'edit') {
 	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>';
 
 	// SuperAdministrator access only
-	if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) {
+	if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
 		print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_EMAILING);
 	} else {
 		$text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')];
@@ -450,7 +450,7 @@ if ($action == 'edit') {
 		print '<tr class="oddeven smtp_oauth_service hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>';
 
 		// SuperAdministrator access only
-		if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) {
+		if (!isModEnabled('multicompany')  || ($user->admin && !$user->entity)) {
 			print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING);
 		} else {
 			$text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING')];

+ 2 - 2
htdocs/admin/mails_ticket.php

@@ -307,7 +307,7 @@ if ($action == 'edit') {
 	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>';
 
 	// SuperAdministrator access only
-	if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) {
+	if (!isModEnabled('multicompany')  || ($user->admin && !$user->entity)) {
 		print $form->selectarray('MAIN_MAIL_SENDMODE_TICKET', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_TICKET);
 	} else {
 		$text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET')];
@@ -437,7 +437,7 @@ if ($action == 'edit') {
 	if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) {
 		print '<tr class="oddeven smtp_oauth_service hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>';
 		// SuperAdministrator access only
-		if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) {
+		if (!isModEnabled('multicompany')  || ($user->admin && !$user->entity)) {
 			print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET);
 		} else {
 			$text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET')];

+ 3 - 3
htdocs/admin/modules.php

@@ -404,13 +404,13 @@ foreach ($modulesdir as $dir) {
 
 							// We discard modules according to features level (PS: if module is activated we always show it)
 							$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
-							if ($objMod->version == 'development' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2))) {
+							if ($objMod->version == 'development' && (!isModEnabled($const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2))) {
 								$modulequalified = 0;
 							}
-							if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1))) {
+							if ($objMod->version == 'experimental' && (!isModEnabled($const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1))) {
 								$modulequalified = 0;
 							}
-							if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) {
+							if (preg_match('/deprecated/', $objMod->version) && (!isModEnabled($const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) {
 								$modulequalified = 0;
 							}
 

+ 1 - 1
htdocs/admin/paymentbybanktransfer.php

@@ -379,7 +379,7 @@ print '<br>';
  */
 
 /* Disable this, there is no trigger with elementtype 'withdraw'
-if (!empty($conf->global->MAIN_MODULE_NOTIFICATION))
+if (isModEnabled('notification'))
 {
 	$langs->load("mails");
 	print load_fiche_titre($langs->trans("Notifications"));

+ 1 - 1
htdocs/admin/prelevement.php

@@ -395,7 +395,7 @@ print '<br>';
  */
 
 /* Disable this, there is no trigger with elementtype 'withdraw'
-if (!empty($conf->global->MAIN_MODULE_NOTIFICATION))
+if (isModEnabled('notification') )
 {
 	$langs->load("mails");
 	print load_fiche_titre($langs->trans("Notifications"));

+ 1 - 1
htdocs/admin/syslog.php

@@ -179,7 +179,7 @@ if (!$defaultsyslogfile) {
 	$defaultsyslogfile = 'dolibarr.log';
 }
 $optionmc = '';
-if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY) && $user->entity) {
+if (isModEnabled('multicompany') && $user->entity) {
 	print '<div class="error">'.$langs->trans("ContactSuperAdminForChange").'</div>';
 	$optionmc = 'disabled';
 }

+ 1 - 1
htdocs/api/admin/explorer_withredoc.php

@@ -27,7 +27,7 @@
 require_once '../../main.inc.php';
 
 // Enable and test if module Api is enabled
-if (empty($conf->global->MAIN_MODULE_API)) {
+if (!isModEnabled('api') ) {
 	$langs->load("admin");
 	dol_syslog("Call of Dolibarr API interfaces with module API REST are disabled");
 	print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>';

+ 1 - 1
htdocs/api/index.php

@@ -112,7 +112,7 @@ if (!empty($conf->global->MAIN_NGINX_FIX)) {
 }
 
 // Enable and test if module Api is enabled
-if (empty($conf->global->MAIN_MODULE_API)) {
+if (!isModEnabled('api') ) {
 	$langs->load("admin");
 	dol_syslog("Call of Dolibarr API interfaces with module API REST are disabled");
 	print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>';

+ 2 - 2
htdocs/compta/localtax/clients.php

@@ -147,7 +147,7 @@ if ($calc == 0 || $calc == 1) {	// Calculate on invoice for goods and services
 	$calcmode = $calc == 0 ? $langs->trans("CalcModeLT".$local) : $langs->trans("CalcModeLT".$local."Rec");
 	$calcmode .= ' <span class="opacitymedium">('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')</span>';
 	$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
-	if (!empty($conf->global->MAIN_MODULE_COMPTABILITE)) {
+	if (isModEnabled('comptabilite')) {
 		$description .= '<br>'.$langs->trans("WarningDepositsNotIncluded");
 	}
 	$description .= $fsearch;
@@ -165,7 +165,7 @@ if ($calc == 2) { 	// Invoice for goods, payment for services
 	$calcmode = $langs->trans("CalcModeLT2Debt");
 	$calcmode .= ' <span class="opacitymedium">('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')</span>';
 	$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
-	if (!empty($conf->global->MAIN_MODULE_COMPTABILITE)) {
+	if (isModEnabled('comptabilite')) {
 		$description .= '<br>'.$langs->trans("WarningDepositsNotIncluded");
 	}
 	$description .= $fsearch;

+ 0 - 2
htdocs/compta/localtax/index.php

@@ -246,8 +246,6 @@ $description .= $langs->trans($LT);
 $calcmode = $langs->trans("LTReportBuildWithOptionDefinedInModule").' ';
 $calcmode .= ' <span class="opacitymedium">('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')</span>';
 
-//if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='<br>'.$langs->trans("ThisIsAnEstimatedValue");
-
 $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
 
 $builddate = dol_now();

+ 1 - 1
htdocs/compta/localtax/quadri_detail.php

@@ -199,7 +199,7 @@ if (! empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
 	$description.='<br>'.$langs->trans("SupplierDepositsAreNotIncluded");
 }
 */
-if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) {
+if (isModEnabled('accounting')) {
 	$description .= $langs->trans("ThisIsAnEstimatedValue");
 }
 

+ 1 - 1
htdocs/compta/stats/byratecountry.php

@@ -207,7 +207,7 @@ if ($nextquarter < 4) {
 $description = $fsearch;
 $builddate = dol_now();
 
-if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) {
+if (isModEnabled('comptabilite')) {
 	$description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue");
 }
 if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') {

+ 1 - 1
htdocs/compta/tva/clients.php

@@ -158,7 +158,7 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
 if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
 	$description .= $langs->trans("SupplierDepositsAreNotIncluded");
 }
-if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) {
+if (isModEnabled('accounting')) {
 	$description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue");
 }
 

+ 1 - 1
htdocs/compta/tva/index.php

@@ -216,7 +216,7 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
 if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
 	$description .= $langs->trans("SupplierDepositsAreNotIncluded");
 }
-if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) {
+if (isModEnabled('accounting')) {
 	$description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue");
 }
 

+ 1 - 1
htdocs/compta/tva/quadri_detail.php

@@ -168,7 +168,7 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
 if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
 	$description .= $langs->trans("SupplierDepositsAreNotIncluded");
 }
-if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) {
+if (isModEnabled('accounting')) {
 	$description .= '<br>' . $langs->trans("ThisIsAnEstimatedValue");
 }
 

+ 1 - 1
htdocs/core/class/html.formwebsite.class.php

@@ -282,7 +282,7 @@ class FormWebsite
 				}
 				if ($website->fk_default_home && $key == $website->fk_default_home) {
 					//$valueforoption .= ' <span class="opacitymedium">('.$langs->trans("HomePage").')</span>';
-					$valueforoption .= ' <span class="opacitymedium fa fa-home"></span>';
+					$valueforoption .= ' <span class="opacitymedium fas fa-home"></span>';
 				}
 
 				$out .= '<option value="'.$key.'"';

+ 1 - 1
htdocs/core/class/interfaces.class.php

@@ -129,7 +129,7 @@ class Interfaces
 						if (strtolower($reg[2]) != 'all') {
 							$module = preg_replace('/^mod/i', '', $reg[2]);
 							$constparam = 'MAIN_MODULE_'.strtoupper($module);
-							if (empty($conf->global->$constparam)) {
+							if (!isModEnabled($constparam)) {
 								$qualified = false;
 							}
 						}

+ 1 - 1
htdocs/core/class/menu.class.php

@@ -71,7 +71,7 @@ class Menu
 	}
 
 	/**
-	 * Insert a menu entry into this->liste
+	 * Insert a menu entry into this->liste (after $idafter)
 	 *
 	 * @param   int     $idafter    Array key after which inserting new entry
 	 * @param	string	$url        Url to follow on click

+ 1 - 1
htdocs/core/class/menubase.class.php

@@ -730,7 +730,7 @@ class Menubase
 						}
 					}
 					$tabMenu[$b]['titre']       = $title;
-					$tabMenu[$b]['prefix'] = $menu['prefix'];
+					$tabMenu[$b]['prefix']      = $menu['prefix'];
 					$tabMenu[$b]['target']      = $menu['target'];
 					$tabMenu[$b]['mainmenu']    = $menu['mainmenu'];
 					$tabMenu[$b]['leftmenu']    = $menu['leftmenu'];

+ 1 - 1
htdocs/core/lib/admin.lib.php

@@ -716,7 +716,7 @@ function modules_prepare_head($nbofactivatedmodules, $nboftotalmodules, $nbmodul
 
 	$h = 0;
 	$head = array();
-	$mode = empty($conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT) ? 'commonkanban' : $conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT;
+	$mode = getDolGlobalString('MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT', 'commonkanban');
 	$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$mode;
 	if ($nbmodulesnotautoenabled <= getDolGlobalInt('MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) {	// If only minimal initial modules enabled)
 		//$head[$h][1] = $form->textwithpicto($langs->trans("AvailableModules"), $desc);

+ 1 - 1
htdocs/core/lib/functions.lib.php

@@ -4658,7 +4658,7 @@ function img_picto_common($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0
 	} else {
 		$path = DOL_URL_ROOT.'/theme/common/'.$picto;
 
-		if (!empty($conf->global->MAIN_MODULE_CAN_OVERWRITE_COMMONICONS)) {
+		if (getDolGlobalInt('MAIN_MODULE_CAN_OVERWRITE_COMMONICONS')) {
 			$themepath = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/'.$picto;
 
 			if (file_exists($themepath)) {

+ 1 - 1
htdocs/core/lib/functionsnumtoword.lib.php

@@ -46,7 +46,7 @@ function dol_convertToWord($num, $langs, $currency = '', $centimes = false)
 		$num = $num * 10;
 	}
 
-	if (!empty($conf->global->MAIN_MODULE_NUMBERWORDS)) {
+	if (isModEnabled('numberwords')) {
 		if ($currency) {
 			$type = '1';
 		} else {

+ 16 - 11
htdocs/core/menus/standard/auguria.lib.php

@@ -170,7 +170,7 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout
 	if (empty($noout)) {
 		foreach ($menu->liste as $menuval) {
 			print_start_menu_entry_auguria($menuval['idsel'], $menuval['classname'], $menuval['enabled']);
-			print_text_menu_entry_auguria($menuval['titre'], $menuval['enabled'], ($menuval['url'] != '#' ?DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target'] ? $menuval['target'] : $atarget));
+			print_text_menu_entry_auguria($menuval['titre'], $menuval['enabled'], ($menuval['url'] != '#' ?DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target'] ? $menuval['target'] : $atarget), $menuval);
 			print_end_menu_entry_auguria($menuval['enabled']);
 		}
 	}
@@ -219,16 +219,17 @@ function print_start_menu_entry_auguria($idsel, $classname, $showmode)
 /**
  * Output menu entry
  *
- * @param	string	$text		Text
- * @param	int		$showmode	0 = hide, 1 = allowed or 2 = not allowed
- * @param	string	$url		Url
- * @param	string	$id			Id
- * @param	string	$idsel		Id sel
- * @param	string	$classname	Class name
- * @param	string	$atarget	Target
+ * @param	string	$text			Text
+ * @param	int		$showmode		0 = hide, 1 = allowed or 2 = not allowed
+ * @param	string	$url			Url
+ * @param	string	$id				Id
+ * @param	string	$idsel			Id sel
+ * @param	string	$classname		Class name
+ * @param	string	$atarget		Target
+ * @param	array	$menuval		All the $menuval array
  * @return	void
  */
-function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $classname, $atarget)
+function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $classname, $atarget, $menuval = array())
 {
 	global $langs, $conf;
 
@@ -237,7 +238,9 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla
 
 	if ($showmode == 1) {
 		print '<a '.$classnameimg.' tabindex="-1" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">';
-		print '<div class="'.$id.' '.$idsel.' topmenuimage aaa"><span class="'.$id.' tmenuimageforpng" id="mainmenuspan_'.$idsel.'"></span></div>';
+		print '<div class="'.$id.' '.$idsel.' topmenuimage aaa">';
+		print '<span class="'.$id.' tmenuimageforpng" id="mainmenuspan_'.$idsel.'"></span>';
+		print '</div>';
 		print '</a>';
 		if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
 			print '<a '.$classnametxt.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">';
@@ -248,7 +251,9 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla
 		}
 	} elseif ($showmode == 2) {
 		print '<div '.$classnameimg.' title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">';
-		print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled"><span class="'.$id.' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.'"></span></div>';
+		print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled">';
+		print '<span class="'.$id.' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.'"></span>';
+		print '</div>';
 		print '</div>';
 		if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
 			print '<span '.$classnametxt.' id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">';

+ 1 - 1
htdocs/core/menus/standard/auguria_menu.php

@@ -194,7 +194,7 @@ class MenuManager
 					if ($val['level'] == 0 && !empty($val['prefix'])) {
 						print $val['prefix'];
 					} elseif ($val['level'] == 0 && $val['mainmenu'] == 'home') {
-						print '<span class="fa fa-home fa-fw paddingright pictofixedwidth" aria-hidden="true"></span>';
+						print '<span class="fas fa-home fa-fw paddingright pictofixedwidth" aria-hidden="true"></span>';
 					}
 
 					print $val['titre'];

+ 40 - 26
htdocs/core/menus/standard/eldy.lib.php

@@ -87,7 +87,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		'id' => $id,
 		'idsel' => 'home',
 		'classname' =>  $classname = (empty($_SESSION["mainmenu"]) || $_SESSION["mainmenu"] == "home") ? 'class="tmenusel"' : 'class="tmenu"',
-		'prefix' => '<span class="fa fa-home fa-fw paddingright"></span>',
+		'prefix' => '<span class="fas fa-home fa-fw"></span>',
 		'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "home") ? 0 : 1),
 		'loadLangs' => array(),
 		'submenus' => array(),
@@ -112,7 +112,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		'id' => $id,
 		'idsel' => 'members',
 		'classname' =>  $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 'class="tmenusel"' : 'class="tmenu"',
-		'prefix' => img_picto('', 'member', 'class="fa-fw paddingright pictofixedwidth"'),
+		'prefix' => img_picto('', 'member', 'class="fa-fw pictofixedwidth"'),
 		'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 0 : 1),
 		'loadLangs' => array("members"),
 		'submenus' => array(),
@@ -141,7 +141,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		'id' => $id,
 		'idsel' => 'companies',
 		'classname' =>  $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "companies") ? 'class="tmenusel"' : 'class="tmenu"',
-		'prefix' => img_picto('', 'company', 'class="fa-fw paddingright pictofixedwidth"'),
+		'prefix' => img_picto('', 'company', 'class="fa-fw pictofixedwidth"'),
 		'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "companies") ? 0 : 1),
 		'loadLangs' => array("companies", "suppliers"),
 		'submenus' => array(),
@@ -168,7 +168,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		'id' => $id,
 		'idsel' => 'products',
 		'classname' =>  $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 'class="tmenusel"' : 'class="tmenu"',
-		'prefix' => img_picto('', 'product', 'class="fa-fw paddingright pictofixedwidth"'),
+		'prefix' => img_picto('', 'product', 'class="fa-fw pictofixedwidth"'),
 		'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 0 : 1),
 		'loadLangs' => array("products", "stocks"),
 		'submenus' => array(),
@@ -193,7 +193,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		'id' => $id,
 		'idsel' => 'mrp',
 		'classname' =>  $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "mrp") ? 'class="tmenusel"' : 'class="tmenu"',
-		'prefix' => img_picto('', 'mrp', 'class="fa-fw paddingright pictofixedwidth"'),
+		'prefix' => img_picto('', 'mrp', 'class="fa-fw pictofixedwidth"'),
 		'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "mrp") ? 0 : 1),
 		'loadLangs' => array("mrp"),
 		'submenus' => array(),
@@ -231,7 +231,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		'id' => $id,
 		'idsel' => 'project',
 		'classname' =>  $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "project") ? 'class="tmenusel"' : 'class="tmenu"',
-		'prefix' => img_picto('', 'project', 'class="fa-fw paddingright pictofixedwidth"'),
+		'prefix' => img_picto('', 'project', 'class="fa-fw pictofixedwidth"'),
 		'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "project") ? 0 : 1),
 		'loadLangs' => array("projects"),
 		'submenus' => array(),
@@ -280,7 +280,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		'id' => $id,
 		'idsel' => 'commercial',
 		'classname' =>  $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "commercial") ? 'class="tmenusel"' : 'class="tmenu"',
-		'prefix' => img_picto('', 'contract', 'class="fa-fw paddingright pictofixedwidth"'),
+		'prefix' => img_picto('', 'contract', 'class="fa-fw pictofixedwidth"'),
 		'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "commercial") ? 0 : 1),
 		'loadLangs' => array("commercial"),
 		'submenus' => array(),
@@ -314,7 +314,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		'id' => $id,
 		'idsel' => 'billing',
 		'classname' =>  $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "billing") ? 'class="tmenusel"' : 'class="tmenu"',
-		'prefix' => img_picto('', 'bill', 'class="fa-fw paddingright pictofixedwidth"'),
+		'prefix' => img_picto('', 'bill', 'class="fa-fw pictofixedwidth"'),
 		'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "billing") ? 0 : 1),
 		'loadLangs' => array("compta"),
 		'submenus' => array(),
@@ -339,7 +339,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		'id' => $id,
 		'idsel' => 'bank',
 		'classname' =>  $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "bank") ? 'class="tmenusel"' : 'class="tmenu"',
-		'prefix' => img_picto('', 'bank_account', 'class="fa-fw paddingright pictofixedwidth"'),
+		'prefix' => img_picto('', 'bank_account', 'class="fa-fw pictofixedwidth"'),
 		'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "bank") ? 0 : 1),
 		'loadLangs' => array("compta", "banks"),
 		'submenus' => array(),
@@ -364,7 +364,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		'id' => $id,
 		'idsel' => 'accountancy',
 		'classname' =>  $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "accountancy") ? 'class="tmenusel"' : 'class="tmenu"',
-		'prefix' => img_picto('', 'accountancy', 'class="fa-fw paddingright pictofixedwidth"'),
+		'prefix' => img_picto('', 'accountancy', 'class="fa-fw pictofixedwidth"'),
 		'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "accountancy") ? 0 : 1),
 		'loadLangs' => array("compta", "accountancy", "assets", "intracommreport"),
 		'submenus' => array(),
@@ -390,7 +390,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		'id' => $id,
 		'idsel' => 'hrm',
 		'classname' =>  $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 'class="tmenusel"' : 'class="tmenu"',
-		'prefix' => img_picto('', 'hrm', 'class="fa-fw paddingright pictofixedwidth"'),
+		'prefix' => img_picto('', 'hrm', 'class="fa-fw pictofixedwidth"'),
 		'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 0 : 1),
 		'loadLangs' => array("hrm", "holiday"),
 		'submenus' => array(),
@@ -421,7 +421,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		'id' => $id,
 		'idsel' => 'ticket',
 		'classname' =>  $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 'class="tmenusel"' : 'class="tmenu"',
-		'prefix' => img_picto('', 'ticket', 'class="fa-fw paddingright pictofixedwidth"'),
+		'prefix' => img_picto('', 'ticket', 'class="fa-fw pictofixedwidth"'),
 		'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 0 : 1),
 		'loadLangs' => array("ticket", "knowledgemanagement"),
 		'submenus' => array(),
@@ -446,7 +446,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		'id' => $id,
 		'idsel' => 'tools',
 		'classname' =>  $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "tools") ? 'class="tmenusel"' : 'class="tmenu"',
-		'prefix' => img_picto('', 'tools', 'class="fa-fw paddingright pictofixedwidth"'),
+		'prefix' => img_picto('', 'tools', 'class="fa-fw pictofixedwidth"'),
 		'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "tools") ? 0 : 1),
 		'loadLangs' => array("other"),
 		'submenus' => array(),
@@ -575,10 +575,11 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
 		print_end_menu_entry(4);
 	}
 
+	//var_dump($menu->liste);
 	if (empty($noout)) {
 		foreach ($menu->liste as $menuval) {
 			print_start_menu_entry($menuval['idsel'], $menuval['classname'], $menuval['enabled']);
-			print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url'] != '#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target'] ? $menuval['target'] : $atarget));
+			print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url'] != '#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target'] ? $menuval['target'] : $atarget), $menuval);
 			print_end_menu_entry($menuval['enabled']);
 		}
 	}
@@ -627,16 +628,17 @@ function print_start_menu_entry($idsel, $classname, $showmode)
 /**
  * Output menu entry
  *
- * @param	string	$text		Text
- * @param	int		$showmode	0 = hide, 1 = allowed or 2 = not allowed
- * @param	string	$url		Url
- * @param	string	$id			Id
- * @param	string	$idsel		Id sel
- * @param	string	$classname	Class name
- * @param	string	$atarget	Target
+ * @param	string	$text			Text
+ * @param	int		$showmode		0 = hide, 1 = allowed or 2 = not allowed
+ * @param	string	$url			Url
+ * @param	string	$id				Id
+ * @param	string	$idsel			Id sel
+ * @param	string	$classname		Class name
+ * @param	string	$atarget		Target
+ * @param	array	$menuval		All the $menuval array
  * @return	void
  */
-function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, $atarget)
+function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, $atarget, $menuval = array())
 {
 	global $conf, $langs;
 
@@ -646,7 +648,13 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname,
 	//$conf->global->THEME_TOPMENU_DISABLE_TEXT=1;
 	if ($showmode == 1) {
 		print '<a '.$classnameimg.' tabindex="-1" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">';
-		print '<div class="'.$id.' '.$idsel.' topmenuimage"><span class="'.$id.' tmenuimageforpng" id="mainmenuspan_'.$idsel.'"></span></div>';
+		print '<div class="'.$id.' '.$idsel.' topmenuimage">';
+		if (!empty($menuval['prefix']) && strpos($menuval['prefix'], '<span') === 0) {
+			print $menuval['prefix'];
+		} else {
+			print '<span class="'.$id.' tmenuimageforpng" id="mainmenuspan_'.$idsel.'"></span>';
+		}
+		print '</div>';
 		print '</a>';
 		if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
 			print '<a '.$classnametxt.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">';
@@ -657,7 +665,13 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname,
 		}
 	} elseif ($showmode == 2) {
 		print '<div '.$classnameimg.' title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">';
-		print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled"><span class="'.$id.' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.'"></span></div>';
+		print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled">';
+		if (!empty($menuval['prefix']) && strpos($menuval['prefix'], '<span') === 0) {
+			print $menuval['prefix'];
+		} else {
+			print '<span class="'.$id.' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.'"></span>';
+		}
+		print '</div>';
 		print '</div>';
 		if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
 			print '<span '.$classnametxt.' id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">';
@@ -987,8 +1001,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
 						print '<span class="vmenu">';
 					}
 					if (!empty($menu_array[$i]['prefix'])) {
-						if (preg_match('/^fa-[a-zA-Z0-9-_]+$/', $menu_array[$i]['prefix'])) {
-							print '<span class="fa '.$menu_array[$i]['prefix'].' paddingright pictofixedwidth"></span>';
+						if (preg_match('/^fa\-[a-zA-Z0-9\-_]+$/', $menu_array[$i]['prefix'])) {
+							print '<span class="fas '.$menu_array[$i]['prefix'].' paddingright pictofixedwidth"></span>';
 						} else {
 							print $menu_array[$i]['prefix'];
 						}

+ 1 - 1
htdocs/core/menus/standard/eldy_menu.php

@@ -224,7 +224,7 @@ class MenuManager
 						print '<a href="'.$relurl.'">';
 
 						if ($val['level'] == 0) {
-							print '<span class="fa fa-home fa-fw paddingright pictofixedwidth" aria-hidden="true"></span>';
+							print '<span class="fas fa-home fa-fw paddingright pictofixedwidth" aria-hidden="true"></span>';
 						}
 
 						if ($langs->trans(ucfirst($val['mainmenu'])."Dashboard") == ucfirst($val['mainmenu'])."Dashboard") {  // No translation

+ 16 - 11
htdocs/core/menus/standard/empty.php

@@ -178,7 +178,7 @@ class MenuManager
 
 					// Add font-awesome
 					if ($val['level'] == 0 && $val['mainmenu'] == 'home') {
-						print '<span class="fa fa-home fa-fw paddingright" aria-hidden="true"></span>';
+						print '<span class="fas fa-home fa-fw paddingright" aria-hidden="true"></span>';
 					}
 
 					print $val['titre'];
@@ -504,16 +504,17 @@ function print_start_menu_entry_empty($idsel, $classname, $showmode)
 /**
  * Output menu entry
  *
- * @param	string	$text		Text
- * @param	int		$showmode	1 or 2
- * @param	string	$url		Url
- * @param	string	$id			Id
- * @param	string	$idsel		Id sel
- * @param	string	$classname	Class name
- * @param	string	$atarget	Target
+ * @param	string	$text			Text
+ * @param	int		$showmode		1 or 2
+ * @param	string	$url			Url
+ * @param	string	$id				Id
+ * @param	string	$idsel			Id sel
+ * @param	string	$classname		Class name
+ * @param	string	$atarget		Target
+ * @param	array	$menuval		All the $menuval array
  * @return	void
  */
-function print_text_menu_entry_empty($text, $showmode, $url, $id, $idsel, $classname, $atarget)
+function print_text_menu_entry_empty($text, $showmode, $url, $id, $idsel, $classname, $atarget, $menuval = array())
 {
 	global $conf, $langs;
 
@@ -522,7 +523,9 @@ function print_text_menu_entry_empty($text, $showmode, $url, $id, $idsel, $class
 
 	if ($showmode == 1) {
 		print '<a '.$classnameimg.' tabindex="-1" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">';
-		print '<div class="'.$id.' '.$idsel.' topmenuimage"><span class="'.$id.' tmenuimageforpng" id="mainmenuspan_'.$idsel.'"></span></div>';
+		print '<div class="'.$id.' '.$idsel.' topmenuimage">';
+		print '<span class="'.$id.' tmenuimageforpng" id="mainmenuspan_'.$idsel.'"></span>';
+		print '</div>';
 		print '</a>';
 		if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
 			print '<a '.$classnametxt.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').'>';
@@ -534,7 +537,9 @@ function print_text_menu_entry_empty($text, $showmode, $url, $id, $idsel, $class
 	}
 	if ($showmode == 2) {
 		print '<div '.$classnameimg.' title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">';
-		print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled"><span class="'.$id.' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.'"></span></div>';
+		print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled">';
+		print '<span class="'.$id.' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.'"></span>';
+		print '</div>';
 		print '</div>';
 		if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
 			print '<span '.$classnametxt.' id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">';

+ 38 - 28
htdocs/core/modules/DolibarrModules.class.php

@@ -2273,7 +2273,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
 
 		$error = 0;
 
-		if (is_array($this->module_parts) && !empty($this->module_parts)) {
+		if (is_array($this->module_parts)) {
+			if (empty($this->module_parts['icon']) && !empty($this->picto) && preg_match('/^fa\-/', $this->picto)) {
+				$this->module_parts['icon'] = $this->picto;
+			}
+
 			foreach ($this->module_parts as $key => $value) {
 				if (is_array($value) && count($value) == 0) {
 					continue; // Discard empty arrays
@@ -2301,32 +2305,34 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
 					}
 				}
 
-				$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
-				$sql .= "name";
-				$sql .= ", type";
-				$sql .= ", value";
-				$sql .= ", note";
-				$sql .= ", visible";
-				$sql .= ", entity";
-				$sql .= ")";
-				$sql .= " VALUES (";
-				$sql .= " ".$this->db->encrypt($this->const_name."_".strtoupper($key));
-				$sql .= ", 'chaine'";
-				$sql .= ", ".$this->db->encrypt($newvalue);
-				$sql .= ", null";
-				$sql .= ", '0'";
-				$sql .= ", ".((int) $entity);
-				$sql .= ")";
-
-				dol_syslog(get_class($this)."::insert_module_parts for key=".$this->const_name."_".strtoupper($key), LOG_DEBUG);
-
-				$resql = $this->db->query($sql, 1);
-				if (!$resql) {
-					if ($this->db->lasterrno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') {
-						 $error++;
-						 $this->error = $this->db->lasterror();
-					} else {
-						 dol_syslog(get_class($this)."::insert_module_parts for ".$this->const_name."_".strtoupper($key)." Record already exists.", LOG_WARNING);
+				if (!empty($newvalue)) {
+					$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
+					$sql .= "name";
+					$sql .= ", type";
+					$sql .= ", value";
+					$sql .= ", note";
+					$sql .= ", visible";
+					$sql .= ", entity";
+					$sql .= ")";
+					$sql .= " VALUES (";
+					$sql .= " ".$this->db->encrypt($this->const_name."_".strtoupper($key), 1);
+					$sql .= ", 'chaine'";
+					$sql .= ", ".$this->db->encrypt($newvalue, 1);
+					$sql .= ", null";
+					$sql .= ", '0'";
+					$sql .= ", ".((int) $entity);
+					$sql .= ")";
+
+					dol_syslog(get_class($this)."::insert_module_parts for key=".$this->const_name."_".strtoupper($key), LOG_DEBUG);
+
+					$resql = $this->db->query($sql, 1);
+					if (!$resql) {
+						if ($this->db->lasterrno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') {
+							 $error++;
+							 $this->error = $this->db->lasterror();
+						} else {
+							 dol_syslog(get_class($this)."::insert_module_parts for ".$this->const_name."_".strtoupper($key)." Record already exists.", LOG_WARNING);
+						}
 					}
 				}
 			}
@@ -2347,9 +2353,13 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
 
 		$err = 0;
 
-		if (is_array($this->module_parts) && !empty($this->module_parts)) {
+		if (is_array($this->module_parts)) {
 			dol_syslog(get_class($this)."::delete_module_parts", LOG_DEBUG);
 
+			if (empty($this->module_parts['icon']) && !empty($this->picto) && preg_match('/^fa\-/', $this->picto)) {
+				$this->module_parts['icon'] = $this->picto;
+			}
+
 			foreach ($this->module_parts as $key => $value) {
 				// If entity is defined
 				if (is_array($value) && isset($value['entity'])) {

+ 1 - 1
htdocs/core/modules/modAgenda.class.php

@@ -209,7 +209,7 @@ class modAgenda extends DolibarrModules
 			'fk_menu'=>0,
 			'type'=>'top',
 			'titre'=>'TMenuAgenda',
-			'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'),
+			'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth"'),
 			'mainmenu'=>'agenda',
 			'url'=>'/comm/action/index.php',
 			'langs'=>'agenda',

+ 1 - 1
htdocs/core/modules/modBookCal.class.php

@@ -301,7 +301,7 @@ class modBookCal extends DolibarrModules
 			'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
 			'type'=>'top', // This is a Top menu entry
 			'titre'=>'ModuleBookCalName',
-			'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'),
+			'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth valignmiddle"'),
 			'mainmenu'=>'bookcal',
 			'leftmenu'=>'',
 			'url'=>'/bookcal/bookcalindex.php',

+ 1 - 1
htdocs/core/modules/modECM.class.php

@@ -123,7 +123,7 @@ class modECM extends DolibarrModules
 			'fk_menu'=>0,
 			'type'=>'top',
 			'titre'=>'MenuECM',
-			'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'),
+			'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth"'),
 			'mainmenu'=>'ecm',
 			'url'=>'/ecm/index.php',
 			'langs'=>'ecm',

+ 1 - 1
htdocs/core/modules/modExternalSite.class.php

@@ -103,7 +103,7 @@ class modExternalSite extends DolibarrModules
 			'fk_menu'=>0,
 			'type'=>'top',
 			'titre'=>'__[EXTERNALSITE_LABEL]__',
-			'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'),
+			'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth em092"'),
 			'mainmenu'=>'externalsite',
 			'url'=>'/externalsite/frames.php',
 			'langs'=>'other',

+ 1 - 1
htdocs/core/modules/modFTP.class.php

@@ -114,7 +114,7 @@ class modFTP extends DolibarrModules
 		$this->menu[$r] = array('fk_menu'=>0,
 							  'type'=>'top',
 							  'titre'=>'FTP',
-							  'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'),
+							  'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth em092"'),
 							  'mainmenu'=>'ftp',
 							  'url'=>'/ftp/index.php',
 							  'langs'=>'ftp',

+ 0 - 1
htdocs/core/modules/modHRM.class.php

@@ -114,7 +114,6 @@ class modHRM extends DolibarrModules
 		// Constants
 		// Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0),
 		//                             1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) );
-		//                             2=>array('MAIN_MODULE_MYMODULE_NEEDSMARTY','chaine',1,'Constant to say module need smarty',0)
 		$this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities')
 		$r = 0;
 

+ 0 - 1
htdocs/core/modules/modHoliday.class.php

@@ -91,7 +91,6 @@ class modHoliday extends DolibarrModules
 		// Constants
 		// Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0),
 		//                             1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) );
-		//                             2=>array('MAIN_MODULE_MYMODULE_NEEDSMARTY','chaine',1,'Constant to say module need smarty',0)
 		$this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities')
 		$r = 0;
 

+ 1 - 1
htdocs/core/modules/modKnowledgeManagement.class.php

@@ -266,7 +266,7 @@ class modKnowledgeManagement extends DolibarrModules
 			'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
 			'type'=>'top', // This is a Top menu entry
 			'titre'=>'ModuleKnowledgeManagementName',
-			'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'),
+			'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth em092"'),
 			'mainmenu'=>'knowledgemanagement',
 			'leftmenu'=>'',
 			'url'=>'/knowledgemanagement/knowledgerecord_list.php',

+ 1 - 1
htdocs/core/modules/modTakePos.class.php

@@ -217,7 +217,7 @@ class modTakePos extends DolibarrModules
 								'titre'=>'PointOfSaleShort',
 								'mainmenu'=>'takepos',
 								'leftmenu'=>'',
-								'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'),
+								'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth"'),
 								'url'=>'/takepos/index.php',
 								'langs'=>'cashdesk', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
 								'position'=>1000 + $r,

+ 1 - 1
htdocs/core/modules/modWebhook.class.php

@@ -285,7 +285,7 @@ class modWebhook extends DolibarrModules
 			'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
 			'type'=>'top', // This is a Top menu entry
 			'titre'=>'ModuleWebhookName',
-			'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'),
+			'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth valignmiddle"'),
 			'mainmenu'=>'webhook',
 			'leftmenu'=>'',
 			'url'=>'/webhook/webhookindex.php',

+ 1 - 1
htdocs/core/modules/modWebsite.class.php

@@ -120,7 +120,7 @@ class modWebsite extends DolibarrModules
 		$this->menu[$r] = array('fk_menu'=>'0', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
 								'type'=>'top', // This is a Left menu entry
 								'titre'=>'WebSites',
-								'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'),
+								'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth em092"'),
 								'mainmenu'=>'website',
 								'url'=>'/website/index.php',
 								'langs'=>'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.

+ 1 - 1
htdocs/modulebuilder/template/core/modules/modMyModule.class.php

@@ -304,7 +304,7 @@ class modMyModule extends DolibarrModules
 			'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
 			'type'=>'top', // This is a Top menu entry
 			'titre'=>'ModuleMyModuleName',
-			'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'),
+			'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth valignmiddle"'),
 			'mainmenu'=>'mymodule',
 			'leftmenu'=>'',
 			'url'=>'/mymodule/mymoduleindex.php',

+ 32 - 25
htdocs/theme/eldy/global.inc.php

@@ -2834,6 +2834,7 @@ li.tmenu:hover .tmenuimage:not(.menuhider), li.tmenu:hover .tmenuimage:not(.menu
 	$divalreadydefined = array('home', 'companies', 'products', 'mrp', 'commercial', 'externalsite', 'accountancy', 'project', 'tools', 'members', 'agenda', 'ftp', 'holiday', 'hrm', 'bookmark', 'cashdesk', 'takepos', 'ecm', 'geoipmaxmind', 'gravatar', 'clicktodial', 'paypal', 'stripe', 'webservices', 'website');
 	// Put here list of menu entries we are sure we don't want
 	$divnotrequired = array('multicurrency', 'salaries', 'ticket', 'margin', 'opensurvey', 'paybox', 'expensereport', 'incoterm', 'prelevement', 'propal', 'workflow', 'notification', 'supplier_proposal', 'cron', 'product', 'productbatch', 'expedition');
+
 	foreach ($mainmenuusedarray as $val) {
 		if (empty($val) || in_array($val, $divalreadydefined)) {
 			continue;
@@ -2841,40 +2842,46 @@ li.tmenu:hover .tmenuimage:not(.menuhider), li.tmenu:hover .tmenuimage:not(.menu
 		if (in_array($val, $divnotrequired)) {
 			continue;
 		}
-		//print "XXX".$val;
 
-		// Search img file in module dir
 		$found = 0; $url = '';
-		foreach ($conf->file->dol_document_root as $dirroot) {
-			if (file_exists($dirroot."/".$val."/img/".$val.".png")) {
-				$url = dol_buildpath('/'.$val.'/img/'.$val.'.png', 1);
-				$found = 1;
-				break;
+		$constformoduleicon = 'MAIN_MODULE_'.strtoupper($val).'_ICON';
+		$iconformodule = getDolGlobalString($constformoduleicon);
+		if ($iconformodule) {
+			if (preg_match('/^fa\-/', $iconformodule)) {
+				// This is a fa icon
+			} else {
+				$url = dol_buildpath('/'.$val.'/img/'.$iconformodule.'.png', 1);
+			}
+			$found = 1;
+		} else {
+			// Search img file in module dir
+			foreach ($conf->file->dol_document_root as $dirroot) {
+				if (file_exists($dirroot."/".$val."/img/".$val.".png")) {
+					$url = dol_buildpath('/'.$val.'/img/'.$val.'.png', 1);
+					$found = 1;
+					break;
+				}
 			}
 		}
-		// Img file not found
+		//print "XXX".$val."->".$found."\n";
+
+		// Output entry for menu icon in CSS
 		if (!$found) {
-			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 "/* Overwrite this definition in your own css with a different content to use your own font awesome icon. */\n";
-				print 'div.mainmenu.'.$val.'::before {
-                    content: "\f249";
-                }'."\n";
-			} else {
-				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";
-				$url = dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic, 4))."_over.png", 1);
+			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.' span::before {'."\n";
+			print 'content: "\f249";'."\n";
+			print '}'."\n";
+			$generic++;
+		} else {
+			if ($url) {
 				print "div.mainmenu.".$val." {\n";
 				print "	background-image: url(".$url.");\n";
 				print " background-position-y: 3px;\n";
+				print " filter: saturate(0);\n";
 				print "}\n";
+			} else {
+				print '/* icon for module '.$val.' is a fa icon */'."\n";
 			}
-			$generic++;
-		} else {
-			print "div.mainmenu.".$val." {\n";
-			print "	background-image: url(".$url.");\n";
-			print " background-position-y: 3px;\n";
-			print " filter: saturate(0);\n";
-			print "}\n";
 		}
 	}
 	// End of part to add more div class css
@@ -2883,7 +2890,7 @@ li.tmenu:hover .tmenuimage:not(.menuhider), li.tmenu:hover .tmenuimage:not(.menu
 
 .tmenuimage {
 	padding:0 0 0 0 !important;
-	margin:0 0px 0 0 !important;
+	margin:0 0 0 0 !important;
 	<?php if ($disableimages) { ?>
 		display: none;
 	<?php } ?>

+ 10 - 10
htdocs/theme/eldy/info-box.inc.php

@@ -387,40 +387,40 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
 }
 
 .infobox-adherent, .infobox-member {
-	color: #79633f !important;
+	color: #79633f;
 }
 .infobox-project{
-	color: #6c6aa8 !important;
+	color: #6c6aa8;
 }
 .infobox-action{
-	color: #b06080 !important;
+	color: #b06080;
 }
 /* Color for customer object */
 .infobox-propal:not(.error),
 .infobox-facture:not(.error),
 .infobox-commande:not(.error) {
-	color: #65953d !important;
+	color: #65953d;
 }
 /* Color for vendor object */
 .infobox-supplier_proposal:not(.error),
 .infobox-invoice_supplier:not(.error),
 .infobox-order_supplier:not(.error) {
-	color: #599caf !important;
+	color: #599caf;
 }
 .infobox-contrat, .infobox-ticket{
-	color: #3bbfa8 !important;
+	color: #3bbfa8;
 }
 .infobox-bank_account{
-	color: #b0bb39 !important;
+	color: #b0bb39;
 }
 .infobox-adherent, .infobox-member {
-	color: #79633f !important;
+	color: #79633f;
 }
 .infobox-expensereport{
-	color: #79633f !important;
+	color: #79633f;
 }
 .infobox-holiday{
-	color: #755114 !important;
+	color: #755114;
 }
 
 

+ 5 - 108
htdocs/theme/eldy/main_menu_fa_icons.inc.php

@@ -22,113 +22,6 @@ div.mainmenu.menu {
 	background-image: none;
 }
 
-div.mainmenu.menu::before {
-	content: "\f0c9";
-}
-
-
-div.mainmenu.home::before{
-	content: "\f015";
-}
-
-div.mainmenu.billing::before {
-	content: "\f51e";
-}
-
-div.mainmenu.accountancy::before {
-	/* content: "\f53d"; */
-	content: "\f688";
-	font-size: 1.2em;
-}
-
-div.mainmenu.agenda::before {
-	content: "\f073";
-}
-
-div.mainmenu.bank::before {
-	content: "\f19c";
-}
-
-<?php if (getDolGlobalInt('MAIN_FEATURES_LEVEL') == 2) { ?>
-/* TESTING USAGE OF SVG WITHOUT FONT */
-div.mainmenu.cashdesk {
-	line-height: 26px;
-}
-
-div.mainmenu.cashdesk .tmenuimage {
-	line-height: 26px;
-	display: inline-block;
-	vertical-align: middle;
-	height: <?php echo $topMenuFontSize; ?>;
-	background-color: #<?php echo $colortextbackhmenu; ?>;
-	width: 100%;
-	-webkit-mask: url(<?php echo DOL_URL_ROOT.'/theme/common/fontawesome-5/svgs/solid/cash-register.svg' ?>) no-repeat 50% 50%; /* for old webkit browser */
-	mask: url(<?php echo DOL_URL_ROOT.'/theme/common/fontawesome-5/svgs/solid/cash-register.svg' ?>) no-repeat 50% 50%;
-}
-
-<?php } else { ?>
-div.mainmenu.cashdesk::before {
-	content: "\f788";
-}
-
-<?php } ?>
-
-
-div.mainmenu.takepos::before {
-	content: "\f788";
-}
-
-div.mainmenu.companies::before {
-	content: "\f1ad";
-}
-
-div.mainmenu.commercial::before {
-	content: "\f0f2";
-}
-
-div.mainmenu.ecm::before {
-	content: "\f07c";
-}
-
-div.mainmenu.externalsite::before {
-	content: "\f360";
-}
-
-div.mainmenu.ftp::before {
-	content: "\f362";
-}
-
-div.mainmenu.hrm::before {
-	content: "\f508";
-}
-
-div.mainmenu.members::before {
-	content: "\f007";
-}
-
-div.mainmenu.products::before {
-	content: "\f1b2";
-}
-
-div.mainmenu.mrp::before {
-	content: "\f1b3";
-}
-
-div.mainmenu.project::before {
-	content: "\f542";
-}
-
-div.mainmenu.ticket::before {
-	content: "\f3ff";
-}
-
-div.mainmenu.tools::before {
-	content: "\f0ad";
-}
-
-div.mainmenu.website::before {
-	content: "\f57d";
-}
 
 div.mainmenu.generic1::before {
 	content: "\f249";
@@ -198,7 +91,11 @@ div.mainmenu.generic4::before {
 	border-bottom: solid 60px currentColor;
 	margin-left: 30px;
 }
-
+.tmenu span.fas, .tmenu span.far {
+	color: unset !important;
+	line-height: 28px;
+	text-align: center;
+}
 
 .em092 {
 	font-size: 0.92em;

+ 10 - 10
htdocs/theme/md/info-box.inc.php

@@ -93,41 +93,41 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
 
 
 .infobox-adherent, .infobox-member {
-	color: #79633f !important;
+	color: #79633f;
 }
 .infobox-project{
-	color: #6c6aa8 !important;
+	color: #6c6aa8;
 }
 .infobox-action{
-	color: #a47080 !important;
+	color: #a47080;
 }
 /* Color for customer object */
 .infobox-propal:not(.pictotitle):not(.error),
 .infobox-facture:not(.pictotitle):not(.error),
 .infobox-commande:not(.pictotitle):not(.error) {
-	color: #65953d !important;
+	color: #65953d;
 }
 /* Color for vendor object */
 .infobox-supplier_proposal:not(.pictotitle):not(.error),
 .infobox-invoice_supplier:not(.pictotitle):not(.error),
 .infobox-order_supplier:not(.pictotitle):not(.error) {
-	color: #599caf !important;
+	color: #599caf;
 }
 
 .infobox-contrat, .infobox-ticket{
-	color: #46a676 !important;
+	color: #46a676;
 }
 .infobox-bank_account{
-	color: #b0a53e !important;
+	color: #b0a53e;
 }
 .infobox-adherent, .infobox-member {
-	color: #79633f !important;
+	color: #79633f;
 }
 .infobox-expensereport{
-	color: #79633f !important;
+	color: #79633f;
 }
 .infobox-holiday{
-	color: #755114 !important;
+	color: #755114;
 }
 
 

+ 6 - 85
htdocs/theme/md/main_menu_fa_icons.inc.php

@@ -26,91 +26,6 @@ div.mainmenu.menu::before {
 	content: "\f0c9";
 }
 
-
-div.mainmenu.home::before{
-	content: "\f015";
-}
-
-div.mainmenu.billing::before {
-	content: "\f51e";
-}
-
-div.mainmenu.accountancy::before {
-	/* content: "\f53d"; */
-	content: "\f688";
-	font-size: 1.2em;
-}
-
-div.mainmenu.agenda::before {
-	content: "\f073";
-}
-
-div.mainmenu.bank::before {
-	content: "\f19c";
-}
-
-div.mainmenu.cashdesk::before {
-	content: "\f788";
-}
-
-
-div.mainmenu.takepos::before {
-	content: "\f788";
-}
-
-div.mainmenu.companies::before {
-	content: "\f1ad";
-}
-
-div.mainmenu.commercial::before {
-	content: "\f0f2";
-}
-
-div.mainmenu.ecm::before {
-	content: "\f07c";
-}
-
-div.mainmenu.externalsite::before {
-	content: "\f360";
-}
-
-div.mainmenu.ftp::before {
-	content: "\f362";
-}
-
-div.mainmenu.hrm::before {
-	content: "\f508";
-}
-
-div.mainmenu.members::before {
-	content: "\f007";
-}
-
-div.mainmenu.products::before {
-	content: "\f1b2";
-}
-
-div.mainmenu.mrp::before {
-	content: "\f1b3";
-}
-
-div.mainmenu.project::before {
-	content: "\f542";
-}
-
-div.mainmenu.ticket::before {
-	content: "\f3ff";
-}
-
-div.mainmenu.tools::before {
-	content: "\f0ad";
-}
-
-div.mainmenu.website::before {
-	content: "\f57d";
-}
-
-
 div.mainmenu.generic1::before {
 	content: "\f249";
 }
@@ -180,6 +95,12 @@ div.mainmenu.generic4::before {
 	margin-left: 30px;
 }
 
+.tmenu span.fas, .tmenu span.far {
+	color: unset !important;
+	line-height: 28px;
+	text-align: center;
+}
+
 .menu_titre .em092 {
 	font-size: 0.92em;
 }

+ 30 - 22
htdocs/theme/md/style.css.php

@@ -2981,36 +2981,44 @@ div.mainmenu.menu {
 		}
 		//print "XXX".$val;
 
-		// Search img file in module dir
 		$found = 0; $url = '';
-		foreach ($conf->file->dol_document_root as $dirroot) {
-			if (file_exists($dirroot."/".$val."/img/".$val.".png")) {
-				$url = dol_buildpath('/'.$val.'/img/'.$val.'.png', 1);
-				$found = 1;
-				break;
+		$constformoduleicon = 'MAIN_MODULE_'.strtoupper($val).'_ICON';
+		$iconformodule = getDolGlobalString($constformoduleicon);
+		if ($iconformodule) {
+			if (preg_match('/^fa\-/', $iconformodule)) {
+				// This is a fa icon
+			} else {
+				$url = 	dol_buildpath('/'.$val.'/img/'.$iconformodule.'.png', 1);
+			}
+			$found = 1;
+		} else {
+			// Search img file in module dir
+			foreach ($conf->file->dol_document_root as $dirroot) {
+				if (file_exists($dirroot."/".$val."/img/".$val.".png")) {
+					$url = dol_buildpath('/'.$val.'/img/'.$val.'.png', 1);
+					$found = 1;
+					break;
+				}
 			}
 		}
-		// Img file not found
+
+		// Output entry for menu icon in CSS
 		if (!$found) {
-			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 "/* Overwrite this definition in your own css with a different content to use your own font awesome icon. */\n";
-				print 'div.mainmenu.'.$val.'::before {
-	                    content: "\f249";
-	                }'."\n";
-			} else {
-				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";
-				$url = dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic, 4))."_over.png", 1);
+			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.' span::before {'."\n";
+			print 'content: "\f249";'."\n";
+			print '}'."\n";
+			$generic++;
+		} else {
+			if ($url) {
 				print "div.mainmenu.".$val." {\n";
 				print "	background-image: url(".$url.");\n";
+				print " background-position-y: 3px;\n";
+				print " filter: saturate(0);\n";
 				print "}\n";
+			} else {
+				print '/* icon for module '.$val.' is a fa icon */'."\n";
 			}
-			$generic++;
-		} else {
-			print "div.mainmenu.".$val." {\n";
-			print "	background-image: url(".$url.");\n";
-			print " filter: saturate(0);\n";
-			print "}\n";
 		}
 	}
 	// End of part to add more div class css

+ 3 - 3
htdocs/website/index.php

@@ -3403,13 +3403,13 @@ if (!GETPOST('hide_websitemenu')) {
 				print '<span class="websiteselection">';
 				if ($object->fk_default_home > 0 && $pageid == $object->fk_default_home) {
 					//$disabled=' disabled="disabled"';
-					//print '<span class="button bordertransp disabled"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fa fa-home"></span></span>';
+					//print '<span class="button bordertransp disabled"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fas fa-home"></span></span>';
 					//print '<input type="submit" class="button bordertransp" disabled="disabled" value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">';
-					print '<a href="#" class="button bordertransp disabled" disabled="disabled" title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fa fa-home valignmiddle btnTitle-icon"></span></a>';
+					print '<a href="#" class="button bordertransp disabled" disabled="disabled" title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fas fa-home valignmiddle btnTitle-icon"></span></a>';
 				} else {
 					//$disabled='';
 					//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">';
-					print '<a href="'.$_SERVER["PHP_SELF"].'?action=setashome&token='.newToken().'&website='.urlencode($website->ref).'&pageid='.((int) $pageid).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fa fa-home valignmiddle btnTitle-icon"></span></a>';
+					print '<a href="'.$_SERVER["PHP_SELF"].'?action=setashome&token='.newToken().'&website='.urlencode($website->ref).'&pageid='.((int) $pageid).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fas fa-home valignmiddle btnTitle-icon"></span></a>';
 				}
 				print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("ClonePage")).'" name="createpagefromclone">';