[Mapbender-commits] r7014 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Oct 4 06:16:09 EDT 2010


Author: christoph
Date: 2010-10-04 10:16:09 +0000 (Mon, 04 Oct 2010)
New Revision: 7014

Modified:
   trunk/mapbender/http/javascripts/map.php
Log:
* create a list of all modules before loading

Modified: trunk/mapbender/http/javascripts/map.php
===================================================================
--- trunk/mapbender/http/javascripts/map.php	2010-10-04 08:54:16 UTC (rev 7013)
+++ trunk/mapbender/http/javascripts/map.php	2010-10-04 10:16:09 UTC (rev 7014)
@@ -118,34 +118,35 @@
 $v = array($gui_id);
 $t = array('s');
 $res = db_prep_query($sql, $v, $t);
+$moduleArray = array();
 while($row = db_fetch_array($res)){
 	if($row["e_mb_mod"] != ""){
-		$moduleArray = explode(",", $row["e_mb_mod"]);
-				$e = new mb_notice(serialize($moduleArray));
-		for ($i = 0; $i < count($moduleArray); $i++) {
-			if (trim($moduleArray[$i]) !== "") {
-				$fileFound = false;
-				$pathArray = explode(",", MODULE_SEARCH_PATHS);
-				foreach ($pathArray as $path) {
-					$currentFile = dirname(__FILE__) . "/" . $path . trim($moduleArray[$i]);
-					if (file_exists($currentFile)) {
-						$e = new mb_notice("LOADING module : " . $currentFile);
-						require_once($currentFile);
-						echo "\n";
-						$fileFound = true;
-						break;
-					}
-				}
-				
-				if ($fileFound) {
-					continue;
-				}
+		$moduleArray = array_merge($moduleArray, explode(",", $row["e_mb_mod"]));
+	}
+}
+
+for ($i = 0; $i < count($moduleArray); $i++) {
+	if (trim($moduleArray[$i]) !== "") {
+		$fileFound = false;
+		$pathArray = explode(",", MODULE_SEARCH_PATHS);
+		foreach ($pathArray as $path) {
+			$currentFile = dirname(__FILE__) . "/" . $path . trim($moduleArray[$i]);
+			if (file_exists($currentFile)) {
+				$e = new mb_notice("LOADING module : " . $currentFile);
+				require_once($currentFile);
+				echo "\n";
+				$fileFound = true;
+				break;
 			}
-			
-			$e = new mb_exception("Javascript module not found: " . trim($moduleArray[$i]));
-			echo "var e = new Mb_exception('Javascript module not found: " . trim($moduleArray[$i]) . "');";
 		}
+
+		if ($fileFound) {
+			continue;
+		}
 	}
+
+	$e = new mb_exception("Javascript module not found: " . trim($moduleArray[$i]));
+	echo "var e = new Mb_exception('Javascript module not found: " . trim($moduleArray[$i]) . "');";
 }
 
 //
@@ -310,7 +311,7 @@
 			})();
 		}		
 	};
-	
+
 	Mapbender.events.hideSplashScreen.trigger();
 
 	$jsText



More information about the Mapbender_commits mailing list