From 3bfa9425baca9687d0935247fd2406bba748dc30 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 1 Aug 2011 12:25:14 +0000 Subject: [PATCH] New: possibility to use includes/modules in external modules dir --- htdocs/admin/modules.php | 11 ++++++----- htdocs/master.inc.php | 9 ++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 671bd69a0e4..a5025c44000 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -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 ''; $db->close(); -llxFooter('$Date: 2011/08/01 12:25:15 $ - $Revision: 1.157 $'); +llxFooter('$Date: 2011/08/01 12:28:09 $ - $Revision: 1.158 $'); ?> diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 03ef2767e40..eedd6a8841c 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -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 . */ /** @@ -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; } }