diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 1dc2a00d264..98fcf9a65ec 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -191,9 +191,12 @@ while (($file = readdir($handle))!==false) { $j = 1000 + $i; } - $modules[$i] = $modName; - $numero[$i] = $j; - $orders[$i] = "$objMod->family"."_".$j; // Tri par famille puis numero module + + $modules[$i] = $objMod; + + $nom[$i] = $modName; + $numero[$i] = $j; + $orders[$i] = "$objMod->family"."_".$j; // Tri par famille puis numero module $j++; $i++; } @@ -211,21 +214,23 @@ $familylib=array( 'other'=>$langs->trans("ModuleFamilyOther"), 'technic'=>$langs->trans("ModuleFamilyTechnic"), 'financial'=>$langs->trans("ModuleFamilyFinancial"), -'experimental'=>$langs->trans("ModuleFamilyExperimental") ); foreach ($orders as $key => $value) { $tab=split('_',$value); $family=$tab[0]; $numero=$tab[1]; - $modName = $modules[$key]; - if ($modName) - { - $objMod = new $modName($db); - } + $modName = $nom[$key]; + $objMod = $modules[$key]; + // On affiche pas module si en version 'development' et que + // constante MAIN_SHOW_DEVELOPMENT_MODULES non définie + if ($objMod->version == 'development' && ! $conf->global->MAIN_SHOW_DEVELOPMENT_MODULES) + { + continue; + } + $const_name = $objMod->const_name; - $const_value = $objMod->const_config; if ($oldfamily && $family!=$oldfamily && $atleastoneforfamily) { print "