[Mapbender-commits] r4292 - in trunk/mapbender: core http/classes http/javascripts http/php http/print lib resources/db/update

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jul 3 11:54:57 EDT 2009


Author: christoph
Date: 2009-07-03 11:54:57 -0400 (Fri, 03 Jul 2009)
New Revision: 4292

Added:
   trunk/mapbender/http/javascripts/mod_log.js
   trunk/mapbender/http/javascripts/mod_reload.js
   trunk/mapbender/http/javascripts/mod_resize_mapsize.js
   trunk/mapbender/http/javascripts/mod_sandclock.js
Removed:
   trunk/mapbender/http/javascripts/mod_log.php
   trunk/mapbender/http/javascripts/mod_reload.php
   trunk/mapbender/http/javascripts/mod_resize_mapsize.php
   trunk/mapbender/http/javascripts/mod_sandclock.php
   trunk/mapbender/http/javascripts/mod_sandclock2.php
   trunk/mapbender/http/php/mod_map1.php
   trunk/mapbender/http/php/mod_mapOV.php
Modified:
   trunk/mapbender/core/system.php
   trunk/mapbender/http/classes/class_log.php
   trunk/mapbender/http/javascripts/map.js
   trunk/mapbender/http/javascripts/map.php
   trunk/mapbender/http/javascripts/map_obj.js
   trunk/mapbender/http/javascripts/mapnf.php
   trunk/mapbender/http/javascripts/mod_digitize_tab.php
   trunk/mapbender/http/javascripts/mod_dynamicOverview.php
   trunk/mapbender/http/javascripts/ovnf.php
   trunk/mapbender/http/javascripts/wfs.php
   trunk/mapbender/http/php/mod_log.php
   trunk/mapbender/http/print/mod_printPDF.php
   trunk/mapbender/lib/ajax.js
   trunk/mapbender/lib/ajax.php
   trunk/mapbender/lib/core.js
   trunk/mapbender/lib/extent.js
   trunk/mapbender/lib/point.js
   trunk/mapbender/resources/db/update/update_2.7.sql
Log:
a lot of important changes...just ask Testbaudson

Modified: trunk/mapbender/core/system.php
===================================================================
--- trunk/mapbender/core/system.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/core/system.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -39,5 +39,5 @@
 	"zoomOut1,selArea1,pan1,copyright,dependentDiv,dragMapSize," .
 	"dynamicOverview,FeatureInfoRedirect,highlightPOI,navFrame,sandclock," .
 	"scaleBar,scaleSelect,setBBOX,setPOI2Scale,reload,overview,addWMS," . 
-	"repaint,changeEPSG,mousewheelZoom,doubleclickZoom"
+	"repaint,changeEPSG,mousewheelZoom,doubleclickZoom,resizeMapsize"
 );

