New: N'affiche pas les modules en version 'development'.

This commit is contained in:
Laurent Destailleur 2005-08-13 20:15:35 +00:00
parent 5a05c314f3
commit 30646d860d

View File

@ -191,9 +191,12 @@ while (($file = readdir($handle))!==false)
{ {
$j = 1000 + $i; $j = 1000 + $i;
} }
$modules[$i] = $modName;
$numero[$i] = $j; $modules[$i] = $objMod;
$orders[$i] = "$objMod->family"."_".$j; // Tri par famille puis numero module
$nom[$i] = $modName;
$numero[$i] = $j;
$orders[$i] = "$objMod->family"."_".$j; // Tri par famille puis numero module
$j++; $j++;
$i++; $i++;
} }
@ -211,21 +214,23 @@ $familylib=array(
'other'=>$langs->trans("ModuleFamilyOther"), 'other'=>$langs->trans("ModuleFamilyOther"),
'technic'=>$langs->trans("ModuleFamilyTechnic"), 'technic'=>$langs->trans("ModuleFamilyTechnic"),
'financial'=>$langs->trans("ModuleFamilyFinancial"), 'financial'=>$langs->trans("ModuleFamilyFinancial"),
'experimental'=>$langs->trans("ModuleFamilyExperimental")
); );
foreach ($orders as $key => $value) foreach ($orders as $key => $value)
{ {
$tab=split('_',$value); $tab=split('_',$value);
$family=$tab[0]; $numero=$tab[1]; $family=$tab[0]; $numero=$tab[1];
$modName = $modules[$key]; $modName = $nom[$key];
if ($modName) $objMod = $modules[$key];
{
$objMod = new $modName($db);
}
// 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_name = $objMod->const_name;
$const_value = $objMod->const_config;
if ($oldfamily && $family!=$oldfamily && $atleastoneforfamily) { if ($oldfamily && $family!=$oldfamily && $atleastoneforfamily) {
print "<tr class=\"liste_titre\">\n <td colspan=\"9\"></td>\n</tr>\n"; print "<tr class=\"liste_titre\">\n <td colspan=\"9\"></td>\n</tr>\n";
@ -233,22 +238,22 @@ foreach ($orders as $key => $value)
} }
if((!$objMod->special && !$_GET["spe"] ) or ($objMod->special && $_GET["spe"])) if((!$objMod->special && !$_GET["spe"] ) or ($objMod->special && $_GET["spe"]))
{ {
$atleastoneforfamily=1; $atleastoneforfamily=1;
$var=!$var; $var=!$var;
print "<tr $bc[$var]>\n"; print "<tr $bc[$var]>\n";
print " <td class=\"body\" valign=\"top\">"; print " <td class=\"body\" valign=\"top\">";
if ($family!=$oldfamily) if ($family!=$oldfamily)
{ {
print "<div class=\"titre\">".$familylib[$family]."</div>"; print "<div class=\"titre\">".$familylib[$family]."</div>";
$oldfamily=$family; $oldfamily=$family;
} }
else else
{ {
print '&nbsp;'; print '&nbsp;';
} }
print "</td>\n"; print "</td>\n";
print ' <td valign="top" width="14" align="center">'; print ' <td valign="top" width="14" align="center">';
print $objMod->picto?img_object('',$objMod->picto):img_object('','generic'); print $objMod->picto?img_object('',$objMod->picto):img_object('','generic');
@ -261,24 +266,23 @@ foreach ($orders as $key => $value)
print $objMod->getDbVersion(); print $objMod->getDbVersion();
print "</td>\n <td align=\"center\">"; print "</td>\n <td align=\"center\">";
if ($const_value == 1) if ($conf->global->$const_name == 1)
{ {
print img_tick(); print img_tick();
} }
else else
{ {
print "&nbsp;"; print "&nbsp;";
} }
print "</td>\n <td align=\"center\">";
if ($const_value == 1) print "</td>\n <td align=\"center\">";
{
if ($conf->global->$const_name == 1)
{
// Module actif // Module actif
print "<a href=\"modules.php?id=".$objMod->numero."&amp;action=reset&amp;value=" . $modName . "&amp;spe=" . $_GET["spe"] . "\">" . $langs->trans("Disable") . "</a></td>\n"; print "<a href=\"modules.php?id=".$objMod->numero."&amp;action=reset&amp;value=" . $modName . "&amp;spe=" . $_GET["spe"] . "\">" . $langs->trans("Disable") . "</a></td>\n";
if ($objMod->config_page_url) if ($objMod->config_page_url)
{ {
if (is_array($objMod->config_page_url)) { if (is_array($objMod->config_page_url)) {
@ -308,17 +312,17 @@ foreach ($orders as $key => $value)
{ {
print " <td>&nbsp;</td>"; print " <td>&nbsp;</td>";
} }
} }
else else
{ {
// Module non actif // Module non actif
print "<a href=\"modules.php?id=".$objMod->numero."&amp;action=set&amp;value=" . $modName . "&amp;spe=" . $_GET["spe"] . "\">" . $langs->trans("Activate") . "</a></td>\n <td>&nbsp;</td>\n"; print "<a href=\"modules.php?id=".$objMod->numero."&amp;action=set&amp;value=" . $modName . "&amp;spe=" . $_GET["spe"] . "\">" . $langs->trans("Activate") . "</a></td>\n <td>&nbsp;</td>\n";
} }
print "</tr>\n"; print "</tr>\n";
} }
} }
print "</table></div>\n"; print "</table></div>\n";