[Mapbender-commits] r2593 - branches/testbaudson_dev/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jul 7 09:11:28 EDT 2008


Author: christoph
Date: 2008-07-07 09:11:27 -0400 (Mon, 07 Jul 2008)
New Revision: 2593

Modified:
   branches/testbaudson_dev/http/javascripts/map.php
Log:
added list of modules and extensions

Modified: branches/testbaudson_dev/http/javascripts/map.php
===================================================================
--- branches/testbaudson_dev/http/javascripts/map.php	2008-07-07 13:09:39 UTC (rev 2592)
+++ branches/testbaudson_dev/http/javascripts/map.php	2008-07-07 13:11:27 UTC (rev 2593)
@@ -74,21 +74,48 @@
 //
 // Load external JavaScript libraries
 //
-require_once(dirname(__FILE__) . "/../../ext/jquery-1.2.6.min.js");
-require_once(dirname(__FILE__) . "/../../ext/jqjson.js");
-require_once(dirname(__FILE__) . "/../../ext/jquery.mousewheel.min.js");
+$extPath = dirname(__FILE__) . "/../../ext/";
+$extFileArray = array(  "jquery-1.2.6.min.js", 
+						"jqjson.js", 
+						"jquery.mousewheel.min.js");
+
+for ($i = 0; $i < count($extFileArray); $i++) {
+	$currentFile = $extPath . $extFileArray[$i];
+	if (file_exists($currentFile)) {
+		require_once($currentFile);
+	}
+	else {
+		$e = new mb_exception("Extension not found: " . $currentFile);
+		echo "var e = new Mb_exception('Library not found: " . $currentFile . "');";
+		die;
+	}
+}
+
 //
 // Load internal JavaScript libraries
 //
-require_once(dirname(__FILE__) . "/../../lib/exception.js");
-require_once(dirname(__FILE__) . "/../../lib/ajax.js");
-require_once(dirname(__FILE__) . "/../../lib/basic.js");
-require_once(dirname(__FILE__) . "/../../lib/div.js");
-require_once(dirname(__FILE__) . "/../../lib/list.js");
-require_once(dirname(__FILE__) . "/../../lib/point.js");
-require_once(dirname(__FILE__) . "/../../lib/style.js");
-require_once(dirname(__FILE__) . "/../../lib/button.js");
+$libPath = dirname(__FILE__) . "/../../lib/";
+$libFileArray = array(  "exception.js", 
+						"ajax.js", 
+						"basic.js",
+						"div.js",
+						"list.js",
+						"point.js",
+						"style.js",
+						"button.js");
 
+for ($i = 0; $i < count($libFileArray); $i++) {
+	$currentFile = $libPath . $libFileArray[$i];
+	if (file_exists($currentFile)) {
+		require_once($currentFile);
+	}
+	else {
+		$e = new mb_exception("Library not found: " . $currentFile);
+		echo "var e = new Mb_exception('Library not found: " . $currentFile . "');";
+		die;
+	}
+}
+
 //
 // Load JavaScript modules of GUI elements
 //
@@ -106,6 +133,8 @@
 			}
 			else {
 				$e = new mb_exception("Javascript module not found: " . $currentFile);
+				echo "var e = new Mb_exception('Javascript module not found: " . $currentFile . "');";
+				die;
 			}
 		}
 	}
@@ -134,6 +163,8 @@
 			}
 			else {
 				$e = new mb_exception("Javascript not found: " . $currentFile);
+				echo "var e = new Mb_exception('Javascript not found: " . $currentFile . "');";
+				die;
 			}
 		}
 	}



More information about the Mapbender_commits mailing list