Modified: trunk/mapbender/http/classes/class_log.php
===================================================================
--- trunk/mapbender/http/classes/class_log.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/classes/class_log.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -70,10 +70,6 @@
 		}
 		else if($type == 'db'){
 
-
-			include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-			$con = db_connect(DBSERVER,OWNER,PW);
-			db_select_db(DB,$con);
 			for($i = 0; $i < count($this->url); $i++){
 				$sql = "INSERT INTO mb_log (";
 				$sql .= "time_client, time_server, time_readable, mb_session, ";

Modified: trunk/mapbender/http/javascripts/map.js
===================================================================
--- trunk/mapbender/http/javascripts/map.js	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/javascripts/map.js	2009-07-03 15:54:57 UTC (rev 4292)
@@ -43,14 +43,6 @@
 	return null;
 }
 
-
-eventAfterInit.register(function () {
-	// performs a map request for each map frame
-	for (var i = 0; i < mb_mapObj.length; i++){
-		setMapRequest(mb_mapObj[i].elementName);
-	}      	
-});
-
 /**
  * @deprecated
  */

Modified: trunk/mapbender/http/javascripts/map.php
===================================================================
--- trunk/mapbender/http/javascripts/map.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/javascripts/map.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -185,67 +185,85 @@
 $mb_v = array($gui_id);
 $mb_t = array("s");
 $mb_res = db_prep_query($mb_sql, $mb_v, $mb_t);
-while($row_js = db_fetch_array($mb_res)){
-	if($row_js["e_js_file"] != ""){
-		$jsArray = explode(",", $row_js["e_js_file"]);
-		for ($i = 0; $i < count($jsArray); $i++) {
-			$e_id = isset($row_js["e_id"]) ? $row_js["e_id"] : "";
-			$e_src = $row_js["e_src"];
-			$e_require = $row_js["e_requires"];
-			$e_target = explode(",",$row_js["e_target"]);
-			$e_width = intval($row_js["e_width"]);
-			$e_height = intval($row_js["e_height"]);
-			$e_top = intval($row_js["e_top"]);
-			$e_left = intval($row_js["e_left"]);
-			$currentFile = trim($jsArray[$i]);
-			if (!file_exists($currentFile)) {
-				$e = new mb_exception("Javascript not found: " . $currentFile);
-				echo "var e = new Mb_exception('Javascript not found: " . $currentFile . "');";
-				continue;
-			}
-			if (in_array($e_id, $modulesNotRelyingOnGlobalsArray)) {
-				ob_start();
-				echo "var options = {" . 
-					"id:'$e_id'," . 
-					"target:" . ($e_target[0] != "" ? $json->encode($e_target) : "[]") . "," .
-					"top:$e_top," . 
-					"left:$e_left," . 
-					"width:$e_width," . 
-					"height:$e_height," . 
-					"src:'$e_src'" . 
-					"};";
+while ($row_js = db_fetch_array($mb_res)) {
+		
+	//
+	// Create element properties
+	//
+	$e_id = isset($row_js["e_id"]) ? 
+		str_replace(" ", "", $row_js["e_id"]) : "";
+	$e_src = $row_js["e_src"];
+	$e_require = $row_js["e_requires"];
+	$e_target = explode(",",$row_js["e_target"]);
+	$e_width = intval($row_js["e_width"]);
+	$e_height = intval($row_js["e_height"]);
+	$e_top = intval($row_js["e_top"]);
+	$e_left = intval($row_js["e_left"]);
 
-				include "../include/dyn_js_object.php";
-				echo <<<JS
-				
-$.fn.$e_id = function (options) {
-	return this.each(function () {
+	$elementAttributes = "{" . 
+		"id:'$e_id'," . 
+		"target:" . ($e_target[0] != "" ? $json->encode($e_target) : "[]") . "," .
+		"url:'$e_url'," .
+		"top:$e_top," . 
+		"left:$e_left," . 
+		"width:$e_width," . 
+		"height:$e_height," . 
+		"src:'$e_src'" . 
+		"}";
 
-JS;
+	echo "Mapbender.modules." . $e_id . " = " . $elementAttributes . ";\n";
+
+	//
+	// Include JavaScript files
+	//
+	$jsFileString = $row_js["e_js_file"];
+	$e = new mb_exception("###############$e_id################$jsFileString");
+	if ($jsFileString){
+		if (in_array($e_id, $modulesNotRelyingOnGlobalsArray)) {
+			//
+			// Create the jQuery plugin in output buffer
+			//
+			ob_start();
+			echo "var options = " . $elementAttributes . ";";
+			
+			// extend the options variable by JS element vars 
+			include "../include/dyn_js_object.php";
+	
+			echo "$.fn.$e_id = function (options) {" . 
+				"return this.each(function () {";
+	
+			$jsArray = explode(",", $jsFileString);
+			for ($i = 0; $i < count($jsArray); $i++) {
+				$currentFile = trim($jsArray[$i]);
+		
+				if (!file_exists($currentFile)) {
+					$e = new mb_exception("Javascript not found: " . $currentFile);
+					echo "var e = new Mb_exception('Javascript not found: " . $currentFile . "');";
+					continue;
+				}
+				$e = new mb_notice("LOADING JS : " . $currentFile);
 				require($currentFile);
-				echo <<<JS
+			}	
 
-	});
-}
-
-JS;
-				echo "$('#$e_id').$e_id(options);";
-				$executeJsPluginsArray[] = ob_get_contents();
-				ob_end_clean();
-				echo "Mapbender.modules.$e_id = {};\n";
-			}
-			else {
-				echo "Mapbender.modules." . $e_id . " = {\n";
-				echo "id:'".$row_js["e_id"]."',";
-				echo "url:'".$row_js["e_url"]."',";
-				echo "top:'".$row_js["e_top"]."',";
-				echo "left:'".$row_js["e_left"]."',";
-				echo "width:'".$row_js["e_width"]."',";
-				echo "height:'".$row_js["e_height"]."'";
-				echo "};\n";
+			echo "});};";
+	
+			echo "$('#$e_id').$e_id(options);";
+			$executeJsPluginsArray[] = ob_get_contents();
+			ob_end_clean();
+		}
+		else {
+			$jsArray = explode(",", $jsFileString);
+			for ($i = 0; $i < count($jsArray); $i++) {
+				$currentFile = trim($jsArray[$i]);
+		
+				if (!file_exists($currentFile)) {
+					$e = new mb_exception("Javascript not found: " . $currentFile);
+					echo "var e = new Mb_exception('Javascript not found: " . $currentFile . "');";
+					continue;
+				}
+				$e = new mb_notice("LOADING JS : " . $currentFile);
 				require($currentFile);
 			}
-			$e = new mb_notice("LOADING JS : " . $currentFile);
 		}
 	}
 }

Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/javascripts/map_obj.js	2009-07-03 15:54:57 UTC (rev 4292)
@@ -41,7 +41,12 @@
 	 * maxy		- y of north east
 	 */
 	this.setExtent = function(minx, miny, maxx, maxy){
-		this.extent = String(minx) + "," + String(miny) + "," + String(maxx) + "," + String(maxy);
+		if (!this.extent) {
+			this.extent = new Mapbender.Extent(minx, miny, maxx, maxy);
+		}
+		else {
+			this.extent.set(new Point(minx, miny), new Point(maxx, maxy));
+		}
 	};
 
 /*	
@@ -350,7 +355,7 @@
 	 * @param {Object} direction
 	 */
 	this.pan = function (direction) {
-		var arrayBBox = this.extent.toString().split(",");
+		var arrayBBox = this.getExtent().split(",");
 		var minx = parseFloat(arrayBBox[0]);
 		var miny = parseFloat(arrayBBox[1]);
 		var maxx = parseFloat(arrayBBox[2]);
@@ -503,7 +508,7 @@
 	};
 	
 	this.convertPixelToReal = function (aPoint) {
-		var arrayBBox = this.extent.toString().split(",");
+		var arrayBBox = this.getExtent().split(",");
 		var minX = parseFloat(arrayBBox[0]);
 		var minY = parseFloat(arrayBBox[1]);
 		var maxX = parseFloat(arrayBBox[2]);
@@ -614,7 +619,7 @@
 		}
 		url += "&";
 		url += "SRS=" + this.epsg + "&";
-		url += "BBOX=" + this.extent.toString() + "&";
+		url += "BBOX=" + this.getExtent() + "&";
 		url += "WIDTH=" + this.width + "&";
 		url += "HEIGHT=" + this.height + "&";
 		url += "FORMAT=" + currentWms.gui_wms_mapformat + "&";
@@ -793,7 +798,11 @@
 			var myDivId = this.elementName + "_div_" + ii;          
 			writeTag(this.frameName, myDivId, newMapRequest);
 			var myMapId = this.elementName + "_map_" + ii;
-			eventAfterMapRequest.trigger({"map":this, "myMapId":myMapId});
+			eventAfterMapRequest.trigger({
+				map: this, 
+				myMapId: myMapId,
+				url: [this.getMapUrl(ii)]
+			});
 			return true;
 		}  
 		return false; 
@@ -807,7 +816,7 @@
 		this.mb_MapFutureObj[cnt].width = this.width;
 		this.mb_MapFutureObj[cnt].height = this.height;
 		this.mb_MapFutureObj[cnt].epsg = this.epsg;
-		this.mb_MapFutureObj[cnt].extent = this.extent.toString();
+		this.mb_MapFutureObj[cnt].extent = this.extent;
 		this.mb_MapFutureObj[cnt].layers = [];
 		
 		for(var i=0; i<this.layers.length;i++){
@@ -839,6 +848,7 @@
 		
 		var newMapRequest = "";
 		
+		var mapUrlArray = [];
 		for (var ii = 0; ii < this.wms.length; ii++) {
 			var currentWms = this.wms[ii];
 		
@@ -846,17 +856,21 @@
 				continue;
 			}
 			myMapId.push(this.elementName + "_map_" + ii);
-			
 			newMapRequest += getLayerHtmlCode(ii);
-			
+			mapUrlArray.push(this.getMapUrl(ii));
 		}
 		writeTag(this.frameName, this.elementName+"_maps", newMapRequest);
 
 		eventAfterMapRequest.trigger({
-			"map": this,
-			"myMapId": myMapId.join(",")
+			map: this,
+			myMapId: myMapId.join(","),
+			url: mapUrlArray
 		});
-		this.afterMapRequest.trigger();
+		this.afterMapRequest.trigger({
+			map: this,
+			myMapId: myMapId.join(","),
+			url: mapUrlArray
+		});
 	};
 
 	var that = this;
@@ -1039,9 +1053,6 @@
 	 */
 	this.eventResizeMap = new MapbenderEvent();
 
-
-
-	eventAfterMapObjectConstruction.trigger();
 }
 
 Mapbender.Map.prototype.getWfsConfIds = function (wfs_config) {

Modified: trunk/mapbender/http/javascripts/mapnf.php
===================================================================
--- trunk/mapbender/http/javascripts/mapnf.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/javascripts/mapnf.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -24,14 +24,13 @@
 	
 	$this.html('<div id="'+options.id+'_maps" name="maps" style ="position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index:2;"></div>');
 
-	Mapbender.modules[options.id] = new Mapbender.Map (
+	Mapbender.modules[options.id] = $.extend(new Mapbender.Map (
 		'', 
 		options.id, 
 		options.width, 
 		options.height, 
 		null
-	);
-	
+	), Mapbender.modules[options.id]);
 	mb_mapObj.push(Mapbender.modules[options.id]);
 	var mapObject = Mapbender.modules[options.id];
 	

Modified: trunk/mapbender/http/javascripts/mod_digitize_tab.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_digitize_tab.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -1506,6 +1506,7 @@
 						geom.geomType == parent.geomType.polygon && 
 						(
 						wfsConf[attr]['element'][elementIndex]['element_type'] == 'MultiPolygonPropertyType' ||
+						wfsConf[attr]['element'][elementIndex]['element_type'] == 'GeometryPropertyType' ||
 						wfsConf[attr]['element'][elementIndex]['element_type'] == 'MultiSurfacePropertyType'
 						)
 					);
@@ -1514,6 +1515,7 @@
 						geom.count() == 1 && 
 						(
 						wfsConf[attr]['element'][elementIndex]['element_type'] == 'PolygonPropertyType' ||
+						wfsConf[attr]['element'][elementIndex]['element_type'] == 'GeometryPropertyType' ||
 						wfsConf[attr]['element'][elementIndex]['element_type'] == 'SurfacePropertyType'
 						)
 					);
@@ -1521,6 +1523,7 @@
 						geom.geomType == parent.geomType.line && 
 						(
 						wfsConf[attr]['element'][elementIndex]['element_type'] == 'MultiLineStringPropertyType' ||
+						wfsConf[attr]['element'][elementIndex]['element_type'] == 'GeometryPropertyType' ||
 						wfsConf[attr]['element'][elementIndex]['element_type'] == 'MultiCurvePropertyType'
 						)
 					);
@@ -1529,12 +1532,13 @@
 						geom.count() == 1 && 
 						(
 						wfsConf[attr]['element'][elementIndex]['element_type'] == 'LineStringPropertyType' ||
+						wfsConf[attr]['element'][elementIndex]['element_type'] == 'GeometryPropertyType' ||
 						wfsConf[attr]['element'][elementIndex]['element_type'] == 'CurvePropertyType'
 						)
 					);
 					var isPoint = (geom.geomType == parent.geomType.point && wfsConf[attr]['element'][elementIndex]['element_type'] == 'PointPropertyType');
 //					alert(isMultiPolygon + " " + isPolygon + " " + isMultiLine + " " + isLine + " " + isPoint);
-					if (isMultiPolygon || isPolygon || isMultiLine || isLine || isPoint || wfsConf[attr]['element'][elementIndex]['element_type'] == 'GeometryAssociationType') {
+					if (isMultiPolygon || isPolygon || isMultiLine || isLine || isPoint || wfsConf[attr]['element'][elementIndex]['element_type'] == 'GeometryPropertyType') {
 						
 						wfsConfIndices.push(attr);
 					}

Modified: trunk/mapbender/http/javascripts/mod_dynamicOverview.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_dynamicOverview.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/javascripts/mod_dynamicOverview.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -138,7 +138,7 @@
 			maxx = 	parseFloat(minCoords[2]);
 			maxy = 	parseFloat(minCoords[3]);
 		}
-		var newExtent = new Extent(minx, miny, maxx, maxy)
+		var newExtent = new Mapbender.Extent(minx, miny, maxx, maxy)
 		map1.calculateExtent(newExtent);
 		map1.zoom(true, 1.0);
 	}

