New: possibility to use includes/modules in external modules dir

This commit is contained in:
Regis Houssin 2011-08-01 12:25:14 +00:00
parent 544d947193
commit 3bfa9425ba
2 changed files with 10 additions and 10 deletions

View File

@ -22,7 +22,7 @@
/**
* \file htdocs/admin/modules.php
* \brief Page to activate/disable all modules
* \version $Id: modules.php,v 1.157 2011/08/01 12:25:15 hregis Exp $
* \version $Id: modules.php,v 1.158 2011/08/01 12:28:09 hregis Exp $
*/
require("../main.inc.php");
@ -89,10 +89,10 @@ foreach ($conf->file->dol_document_root as $type => $dirroot)
if ($type == 'alt')
{
$althandle=@opendir($dirroot);
if (is_resource($althandle))
$handle=@opendir($dirroot);
if (is_resource($handle))
{
while (($file = readdir($althandle))!==false)
while (($file = readdir($handle))!==false)
{
if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes')
{
@ -102,6 +102,7 @@ foreach ($conf->file->dol_document_root as $type => $dirroot)
}
}
}
closedir($handle);
}
}
}
@ -472,5 +473,5 @@ print '</div>';
$db->close();
llxFooter('$Date: 2011/08/01 12:25:15 $ - $Revision: 1.157 $');
llxFooter('$Date: 2011/08/01 12:28:09 $ - $Revision: 1.158 $');
?>

View File

@ -21,8 +21,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
@ -30,7 +29,7 @@
* \ingroup core
* \brief File that defines environment for all Dolibarr process (pages or scripts)
* This script reads the conf file, init $lang, $db and and empty $user
* \version $Id: master.inc.php,v 1.350 2011/07/30 10:23:24 eldy Exp $
* \version $Id: master.inc.php,v 1.352 2011/08/01 12:25:14 hregis Exp $
*/
@ -71,14 +70,14 @@ $conf->file->character_set_client=strtoupper($force_charset_do_notuse);
$conf->file->cookie_cryptkey = empty($dolibarr_main_cookie_cryptkey)?'':$dolibarr_main_cookie_cryptkey;
// Define array of document root directories
$conf->file->dol_document_root=array(DOL_DOCUMENT_ROOT);
$conf->file->dol_document_root=array('main' => DOL_DOCUMENT_ROOT);
if (! empty($dolibarr_main_document_root_alt))
{
// dolibarr_main_document_root_alt contains several directories
$values=preg_split('/[;,]/',$dolibarr_main_document_root_alt);
foreach($values as $value)
{
$conf->file->dol_document_root[]=$value;
$conf->file->dol_document_root['alt']=$value;
}
}