Skip to content

Commit

Permalink
Fix: Use same algo to scan modules than admin/modules page
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Apr 28, 2012
1 parent 2a19e9d commit 6b9717b
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions htdocs/admin/system/modules.php
Expand Up @@ -47,29 +47,30 @@
$modules_names = array();
$modules_files = array();

// Search modules dirs
$modulesdir = array();
foreach ($conf->file->dol_document_root as $type => $dirroot)
{
$modulesdir[] = $dirroot . "/core/modules/";

if ($type == 'alt')
{
$handle=@opendir($dirroot);
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
{
if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes')
{
if (is_dir($dirroot . '/' . $file . '/core/modules/'))
{
$modulesdir[] = $dirroot . '/' . $file . '/core/modules/';
}
}
}
closedir($handle);
}
}
$modulesdir[$dirroot . '/core/modules/'] = $dirroot . '/core/modules/';

$handle=@opendir($dirroot);
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
{
if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes')
{
if (is_dir($dirroot . '/' . $file . '/core/modules/'))
{
$modulesdir[$dirroot . '/' . $file . '/core/modules/'] = $dirroot . '/' . $file . '/core/modules/';
}
}
}
closedir($handle);
}
}
//var_dump($modulesdir);


// Load list of modules
foreach($modulesdir as $dir)
Expand Down

0 comments on commit 6b9717b

Please sign in to comment.