Added: trunk/mapbender/http/javascripts/mod_log.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_log.js	                        (rev 0)
+++ trunk/mapbender/http/javascripts/mod_log.js	2009-07-03 15:54:57 UTC (rev 4292)
@@ -0,0 +1,54 @@
+/**
+ * Package: Log
+ *
+ * Description:
+ * Logs the accesses to the guis in the database or a logfile
+ * The accesses will be written in the mapbender database on table mb_log or 
+ * into mapbender/log/mb_access_$DATE.log.
+ * The log mode can be set via the element_var logtype (file or db). 
+ * 
+ * Files:
+ *  - http/javascripts/mod_log.js
+ *  - http/php/mod_log.php
+ *
+ * SQL:
+ * > INSERT INTO gui_element (fkey_gui_id, e_id, e_pos, e_public, e_comment, 
+ * > e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, 
+ * > e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, 
+ * > e_target, e_requires, e_url) VALUES ('<gui_id>', 'log', 2, 1, 
+ * > 'log requests', 'div', '', '', 0, 0, NULL, NULL, NULL, '', '', 'div', 
+ * > 'mod_log.php', '', 'mapframe1', '', '');
+ * > 
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, 
+ * > context, var_type) VALUES('<gui_id>', 'log', 'logtype', 'file', 
+ * > 'http://www.mapbender.org/Log' ,'php_var');
+ *
+ * Help:
+ * http://www.mapbender.org/Log
+ *
+ * Maintainer:
+ * http://www.mapbender.org/User:Melchior_Moos
+ * 
+ * Parameters:
+ * logtype		- {String} log mode, file | db
+ *
+ * License:
+ * Copyright (c) 2009, Open Source Geospatial Foundation
+ * This program is dual licensed under the GNU General Public License 
+ * and Simplified BSD license.  
+ * http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
+ */
+Mapbender.events.init.register(function () {
+	eventAfterMapRequest.register(function (options) {
+		var parameters = {
+			req : options.url,
+			time_client : Mapbender.getTimestamp() 
+		};
+		var notification = new Mapbender.Ajax.Notification({
+			method: "logRequest",
+			url: "../php/mod_log.php",
+			parameters: parameters
+		});
+		notification.send();
+	});
+});

Deleted: trunk/mapbender/http/javascripts/mod_log.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_log.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/javascripts/mod_log.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -1,13 +0,0 @@
-Mapbender.events.init.register(function () {
-	eventAfterMapRequest.register(function (options) {
-		var parameters = {
-			req : options.url,
-			time_client : Mapbender.getTimestamp() 
-		};
-		var notification = new Mapbender.Ajax.Notification({
-			url: "../php/mod_log.php",
-			parameters: parameters
-		});
-		notification.send();
-	});
-});

Added: trunk/mapbender/http/javascripts/mod_reload.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_reload.js	                        (rev 0)
+++ trunk/mapbender/http/javascripts/mod_reload.js	2009-07-03 15:54:57 UTC (rev 4292)
@@ -0,0 +1,59 @@
+/**
+ * Package: Reload
+ * 
+ * Description:
+ * A button that reloads the whole window. 
+ *
+ * Files:
+ *  - http/javascripts/mod_reload.js
+ *
+ * SQL:
+ * > INSERT INTO gui_element (fkey_gui_id, e_id, e_pos, e_public, 
+ * > e_comment, e_element, e_src, e_attributes, e_left, e_top, e_width, 
+ * > e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, 
+ * > e_mb_mod, e_target, e_requires, e_url) VALUES ('<gui_id>', 'reload',
+ * > 2,1,'reload','img','../img/button_blink_red/reload_off.png', '',335,
+ * > 60,24,24,1,'','','','mod_reload.js','','mapframe1','',
+ * > 'http://www.mapbender.org/index.php/Reload');
+ *
+ * Help:
+ * http://www.mapbender.org/index.php/Reload
+ *
+ * Maintainer: 
+ * http://www.mapbender.org/User:Vera_Schulze
+ *
+ * License:
+ * Copyright (c) 2009, Open Source Geospatial Foundation
+ * This program is dual licensed under the GNU General Public License 
+ * and Simplified BSD license.  
+ * http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
+ */
+var Reload = function (options) {
+	var that = this;
+	
+	var domElement = $("#" + options.id);
+	domElement.src = options.src;
+	if (!options.src) {
+		new Mb_exception(options.id + " requires a src.");
+	}
+	else {
+		$(domElement).mouseover(function () {
+			domElement.src = options.src.replace(/_off/,"_over");
+		}).mouseout(function () {
+			domElement.src = options.src;
+		}).click(function () {
+		   that.reload(); 
+		});
+	};
+	
+	/**
+	 * Method: reload
+	 *
+	 * Reloads the window.
+	 */
+	this.reload = function () {
+		location.reload();
+	};
+};
+
+var reload = new Reload(options);
\ No newline at end of file

Deleted: trunk/mapbender/http/javascripts/mod_reload.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_reload.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/javascripts/mod_reload.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -1,70 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/reload
-# Copyright (C) 2002 CCGIS 
-#
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# 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.
-?>
-/**
- * Package: Reload
- * 
- * Description:
- * A button that reloads the whole window. 
- *
- * SQL:
- * > INSERT INTO gui_element (fkey_gui_id, e_id, e_pos, e_public, 
- * > e_comment, e_element, e_src, e_attributes, e_left, e_top, e_width, 
- * > e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, 
- * > e_mb_mod, e_target, e_requires, e_url) VALUES ('<gui_id>', 'reload',
- * > 2,1,'reload','img','../img/button_blink_red/reload_off.png', '',335,
- * > 60,24,24,1,'','','','mod_reload.php','','mapframe1','',
- * > 'http://www.mapbender.org/index.php/Reload');
- *
- * Help:
- * http://www.mapbender.org/index.php/Reload
- *
- * Maintainer: 
- * http://www.mapbender.org/User:Vera_Schulze
- */
-var Reload = function (options) {
-	var that = this;
-	
-	var domElement = $("#" + options.id);
-	domElement.src = options.src;
-	if (!options.src) {
-		new Mb_exception(options.id + " requires a src.");
-	}
-	else {
-		$(domElement).mouseover(function () {
-			domElement.src = options.src.replace(/_off/,"_over");
-		}).mouseout(function () {
-			domElement.src = options.src;
-		}).click(function () {
-		   that.reload(); 
-		});
-	};
-	
-	/**
-	 * Method: reload
-	 *
-	 * Reloads the window.
-	 */
-	this.reload = function () {
-		location.reload();
-	};
-};
-
-
-var reload = new Reload(options);
\ No newline at end of file

