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 * \file htdocs/admin/modules.php
* \brief Page to activate/disable all modules * \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"); require("../main.inc.php");
@ -89,10 +89,10 @@ foreach ($conf->file->dol_document_root as $type => $dirroot)
if ($type == 'alt') if ($type == 'alt')
{ {
$althandle=@opendir($dirroot); $handle=@opendir($dirroot);
if (is_resource($althandle)) 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') 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(); $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. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program. If not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
/** /**
@ -30,7 +29,7 @@
* \ingroup core * \ingroup core
* \brief File that defines environment for all Dolibarr process (pages or scripts) * \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 * 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; $conf->file->cookie_cryptkey = empty($dolibarr_main_cookie_cryptkey)?'':$dolibarr_main_cookie_cryptkey;
// Define array of document root directories // 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)) if (! empty($dolibarr_main_document_root_alt))
{ {
// dolibarr_main_document_root_alt contains several directories // dolibarr_main_document_root_alt contains several directories
$values=preg_split('/[;,]/',$dolibarr_main_document_root_alt); $values=preg_split('/[;,]/',$dolibarr_main_document_root_alt);
foreach($values as $value) foreach($values as $value)
{ {
$conf->file->dol_document_root[]=$value; $conf->file->dol_document_root['alt']=$value;
} }
} }