Can use alternate document roots directories
This commit is contained in:
parent
35f6bda428
commit
371401dad5
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -45,27 +45,31 @@ print "<br>\n";
|
|||||||
print $langs->trans("ToActivateModule").'<br>';
|
print $langs->trans("ToActivateModule").'<br>';
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
// Charge les modules
|
|
||||||
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/";
|
|
||||||
$handle=opendir($dir);
|
|
||||||
$modules = array();
|
$modules = array();
|
||||||
$modules_names = array();
|
$modules_names = array();
|
||||||
$modules_files = array();
|
$modules_files = array();
|
||||||
while (($file = readdir($handle))!==false)
|
|
||||||
|
// Load list of modules
|
||||||
|
foreach($conf->file->dol_document_root as $searchdir)
|
||||||
{
|
{
|
||||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php')
|
$dirtoscan=$searchdir.'/includes/modules/';
|
||||||
|
$handle=opendir($dirtoscan);
|
||||||
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
$modName = substr($file, 0, strlen($file) - 10);
|
if (is_readable($dirtoscan.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php')
|
||||||
|
|
||||||
if ($modName)
|
|
||||||
{
|
{
|
||||||
include_once(DOL_DOCUMENT_ROOT."/includes/modules/".$file);
|
$modName = substr($file, 0, strlen($file) - 10);
|
||||||
$objMod = new $modName($db);
|
|
||||||
|
|
||||||
$modules[$objMod->numero]=$objMod;
|
if ($modName)
|
||||||
$modules_names[$objMod->numero]=$objMod->name;
|
{
|
||||||
$modules_files[$objMod->numero]=$file;
|
include_once($dirtoscan.$file);
|
||||||
$picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic';
|
$objMod = new $modName($db);
|
||||||
|
|
||||||
|
$modules[$objMod->numero]=$objMod;
|
||||||
|
$modules_names[$objMod->numero]=$objMod->name;
|
||||||
|
$modules_files[$objMod->numero]=$file;
|
||||||
|
$picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user