Added: trunk/mapbender/http/javascripts/mod_resize_mapsize.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_resize_mapsize.js	                        (rev 0)
+++ trunk/mapbender/http/javascripts/mod_resize_mapsize.js	2009-07-03 15:54:57 UTC (rev 4292)
@@ -0,0 +1,160 @@
+/**
+ * Package: ResizeMapsize
+ *
+ * Description:
+ * This modul dynamically resizes the mapframe in relation to the 
+ * browsersize. Thanks to Antje Jacobs and Marko Samson.
+ * 
+ * Files:
+ *  - http/javascripts/mod_resizeMapsize.js
+ *
+ * SQL:
+ * > INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, 
+ * > e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, 
+ * > e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, 
+ * > e_target, e_requires, e_url) VALUES('<gui_id>','resizeMapsize',2,1,
+ * > 'resize_mapsize','img','../img/button_blink_red/resizemapsize_off.png',
+ * > 'onclick = "adjustDimension()" onmouseover=''this.src = this.src.replace(/_off/,"_over");'' onmouseout=''this.src = this.src.replace(/_over/, "_off");'' title="Kartenfenstergröße optimieren"',
+ * > 838,40,24,24,3,'filter:Chroma(color=#C2CBCF);','','',
+ * > 'mod_resize_mapsize.php','','mapframe1','','');
+ * > 
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, 
+ * > context, var_type) VALUES('<gui_id>', 'resizeMapsize', 'adjust_height', 
+ * > '-35', 'to adjust the height of the mapframe on the bottom of the window',
+ * > 'var');
+ * >
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, 
+ * > context, var_type) VALUES('gui1', 'resizeMapsize', 'adjust_width', '-45', 
+ * > 'to adjust the width of the mapframe on the right side of the window',
+ * > 'var');
+ * >
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, 
+ * > context, var_type) VALUES('gui1', 'resizeMapsize', 'resize_option', 
+ * > 'button', 'auto (autoresize on load), button (resize by button)' ,'var');
+ *
+ * Help:
+ * http://www.mapbender.org/ResizeMapsize
+ *
+ * Maintainer:
+ * http://www.mapbender.org/User:Christoph_Baudson
+ * 
+ * Parameters:
+ * adjust_height    - *[optional]* {Integer} adjust the maximum size of the 
+ * 						mapframe. A positive number will enlarge the maximum 
+ * 						mapframe size, an negative number will reduce the 
+ * 						maximum mapframe size. Default: -90
+ * adjust_width		- *[optional]* {Integer} adjust the maximum size of the 
+ * 						mapframe. A positive number will enlarge the maximum 
+ * 						mapframe size, an negative number will reduce the 
+ * 						maximum mapframe size. Default: -45
+ * resize_option	- *[optional]* {String} choose between automatic 
+ * 						resizing on startup and resizing by clicking the 
+ * 						button. The element var value 'auto' means automatic 
+ * 						resizing, the value 'button' means resizing clicking 
+ * 						the button. If element var resize_option doesn't 
+ * 						exist, automatic resizing will be set as standard 
+ * 						configuration. 
+ *
+ * License:
+ * Copyright (c) 2009, Open Source Geospatial Foundation
+ * This program is dual licensed under the GNU General Public License 
+ * and Simplified BSD license.  
+ * http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
+ */
+
+if (!options.resize_option) {
+	options.resize_option = "auto";
+}
+var resize_option = options.resize_option;
+
+if (!options.adjust_width) {
+	options.adjust_width = -45;
+}
+var adjust_width = options.adjust_width;
+
+if (!options.adjust_height) {
+	options.adjust_height = -90;
+}
+var adjust_height = options.adjust_height;
+
+var map;
+var map_frame = options.target;
+var map_frame_left;
+var map_frame_top;
+
+var legend_width = (Mapbender.modules["legend"]) ? 
+	Mapbender.modules["legend"].width : 0;
+
+var width_temp, height_temp;
+
+function frameWidth(){
+  	if (window.innerWidth) {
+		return window.innerWidth;
+	}
+  	else if (document.body && document.body.offsetWidth) {
+		return document.body.offsetWidth;
+	}
+  	return 0;
+}
+
+function frameHeight(){
+  	if (window.innerHeight) {
+		return window.innerHeight;
+	}
+	else if (document.body && document.body.offsetHeight) {
+		return document.body.offsetHeight;
+	}
+    return 0;
+}
+
+function adjustDimension(skipMapRequest) {
+	var mapheight = frameHeight() - parseInt(options.top) + adjust_height;
+	var mapwidth = frameWidth() - map_frame_left - legend_width + adjust_width;
+	var coords = map.getExtent().split(",");
+	midcoordx = parseFloat(
+		(parseFloat(coords[2])-parseFloat(coords[0])
+	)/2) + parseFloat(coords[0]);
+	midcoordy = parseFloat((parseFloat(coords[3])-parseFloat(coords[1]))/2)+parseFloat(coords[1]);
+	map.setWidth(mapwidth);
+	map.setHeight(mapheight);
+
+	var sw = map.convertPixelToReal(new Point(0, mapheight));
+	var ne = map.convertPixelToReal(new Point(mapwidth, 0));
+	map.calculateExtent(new Mapbender.Extent(sw, ne));
+//	map.extent.set(new Point(midcoordx, midcoordy));
+	if (!skipMapRequest) {
+		map.setMapRequest();
+	}
+}
+
+function rebuild() {
+  	if (width_temp != frameWidth() || height_temp != frameHeight()) {
+		window.setTimeout(function () {
+			adjustDimension()
+		}, 500);
+	}
+}
+
+function control(skipMapRequest){
+  	adjustDimension(skipMapRequest);
+	if (!window.width_temp && window.innerWidth) {
+  	    window.onresize = rebuild;
+  	    width_temp = frameWidth();
+  	    height_temp = frameHeight();
+    }
+
+    if (!window.width_temp && document.body && document.body.offsetWidth) {
+  	    window.onresize = rebuild;
+  	    width_temp = frameWidth();
+  	    height_temp = frameHeight();
+    }
+}
+
+if (resize_option == 'auto'){
+	eventInit.register(function() {
+		map = Mapbender.modules[options.target];
+		map_frame_left = map.left;
+		map_frame_top = map.top;
+		control(true);
+	});
+}

Deleted: trunk/mapbender/http/javascripts/mod_resize_mapsize.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_resize_mapsize.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/javascripts/mod_resize_mapsize.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -1,123 +0,0 @@
-<?php
-# $Id:mod_resize_mapsize.php 1964 2008-01-15 08:11:29Z christoph $
-# http://www.mapbender.org/index.php/ResizeMapsize
-# Created on 12.07.2006/07:32:08
-# Copyright (C) 2002 CCGIS 
-# Projekt: mapbender
-# File: mod_resize_mapsize.php
-#
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# 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.
-
-require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
-include(dirname(__FILE__) . "/../include/dyn_js.php");
-
-$sqltarget = "SELECT e_target FROM gui_element WHERE e_id = 'resizeMapsize' AND fkey_gui_id = $1";
-$v = array($gui_id);
-$t = array('s');
-$res = db_prep_query($sqltarget, $v, $t);
-while($row = db_fetch_array($res)){
-	$e_target = $row["e_target"];
-}
-
-$sql = "SELECT e_left, e_top FROM gui_element WHERE e_id = '".$e_target."' AND fkey_gui_id = $1";
-$v = array($gui_id);
-$t = array('s');
-$res = db_prep_query($sql, $v, $t);
-while($row = db_fetch_array($res)){
-	$e_left = $row["e_left"];
-	$e_top = $row["e_top"];
-}
-
-$sqllegend = "SELECT e_width FROM gui_element WHERE e_id = 'legend' AND fkey_gui_id = $1";
-$v = array($gui_id);
-$t = array('s');
-$res = db_prep_query($sqllegend, $v, $t);
-while($row = db_fetch_array($res)){
-	$leg_e_width = $row["e_width"];
-}
-
-?>
-try{
-	if (resize_option){}
-}
-catch(e){
-	resize_option = "auto";
-}
-
-try{
-	if (adjust_width){}
-}
-catch(e){
-	adjust_width = "-45";
-}
-
-try{
-	if (adjust_height){}
-}
-catch(e){
-	adjust_height = "-35";
-}
-var map_frame = "<?php echo $e_target ?>";
-var map_frame_left = "<?php echo $e_left ?>";
-var map_frame_top = "<?php echo $e_top ?>";
-var legend_width = "<?php echo $leg_e_width ?>";
-
-function frameWidth(){
-  	if (window.innerWidth) return window.innerWidth;
-  	else if (document.body && document.body.offsetWidth)  return document.body.offsetWidth;
-  	else return 0;
-}
-
-function frameHeight(){
-  	if (window.innerHeight)return window.innerHeight;
-	else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
-    else return 0;
-}
-
-function adjustDimension(){
-	var ind = getMapObjIndexByName("<?php  echo $e_target;  ?>");
-	var mapheight = frameHeight() - <?php echo $e_top ?> + parseInt(adjust_height);
-	var mapwidth = frameWidth() - map_frame_left - legend_width + parseInt(adjust_width) ;
-	var coords = mb_mapObj[ind].extent.toString().split(",");
-	midcoordx=parseFloat((parseFloat(coords[2])-parseFloat(coords[0]))/2)+parseFloat(coords[0]);
-	midcoordy=parseFloat((parseFloat(coords[3])-parseFloat(coords[1]))/2)+parseFloat(coords[1]);
-	mb_mapObj[ind].setWidth(mapwidth);
-	mb_mapObj[ind].setHeight(mapheight);
-	mb_mapObj[ind].repaintScale(midcoordx,midcoordy,mb_mapObj[ind].getScale());
-}
-
-function rebuild() {
-  	if (width_temp != frameWidth() || height_temp != frameHeight()) window.setTimeout('adjustDimension()', 500);
-}
-
-function control(){
-  	adjustDimension();
-	if (!window.width_temp && window.innerWidth) {
-  	    window.onresize = rebuild;
-  	    width_temp = frameWidth();
-  	    height_temp = frameHeight();
-    }
-
-    if (!window.width_temp && document.body && document.body.offsetWidth) {
-  	    window.onresize = rebuild;
-  	    width_temp = frameWidth();
-  	    height_temp = frameHeight();
-    }
-}
-if (resize_option == 'auto'){
-	eventInit.register(function() {
-		control();
-	});
-}

