New: add directory for external module and other customization

This commit is contained in:
Regis Houssin 2010-12-15 16:02:00 +00:00
parent ad16244f08
commit 9c20c25d11
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2005-2009 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>
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -51,7 +52,8 @@ $modules_files = array();
// Load list of modules // Load list of modules
foreach($conf->file->dol_document_root as $searchdir) foreach($conf->file->dol_document_root as $searchdir)
{ {
$dirtoscan=$searchdir.'/includes/modules/'; if (preg_match('/custom$/i',$searchdir)) $dirtoscan = $searchdir . "/modules/";
else $dirtoscan = $searchdir . "/includes/modules/";
$handle=opendir($dirtoscan); $handle=opendir($dirtoscan);
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {

View File

@ -142,7 +142,8 @@ class Conf
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_TRIGGERS$/i',$key,$reg)) elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_TRIGGERS$/i',$key,$reg))
{ {
$modulename = strtolower($reg[1]); $modulename = strtolower($reg[1]);
$this->triggers_modules[] = DOL_DOCUMENT_ROOT.'/'.$modulename.'/inc/triggers/'; if ($value == 1) $this->triggers_modules[] = DOL_DOCUMENT_ROOT.'/'.$modulename.'/inc/triggers/';
else if ($value == 2) $this->triggers_modules[] = DOL_DOCUMENT_EXTMODULE.'/'.$modulename.'/inc/triggers/';
} }
// If this is constant for login method activated by a module // If this is constant for login method activated by a module
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_LOGIN_METHOD$/i',$key,$reg)) elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_LOGIN_METHOD$/i',$key,$reg))