diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php
index afc23f3ff63..f6e3c633a74 100644
--- a/htdocs/admin/compta.php
+++ b/htdocs/admin/compta.php
@@ -146,17 +146,6 @@ print '
'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").' ';
// 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')];
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index af7327dcf68..f3b6dfcf5fb 100644
--- a/htdocs/admin/modules.php
+++ b/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;
}
diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php
index eeabf022b46..e5fe6cc018c 100644
--- a/htdocs/admin/paymentbybanktransfer.php
+++ b/htdocs/admin/paymentbybanktransfer.php
@@ -379,7 +379,7 @@ print ' ';
*/
/* 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"));
diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php
index 5908680756c..ac196aae015 100644
--- a/htdocs/admin/prelevement.php
+++ b/htdocs/admin/prelevement.php
@@ -395,7 +395,7 @@ print ' ';
*/
/* 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"));
diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php
index cf07dd49539..843d6a95787 100644
--- a/htdocs/admin/syslog.php
+++ b/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 ''.$langs->trans("ContactSuperAdminForChange").'
';
$optionmc = 'disabled';
}
diff --git a/htdocs/api/admin/explorer_withredoc.php b/htdocs/api/admin/explorer_withredoc.php
index 45dd31d57c9..0808a93a999 100644
--- a/htdocs/api/admin/explorer_withredoc.php
+++ b/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').'. ';
diff --git a/htdocs/api/index.php b/htdocs/api/index.php
index 0e2f615b3d7..ebf6c7e8091 100644
--- a/htdocs/api/index.php
+++ b/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').'. ';
diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php
index 1966312d7f2..b3ea354bda7 100644
--- a/htdocs/compta/localtax/clients.php
+++ b/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 .= ' ('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').') ';
$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 .= ' '.$langs->trans("WarningDepositsNotIncluded");
}
$description .= $fsearch;
@@ -165,7 +165,7 @@ if ($calc == 2) { // Invoice for goods, payment for services
$calcmode = $langs->trans("CalcModeLT2Debt");
$calcmode .= ' ('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').') ';
$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 .= ' '.$langs->trans("WarningDepositsNotIncluded");
}
$description .= $fsearch;
diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php
index f5d1fe1f948..caa5173a13c 100644
--- a/htdocs/compta/localtax/index.php
+++ b/htdocs/compta/localtax/index.php
@@ -246,8 +246,6 @@ $description .= $langs->trans($LT);
$calcmode = $langs->trans("LTReportBuildWithOptionDefinedInModule").' ';
$calcmode .= ' ('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').') ';
-//if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.=' '.$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();
diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php
index 8cf68332e43..86d6e58f31f 100644
--- a/htdocs/compta/localtax/quadri_detail.php
+++ b/htdocs/compta/localtax/quadri_detail.php
@@ -199,7 +199,7 @@ 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 .= $langs->trans("ThisIsAnEstimatedValue");
}
diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php
index dce5ec2602e..7560439a4a5 100644
--- a/htdocs/compta/stats/byratecountry.php
+++ b/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 .= ' '.$langs->trans("ThisIsAnEstimatedValue");
}
if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') {
diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php
index c00da16c3be..af617959330 100644
--- a/htdocs/compta/tva/clients.php
+++ b/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 .= ' '.$langs->trans("ThisIsAnEstimatedValue");
}
diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php
index 72366e6a7e2..b1365081432 100644
--- a/htdocs/compta/tva/index.php
+++ b/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 .= ' '.$langs->trans("ThisIsAnEstimatedValue");
}
diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php
index 5235b4211ff..9eb46427768 100644
--- a/htdocs/compta/tva/quadri_detail.php
+++ b/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 .= ' ' . $langs->trans("ThisIsAnEstimatedValue");
}
diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php
index 632d751fa41..2f54c791c24 100644
--- a/htdocs/core/class/html.formwebsite.class.php
+++ b/htdocs/core/class/html.formwebsite.class.php
@@ -282,7 +282,7 @@ class FormWebsite
}
if ($website->fk_default_home && $key == $website->fk_default_home) {
//$valueforoption .= ' ('.$langs->trans("HomePage").') ';
- $valueforoption .= ' ';
+ $valueforoption .= ' ';
}
$out .= 'global->$constparam)) {
+ if (!isModEnabled($constparam)) {
$qualified = false;
}
}
diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php
index eab31288cca..78a14c8c476 100644
--- a/htdocs/core/class/menu.class.php
+++ b/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
diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php
index 2be8cab1fc4..bc23abc1dbc 100644
--- a/htdocs/core/class/menubase.class.php
+++ b/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'];
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index e06b4c64e19..0f42870f541 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/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);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 6c4a05df7a0..5f9c4ac77c8 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/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)) {
diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php
index cdc288abd17..d79b8a1f734 100644
--- a/htdocs/core/lib/functionsnumtoword.lib.php
+++ b/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 {
diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php
index 091f2b7e969..568818f712a 100644
--- a/htdocs/core/menus/standard/auguria.lib.php
+++ b/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 '';
- print '';
+ print '';
print ' ';
if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
print '';
@@ -248,7 +251,9 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla
}
} elseif ($showmode == 2) {
print '';
- print '';
+ print '';
print '
';
if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
print '';
diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php
index 168effd964d..e2a1b99b979 100644
--- a/htdocs/core/menus/standard/auguria_menu.php
+++ b/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 ' ';
+ print ' ';
}
print $val['titre'];
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index f281d7acf85..a4f6b5c9c1a 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/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' => ' ',
+ 'prefix' => ' ',
'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 '';
- print '';
+ print '';
print ' ';
if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
print '';
@@ -657,7 +665,13 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname,
}
} elseif ($showmode == 2) {
print '';
- print '';
+ print '';
print '
';
if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
print '';
@@ -987,8 +1001,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
print '