Copied: trunk/mapbender/http/javascripts/mod_sandclock.js (from rev 4263, trunk/mapbender/http/javascripts/mod_sandclock.php)
===================================================================
--- trunk/mapbender/http/javascripts/mod_sandclock.js	                        (rev 0)
+++ trunk/mapbender/http/javascripts/mod_sandclock.js	2009-07-03 15:54:57 UTC (rev 4292)
@@ -0,0 +1,141 @@
+/**
+ * Package: Sandclock
+ *
+ * Description:
+ * Displays an arbitrary sandclock image on a map
+ *
+ * SQL:
+ * > INSERT INTO gui_element (fkey_gui_id, e_id, e_pos, e_public, 
+ * > e_comment, e_element, e_src, e_attributes, e_left, e_top, e_width, 
+ * > e_height, e_z_index, e_more_styles, e_content, e_closeTag, e_js_file, 
+ * > e_mb_mod, e_target, e_requires) VALUES ('<gui_id>', 'sandclock', '0002', 
+ * > '1', 'displays a sand clock while waiting for requests', 'div', '', 
+ * > '', '', '', '', '', '', '', '', 'div', 'mod_sandclock.php', '', 
+ * > 'mapframe1', '');
+ * > 
+ * > INSERT INTO gui_element_vars (fkey_gui_id, fkey_e_id, var_name, 
+ * > var_value, context, var_type) VALUES ('<gui_id>', 'sandclock', 
+ * > 'mod_sandclock_image', '../img/sandclock.gif', 
+ * > 'define a sandclock-image', 'var');
+ * 
+ * Help:
+ * http://www.mapbender.org/Sandclock
+ * 
+ * Maintainer:
+ * http://www.mapbender.org/User:Christoph_Baudson
+ * 
+ * Parameters:
+ * mod_sandclock_img - *[optional]* the filename and path to the sandclock image
+ *
+ * License:
+ * Copyright (c) 2009, Open Source Geospatial Foundation
+ * This program is dual licensed under the GNU General Public License 
+ * and Simplified BSD license.  
+ * http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
+ */
+ 
+var Sandclock = function (options) {
+	var that = this;
+
+	//
+	// check if target is set correctly
+	//
+	if (!options.target) {
+		new Mb_Exception(this.id + "requires a target.");
+		return;
+	}
+	
+	if (!Mapbender.modules[options.target]) {
+		new Mb_exception("Target " + options.target + " not found by " + this.id)
+	}
+	var map;
+	
+	//
+	// element vars
+	//
+	if (!options.mod_sandclock_image) {
+		options.mod_sandclock_image = "../img/sandclock.gif";
+	}
+
+	var mod_sandclock_img = new Image();
+	mod_sandclock_img.src = options.mod_sandclock_image;
+	
+	
+	//
+	// constructor
+	//
+	eventAfterMapRequest.register(function (obj) {
+		that.show(obj.myMapId);
+	});
+
+	var isInitialised = false;
+	
+	var aktiv;
+	
+	/** 
+	 * Method: show
+	 *
+	 * Displays the sandclock
+	 */
+	this.show = function (mapId) {
+		var temp = "<img src='"+mod_sandclock_img.src+"'>";
+		if (!isInitialised) {
+			map = Mapbender.modules[options.target];
+			var map_el = map.getDomElement();
+			if(!map_el.ownerDocument.getElementById(map.elementName+"_sandclock")){
+				//create Box Elements
+				el_top = map_el.ownerDocument.createElement("div");
+				el_top.style.position = "absolute";
+				el_top.style.top = "0px";
+				el_top.style.left = "0px";
+				el_top.style.overflow = "hidden";
+				el_top.style.zIndex = "1000";
+				el_top.style.visibility = "visible";
+				el_top.style.cursor = "crosshair";
+				el_top.id = map.elementName+"_sandclock";
+				map_el.appendChild(el_top);
+			}
+			isInitialised = true;
+		}
+		writeTag(map.frameName, map.elementName+"_sandclock", temp);
+		mb_arrangeElement("", options.target+"_sandclock", (map.width/2 - 16), (map.height/2 - 16));
+	
+		//
+		// if mapId is not given, the sandclock has to be turned off manually
+		// by calling hide(). Usually this is done in a callback 
+		// function.
+		//
+		if (typeof mapId !== "undefined") {
+			aktiv = setTimeout(function () {
+				that.show(mapId);
+			},10);
+			var mapIdArray = mapId.split(",");
+			var complete = true;
+			var mapId;
+			for (var i = 0; i < mapIdArray.length && complete; i++) {
+				mapId = mapIdArray[i];
+				var myDoc = map.getDomElement().ownerDocument;
+				if(myDoc.getElementById(mapId) && 
+					!myDoc.getElementById(mapId).complete) {
+					complete = false;
+				}
+			}
+			if (complete) {
+				clearTimeout(aktiv);
+				that.hide(map);
+			} 
+		}
+		
+	};
+	
+	/**
+	 * Method: hide
+	 *
+	 * Hides the sandclock
+	 */
+	this.hide = function () {
+		writeTag(map.frameName, map.elementName+"_sandclock", "");
+	};
+}
+
+$.extend(Mapbender.modules[options.id], new Sandclock(options));


Property changes on: trunk/mapbender/http/javascripts/mod_sandclock.js
___________________________________________________________________
Added: svn:keywords
   + HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
Added: svn:mergeinfo
   + 

Deleted: trunk/mapbender/http/javascripts/mod_sandclock.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_sandclock.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/javascripts/mod_sandclock.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -1,151 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_sandclock.php
-# Copyright (C) 2002 CCGIS 
-#
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# 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.
-?>
-/**
- * Package: Sandclock
- *
- * Description:
- * Displays an arbitrary sandclock image on a map
- *
- * SQL:
- * > INSERT INTO gui_element (fkey_gui_id, e_id, e_pos, e_public, 
- * > e_comment, e_element, e_src, e_attributes, e_left, e_top, e_width, 
- * > e_height, e_z_index, e_more_styles, e_content, e_closeTag, e_js_file, 
- * > e_mb_mod, e_target, e_requires) VALUES ('<gui_id>', 'sandclock', '0002', 
- * > '1', 'displays a sand clock while waiting for requests', 'div', '', 
- * > '', '', '', '', '', '', '', '', 'div', 'mod_sandclock.php', '', 
- * > 'mapframe1', '');
- * > 
- * > INSERT INTO gui_element_vars (fkey_gui_id, fkey_e_id, var_name, 
- * > var_value, context, var_type) VALUES ('<gui_id>', 'sandclock', 
- * > 'mod_sandclock_image', '../img/sandclock.gif', 
- * > 'define a sandclock-image', 'var');
- * 
- * Maintainer:
- * http://www.mapbender.org/User:Christoph_Baudson
- * 
- * Parameters:
- * mod_sandclock_img - *[optional]* the filename and path to the sandclock image
- */
- 
-var Sandclock = function (options) {
-	var that = this;
-
-	//
-	// check if target is set correctly
-	//
-	if (!options.target) {
-		new Mb_Exception(this.id + "requires a target.");
-		return;
-	}
-	
-	if (!Mapbender.modules[options.target]) {
-		new Mb_exception("Target " + options.target + " not found by " + this.id)
-	}
-	var map;
-	
-	//
-	// element vars
-	//
-	if (!options.mod_sandclock_image) {
-		options.mod_sandclock_image = "../img/sandclock.gif";
-	}
-
-	var mod_sandclock_img = new Image();
-	mod_sandclock_img.src = options.mod_sandclock_image;
-	
-	
-	//
-	// constructor
-	//
-	eventAfterMapRequest.register(function (obj) {
-		that.show(obj.myMapId);
-	});
-
-	var isInitialised = false;
-	
-	var aktiv;
-	
-	/** 
-	 * Method: show
-	 *
-	 * Displays the sandclock
-	 */
-	this.show = function (mapId) {
-		var temp = "<img src='"+mod_sandclock_img.src+"'>";
-		if (!isInitialised) {
-			map = Mapbender.modules[options.target];
-			var map_el = map.getDomElement();
-			if(!map_el.ownerDocument.getElementById(map.elementName+"_sandclock")){
-				//create Box Elements
-				el_top = map_el.ownerDocument.createElement("div");
-				el_top.style.position = "absolute";
-				el_top.style.top = "0px";
-				el_top.style.left = "0px";
-				el_top.style.overflow = "hidden";
-				el_top.style.zIndex = "1000";
-				el_top.style.visibility = "visible";
-				el_top.style.cursor = "crosshair";
-				el_top.id = map.elementName+"_sandclock";
-				map_el.appendChild(el_top);
-			}
-			isInitialised = true;
-		}
-		writeTag(map.frameName, map.elementName+"_sandclock", temp);
-		mb_arrangeElement("", options.target+"_sandclock", (map.width/2 - 16), (map.height/2 - 16));
-	
-		//
-		// if mapId is not given, the sandclock has to be turned off manually
-		// by calling hide(). Usually this is done in a callback 
-		// function.
-		//
-		if (typeof mapId !== "undefined") {
-			aktiv = setTimeout(function () {
-				that.show(mapId);
-			},10);
-			var mapIdArray = mapId.split(",");
-			var complete = true;
-			var mapId;
-			for (var i = 0; i < mapIdArray.length && complete; i++) {
-				mapId = mapIdArray[i];
-				var myDoc = map.getDomElement().ownerDocument;
-				if(myDoc.getElementById(mapId) && 
-					!myDoc.getElementById(mapId).complete) {
-					complete = false;
-				}
-			}
-			if (complete) {
-				clearTimeout(aktiv);
-				that.hide(map);
-			} 
-		}
-		
-	};
-	
-	/**
-	 * Method: hide
-	 *
-	 * Hides the sandclock
-	 */
-	this.hide = function () {
-		writeTag(map.frameName, map.elementName+"_sandclock", "");
-	};
-}
-
-var sandclock = new Sandclock(options);

