Fix: No modules lost if we use two root directories
This commit is contained in:
parent
471d295660
commit
3994341a3c
@ -175,16 +175,17 @@ $modules = array();
|
|||||||
$orders = array();
|
$orders = array();
|
||||||
$categ = array();
|
$categ = array();
|
||||||
$dirmod = array();
|
$dirmod = array();
|
||||||
|
$i = 0; // is a sequencer of modules found
|
||||||
|
$j = 0; // j is module number. Automatically affeted if module number not defined.
|
||||||
foreach ($dirlist as $dirroot)
|
foreach ($dirlist as $dirroot)
|
||||||
{
|
{
|
||||||
$dir = $dirroot . "/includes/modules/";
|
$dir = $dirroot . "/includes/modules/";
|
||||||
|
|
||||||
// Charge tableaux modules, nom, numero, orders depuis r<>pertoire dir
|
// Charge tableaux modules, nom, numero, orders depuis r<>pertoire dir
|
||||||
$handle=opendir($dir);
|
$handle=opendir($dir);
|
||||||
$i = 0;
|
|
||||||
$j = 0;
|
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
|
//print "$i ".$file."\n<br>";
|
||||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php')
|
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php')
|
||||||
{
|
{
|
||||||
$modName = substr($file, 0, strlen($file) - 10);
|
$modName = substr($file, 0, strlen($file) - 10);
|
||||||
@ -219,6 +220,7 @@ foreach ($dirlist as $dirroot)
|
|||||||
$modules[$i] = $objMod;
|
$modules[$i] = $objMod;
|
||||||
$filename[$i]= $modName;
|
$filename[$i]= $modName;
|
||||||
$orders[$i] = "$objMod->family"."_".$j; // Tri par famille puis numero module
|
$orders[$i] = "$objMod->family"."_".$j; // Tri par famille puis numero module
|
||||||
|
//print "x".$modName." ".$orders[$i]."\n<br>";
|
||||||
$categ[$objMod->special]++; // Array of all different modules categories
|
$categ[$objMod->special]++; // Array of all different modules categories
|
||||||
$dirmod[$i] = $dirroot;
|
$dirmod[$i] = $dirroot;
|
||||||
$j++;
|
$j++;
|
||||||
@ -227,11 +229,12 @@ foreach ($dirlist as $dirroot)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
asort($orders);
|
asort($orders);
|
||||||
|
|
||||||
|
|
||||||
// Affichage debut page
|
// Affichage debut page
|
||||||
|
|
||||||
if ($mode==0) print $langs->trans("ModulesDesc")."<br>\n";
|
if ($mode==0) print $langs->trans("ModulesDesc")."<br>\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user