Deleted: trunk/mapbender/http/javascripts/mod_sandclock2.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_sandclock2.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/javascripts/mod_sandclock2.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -1,72 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_sandclock2.php
-# Copyright (C) 2002 CCGIS 
-#
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# 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.
-
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-echo "var mod_sandclock_target = '".$e_target[0]."';";
-?>
-var mod_sandclock_maxWait = 1000 * 60;
-var mod_sandclock_minWait = 1000 * 0;
-
-var mod_sandclock_count;
-var mod_sandclock_img = new Image();
-mod_sandclock_img.src = "../img/sandclock.gif";
-mb_registerSubFunctions("mod_sandclock(true,myMapId)");
-
-
-function mod_sandclock(start){
-	var ind = getMapObjIndexByName(mod_sandclock_target);
-	if(start){  
-		mod_sandclock_count = mod_sandclock_maxWait; 
-		var temp = "<img src='"+mod_sandclock_img.src+"'>";
-		writeTag(mod_sandclock_target, "sandclock", temp);
-
-		mb_arrangeElement(mod_sandclock_target, "sandclock", (mb_mapObj[ind].width/2 - 16), (mb_mapObj[ind].height/2 - 16));
-
-		var dim = mod_sandclock_getWSize();
-		document.getElementById("sandclock2").style.width = dim[0];
-		document.getElementById("sandclock2").style.height = dim[1];
-	}
-
-	// check images:
-	aktiv = setTimeout("mod_sandclock(false)",100);
-	mod_sandclock_count -= 1000;
-
-	var allMaps = window.frames[mod_sandclock_target].document.getElementsByName("mapimage");
-	var cnt = 1;
-	for(var i=0; i<allMaps.length; i++){
-		if(allMaps[i].complete == true){
-			cnt++;
-		}         
-	}   
-	if((mod_sandclock_count <= 0 || cnt >= allMaps.length) && mod_sandclock_count < (mod_sandclock_maxWait - mod_sandclock_minWait)){
-		clearTimeout(aktiv);
-		writeTag(mod_sandclock_target, "sandclock", "");
-		document.getElementById("sandclock2").style.width = 1;
-		document.getElementById("sandclock2").style.height = 1;      
-	}
-}
-function mod_sandclock_getWSize(){
-	if(ie){
-		var dim = new Array(window.document.body.offsetWidth,  window.document.body.offsetHeight);
-	}
-	else{
-		var dim = new Array(window.innerWidth, window.innerHeight);
-	}
-	return dim;
-}
\ No newline at end of file

Modified: trunk/mapbender/http/javascripts/ovnf.php
===================================================================
--- trunk/mapbender/http/javascripts/ovnf.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/javascripts/ovnf.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -26,13 +26,15 @@
 	return;
 }
 parent.eventInitMap.register(function () {
-	var map = Mapbender.modules[options.id] = new Mapbender.Map (
+	
+	$.extend(Mapbender.modules[options.id], new Mapbender.Map(
 		'', 
 		options.id, 
 		options.width, 
 		options.height, 
 		options.overview_wms
-	); 
+	)); 
+	var map = Mapbender.modules[options.id];
 	mb_mapObj.push(map);
 			
 	var el = map.getDomElement();

Modified: trunk/mapbender/http/javascripts/wfs.php
===================================================================
--- trunk/mapbender/http/javascripts/wfs.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/javascripts/wfs.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -354,7 +354,7 @@
 			var buffer = new Point(b, b);
 			var bbox_ll = tmp[0].minus(buffer);
 			var bbox_ru = tmp[1].plus(buffer);
-			mb_calcExtent(mb_wfs_targets[0], bbox_ll, bbox_ru);
+			Mapbender.modules[mb_wfs_targets[0]].calculateExtent(new Mapbender.Extent(bbox_ll, bbox_ru));
 			highlight.del(m, colour);
 			zoom(mb_wfs_targets[0], 'true', 1.0);
 			highlight.add(m, colour);

Modified: trunk/mapbender/http/php/mod_log.php
===================================================================
--- trunk/mapbender/http/php/mod_log.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/php/mod_log.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -17,19 +17,32 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-$ajaxResponse = new AjaxResponse($_REQUEST);
+require dirname(__FILE__) . "/../../core/globalSettings.php" ;
 
-require(dirname(__FILE__)."/../include/dyn_php.php");
+$ajaxRequest = new AjaxRequest($_REQUEST);
 
-if($_REQUEST['req']){
-	ignore_user_abort();
-	$req = array();
-	$req[0] = urldecode($_REQUEST['req']);
-	$time_client = $_REQUEST['time_client'];
-	
-	if(empty($req)){$req = "init";}
-	include(dirname(__FILE__)."/../classes/class_log.php");
-	$log = new log("default", $req, $time_client, $logtype);
+$e_id = "log";
+$gui_id = Mapbender::session()->get("mb_user_myGui");
+
+require dirname(__FILE__) . "/../include/dyn_php.php" ;
+
+switch ($ajaxRequest->getMethod()) {
+	case "logRequest":
+
+		$request = $ajaxRequest->getParameter("req");
+
+		if (!is_null($request)) {
+			ignore_user_abort();
+			$time_client = $ajaxRequest->getParameter("time_client");
+			
+			if (empty($request)) {
+				$request = "init";
+			}
+			require dirname(__FILE__) . "/../classes/class_log.php";
+			$log = new log("default", $request, $time_client, $logtype);
+		}
+		break;
+	default:
+		$e = new mb_exception("Invalid method in " . __FILE__);
 }
-echo "log into $logtype successful!";
 ?>
\ No newline at end of file

Deleted: trunk/mapbender/http/php/mod_map1.php
===================================================================
--- trunk/mapbender/http/php/mod_map1.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/php/mod_map1.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -1,150 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/Administration
-# Copyright (C) 2002 CCGIS 
-#
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# 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.
-
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-
-<title>mod_map1</title>
-<?php
-$sql = "SELECT e_width, e_height FROM gui_element WHERE e_id = 'mapframe1' AND fkey_gui_id = $1";
-$v = array(Mapbender::session()->get("mb_user_id"));
-$t = array("s");
-$res = db_prep_query($sql, $v, $t);
-$cnt = 0;
-while($row = db_fetch_array($res)){
-   $e_width = $row["e_width"];
-   $e_height = $row["e_height"];
-   $cnt++;
-}
-session_write_close();
-if($cnt > 1){ echo "alert('mapframe1: ID not unique!');";}
-echo '<script type="text/javascript">';
-echo "\n";
-echo "var mod_map1_width = '".$e_width."';\n";
-echo "var mod_map1_height = '".$e_height."';\n";
-echo "</script>\n";
-?>
-<!--
-<script type='text/javascript' src='../extensions/jquery-1.2.6.min.js'></script>
-<script type='text/javascript' src='../extensions/jquery.mousewheel.min.js'></script>
-<script type='text/javascript' src='../extensions/jqjson.js'></script>
--->
-<script type="text/javascript">
-<!--
-
-var mapTimeout;
-var	sum_delta = 0;
-var lastTimestamp;
-var lastScrollPositionX;
-var lastScrollPositionY;
-
-function init () {
-	
-	parent.eventInitMap.register(function init_mod_map1(){
-		parent.mb_registerMapObj('mapframe1', 'mapframe1', null,mod_map1_width, mod_map1_height);
-		
-		if (!parent.$.browser.msie) {
-			
-			parent.$(document, window.frames['mapframe1']).mousewheel(function (event, delta) {
-				if (sum_delta == 0) {
-					mapTimeout = setTimeout(function () {
-							lastScrollPositionX=event.pageX;
-							lastScrollPositionY=event.pageY;
-							mousewheelZoom();	
-						}, 
-						100);
-				}
-				sum_delta = sum_delta + (delta);
-				var currentTime = new Date();
-				lastTimestamp = currentTime.getTime();
-				
-				return false;
-			});
-		}
-	});
-}
-
-function mousewheelZoom () {
-	var currentTime = new Date();
-
-	if (currentTime.getTime() - lastTimestamp > 200) {
-				
-		var ind = parent.getMapObjIndexByName('mapframe1');			
-		var pos = parent.makeClickPos2RealWorldPos("mapframe1", lastScrollPositionX, lastScrollPositionY);
-				
-		if (sum_delta > 0) {
-			parent.zoom("mapframe1", true, Math.pow(parent.Mapbender.zoomMousewheel, sum_delta), pos[0],pos[1]);
-		}
-		else {
-			parent.zoom("mapframe1", false, Math.pow(parent.Mapbender.zoomMousewheel, -sum_delta), pos[0], pos[1]);
-		}
-		
-		var newPosX =  parent.parent.mb_mapObj[ind].width - lastScrollPositionX;
-		var newPosY =  parent.parent.mb_mapObj[ind].height - lastScrollPositionY;
-				
-		var posAfterZoom = parent.makeClickPos2RealWorldPos("mapframe1", newPosX, newPosY);
-		parent.zoom('mapframe1', false, 1.0, posAfterZoom[0], posAfterZoom[1]); 
-		
-		sum_delta = 0;
-		clearTimeout(mapTimeout);
-	}
-	else {
-		mapTimeout = setTimeout(function () {
-				mousewheelZoom(sum_delta);	
-			}, 
-			100);
-	}
-}
-// -->
-</script>
-</head>
-<body leftmargin='0' topmargin='0' onload="init()" bgcolor='#ffffff'>
-<div id='mapframe1' name='mapframe1' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index:2;'>
-<div id='markResult' name='maps' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index:26'> </div>
-<div id='mapframe1_maps' name='maps' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index:2;'> </div>
-<div id='highlight' style="position:absolute;top:-10px;left:-10px;width:14px;height:14px;z-index:3;visibility:visible"><img src="../img/redball.gif"/></div>
-<div id='l_right' name='l_right' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:10;visibility:hidden;background-color:#ff0000;cursor: crosshair;"></div>
-<div id='l_bottom'  name='l_bottom' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:11;visibility:hidden;background-color:#ff0000;cursor: crosshair;"></div>
-<div id='l_left' name='l_left' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:12;visibility:hidden;background-color:#ff0000;cursor: crosshair;"></div>
-<div id='l_top' name='l_top' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:13;visibility:hidden;background-color:#ff0000;cursor: crosshair;"></div>
-<div id="sandclock" style="position:absolute; top:0px; left:0px; z-index:14;"></div>
-<div id="scalebar" style="position:absolute; top:0px; left:0px; z-index:15;"></div>
-<div id="measuring" style="position:absolute; top:0px; left:0px; z-index:16; font-size:10px"></div>
-<div id="measure_display" style="position:absolute; top:0px; left:0px; z-index:17;"></div>
-<div id="copyright" style="position:absolute; top:0px; left:0px; z-index:18;"></div>
-<div id="measure_sub" style="position:absolute; top:0px; left:0px; z-index:19;"></div>
-<div id='permanent' style="position:absolute;top:-10px;left:-10px;width:14px;height:14px;z-index:13;visibility:hidden"><img src="../img/redball.gif"/></div>
-<div id="digitize_sub" style="position:absolute; top:0px; left:0px; z-index:24;"></div>
-<div id="digitize_display" style="position:absolute; top:0px; left:0px; z-index:25;"></div>
-<div id='um_title' name='um_title' style="font-family: Arial, Helvetica, sans-serif; DISPLAY:none; OVERFLOW:visible; POSITION:absolute; DISPLAY:none; BACKGROUND:#BEC1C4;border:1px solid black; z-index:98;"></div>
-<div id='um_draw' name='um_draw' style="LEFT:0px;OVERFLOW:visible;POSITION:absolute;TOP:0px;z-index:99;"></div>
-<img id='um_img' name='um_img' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; border:0;z-index:100' src='../img/transparent.gif' useMap='#um'>
-<map name='um' id='um'></map>
-</div>
-</body>
-</html>

Deleted: trunk/mapbender/http/php/mod_mapOV.php
===================================================================
--- trunk/mapbender/http/php/mod_mapOV.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/php/mod_mapOV.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -1,149 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/Administration
-# Copyright (C) 2002 CCGIS 
-#
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# 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.
-
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-
-if(isset($_REQUEST["wms"])){
-	$rank = $_REQUEST["wms"];
-}
-else{
-	$rank = 0;
-}
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-<title>mod_mapOV0.php</title>
-<?php
-include '../include/dyn_css.php';
-?>
-<?php
-$gui_id = Mapbender::session()->get("mb_user_gui");
-$sql = "SELECT e_width,e_height, e_target FROM gui_element WHERE e_id = 'overview' AND fkey_gui_id = $1";
-$v = array($gui_id);
-$t = array("s");
-$res = db_prep_query($sql, $v, $t);
-$cnt = 0;
-echo "<script type='text/javascript'>";
-while($row = db_fetch_array($res)){ 
-   echo "var mod_overview_width = " . $row["e_width"].";";
-   echo "var mod_overview_height = " . $row["e_height"].";";
-   echo "var mod_overview_target = '" . $row["e_target"]."';";
-   $cnt++;
-}
-echo "var mod_overview_rank = ".$rank.";";
-if($cnt > 1){ echo "alert('overview: ID not unique!');";}
-echo "</script>";
-?>
-<script type="text/javascript">
-<!--
-
-function init () {
-	parent.eventInitMap.register(function init_mod_mapOV(){
-		parent.mb_registerMapObj('overview', 'overview', mod_overview_rank, mod_overview_width, mod_overview_height);
-		document.onmouseover = mod_ov_setHandler;
-		document.onmousedown = parent.mod_box_start;
-		document.onmouseup = mod_ov_getExtent;
-		document.onmousemove = parent.mod_box_run;
-		
-		var ind = parent.getMapObjIndexByName('overview');
-		var ov_extent = parent.mb_mapObj[ind].getExtentInfos();
-		parent.mb_mapObj[ind].isOverview = true;
-	});
-}
-function mod_ov_setHandler(e){
-   parent.mb_isBF = "overview";
-   parent.mb_zF = mod_overview_target;
-}
-function mod_ov_getExtent(e){
-	mod_ov_setValidClipping(parent.mod_box_stop(e));
-}
-parent.mb_registerSubFunctions("window.frames['overview'].mod_ov_showMapExtent()");
-function mod_ov_showMapExtent(){
-	for(var i=0; i<parent.mb_mapObj.length; i++){
-		if(parent.mb_mapObj[i].frameName == mod_overview_target){
-			var arrayBBox = parent.mb_mapObj[i].extent.toString().split(",");
-			var minX = parseFloat(arrayBBox[0]);
-			var minY = parseFloat(arrayBBox[1]);
-			var maxX = parseFloat(arrayBBox[2]);
-			var maxY = parseFloat(arrayBBox[3]);
-			var ind = parent.getMapObjIndexByName(mod_overview_target);
-			var pointMin = parent.mb_mapObj[ind].convertRealToPixel(new parent.Point(minX, maxY)); 
-			var pointMax = parent.mb_mapObj[ind].convertRealToPixel(new parent.Point(maxX, minY)); 
-			var px1 = pointMin.x;
-			var py1 = pointMin.y;
-			var px2 = pointMax.x;
-			var py2 = pointMax.y;
-
-		parent.mb_isBF = "overview";
-		parent.mb_zF = mod_overview_target;
-		while((px2 - px1) < 8){
-			px1 -= 1;
-			px2 += 1;
-		}
-		while((py2 - py1) < 8){
-			py1 -= 1;
-			py2 += 1;
-		}
-		if(px1 < 0){px1 = 1;}
-		if(px1 > mod_overview_width){px1 = mod_overview_width-1;}
-
-		if(py1 < 0){py1 = 1;}
-		if(py1 > mod_overview_height){py1 = mod_overview_height-1;}
-
-		if(px2 > mod_overview_width){px2 = mod_overview_width-1;}
-		if(px2 < 0){px2 = 1;}
-
-		if(py2 > mod_overview_height){py2 = mod_overview_height-1;}
-		if(py2 < 0){py2 = 1;}
-
-		parent.mb_drawBox(px1,py1,px2,py2);
-		}
-	}
-}
-function mod_ov_setValidClipping(coords){
-	if(coords.length > 2){
-		parent.mb_calculateExtent(parent.mb_zF,coords[0],coords[1],coords[2],coords[3]);
-		parent.setMapRequest(parent.mb_zF);
-	}
-	else{
-		parent.zoom(parent.mb_zF,true,1.0,coords[0], coords[1]);
-	}
-}
-// -->
-</script>
-</head>
-<body leftmargin='0' topmargin='0' onload="init()"  bgcolor='#ffffff'>
-<div id='overview' name='overview' style =' position:absolute;left:0px;top:0px;width:0px;height:0px;' >
-<div id='overview_maps' name='maps' style =' position:absolute;left:0px;top:0px;width:0px;height:0px;' ></div>
-<div id='l_top' name='l_top' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:11;visibility:hidden;background-color:red;cursor: crosshair;"></div>
-<div id='l_right' name='l_right' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:12;visibility:hidden;background-color:red;cursor: crosshair;"></div>
-<div id='l_bottom'  name='l_bottom' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:13;visibility:hidden;background-color:red;cursor: crosshair;"></div>
-<div id='l_left' name='l_left' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:14;visibility:hidden;background-color:red;cursor: crosshair;"></div>
-<div id='highlight' style="position:absolute;top:-10px;left:-10px;width:14px;height:14px;z-index:3;visibility:visible"><img src="../img/redball.gif" width="14" height="14" /></div>
-</div>
-</body>
-</html>

Modified: trunk/mapbender/http/print/mod_printPDF.php
===================================================================
--- trunk/mapbender/http/print/mod_printPDF.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/http/print/mod_printPDF.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -17,6 +17,10 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
+if (!preg_match("/^[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)$/", $_REQUEST["conf"])) {
+	die;
+}
+
 require_once(dirname(__FILE__)."/../../core/globalSettings.php");
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Modified: trunk/mapbender/lib/ajax.js
===================================================================
--- trunk/mapbender/lib/ajax.js	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/lib/ajax.js	2009-07-03 15:54:57 UTC (rev 4292)
@@ -86,7 +86,7 @@
 	var getParameters = function () {
 		return {
 			"method": method,
-			"params": $.toJSON([parameters]),
+			"params": $.toJSON(parameters),
 			"id": null
 		};
 	}

Modified: trunk/mapbender/lib/ajax.php
===================================================================
--- trunk/mapbender/lib/ajax.php	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/lib/ajax.php	2009-07-03 15:54:57 UTC (rev 4292)
@@ -56,7 +56,6 @@
 			$this->method = $requestArray["method"];
 			
 			if ($requestArray["params"]) {
-				
 				$obj = $this->json->decode(stripslashes($requestArray["params"]));
 				$this->paramObject = $obj;
 			}

Modified: trunk/mapbender/lib/core.js
===================================================================
--- trunk/mapbender/lib/core.js	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/lib/core.js	2009-07-03 15:54:57 UTC (rev 4292)
@@ -1,9 +1,3 @@
-/**
- * @deprecated, use Mapbender.modules[module_id]
- */
-var mb_mapObj = [];
-
-
 var currentWmcExtensionData = {};
 var restoredWmcExtensionData = {};
 
@@ -76,11 +70,6 @@
 var eventLocalize = Mapbender.events.localize = new MapbenderEvent();
 
 /**
- * Triggered after the map object has been created. 
- */
-var eventAfterMapObjectConstruction = new MapbenderEvent(); // possibly obsolete!
-
-/**
  * Triggered after the map has been resized
  */
 var eventResizeMap = new MapbenderEvent();
@@ -125,15 +114,6 @@
  * deprecated wrapped function
  * @deprecated
  */
-function mb_registerMapObjectSubFunctions(stringFunction){
-//	mb_MapObjectSubFunctions[mb_MapObjectSubFunctions.length] = stringFunction;
-	eventAfterMapObjectConstruction.register(stringFunction);
-}
-
-/**
- * deprecated wrapped function
- * @deprecated
- */
 function mb_registerloadWmsSubFunctions(stringFunction){
 //	mb_loadWmsSubFunctions[mb_loadWmsSubFunctions.length] = stringFunction;
 	eventAfterLoadWMS.register(stringFunction);
@@ -178,9 +158,8 @@
 /**
  * Called in index.php on body onload
  */
-
 function init(){
-	new Mb_notice("old body onload init");
+	new Mb_warning("deprecated: old body onload init! Remove onload='init()' from the body element attributes.");
 }
 
 /**
@@ -188,10 +167,25 @@
  * @deprecated
  */
 function writeTag(frameName, elName, tagSource) {
-  if(frameName && frameName !== ""){
-     window.frames[frameName].document.getElementById(elName).innerHTML = tagSource;
-  }
-  else if(!frameName || frameName === ""){
-       document.getElementById(elName).innerHTML = tagSource;
-  }
+	if (frameName && frameName !== "") {
+		window.frames[frameName].document.getElementById(elName).innerHTML = tagSource;
+	}
+	else if(!frameName || frameName === ""){
+		var node = document.getElementById(elName);
+		if (node !== null) {
+		   	node.innerHTML = tagSource;
+		}
+	}
 }
+
+/**
+ * @deprecated, use Mapbender.modules[module_id]
+ */
+var mb_mapObj = [];
+
+eventAfterInit.register(function () {
+	// performs a map request for each map frame
+	for (var i = 0; i < mb_mapObj.length; i++){
+		setMapRequest(mb_mapObj[i].elementName);
+	}      	
+});

Modified: trunk/mapbender/lib/extent.js
===================================================================
--- trunk/mapbender/lib/extent.js	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/lib/extent.js	2009-07-03 15:54:57 UTC (rev 4292)
@@ -116,5 +116,4 @@
 			new Point(parseFloat(maxx), parseFloat(maxy))
 		);
 	}
-	return this;
 }

Modified: trunk/mapbender/lib/point.js
===================================================================
--- trunk/mapbender/lib/point.js	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/lib/point.js	2009-07-03 15:54:57 UTC (rev 4292)
@@ -130,48 +130,10 @@
 	var ind = getMapObjIndexByName(frameName);
 	return mb_mapObj[ind].convertRealToPixel(aPoint);
 }
+
 /**
  * @ignore
  */
-function mb_calcExtent(frameName, min, max) {
-	var ind;
-	if (typeof(mb_mapObj) == 'object') {
-		ind = getMapObjIndexByName(frameName);
-	}
-	else if (typeof(parent.mb_mapObj) == 'object') {
-		ind = parent.getMapObjIndexByName(frameName);
-	}
-	else {
-		var e = new Mb_exception('Point.mb_calcExtent: function getMapObjIndexByName not found');
-	}
-	var extent = max.minus(min);
-	var center = extent.dividedBy(2).plus(min);
-	
-	var relation_px_x = mb_mapObj[ind].width / mb_mapObj[ind].height;
-	var relation_px_y = mb_mapObj[ind].height / mb_mapObj[ind].width;
-	var relation_bbox_x = extent.x / extent.y;     
-	
-	var new_min;
-	var new_max;
-	
-	if(relation_bbox_x <= relation_px_x){                
-		new_min = new Point(center.x - relation_px_x * extent.y / 2, min.y);
-		new_max = new Point(center.x + relation_px_x * extent.y / 2, max.y);
-	}
-	else if(relation_bbox_x > relation_px_x){                
-		new_min = new Point(min.x, center.y - relation_px_y * extent.x / 2);
-		new_max = new Point(max.x, center.y + relation_px_y * extent.x / 2);
-	}
-	mb_mapObj[ind].extent = new Mapbender.Extent(
-		new_min.x,
-		new_min.y,
-		new_max.x,
-		new_max.y
-	);
-}
-/**
- * @ignore
- */
 function roundToDigits(aFloat, numberOfDigits) {
 	return Math.round(aFloat*Math.pow(10, parseInt(numberOfDigits, 10)))/Math.pow(10, parseInt(numberOfDigits, 10));
 }

Modified: trunk/mapbender/resources/db/update/update_2.7.sql
===================================================================
--- trunk/mapbender/resources/db/update/update_2.7.sql	2009-07-03 13:45:31 UTC (rev 4291)
+++ trunk/mapbender/resources/db/update/update_2.7.sql	2009-07-03 15:54:57 UTC (rev 4292)
@@ -86,4 +86,13 @@
 UPDATE gui_element SET e_attributes = '' WHERE e_id = 'body';
 
 -- mapframe layers are now added dynamically by the modules
-UPDATE gui_element SET e_content = '' WHERE e_id = 'mapframe1';
\ No newline at end of file
+UPDATE gui_element SET e_content = '' WHERE e_id = 'mapframe1';
+
+-- file extension is now .js
+UPDATE gui_element SET e_js_file = 'mod_log.js' WHERE e_id = 'log';
+
+-- file extension is now .js
+UPDATE gui_element SET e_js_file = 'mod_resize_mapsize.js' WHERE e_id = 'resizeMapsize';
+
+-- file extension is now .js
+UPDATE gui_element SET e_js_file = 'mod_sandclock.js' WHERE e_id = 'sandclock';



More information about the Mapbender_commits mailing list