[Mapbender-commits] r2739 - in trunk/mapbender: conf core http/classes http/css http/frames http/html http/javascripts http/php http/print lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Aug 5 07:54:59 EDT 2008


Author: christoph
Date: 2008-08-05 07:54:58 -0400 (Tue, 05 Aug 2008)
New Revision: 2739

Modified:
   trunk/mapbender/conf/session.conf
   trunk/mapbender/core/globalSettings.php
   trunk/mapbender/core/i18n.php
   trunk/mapbender/http/classes/class_kml.php
   trunk/mapbender/http/classes/class_locale.php
   trunk/mapbender/http/classes/class_map.php
   trunk/mapbender/http/classes/class_wmc.php
   trunk/mapbender/http/classes/class_wmcToXml.php
   trunk/mapbender/http/classes/class_wms.php
   trunk/mapbender/http/css/administration_alloc.css
   trunk/mapbender/http/frames/index.php
   trunk/mapbender/http/frames/login.php
   trunk/mapbender/http/html/mod_treefolder2.php
   trunk/mapbender/http/javascripts/geometry.js
   trunk/mapbender/http/javascripts/map.js
   trunk/mapbender/http/javascripts/map.php
   trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList_ajax.php
   trunk/mapbender/http/javascripts/mod_loadwmc.php
   trunk/mapbender/http/javascripts/mod_savewmc.php
   trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
   trunk/mapbender/http/javascripts/wfs.js
   trunk/mapbender/http/php/mod_editGuiWms.php
   trunk/mapbender/http/php/mod_loadCapabilitiesList.php
   trunk/mapbender/http/php/mod_map1.php
   trunk/mapbender/http/php/mod_mapOV.php
   trunk/mapbender/http/php/mod_wfs_gazetteer_server.php
   trunk/mapbender/http/php/mod_wfs_server.php
   trunk/mapbender/http/print/mod_printPDF_pdf.php
   trunk/mapbender/http/print/printPDF.conf
   trunk/mapbender/http/print/printPDF_b.conf
   trunk/mapbender/lib/core.js
   trunk/mapbender/lib/database-mysql.php
Log:
merged with project

Modified: trunk/mapbender/conf/session.conf
===================================================================
--- trunk/mapbender/conf/session.conf	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/conf/session.conf	2008-08-05 11:54:58 UTC (rev 2739)
@@ -8,6 +8,18 @@
 $_SESSION["mb_myPOI"] = $_REQUEST["mb_myPOI"];
 $_SESSION["mb_myPOI2SCALE"] = $_REQUEST["mb_myPOI2SCALE"];
 
+$_SESSION["mb_lang"] = $_REQUEST["lang"];
+
+$_SESSION["command"] = strtoupper($_REQUEST["COMMAND"]);
+
+$i = 1;
+$_SESSION["wms"] = array();
+while ($_REQUEST["wms".$i]) {
+	array_push($_SESSION["wms"], urldecode($_REQUEST["wms".$i]));
+	$i++;
+}
+unset($i);
+
 $_SESSION["mb_myWmc"] = "";
 $_SESSION["mb_myWmc_action"] = "";
 if ($_REQUEST["wmc_id"]) {
@@ -22,4 +34,4 @@
 	$_SESSION["mb_myWmc"] = $_REQUEST["append_wmc_id"];
 	$_SESSION["mb_myWmc_action"] = "append";
 }
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/core/globalSettings.php
===================================================================
--- trunk/mapbender/core/globalSettings.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/core/globalSettings.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -63,5 +63,4 @@
 //
 $con = db_connect($DBSERVER, $OWNER, $PW);
 db_select_db(DB, $con);
-
 ?>

Modified: trunk/mapbender/core/i18n.php
===================================================================
--- trunk/mapbender/core/i18n.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/core/i18n.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -18,8 +18,9 @@
 
 	function _mb ($someString) {
 		if (USE_I18N) {
+//			$e = new mb_notice("Translating '" . $someString . "' to language " . $_SESSION["mb_locale"] . ": '" . _($someString) . "'");
 			return _($someString);
 		}
 		return $someString;
 	}
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/http/classes/class_kml.php
===================================================================
--- trunk/mapbender/http/classes/class_kml.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/classes/class_kml.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -16,6 +16,7 @@
 # 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__)."/../../core/globalSettings.php");
 
 class kml {

Modified: trunk/mapbender/http/classes/class_locale.php
===================================================================
--- trunk/mapbender/http/classes/class_locale.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/classes/class_locale.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -100,14 +100,16 @@
 				}
 				
 				$locale = $this->systemLocales[$this->knownLanguages[$languageId]][$this->os];				
-				if (setlocale(LC_ALL, $locale)) {
-					$this->name = $locale;
+				$selectedLocale = setlocale(LC_MESSAGES, $locale);
+				if ($selectedLocale) {
+					$this->name = $selectedLocale;
 					$_SESSION["mb_lang"] = $languageId;
 					$_SESSION["mb_locale"] = $this->name;
 					$e = new Mb_notice("locale " . $this->name . " ok on " . $this->os);
 					// from http://de3.php.net/manual/de/function.gettext.php
-					bindtextdomain("Mapbender", dirname(__FILE__)."/../../resources/locale/");
-					textdomain("Mapbender");
+					$path = bindtextdomain("Mapbender", dirname(__FILE__)."/../../resources/locale/");
+					$enc = bind_textdomain_codeset("Mapbender", "UTF-8");
+					$dom = textdomain("Mapbender");
 					return true;
 				}
 			}
@@ -133,7 +135,7 @@
 	  else if (strncasecmp(php_uname(), 'FreeBSD', 7) == 0)
 	    return 'bsd';  
 	  else {
-	    throw new Mb_exception('unknown platform: could not interpret uname. php_uname() returned '. php_uname().'. Please report to MB developers');
+	    $e = new mb_exception('unknown platform: could not interpret uname. php_uname() returned '. php_uname().'. Please report to MB developers');
 	    return null;
 	  }
 	}

Modified: trunk/mapbender/http/classes/class_map.php
===================================================================
--- trunk/mapbender/http/classes/class_map.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/classes/class_map.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -380,7 +380,7 @@
 	private static function selectByApplication ($appId, $frameName) {
 		// find the mapframe in the application elements...
 		$sql = "SELECT * FROM gui_element WHERE fkey_gui_id = $1 AND " . 
-				"e_id = $2 LIMIT 1";
+				"e_id = $2 AND e_public = 1 LIMIT 1";
 		$v = array($appId, $frameName);
 		$t = array('s', 's');
 		$res = db_prep_query($sql,$v,$t);
@@ -408,7 +408,7 @@
 //				$e = new mb_exception("guess this is the OV");
 				$pattern = "/[\.\/a-zA-Z_]*\?wms=([0-9]*)[^0-9]*/";
 				$ovIndex = preg_replace($pattern, "\$1", $row["e_src"]);
-				$e = new mb_exception("OV index: " . $ovIndex);
+//				$e = new mb_exception("OV index: " . $ovIndex);
 				if (!$ovIndex) {
 					$ovIndex = 0;
 				}
@@ -421,8 +421,14 @@
 
 			$currentMap->wmsArray = $wmsArray;
 			
-			// TO DO: EXTENT!
-			
+			// EXTENT
+			$minx = $wmsArray[0]->objLayer[0]->layer_epsg[0]["minx"];
+			$miny = $wmsArray[0]->objLayer[0]->layer_epsg[0]["miny"];
+			$maxx = $wmsArray[0]->objLayer[0]->layer_epsg[0]["maxx"];
+			$maxy = $wmsArray[0]->objLayer[0]->layer_epsg[0]["maxy"];
+			$epsg = $wmsArray[0]->objLayer[0]->layer_epsg[0]["epsg"];
+			$mapExtent = new Mapbender_bbox($minx, $miny, $maxx, $maxy, $epsg);
+			$currentMap->setExtent($mapExtent);
 			return $currentMap;			
 		}
 		else {
@@ -432,4 +438,4 @@
 	
 
 }
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/http/classes/class_wmc.php
===================================================================
--- trunk/mapbender/http/classes/class_wmc.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/classes/class_wmc.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -153,6 +153,8 @@
 		// get the map objects "overview" and "mapframe1"
 		$this->mainMap = map::selectMainMapByApplication($appId);
 		$this->overviewMap = map::selectOverviewMapByApplication($appId);
+		$this->createXml();
+		$this->saveAsFile();
 	}
 
 	/**
@@ -379,7 +381,7 @@
 			array_push($wmcJsArray, "setMapRequest('" . $this->overviewMap->getFrameName() . "');");
 		}
 
-		array_push($wmcJsArray, "eventAfterLoadWMS.trigger()");
+		array_push($wmcJsArray, "eventAfterLoadWMS.trigger();");
 		return $wmcJsArray;
 	}
 	
@@ -420,6 +422,23 @@
 		}
 	}
 
+	/**
+	 * Adds a WMS to this WMC
+	 * 
+	 * @return 
+	 */
+	public function appendWmsArray ($wmsArray) {
+		return $this->mainMap->appendWmsArray($wmsArray);
+	}
+	
+	/**
+	 * Merges a WMS into this WMC
+	 * 
+	 * @return 
+	 */
+	public function mergeWmsArray ($wmsArray) {
+		$this->mainMap->mergeWmsArray($wmsArray);
+	}
 
 // ---------------------------------------------------------------------------
 // private functions
@@ -763,7 +782,19 @@
 							$extension = false;
 						}
 						if ($extension == true){
-							$currentLayer["extension"][$tag] = $value;
+							if ($value !== "") {
+								if (isset($currentLayer["extension"][$tag])) {
+									if (!is_array($currentLayer["extension"][$tag])) {
+										$firstValue = $currentLayer["extension"][$tag];
+										$currentLayer["extension"][$tag] = array();
+										array_push($currentLayer["extension"][$tag], $firstValue);
+									}	
+									array_push($currentLayer["extension"][$tag], $value);
+								}
+								else {
+									$currentLayer["extension"][$tag] = $value;									
+								}
+							}
 						}
 						if ($tag == "EXTENSION" && $type == "open") {
 							$currentLayer["extension"] = array();
@@ -893,7 +924,6 @@
 			$wms->wms_getfeatureinfo = $currentLayer["url"]; // TODO : Add correct data
 			
 			$styleIndex = $currentLayer["styleIndex"];
-			$e = new mb_notice("StyleIndex: " . $styleIndex);
 			$wms->wms_getlegendurl = $currentLayer["style"][$styleIndex]["legendurl"];
 
 			$wms->wms_filter = ""; // TODO : Add correct data
@@ -935,6 +965,38 @@
 			$wms->objLayer[0]->gui_layer_minscale = 0;
 			$wms->objLayer[0]->gui_layer_maxscale = 0;
 
+			// layer epsg
+			if ($currentLayer["extension"]["EPSG"]) {
+				$layerEpsgArray = array();
+				$layerMinXArray = array();
+				$layerMinYArray = array();
+				$layerMaxXArray = array();
+				$layerMaxYArray = array();
+				if (!is_array($currentLayer["extension"]["EPSG"])) {
+					$layerEpsgArray[0] = $currentLayer["extension"]["EPSG"];
+					$layerMinXArray[0] = $currentLayer["extension"]["MINX"];
+					$layerMinYArray[0] = $currentLayer["extension"]["MINY"];
+					$layerMaxXArray[0] = $currentLayer["extension"]["MAXX"];
+					$layerMaxYArray[0] = $currentLayer["extension"]["MAXY"];
+				}
+				else {
+					$layerEpsgArray = $currentLayer["extension"]["EPSG"];
+					$layerMinXArray = $currentLayer["extension"]["MINX"];
+					$layerMinYArray = $currentLayer["extension"]["MINY"];
+					$layerMaxXArray = $currentLayer["extension"]["MAXX"];
+					$layerMaxYArray = $currentLayer["extension"]["MAXY"];
+				}
+	
+				for ($i=0; $i < count($layerEpsgArray); $i++) {
+					$currentLayerEpsg = array();
+					$currentLayerEpsg["epsg"] = $layerEpsgArray[$i];
+					$currentLayerEpsg["minx"] = floatval($layerMinXArray[$i]);
+					$currentLayerEpsg["miny"] = floatval($layerMinYArray[$i]); 
+					$currentLayerEpsg["maxx"] = floatval($layerMaxXArray[$i]);
+					$currentLayerEpsg["maxy"] = floatval($layerMaxYArray[$i]);
+					array_push($wms->objLayer[0]->layer_epsg, $currentLayerEpsg);
+				}
+			}			
 			// add WMS
 			array_push($wmsArray, $wms);
 
@@ -999,7 +1061,7 @@
  * @deprecated
  */
 function mb_utf8_encode ($str) {
-	if(CHARSET=="UTF-8") return utf8_encode($str);
+//	if(CHARSET=="UTF-8") return utf8_encode($str);
 	return $str;
 }
 
@@ -1007,7 +1069,7 @@
  * @deprecated
  */
 function mb_utf8_decode ($str) {
-	if(CHARSET=="UTF-8") return utf8_decode($str);
+//	if(CHARSET=="UTF-8") return utf8_decode($str);
 	return $str;
 }
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/http/classes/class_wmcToXml.php
===================================================================
--- trunk/mapbender/http/classes/class_wmcToXml.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/classes/class_wmcToXml.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -108,17 +108,22 @@
 	}
 
 	private function createGeneralNode () {
+		$extensionData = array();
 		if ($this->wmc->overviewMap !== null) {
 			$ovExtent = $this->wmc->overviewMap->getExtent();
-			$extensionData->ov_minx = $ovExtent->min->x;
-			$extensionData->ov_miny = $ovExtent->min->y;
-			$extensionData->ov_maxx = $ovExtent->max->x;
-			$extensionData->ov_maxy = $ovExtent->max->y;
-			$extensionData->ov_srs = $ovExtent->epsg;
-			$extensionData->ov_framename = $this->wmc->overviewMap->getFrameName();
-			$extensionData->ov_width = $this->wmc->overviewMap->getWidth();
-			$extensionData->ov_height = $this->wmc->overviewMap->getHeight();
+			$extensionData["ov_minx"] = $ovExtent->min->x;
+			$extensionData["ov_miny"] = $ovExtent->min->y;
+			$extensionData["ov_maxx"] = $ovExtent->max->x;
+			$extensionData["ov_maxy"] = $ovExtent->max->y;
+			$extensionData["ov_srs"] = $ovExtent->epsg;
+			$extensionData["ov_framename"] = $this->wmc->overviewMap->getFrameName();
+			$extensionData["ov_width"] = $this->wmc->overviewMap->getWidth();
+			$extensionData["ov_height"] = $this->wmc->overviewMap->getHeight();
 		}
+		
+		if ($this->wmc->mainMap !== null) {
+			$extensionData["main_framename"] = $this->wmc->mainMap->getFrameName();
+		}
 				
 		// General
 		$e_general = $this->doc->createElement("General");
@@ -364,6 +369,8 @@
 		$layerExtensionData["gui_selectable"] = $currentLayer->gui_layer_selectable;
 		$layerExtensionData["gui_queryable"] = $currentLayer->gui_layer_queryable;
 		$layerExtensionData["gui_status"] = $currentLayer->gui_layer_status;
+		$layerExtensionData["layer_epsg"] = $currentLayer->layer_epsg;
+		
 		if ($currentMap->isOverview()) {
 			$layerExtensionData["isOverviewLayer"] = 1;
 		}
@@ -375,7 +382,7 @@
 			$e_extension = $this->doc->createElement("Extension");
 			
 			foreach ($layerExtensionData as $keyExtensionData => $valueExtensionData) {
-				$e_currentExtensionTag = $this->doc->createElement($this->wmc->extensionNamespace.":".$keyExtensionData, $valueExtensionData);
+				$e_currentExtensionTag = $this->addExtension($keyExtensionData, $valueExtensionData);
 				$e_extension->appendChild($e_currentExtensionTag);
 			}
 			return $e_extension;
@@ -383,6 +390,23 @@
 		return null;
 	}
 	
+	private function addExtension ($key, $value) {
+		if (is_array($value)) {
+			if (is_numeric($key)) {
+				$key = "data" . $key;
+			}
+			$e_currentExtensionTag = $this->doc->createElement($this->wmc->extensionNamespace.":".$key);
+			foreach ($value as $childKey => $childValue) {
+				$newNode = $this->addExtension($childKey, $childValue);
+				$e_currentExtensionTag->appendChild($newNode);
+			}
+		}
+		else {
+			$e_currentExtensionTag = $this->doc->createElement($this->wmc->extensionNamespace.":".$key, $value);
+		}
+		return $e_currentExtensionTag;
+	}
+	
 	private function createLayerStyleNode ($currentWms, $currentLayer) {
 		$e_layer_stylelist = $this->doc->createElement("StyleList");
 		
@@ -533,4 +557,4 @@
 	}
 
 }
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/classes/class_wms.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -621,13 +621,13 @@
 		if(!$this->wms_title || $this->wms_title == "" || !$this->wms_getmap || $this->wms_getmap == ""){
 			$this->wms_status = false;
 			$this->optimizeWMS();
-			
+			$e = new mb_exception("class_wms: createObjFromXML: WMS " . $url . " could not be loaded.");
 			return false;
 		}
 		else{
 			$this->wms_status = true;
 			$this->optimizeWMS();
-
+			$e = new mb_notice("class_wms: createObjFromXML: WMS " . $url . " has been loaded successfully.");
 			return true;
 		}
 	}
@@ -853,19 +853,40 @@
 		}
 		$newLayer->layer_abstract = $currentLayer["abstract"];
 
-
 		//
 		// set layer epsg
 		//
 		$newLayer->layer_epsg = array();
-		if ($currentExtent !== null) {
-			$currentLayerEpsg = array();
-			$currentLayerEpsg["epsg"] = $currentExtent->epsg;
-			$currentLayerEpsg["minx"] = $currentExtent->min->x;
-			$currentLayerEpsg["miny"] = $currentExtent->min->y; 
-			$currentLayerEpsg["maxx"] = $currentExtent->max->x;
-			$currentLayerEpsg["maxy"] = $currentExtent->max->y;
-			array_push($newLayer->layer_epsg, $currentLayerEpsg);
+		if ($currentLayer["extension"]["EPSG"]) {
+			$layerEpsgArray = array();
+			$layerMinXArray = array();
+			$layerMinYArray = array();
+			$layerMaxXArray = array();
+			$layerMaxYArray = array();
+			if (!is_array($currentLayer["extension"]["EPSG"])) {
+				$layerEpsgArray[0] = $currentLayer["extension"]["EPSG"];
+				$layerMinXArray[0] = $currentLayer["extension"]["MINX"];
+				$layerMinYArray[0] = $currentLayer["extension"]["MINY"];
+				$layerMaxXArray[0] = $currentLayer["extension"]["MAXX"];
+				$layerMaxYArray[0] = $currentLayer["extension"]["MAXY"];
+			}
+			else {
+				$layerEpsgArray = $currentLayer["extension"]["EPSG"];
+				$layerMinXArray = $currentLayer["extension"]["MINX"];
+				$layerMinYArray = $currentLayer["extension"]["MINY"];
+				$layerMaxXArray = $currentLayer["extension"]["MAXX"];
+				$layerMaxYArray = $currentLayer["extension"]["MAXY"];
+			}
+
+			for ($i=0; $i < count($layerEpsgArray); $i++) {
+				$currentLayerEpsg = array();
+				$currentLayerEpsg["epsg"] = $layerEpsgArray[$i];
+				$currentLayerEpsg["minx"] = floatval($layerMinXArray[$i]);
+				$currentLayerEpsg["miny"] = floatval($layerMinYArray[$i]); 
+				$currentLayerEpsg["maxx"] = floatval($layerMaxXArray[$i]);
+				$currentLayerEpsg["maxy"] = floatval($layerMaxYArray[$i]);
+				array_push($newLayer->layer_epsg, $currentLayerEpsg);
+			}
 		}
 
 
@@ -2162,4 +2183,4 @@
 	}
 	
 }
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/http/css/administration_alloc.css
===================================================================
--- trunk/mapbender/http/css/administration_alloc.css	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/css/administration_alloc.css	2008-08-05 11:54:58 UTC (rev 2739)
@@ -1,16 +1,28 @@
 body{
 	background-color : #ffffff;
-	font-family: Arial, Helvetica, sans-serif;
+	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
 }
 select {
 	font-size: 11;
-	font-family: "Times New Roman", Times, serif;
+	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
 	width: 200px;
 	font-weight : bold;
 }
 .select_short{
 	width: auto;
 }
+table{
+	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
+	font-size:11;
+}   
+
+.wms_button{
+	color: black;
+	border: solid thin;
+	height:22px;
+	width:60px;
+}
+
 checkbox{
 	background-color : #0066ff; 
 }
@@ -93,4 +105,4 @@
 	left: auto;
 	color : Red;
 	font-size : 13;
-}
\ No newline at end of file
+}

Modified: trunk/mapbender/http/frames/index.php
===================================================================
--- trunk/mapbender/http/frames/index.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/frames/index.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -30,6 +30,7 @@
 //
 if (!in_array($gui_id, $_SESSION["mb_user_guis"])) {
 	$e = new mb_exception("mb_validateSession.php: User: " . $_SESSION["mb_user_id"] . " not allowed to access GUI " . $gui_id);
+	session_write_close();
 	header("Location: ".LOGIN);
 	die();
 }
@@ -77,6 +78,8 @@
 <?php
 $currentApplication = new gui($gui_id);
 echo $currentApplication->toHtml();
-echo "<script type='text/javascript' src='../javascripts/map.php?".$urlParameters."&mb_myBBOX=".$_REQUEST["mb_myBBOX"]."'></script>";
+$mapPhpParameters = $urlParameters."&mb_myBBOX=".$_REQUEST["mb_myBBOX"];
+echo "<script type='text/javascript' src='../javascripts/map.php?".$mapPhpParameters."'></script>";
+
 ?>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/mapbender/http/frames/login.php
===================================================================
--- trunk/mapbender/http/frames/login.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/frames/login.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -171,6 +171,7 @@
 				if(isset($_REQUEST["mb_myBBOX"])){
 					$myURL .= "&mb_myBBOX=".$_REQUEST["mb_myBBOX"];
 				}
+				session_write_close();
 				header ($myURL);
 				exit;
 			}

Modified: trunk/mapbender/http/html/mod_treefolder2.php
===================================================================
--- trunk/mapbender/http/html/mod_treefolder2.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/html/mod_treefolder2.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -1,610 +1,620 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/Mod_treefolder2.php
-# Copyright (C) 2007 Melchior Moos
-#
-# 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.
-
-$gui_id = $_SESSION["mb_user_gui"];
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
-?>
-<TITLE>Treefolder</TITLE>
-<?php
- include '../include/dyn_css.php';
-?>
-<script language='JavaScript'>
-
-function openwindow(Adresse) {
-Fenster1 = window.open(Adresse, "Informationen", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
-Fenster1.focus();
-}
-</script>
-<script src="../javascripts/jsTree.js" type="text/javascript" language="JavaScript"></script>
-<?php
-echo "<script language='JavaScript'>";
-   $sql = "SELECT e_target FROM gui_element WHERE e_id = $1 AND fkey_gui_id = $2";
-   $v = array($_REQUEST['e_id_css'],$_SESSION["mb_user_gui"]);
-   $t = array('s','s');
-   $res = db_prep_query($sql,$v,$t);
-   $e_target = db_result($res,0,"e_target");
-   echo "mod_treeGDE_map = '".$e_target."';";
-echo "</script>";
-?>
-<SCRIPT language="JavaScript" type="text/javascript">
-
-var jst_container = "document.getElementById('treeContainer')";
-var jst_image_folder = imagedir;
-var jst_display_root = false;
-var defaultTarget = 'examplemain';
-var lock=false;
-var lock_update=false;
-var lock_check=false;
-var selectedMap=-1;
-var selectedWMS=-1;
-var selectedLayer=-1;
-var init=false;
-var errors = 0;
-var state=Array();
-var treeState = "";
-var arrNodes =
-[
-	['root_id', ['Layer','javascript:_foo()']
-
-	]
-];
-function _foo(){}
-
-// some defaults
-try{if (reverse){}}catch(e){reverse = 'false';}
-try{if (switchwms){}}catch(e){switchwms = 'true';}
-try{if (ficheckbox){}}catch(e){ficheckbox = 'false';}
-try{if (metadatalink){}}catch(e){metadatalink = 'false';}
-try{if (wmsbuttons){}}catch(e){wmsbuttons = 'false';}
-try{if (showstatus){}}catch(e){showstatus = 'false';}
-try{if (alerterror){}}catch(e){alerterror = 'false';}
-try{if (openfolder){}}catch(e){openfolder = 'false';}
-try{if (handlesublayer){}}catch(e){handlesublayer = 'false';}
-try{if (menu){}}catch(e){menu = '';}
-try {
-	if (redirectToMetadataUrl) {
-		if (redirectToMetadataUrl == "false") {
-			redirectToMetadataUrl = false;
-		}
-		else {
-			redirectToMetadataUrl = true;
-		}
-	}
-}
-catch (e) {
-	var redirectToMetadataUrl = true;
-}
-var defaultMetadataUrl = '../php/mod_layerMetadata.php?';
-if (redirectToMetadataUrl) {
-	defaultMetadataUrl += 'redirectToMetadataUrl=1';
-}
-else {
-	defaultMetadataUrl += 'redirectToMetadataUrl=0';
-}
-
-//menu elements
-var menu_move_up = ['menu_move_up', ['Move up&nbsp;','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];move_up(ids[0],ids[1],ids[2]);',,'move_up.png']];
-var menu_move_down = ['menu_move_down', ['Move down&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];move_down(ids[0],ids[1],ids[2]);',,'move_down.png']];
-var menu_delete = ['menu_delete', ['Remove&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];remove_wms(ids[0],ids[1],ids[2]);',,'delete_wms.png']];
-var menu_opacity_up = ['menu_opacity_up', ['Opacity up&nbsp;','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_up(ids[0],ids[1],ids[2]);',,'move_up.png']];
-var menu_opacity_down = ['menu_opacity_down', ['Opacity down&nbsp;','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_down(ids[0],ids[1],ids[2]);',,'move_down.png']];
-var menu_metalink = ['menu_metalink', ['Information&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[ids[0]].wms[ids[1]].objLayer[ids[2]].layer_uid);',,'info.png']];
-var menu_zoom = ['menu_zoom', ['Zoom&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];zoomToLayer(ids[0],ids[1],ids[2]);',,'zoom.png']];
-var menu_hide = ['menu_hide', ['Hide menu&nbsp;', 'javascript:hideMenu()',,'hide.png']];
-//var menu_wms_switch = ['menu_zoom', ['Zoom&nbsp;', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
-//var menu_layer_switch = ['menu_zoom', ['Zjjj&nbsp;', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
-//var menu_info_switch = ['menu_zoom', ['Zmn&nbsp;', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
-
-parent.eventAfterLoadWMS.register(reloadTree);
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/Mod_treefolder2.php
+# Copyright (C) 2007 Melchior Moos
+#
+# 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");
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<TITLE>Treefolder</TITLE>
+<?php
+ include '../include/dyn_css.php';
+?>
+<script language='JavaScript'>
+
+function openwindow(Adresse) {
+Fenster1 = window.open(Adresse, "Informationen", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
+Fenster1.focus();
+}
+</script>
+<script src="../javascripts/jsTree.js" type="text/javascript" language="JavaScript"></script>
+<?php
+echo "<script language='JavaScript'>";
+   $sql = "SELECT e_target FROM gui_element WHERE e_id = $1 AND fkey_gui_id = $2";
+   $v = array($_REQUEST['e_id_css'],$_SESSION["mb_user_gui"]);
+   $t = array('s','s');
+   $res = db_prep_query($sql,$v,$t);
+   $e_target = db_result($res,0,"e_target");
+   echo "mod_treeGDE_map = '".$e_target."';";
+echo "</script>";
+session_write_close();
+?>
+<SCRIPT language="JavaScript" type="text/javascript">
+
+var msgObj = {};
+msgObj.tooltipHandleWms = '<?php echo _mb("(De)activate this service");?>';
+msgObj.tooltipLayerVisible = '<?php echo _mb("Toggles the visibility of this service");?>';
+msgObj.tooltipLayerQuerylayer = '<?php echo _mb("Toggles the queryability of this service");?>';
+msgObj.tooltipLayerContextMenu = '<?php echo _mb("Opens the layer context menu");?>';
+msgObj.tooltipWmsContextMenu = '<?php echo _mb("Opens the WMS context menu");?>';
+msgObj.tooltipRemoveWms = '<?php echo _mb("Removes the selected WMS");?>';
+msgObj.tooltipMoveSelectionUp = '<?php echo _mb("Moves the selection up");?>';
+msgObj.tooltipMoveSelectionDown = '<?php echo _mb("Moves the selection down");?>';
+
+var jst_container = "document.getElementById('treeContainer')";
+var jst_image_folder = imagedir;
+var jst_display_root = false;
+var defaultTarget = 'examplemain';
+var lock=false;
+var lock_update=false;
+var lock_check=false;
+var selectedMap=-1;
+var selectedWMS=-1;
+var selectedLayer=-1;
+var init=false;
+var errors = 0;
+var state=Array();
+var treeState = "";
+var arrNodes =
+[
+	['root_id', ['Layer','javascript:_foo()']
+
+	]
+];
+function _foo(){}
+
+// some defaults
+try{if (reverse){}}catch(e){reverse = 'false';}
+try{if (switchwms){}}catch(e){switchwms = 'true';}
+try{if (ficheckbox){}}catch(e){ficheckbox = 'false';}
+try{if (metadatalink){}}catch(e){metadatalink = 'false';}
+try{if (wmsbuttons){}}catch(e){wmsbuttons = 'false';}
+try{if (showstatus){}}catch(e){showstatus = 'false';}
+try{if (alerterror){}}catch(e){alerterror = 'false';}
+try{if (openfolder){}}catch(e){openfolder = 'false';}
+try{if (handlesublayer){}}catch(e){handlesublayer = 'false';}
+try{if (menu){}}catch(e){menu = '';}
+try {
+	if (redirectToMetadataUrl) {
+		if (redirectToMetadataUrl == "false") {
+			redirectToMetadataUrl = false;
+		}
+		else {
+			redirectToMetadataUrl = true;
+		}
+	}
+}
+catch (e) {
+	var redirectToMetadataUrl = true;
+}
+var defaultMetadataUrl = '../php/mod_layerMetadata.php?';
+if (redirectToMetadataUrl) {
+	defaultMetadataUrl += 'redirectToMetadataUrl=1';
+}
+else {
+	defaultMetadataUrl += 'redirectToMetadataUrl=0';
+}
+
+//menu elements
+var menu_move_up = ['menu_move_up', ['Move up&nbsp;','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];move_up(ids[0],ids[1],ids[2]);',,'move_up.png']];
+var menu_move_down = ['menu_move_down', ['Move down&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];move_down(ids[0],ids[1],ids[2]);',,'move_down.png']];
+var menu_delete = ['menu_delete', ['Remove&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];remove_wms(ids[0],ids[1],ids[2]);',,'delete_wms.png']];
+var menu_opacity_up = ['menu_opacity_up', ['Opacity up&nbsp;','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_up(ids[0],ids[1],ids[2]);',,'move_up.png']];
+var menu_opacity_down = ['menu_opacity_down', ['Opacity down&nbsp;','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_down(ids[0],ids[1],ids[2]);',,'move_down.png']];
+var menu_metalink = ['menu_metalink', ['Information&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[ids[0]].wms[ids[1]].objLayer[ids[2]].layer_uid);',,'info.png']];
+var menu_zoom = ['menu_zoom', ['Zoom&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];zoomToLayer(ids[0],ids[1],ids[2]);',,'zoom.png']];
+var menu_hide = ['menu_hide', ['Hide menu&nbsp;', 'javascript:hideMenu()',,'hide.png']];
+//var menu_wms_switch = ['menu_zoom', ['Zoom&nbsp;', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
+//var menu_layer_switch = ['menu_zoom', ['Zjjj&nbsp;', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
+//var menu_info_switch = ['menu_zoom', ['Zmn&nbsp;', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
+
+parent.eventAfterLoadWMS.register(reloadTree);
 parent.eventInit.register(loadTree);
 if(showstatus=='true'||alerterror=='true'){
 	parent.eventAfterMapRequest.register(init_mapcheck);
-	init_mapcheck();
-}
+	init_mapcheck();
+}
 parent.eventAfterMapRequest.register(updateScale);
-if(wmsbuttons != "true")
-	jst_highlight = false;
-
-function select(i,ii,iii){
-	//ignore if selected
-	if(selectedMap==i && selectedWMS==ii && selectedLayer==iii)return;
-	if(selectedMap==-1 && selectedWMS==-1 && selectedLayer==-1){
-		selectedMap=i;
-		selectedWMS=ii;
-		selectedLayer=iii;
-		return;
-	}
-	//scalehints
-	var scale = parseInt(parent.mb_getScale(mod_treeGDE_map));
-	if(scale < parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_minscale) && parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_minscale) != 0){
-		if(selectedLayer==0)
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '#999999');
-		else
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '#999999');
-	}
-	else if(scale > parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_maxscale) && parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_maxscale) != 0){
-		if(selectedLayer==0)
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '#999999');
-		else
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '#999999');
-	}
-	else{
-		if(selectedLayer==0)
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '');
-		else
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '');
-	}
-
-	selectedMap=i;
-	selectedWMS=ii;
-	selectedLayer=iii;
-}
-
-function updateScale(){
-	if(!init)return;
-	for(var i=0; i<parent.mb_mapObj.length; i++){
-		var scale = parseInt(parent.mb_getScale(mod_treeGDE_map));
-		if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
-			for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
-				for(var iii=1; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
-					if(scale < parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_minscale) && parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_minscale) != 0){
-						if(iii==0)
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '#999999');
-						else
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '#999999');
-					}
-					else if(scale > parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_maxscale) && parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_maxscale) != 0){
-						if(iii==0)
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '#999999');
-						else
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '#999999');
-					}
-					else{
-						if(iii==0)
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '');
-						else
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '');
-					}
-				}
-			}
-		}
-	}
-}
-
-function operaLoad(){
-	initArray();
-	renderTree();
-	setTimeout('initWmsCheckboxen();updateScale();',100);
-}
-
-function loadTree(){
-	if(window.opera){
-		setTimeout('operaLoad()',200);
-		return;
-	}
-	initArray();
-	renderTree();
-	initWmsCheckboxen();
-	updateScale();
-}
-
-function reloadTree(){
-	if(!init) return;
-	selectedMap=-1;
-	selectedWMS=-1;
-	selectedLayer=-1;
-	init=false;
-	arrNodes = [['root_id', ['Layer','javascript:_foo()']]];
-	initArray();
-	if(showstatus=='true'||alerterror=='true')
-		init_mapcheck();
-	renderTree();
-	if(window.opera)
-		setTimeout('initWmsCheckboxen();updateScale();',100);
-	else{
-		initWmsCheckboxen();
-		updateScale();
-	}
-}
-
-function imgerror(){
-	var map=parent.getMapObjIndexByName(mod_treeGDE_map);
-	var wms=Number(this.id.substr(4));
-	this.onerror=null;
-	this.onabort=null;
-	if(state[wms]!=-1 && alerterror=='true'){
-		state[wms]=-1;
-		if(confirm('Failed to Load WMS "'+parent.mb_mapObj[map].wms[wms].objLayer[0].layer_title+'" from Server "'+parent.mb_mapObj[map].wms[wms].wms_getmap.substr(0,parent.mb_mapObj[map].wms[wms].wms_getmap.length-1)+'"\nDo you want to try to load it in a new window?')){
-			window.open(this.src,"");
-		}
-	}
-	state[wms]=-1;
-	errors++;
-	if(showstatus=='true')
-		setNodeImage(arrNodes[0][0]+"|"+parent.mb_mapObj[map].wms[wms].wms_id, "error_folder.png");
-}
-
-function checkComplete(wms, map, img, first){
-	var ind=parent.getMapObjIndexByName(mod_treeGDE_map);
-	if(parent.mb_mapObj[ind].wms[wms].mapURL == false || parent.frames[mod_treeGDE_map].document.getElementById(map).complete){
-		if(state[wms]!=-1){
-			for(var i=1;i<parent.mb_mapObj[ind].wms[wms].objLayer.length;i++){
-				if(parent.mb_mapObj[ind].wms[wms].objLayer[i].gui_layer_visible==1){
-					state[wms]=1;
-					if(showstatus=='true')
-						setNodeImage(img);
-					break;
-				}
-			}
-		}
-	}
-	else{
-		if(first){
-			state[wms]=0;
-			parent.frames[mod_treeGDE_map].document.getElementById(map).onerror=imgerror;
-			parent.frames[mod_treeGDE_map].document.getElementById(map).onabort=imgerror;
-
-			if(showstatus=='true')
-				setNodeImage(img, "loading_folder.gif");
-		}
-
-		if(state[wms]!=-1)
-			setTimeout('checkComplete('+wms+', "'+map+'", "'+img+'");',100);
-	}
-}
-
-//parent.mb_registerWmsLoadErrorFunctions("window.frames['treeGDE'].imgerror();");
-
-function init_mapcheck(){
-	if(!init)return;
-	errors = 0;
-	var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
-	if(!parent.mb_mapObj[ind]||!init){
-		setTimeout("init_mapcheck();",100);
-		return;
-	}
-	for(var wms=0;wms<parent.mb_mapObj[ind].wms.length;wms++){
-		var wmsimgid="map_"+wms;
-		if(parent.frames[mod_treeGDE_map].document.getElementById(wmsimgid)){
-			checkComplete(wms, wmsimgid, arrNodes[0][0]+'|'+parent.mb_mapObj[ind].wms[wms].wms_id, true);
-		}
-	}
-}
-
-function handleSelectedLayer(mapObj,wms_id,layername,type,status){
-	if(lock_update||lock_check)return;
-	var ind = parent.getMapObjIndexByName(mapObj);
-	for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
-		if(parent.mb_mapObj[ind].wms[i].wms_id == wms_id){
-			parent.mb_mapObj[ind].wms[i].handleLayer(layername, type, status);
-			break;
-		}
-	}
-}
-
-function zoomToLayer(j,k,l){
-	if(!j&&!k&&!l){
-		j=selectedMap;
-		k=selectedWMS;
-		l=selectedLayer;
-	}
-	var my=parent.mb_mapObj[j].wms[k].objLayer[l].layer_epsg;
-	for (var i=0;i<my.length;i++){
-		if(my[i]["epsg"]==parent.mb_mapObj[j].epsg){
-			parent.mb_calculateExtent(mod_treeGDE_map,my[i]["minx"],my[i]["miny"],my[i]["maxx"],my[i]["maxy"]);
-			var arrayExt = parent.mb_mapObj[j].extent.split(",");
-			parent.mb_repaint(mod_treeGDE_map,arrayExt[0],arrayExt[1],arrayExt[2],arrayExt[3]);
-			break;
-		}
-	}
-}
-
-
-//---begin------------- opacity --------------------
-
-var opacityIncrement = 20;
-
-function opacity_up(j, k, l) {
-	handleOpacity(j, k, opacityIncrement);
-}
-
-function opacity_down(j, k, l) {
-	handleOpacity(j, k, -opacityIncrement);
-}
-
-function handleOpacity(mapObj_id, wms_id, increment) {
-	var opacity = parent.mb_mapObj[mapObj_id].wms[wms_id].gui_wms_mapopacity*100 + increment;
-	parent.mb_mapObj[mapObj_id].wms[wms_id].setOpacity(opacity);
-	reloadTree();
-}
-
-//---end------------- opacity --------------------
-
-function move_up(j,k,l){
-	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
-		j=selectedMap;
-		k=selectedWMS;
-		l=selectedLayer;
-	}
-	if(j==-1||k==-1||l==-1){
-		alert("You have to select the WMS you want to move up!")
-		return;
-	}
-	var lid=parent.mb_mapObj[j].wms[k].objLayer[l].layer_id;
-	if(!parent.mb_mapObj[j].move(parent.mb_mapObj[j].wms[k].wms_id,lid,(reverse=="true")?false:true)){
-		alert("Illegal move operation");
-		return;
-	}
-	treeState = getState();
-	parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
-	parent.mb_execloadWmsSubFunctions();
-	//find layer and select
-	for(k=0;k<parent.mb_mapObj[j].wms.length;k++){
-		for(l=0;l<parent.mb_mapObj[j].wms[k].objLayer.length;l++){
-			if(parent.mb_mapObj[j].wms[k].objLayer[l].layer_id==lid){
-				select(j,k,l);
-				if(l!=0)
-					selectNode(String(lid));
-				else
-					selectNode(String(parent.mb_mapObj[j].wms[k].wms_id));
-			}
-		}
-	}
-}
-
-function move_down(j,k,l){
-	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
-		j=selectedMap;
-		k=selectedWMS;
-		l=selectedLayer;
-	}
-	if(j==-1||k==-1||l==-1){
-		alert("You have to select the WMS you want to move down!")
-		return;
-	}
-	var lid=parent.mb_mapObj[j].wms[k].objLayer[l].layer_id;
-	if(!parent.mb_mapObj[j].move(parent.mb_mapObj[j].wms[k].wms_id,lid,(reverse=="true")?true:false)){
-		alert("Illegal move operation");
-		return;
-	}
-	treeState = getState();
-	parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
-	parent.mb_execloadWmsSubFunctions();
-	//find layer and select
-	for(k=0;k<parent.mb_mapObj[j].wms.length;k++){
-		for(l=0;l<parent.mb_mapObj[j].wms[k].objLayer.length;l++){
-			if(parent.mb_mapObj[j].wms[k].objLayer[l].layer_id==lid){
-				select(j,k,l);
-				if(l!=0)
-					selectNode(String(lid));
-				else
-					selectNode(String(parent.mb_mapObj[j].wms[k].wms_id));
-			}
-		}
-	}
-}
-
-function remove_wms(j,k,l){
-	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
-		j=selectedMap;
-		k=selectedWMS;
-		l=selectedLayer;
-	}
-	if(j==-1||k==-1||l==-1){
-		alert("You have to select the WMS you want to delete!")
-		return;
-	}
-	if(l!=0){
-		alert("It is not possible to delete a single layer, please select a WMS!")
-		return;
-	}
-	var visibleWMS=0;
-	for(var i=0;i<parent.mb_mapObj[j].wms.length;i++)
-		if(parent.mb_mapObj[j].wms[i].gui_wms_visible=='1'||parent.mb_mapObj[j].wms[i].gui_wms_visible==1)
-			visibleWMS++;
-	if(visibleWMS<=1){
-		alert ("Last WMS can't be removed.\n(Der letzte WMS kann nicht entfernt werden.)");
-		return;
-	}
-	if(confirm('Are you sure you want to remove "'+parent.mb_mapObj[j].wms[k].objLayer[l].layer_title+'"?')){
-  		parent.mb_mapObjremoveWMS(j,k);
-		parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
-		parent.mb_execloadWmsSubFunctions();
-	}
-}
-
-function updateParent(path){
-	if(lock_check)return;
-	var reset_lock=!lock_update;
-	lock_update=true;
-	var state=getChildrenCheckState(path, 0);
-	//enableCheckbox(path, (state!=-1)); //3rd state
-	checkNode(path, 0, (state==1));
-	if(state==0 && showstatus=='true' && path.split(jst_delimiter[0]).length == 2){
-		setTimeout('setNodeImage("'+path+'", "error_folder.png");', 100);
-	}
-	if(reset_lock)
-		lock_update=false;
-}
-
-function handleSelectedWMS(path){
-	if(lock_update)return;
-	var t = path.split("|");
-	var reset_lock=!lock_check;
-	var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
-	var layername = parent.mb_mapObj[ind].wms[parent.getWMSIndexById(mod_treeGDE_map,t[t.length-1])].objLayer[0].layer_name;
-	var bChk = IsChecked(path, 0);
-	handleSelectedLayer(mod_treeGDE_map,t[t.length-1],layername,"visible",bChk?"1":"0");
-	lock_check=true;
-	checkChildren(path, 0, bChk);
-	if(ficheckbox)checkChildren(path, 1, bChk);
-	if(bChk==false && showstatus=='true')
-		setTimeout('setNodeImage("'+path+'", "error_folder.png");', 100);
-	if(reset_lock)
-	{
-		lock_check=false;
-		parent.mb_restateLayers(mod_treeGDE_map,t[t.length-1]);
-		parent.setSingleMapRequest(mod_treeGDE_map,t[t.length-1]);
-	}
-}
-
+if(wmsbuttons != "true")
+	jst_highlight = false;
+
+function select(i,ii,iii){
+	//ignore if selected
+	if(selectedMap==i && selectedWMS==ii && selectedLayer==iii)return;
+	if(selectedMap==-1 && selectedWMS==-1 && selectedLayer==-1){
+		selectedMap=i;
+		selectedWMS=ii;
+		selectedLayer=iii;
+		return;
+	}
+	//scalehints
+	var scale = parseInt(parent.mb_getScale(mod_treeGDE_map));
+	if(scale < parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_minscale) && parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_minscale) != 0){
+		if(selectedLayer==0)
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '#999999');
+		else
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '#999999');
+	}
+	else if(scale > parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_maxscale) && parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_maxscale) != 0){
+		if(selectedLayer==0)
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '#999999');
+		else
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '#999999');
+	}
+	else{
+		if(selectedLayer==0)
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '');
+		else
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '');
+	}
+
+	selectedMap=i;
+	selectedWMS=ii;
+	selectedLayer=iii;
+}
+
+function updateScale(){
+	if(!init)return;
+	for(var i=0; i<parent.mb_mapObj.length; i++){
+		var scale = parseInt(parent.mb_getScale(mod_treeGDE_map));
+		if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
+			for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
+				for(var iii=1; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
+					if(scale < parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_minscale) && parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_minscale) != 0){
+						if(iii==0)
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '#999999');
+						else
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '#999999');
+					}
+					else if(scale > parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_maxscale) && parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_maxscale) != 0){
+						if(iii==0)
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '#999999');
+						else
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '#999999');
+					}
+					else{
+						if(iii==0)
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '');
+						else
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '');
+					}
+				}
+			}
+		}
+	}	
+}
+
+function operaLoad(){
+	initArray();
+	renderTree();
+	setTimeout('initWmsCheckboxen();updateScale();',100);
+}
+
+function loadTree(){
+	if(window.opera){
+		setTimeout('operaLoad()',200);
+		return;
+	}
+	initArray();
+	renderTree();
+	initWmsCheckboxen();
+	updateScale();
+}
+
+function reloadTree(){
+	if(!init) return;
+	selectedMap=-1;
+	selectedWMS=-1;
+	selectedLayer=-1;
+	init=false;
+	arrNodes = [['root_id', ['Layer','javascript:_foo()']]];
+	initArray();
+	if(showstatus=='true'||alerterror=='true')
+		init_mapcheck();
+	renderTree();
+	if(window.opera)
+		setTimeout('initWmsCheckboxen();updateScale();',100);
+	else{
+		initWmsCheckboxen();
+		updateScale();
+	}
+}
+
+function imgerror(){
+	var map=parent.getMapObjIndexByName(mod_treeGDE_map);
+	var wms=Number(this.id.substr(4));
+	this.onerror=null;
+	this.onabort=null;
+	if(state[wms]!=-1 && alerterror=='true'){
+		state[wms]=-1;
+		if(confirm('Failed to Load WMS "'+parent.mb_mapObj[map].wms[wms].objLayer[0].layer_title+'" from Server "'+parent.mb_mapObj[map].wms[wms].wms_getmap.substr(0,parent.mb_mapObj[map].wms[wms].wms_getmap.length-1)+'"\nDo you want to try to load it in a new window?')){
+			window.open(this.src,"");
+		}
+	}
+	state[wms]=-1;
+	errors++;
+	if(showstatus=='true')
+		setNodeImage(arrNodes[0][0]+"|"+parent.mb_mapObj[map].wms[wms].wms_id, "error_folder.png");
+}
+
+function checkComplete(wms, map, img, first){
+	var ind=parent.getMapObjIndexByName(mod_treeGDE_map);
+	if(parent.mb_mapObj[ind].wms[wms].mapURL == false || parent.frames[mod_treeGDE_map].document.getElementById(map).complete){
+		if(state[wms]!=-1){
+			for(var i=1;i<parent.mb_mapObj[ind].wms[wms].objLayer.length;i++){
+				if(parent.mb_mapObj[ind].wms[wms].objLayer[i].gui_layer_visible==1){
+					state[wms]=1;
+					if(showstatus=='true')
+						setNodeImage(img);
+					break;
+				}
+			}
+		}
+	}
+	else{
+		if(first){
+			state[wms]=0;
+			parent.frames[mod_treeGDE_map].document.getElementById(map).onerror=imgerror;
+			parent.frames[mod_treeGDE_map].document.getElementById(map).onabort=imgerror;
+			if(showstatus=='true')
+				setNodeImage(img, "loading_folder.gif");
+		}
+
+		if(state[wms]!=-1)
+			setTimeout('checkComplete('+wms+', "'+map+'", "'+img+'");',100);
+	}
+}
+
+//parent.mb_registerWmsLoadErrorFunctions("window.frames['treeGDE'].imgerror();");
+
+function init_mapcheck(){
+	if(!init)return;
+	errors = 0;
+	var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
+	if(!parent.mb_mapObj[ind]||!init){
+		setTimeout("init_mapcheck();",100);
+		return;
+	}
+	for(var wms=0;wms<parent.mb_mapObj[ind].wms.length;wms++){
+		var wmsimgid="map_"+wms;
+		if(parent.frames[mod_treeGDE_map].document.getElementById(wmsimgid)){
+			checkComplete(wms, wmsimgid, arrNodes[0][0]+'|'+parent.mb_mapObj[ind].wms[wms].wms_id, true);
+		}
+	}
+}
+
+function handleSelectedLayer(mapObj,wms_id,layername,type,status){
+	if(lock_update||lock_check)return;
+	var ind = parent.getMapObjIndexByName(mapObj);
+	for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
+		if(parent.mb_mapObj[ind].wms[i].wms_id == wms_id){
+			parent.mb_mapObj[ind].wms[i].handleLayer(layername, type, status);
+			break;
+		}
+	}
+}
+
+function zoomToLayer(j,k,l){
+	if(!j&&!k&&!l){
+		j=selectedMap;
+		k=selectedWMS;
+		l=selectedLayer;
+	}
+	var my=parent.mb_mapObj[j].wms[k].objLayer[l].layer_epsg;
+	for (var i=0;i<my.length;i++){
+		if(my[i]["epsg"]==parent.mb_mapObj[j].epsg){
+			parent.mb_calculateExtent(mod_treeGDE_map,my[i]["minx"],my[i]["miny"],my[i]["maxx"],my[i]["maxy"]);
+			var arrayExt = parent.mb_mapObj[j].extent.split(",");
+			parent.mb_repaint(mod_treeGDE_map,arrayExt[0],arrayExt[1],arrayExt[2],arrayExt[3]);
+			break;
+		}
+	}
+}
+
+
+//---begin------------- opacity --------------------
+
+var opacityIncrement = 20;
+
+function opacity_up(j, k, l) {
+	handleOpacity(j, k, opacityIncrement);
+}
+
+function opacity_down(j, k, l) {
+	handleOpacity(j, k, -opacityIncrement);
+}
+
+function handleOpacity(mapObj_id, wms_id, increment) {
+	var opacity = parent.mb_mapObj[mapObj_id].wms[wms_id].gui_wms_mapopacity*100 + increment;
+	parent.mb_mapObj[mapObj_id].wms[wms_id].setOpacity(opacity);
+	reloadTree();
+}
+
+//---end------------- opacity --------------------
+
+function move_up(j,k,l){
+	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
+		j=selectedMap;
+		k=selectedWMS;
+		l=selectedLayer;
+	}
+	if(j==-1||k==-1||l==-1){
+		alert("You have to select the WMS you want to move up!")
+		return;
+	}
+	var lid=parent.mb_mapObj[j].wms[k].objLayer[l].layer_id;
+	if(!parent.mb_mapObj[j].move(parent.mb_mapObj[j].wms[k].wms_id,lid,(reverse=="true")?false:true)){
+		alert("Illegal move operation");
+		return;
+	}
+	treeState = getState();
+	parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
+	parent.mb_execloadWmsSubFunctions();
+	//find layer and select
+	for(k=0;k<parent.mb_mapObj[j].wms.length;k++){
+		for(l=0;l<parent.mb_mapObj[j].wms[k].objLayer.length;l++){
+			if(parent.mb_mapObj[j].wms[k].objLayer[l].layer_id==lid){
+				select(j,k,l);
+				if(l!=0)
+					selectNode(String(lid));
+				else
+					selectNode(String(parent.mb_mapObj[j].wms[k].wms_id));
+			}
+		}
+	}
+}
+
+function move_down(j,k,l){
+	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
+		j=selectedMap;
+		k=selectedWMS;
+		l=selectedLayer;
+	}
+	if(j==-1||k==-1||l==-1){
+		alert("You have to select the WMS you want to move down!")
+		return;
+	}
+	var lid=parent.mb_mapObj[j].wms[k].objLayer[l].layer_id;
+	if(!parent.mb_mapObj[j].move(parent.mb_mapObj[j].wms[k].wms_id,lid,(reverse=="true")?true:false)){
+		alert("Illegal move operation");
+		return;
+	}
+	treeState = getState();
+	parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
+	parent.mb_execloadWmsSubFunctions();
+	//find layer and select
+	for(k=0;k<parent.mb_mapObj[j].wms.length;k++){
+		for(l=0;l<parent.mb_mapObj[j].wms[k].objLayer.length;l++){
+			if(parent.mb_mapObj[j].wms[k].objLayer[l].layer_id==lid){
+				select(j,k,l);
+				if(l!=0)
+					selectNode(String(lid));
+				else
+					selectNode(String(parent.mb_mapObj[j].wms[k].wms_id));
+			}
+		}
+	}
+}
+
+function remove_wms(j,k,l){
+	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
+		j=selectedMap;
+		k=selectedWMS;
+		l=selectedLayer;
+	}
+	if(j==-1||k==-1||l==-1){
+		alert("You have to select the WMS you want to delete!")
+		return;
+	}
+	if(l!=0){
+		alert("It is not possible to delete a single layer, please select a WMS!")
+		return;
+	}
+	var visibleWMS=0;
+	for(var i=0;i<parent.mb_mapObj[j].wms.length;i++)
+		if(parent.mb_mapObj[j].wms[i].gui_wms_visible=='1'||parent.mb_mapObj[j].wms[i].gui_wms_visible==1)
+			visibleWMS++;
+	if(visibleWMS<=1){
+		alert ("Last WMS can't be removed.\n(Der letzte WMS kann nicht entfernt werden.)");
+		return;
+	}
+	if(confirm('Are you sure you want to remove "'+parent.mb_mapObj[j].wms[k].objLayer[l].layer_title+'"?')){
+  		parent.mb_mapObjremoveWMS(j,k);
+		parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
+		parent.mb_execloadWmsSubFunctions();
+	}
+}
+
+function updateParent(path){
+	if(lock_check)return;
+	var reset_lock=!lock_update;
+	lock_update=true;
+	var state=getChildrenCheckState(path, 0);
+	//enableCheckbox(path, (state!=-1)); //3rd state
+	checkNode(path, 0, (state==1));
+	if(state==0 && showstatus=='true' && path.split(jst_delimiter[0]).length == 2){
+		setTimeout('setNodeImage("'+path+'", "error_folder.png");', 100);
+	}
+	if(reset_lock)
+		lock_update=false;
+}
+
+function handleSelectedWMS(path){
+	if(lock_update)return;
+	var t = path.split("|");
+	var reset_lock=!lock_check;
+	var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
+	var layername = parent.mb_mapObj[ind].wms[parent.getWMSIndexById(mod_treeGDE_map,t[t.length-1])].objLayer[0].layer_name;
+	var bChk = IsChecked(path, 0);
+	handleSelectedLayer(mod_treeGDE_map,t[t.length-1],layername,"visible",bChk?"1":"0");
+	lock_check=true;
+	checkChildren(path, 0, bChk);
+	if(ficheckbox)checkChildren(path, 1, bChk);
+	if(bChk==false && showstatus=='true')
+		setTimeout('setNodeImage("'+path+'", "error_folder.png");', 100);
+	if(reset_lock)
+	{
+		lock_check=false;
+		parent.mb_restateLayers(mod_treeGDE_map,t[t.length-1]);
+		parent.setSingleMapRequest(mod_treeGDE_map,t[t.length-1]);
+	}
+}
+
 function handleSelection(path, box){
-	if(lock_update)return;
-	var reset_lock=!lock_check;
-	lock_check=true;
+	if(lock_update)return;
+	var reset_lock=!lock_check;
+	lock_check=true;
 	var bChk = IsChecked(path, box);	
-//	enableCheckbox(path, 0, true);
+//	enableCheckbox(path, 0, true);
 	checkChildren(path, box, bChk);
-	if(reset_lock){
-		var t = path.split("|");
-		lock_check=false;
-		parent.mb_restateLayers(mod_treeGDE_map,t[1]);
+	if(reset_lock){
+		var t = path.split("|");
+		lock_check=false;
+		parent.mb_restateLayers(mod_treeGDE_map,t[1]);
 		if(box==0)
-		parent.setSingleMapRequest(mod_treeGDE_map,t[1]);
-	}
-}
-
-function initArray(){
-	var parentObj = "";
-	var controls="";
-	if(parent.mb_mapObj.length > 0){
-		for(var i=0; i<parent.mb_mapObj.length; i++){
-			if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
-				for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
-					if(parent.mb_mapObj[i].wms[ii].gui_wms_visible == '1' || parent.mb_mapObj[i].wms[ii].gui_wms_visible == 1){
-						for(var iii=0; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
-							var temp = parent.mb_mapObj[i].wms[ii].objLayer[iii];
-							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == ""){
-								if(!temp.gui_layer_selectable == '1' && !temp.gui_layer_queryable == '1')
-									continue;
-								var c_menu="[";
-								if(reverse=="true"){
-									if(menu.indexOf("wms_down")!=-1 && ii!=parent.mb_mapObj[i].wms.length-1)c_menu+="menu_move_up,";
-									if(menu.indexOf("wms_up")!=-1 && parentObj!="")c_menu+="menu_move_down,";
-								}
-								else{
-									if(menu.indexOf("wms_up")!=-1 && parentObj!="")c_menu+="menu_move_up,";
-									if(menu.indexOf("wms_down")!=-1 && ii!=parent.mb_mapObj[i].wms.length-1)c_menu+="menu_move_down,";
-								}
-								if(menu.indexOf("remove")!=-1)c_menu+="menu_delete,";
-//								if(menu.indexOf("wms_switch")!=-1)c_menu+="menu_wms_switch,";
-								if(menu.indexOf("opacity_up")!=-1 && parseFloat(parent.mb_mapObj[i].wms[ii].gui_wms_mapopacity) < 1)c_menu+="menu_opacity_up,";
-								if(menu.indexOf("opacity_down")!=-1 && parseFloat(parent.mb_mapObj[i].wms[ii].gui_wms_mapopacity) > 0)c_menu+="menu_opacity_down,";
-								if(menu.indexOf("hide")!=-1)c_menu+="menu_hide";
-								c_menu+="]";
-								controls=null;
-								if(switchwms=='true')controls='<INPUT type="checkbox" checked onclick="handleSelectedWMS(\''+arrNodes[0][0]+'|'+parent.mb_mapObj[i].wms[ii].wms_id+'\');" />';
-								if(wmsbuttons == 'true'&&metadatalink == 'true')controls+='<a href="'+'javascript:openwindow(\''+ defaultMetadataUrl + '&id='+temp.layer_uid+'\');'+'"><img src="'+imagedir+'/info.png" /></a>';
-								addNode(arrNodes[0][0],[parent.mb_mapObj[i].wms[ii].wms_id,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,,temp.layer_title,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
-								parentObj = arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id;
-							}
-							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent && (handlesublayer=="true"||parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent=="0")){
-								var parentLayer = "";
-								var j = iii;
-								while(parent.mb_mapObj[i].wms[ii].objLayer[j].layer_parent!="0"){
-									//find parent
-									for(var jj=0; jj < parent.mb_mapObj[i].wms[ii].objLayer.length; jj++){
-										if(parent.mb_mapObj[i].wms[ii].objLayer[jj].layer_pos==parseInt(parent.mb_mapObj[i].wms[ii].objLayer[j].layer_parent)){
-											j=jj;
-											break;
-										}
-									}
-									parentLayer = "|" + parent.mb_mapObj[i].wms[ii].objLayer[j].layer_id + parentLayer;
-								}
-								if(temp.gui_layer_selectable == '1' || temp.gui_layer_queryable == '1'){
-									var c_menu="[";
-									if(reverse=="true"){
-										if(menu.indexOf("layer_down")!=-1 && iii!=parent.mb_mapObj[i].wms[ii].objLayer.length-1)c_menu+="menu_move_up,";
-										if(menu.indexOf("layer_up")!=-1 && iii!=1)c_menu+="menu_move_down,";
-									}
-									else{
-										if(menu.indexOf("layer_up")!=-1 && iii!=1)c_menu+="menu_move_up,";
-										if(menu.indexOf("layer_down")!=-1 && iii!=parent.mb_mapObj[i].wms[ii].objLayer.length-1)c_menu+="menu_move_down,";
-									}
-									if(menu.indexOf("metainfo")!=-1)c_menu+="menu_metalink,";
-									if(menu.indexOf("zoom")!=-1 && temp.layer_epsg.length>0)c_menu+="menu_zoom,";
-//									if(menu.indexOf("layer_switch")!=-1)c_menu+="menu_layer_switch,";
-//									if(menu.indexOf("info_switch")!=-1)c_menu+="menu_info_switch,";
-									if(menu.indexOf("hide")!=-1)c_menu+="menu_hide";
-									c_menu+="]";
-
-									controls='<input type="checkbox" '+(temp.layer_name==""?'style="display:none;" ':"")+((temp.gui_layer_visible=='1')?'checked ':'')+(temp.gui_layer_selectable!='1'?'disabled ':'')+"onclick=\"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','visible',this.checked?1:0);handleSelection('"+parentObj+parentLayer+"|"+temp.layer_id+"', 0);updateParent('"+parentObj+parentLayer+"');"+((ficheckbox == 'false')?"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','querylayer',this.checked?1:0)":"")+"\" />";
-									if(ficheckbox == 'true')controls+='<input type="checkbox" '+(temp.gui_layer_querylayer=='1'?'checked ':'')+(temp.gui_layer_queryable!='1'?'disabled ':'')+"onclick=\"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','querylayer',this.checked?1:0);handleSelection('"+parentObj+parentLayer+"|"+temp.layer_id+"', 1)\" />";
-									if(wmsbuttons == 'true'&&metadatalink == 'true')controls+='<a href="'+'javascript:openwindow(\''+ defaultMetadataUrl + '&id='+temp.layer_uid+'\');'+'"><img src="'+imagedir+'/info.png" /></a>';
-									addNode(parentObj + parentLayer, [temp.layer_id,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,((c_menu!='[]'&&temp.layer_name!="")?'menu.png':null),temp.layer_title,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-	}
-	init=true;
-}
-
-function initWmsCheckboxen(){
-	var hidden=0;
-	if(parent.mb_mapObj.length > 0){
-		for(var i=0; i<parent.mb_mapObj.length; i++){
-			if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
-				for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
-					if(parent.mb_mapObj[i].wms[ii].gui_wms_visible == '1' || parent.mb_mapObj[i].wms[ii].gui_wms_visible == 1){
-						for(var iii=0; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
-							var temp = parent.mb_mapObj[i].wms[ii].objLayer[iii];
-							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == ""){
-								updateParent(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id);
-							}
-						}
-					}
-					else if(ii<=parent.parseInt(openfolder)+hidden)
-						hidden++;
-				}
-				closeAll()
-				if(treeState!='')
-					setState(treeState);
-				else if(openfolder!='false')
-					setState(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[parent.parseInt(openfolder)+hidden].wms_id);
-			}
-		}
-	}
-}
-//-->
-  </SCRIPT>
-</HEAD>
-<BODY VLINK="#000000" ALINK="#000000" LINK="#000000" BGCOLOR="#ffffff" TEXT="#000000"
- MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0">
-<SCRIPT language="JavaScript" type="text/javascript">
-if(wmsbuttons=='true'){
-	document.writeln("<div>");
-	document.writeln('<a href="javascript:move_up()"><img src="'+imagedir+'/move_up.png" alt="move up" style="position:relative;top:0px;left:0px;"/></a>');
-	document.writeln('<a href="javascript:move_down()"><img src="'+imagedir+'/move_down.png" alt="move down" style="position:relative;top:0px;left:-3px"/></a>');
-	document.writeln('<a href="javascript:remove_wms()"><img src="'+imagedir+'/delete_wms.png" alt="remove wms" style="position:relative;top:0px;left:-6px"/></a>');
-	document.writeln("</div>");
-}
-</SCRIPT>
-<DIV id="treeContainer"></DIV>
-</BODY>
-</HTML>
\ No newline at end of file
+		parent.setSingleMapRequest(mod_treeGDE_map,t[1]);
+	}
+}
+
+function initArray(){
+	var parentObj = "";
+	var controls="";
+	if(parent.mb_mapObj.length > 0){
+		for(var i=0; i<parent.mb_mapObj.length; i++){
+			if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
+				for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
+					if(parent.mb_mapObj[i].wms[ii].gui_wms_visible == '1' || parent.mb_mapObj[i].wms[ii].gui_wms_visible == 1){
+						for(var iii=0; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
+							var temp = parent.mb_mapObj[i].wms[ii].objLayer[iii];
+							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == ""){
+								if(!temp.gui_layer_selectable == '1' && !temp.gui_layer_queryable == '1')
+									continue;
+								var c_menu="[";
+								if(reverse=="true"){
+									if(menu.indexOf("wms_down")!=-1 && ii!=parent.mb_mapObj[i].wms.length-1)c_menu+="menu_move_up,";
+									if(menu.indexOf("wms_up")!=-1 && parentObj!="")c_menu+="menu_move_down,";
+								}
+								else{
+									if(menu.indexOf("wms_up")!=-1 && parentObj!="")c_menu+="menu_move_up,";
+									if(menu.indexOf("wms_down")!=-1 && ii!=parent.mb_mapObj[i].wms.length-1)c_menu+="menu_move_down,";
+								}
+								if(menu.indexOf("remove")!=-1)c_menu+="menu_delete,";
+//								if(menu.indexOf("wms_switch")!=-1)c_menu+="menu_wms_switch,";
+								if(menu.indexOf("opacity_up")!=-1 && parseFloat(parent.mb_mapObj[i].wms[ii].gui_wms_mapopacity) < 1)c_menu+="menu_opacity_up,";
+								if(menu.indexOf("opacity_down")!=-1 && parseFloat(parent.mb_mapObj[i].wms[ii].gui_wms_mapopacity) > 0)c_menu+="menu_opacity_down,";
+								if(menu.indexOf("hide")!=-1)c_menu+="menu_hide";
+								c_menu+="]";
+								controls=null;
+								if(switchwms=='true')controls='<INPUT type="checkbox" title="' + msgObj.tooltipHandleWms + '" checked onclick="handleSelectedWMS(\''+arrNodes[0][0]+'|'+parent.mb_mapObj[i].wms[ii].wms_id+'\');" />';
+								if(wmsbuttons == 'true'&&metadatalink == 'true')controls+='<a href="'+'javascript:openwindow(\''+ defaultMetadataUrl + '&id='+temp.layer_uid+'\');'+'"><img src="'+imagedir+'/info.png" /></a>';
+								addNode(arrNodes[0][0],[parent.mb_mapObj[i].wms[ii].wms_id,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,,temp.layer_title,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
+								parentObj = arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id;
+							}
+							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent && (handlesublayer=="true"||parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent=="0")){
+								var parentLayer = "";
+								var j = iii;
+								while(parent.mb_mapObj[i].wms[ii].objLayer[j].layer_parent!="0"){
+									//find parent
+									for(var jj=0; jj < parent.mb_mapObj[i].wms[ii].objLayer.length; jj++){
+										if(parent.mb_mapObj[i].wms[ii].objLayer[jj].layer_pos==parseInt(parent.mb_mapObj[i].wms[ii].objLayer[j].layer_parent)){
+											j=jj;
+											break;
+										}
+									}
+									parentLayer = "|" + parent.mb_mapObj[i].wms[ii].objLayer[j].layer_id + parentLayer;
+								}
+								if(temp.gui_layer_selectable == '1' || temp.gui_layer_queryable == '1'){
+									var c_menu="[";
+									if(reverse=="true"){
+										if(menu.indexOf("layer_down")!=-1 && iii!=parent.mb_mapObj[i].wms[ii].objLayer.length-1)c_menu+="menu_move_up,";
+										if(menu.indexOf("layer_up")!=-1 && iii!=1)c_menu+="menu_move_down,";
+									}
+									else{
+										if(menu.indexOf("layer_up")!=-1 && iii!=1)c_menu+="menu_move_up,";
+										if(menu.indexOf("layer_down")!=-1 && iii!=parent.mb_mapObj[i].wms[ii].objLayer.length-1)c_menu+="menu_move_down,";
+									}
+									if(menu.indexOf("metainfo")!=-1)c_menu+="menu_metalink,";
+									if(menu.indexOf("zoom")!=-1 && temp.layer_epsg.length>0)c_menu+="menu_zoom,";
+//									if(menu.indexOf("layer_switch")!=-1)c_menu+="menu_layer_switch,";
+//									if(menu.indexOf("info_switch")!=-1)c_menu+="menu_info_switch,";
+									if(menu.indexOf("hide")!=-1)c_menu+="menu_hide";
+									c_menu+="]";
+									
+									controls='<input type="checkbox"  title="' + msgObj.tooltipLayerVisible + '"'+(temp.layer_name==""?'style="display:none;" ':"")+((temp.gui_layer_visible=='1')?'checked ':'')+(temp.gui_layer_selectable!='1'?'disabled ':'')+"onclick=\"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','visible',this.checked?1:0);handleSelection('"+parentObj+parentLayer+"|"+temp.layer_id+"');updateParent('"+parentObj+parentLayer+"');"+((ficheckbox == 'false')?"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','querylayer',this.checked?1:0)":"")+"\" />";
+									if(ficheckbox == 'true')controls+='<input type="checkbox" title="' + msgObj.tooltipLayerQuerylayer + '" '+(temp.gui_layer_querylayer=='1'?'checked ':'')+(temp.gui_layer_queryable!='1'?'disabled ':'')+"onclick=\"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','querylayer',this.checked?1:0);checkChildren('"+parentObj+parentLayer+"|"+temp.layer_id+"', 1, this.checked?1:0)\" />";
+									if(wmsbuttons == 'true'&&metadatalink == 'true')controls+='<a href="'+'javascript:openwindow(\''+ defaultMetadataUrl + '&id='+temp.layer_uid+'\');'+'"><img src="'+imagedir+'/info.png" /></a>';
+									addNode(parentObj + parentLayer, [temp.layer_id,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,((c_menu!='[]'&&temp.layer_name!="")?'menu.png':null),temp.layer_title,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+	init=true;
+}
+
+function initWmsCheckboxen(){
+	var hidden=0;
+	if(parent.mb_mapObj.length > 0){
+		for(var i=0; i<parent.mb_mapObj.length; i++){
+			if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
+				for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
+					if(parent.mb_mapObj[i].wms[ii].gui_wms_visible == '1' || parent.mb_mapObj[i].wms[ii].gui_wms_visible == 1){
+						for(var iii=0; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
+							var temp = parent.mb_mapObj[i].wms[ii].objLayer[iii];
+							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == ""){
+								updateParent(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id);
+							}
+						}
+					}
+					else if(ii<=parent.parseInt(openfolder)+hidden)
+						hidden++;
+				}
+				closeAll()
+				if(treeState!='')
+					setState(treeState);
+				else if(openfolder!='false')
+					setState(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[parent.parseInt(openfolder)+hidden].wms_id);
+			}
+		}
+	}
+}
+//-->  
+  </SCRIPT>
+</HEAD>
+<BODY VLINK="#000000" ALINK="#000000" LINK="#000000" BGCOLOR="#ffffff" TEXT="#000000"
+ MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0">
+<SCRIPT language="JavaScript" type="text/javascript">
+if(wmsbuttons=='true'){
+	document.writeln("<div>"); 
+	document.writeln('<a href="javascript:move_up()"><img title="'+msgObj.tooltipMoveSelectionUp+'" src="'+imagedir+'/move_up.png" alt="move up" style="position:relative;top:0px;left:0px;"/></a>'); 
+	document.writeln('<a href="javascript:move_down()"><img title="'+msgObj.tooltipMoveSelectionDown+'" src="'+imagedir+'/move_down.png" alt="move down" style="position:relative;top:0px;left:-3px"/></a>'); 
+	document.writeln('<a href="javascript:remove_wms()"><img title="'+msgObj.tooltipRemoveWms+'" src="'+imagedir+'/delete_wms.png" alt="remove wms" style="position:relative;top:0px;left:-6px"/></a>'); 
+	document.writeln("</div>"); 
+}
+</SCRIPT>
+<DIV id="treeContainer"></DIV>
+</BODY>
+</HTML>

Modified: trunk/mapbender/http/javascripts/geometry.js
===================================================================
--- trunk/mapbender/http/javascripts/geometry.js	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/javascripts/geometry.js	2008-08-05 11:54:58 UTC (rev 2739)
@@ -348,8 +348,8 @@
 																		// MULTILINESTRING
 																		//
 																		this.addMember(geomType.line);
-																		this.get(-1).addGeometry();
 																		for (var m = 0; m < coordinates.length; m++) {
+																			this.get(-1).addGeometry();
 																			var currentLine = coordinates[m];
 																			for (var n = 0; n < currentLine.length; n++) {
 																				var currentPoint = currentLine[n];
@@ -372,8 +372,8 @@
 																				var currentPoint = currentPolygon[n];
 																				this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
 																			}
+																			this.getGeometry(-1,-1).setEpsg(featureEpsg);
 																		}
-																		this.getGeometry(-1,-1).setEpsg(featureEpsg);
 																		this.close();
 																		break;
 																		
@@ -389,8 +389,8 @@
 																				var currentPoint = currentPolygon[n];
 																				this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
 																			}
+																			this.getGeometry(-1,-1).setEpsg(featureEpsg);
 																		}
-																		this.getGeometry(-1,-1).setEpsg(featureEpsg);
 																		this.close();
 																		break;
 							
@@ -1057,6 +1057,19 @@
 	};
 
 	/**
+	 * removes an element with a given name. If an element with this name exists, it is removed.
+	 *
+	 * @param {String} aName the name of the element to delete
+	 */
+	this.delElement = function(aName){
+		var i = this.getElementIndexByName(aName);
+		if (i !== false) {
+			name.splice(i, 1);
+			value.splice(i, 1);
+		}
+	}
+	
+	/**
 	 * checks if an index is valid
 	 *
 	 * @private
@@ -1262,17 +1275,27 @@
 	 * @param {Float} y y coordinate within the map frame
 	 */
 	var displayIcon = function (url, x, y) {
-		var newImg = document.createElement("img");
-		newImg.src = url;
-		newImg.className = "mapsymbol";
-		newImg.style.cursor = "help";
-		newImg.style.position = "absolute";
-
-		// center the image at x, y
-		newImg.style.top = y - Math.round(newImg.height/2);
-		newImg.style.left = x - Math.round(newImg.width/2);
-		newImg.style.zIndex = 100;
-		that.canvasDivTag.getTag().appendChild(newImg);
+		if(ie){
+			var newImg = document.createElement("img");
+			var newImgTop = y - Math.round(80/2);
+			var newImgLeft = x - Math.round(80/2);
+			that.canvasDivTag.getTag().innerHTML = "<img src='" + url + "' style='position:absolute;top:"+newImgTop+";left:"+newImgLeft+";z-index:100'/>";
+		}
+		else{
+			var newImg = document.createElement("img");
+			newImg.src = url;
+			that.canvasDivTag.getTag().appendChild(newImg);	
+			//newImg.className = "mapsymbol";
+			//newImg.style.cursor = "help";
+			newImg.style.position = "absolute";
+			
+			// center the image at x, y
+			newImg.style.top = y - Math.round(80/2);
+			newImg.style.left = x - Math.round(80/2);
+	//		newImg.style.top = y - Math.round(80);
+	//		newImg.style.left = x;
+			newImg.style.zIndex = 100;
+		}
 	};
 	
 	/**

Modified: trunk/mapbender/http/javascripts/map.js
===================================================================
--- trunk/mapbender/http/javascripts/map.js	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/javascripts/map.js	2008-08-05 11:54:58 UTC (rev 2739)
@@ -232,11 +232,14 @@
 		}
 	}
 
-	var imageString = "<img id='"+myMapId+"' name='mapimage' ";
-	imageString += "src='" + newMapURL + "' ";
-	imageString += "width='"+currentMapObject.width+"' ";
-	imageString += "height='"+currentMapObject.height+"' ";
-	imageString += "border='0'>";
+	var imageString = "";
+	if (newMapURL) {
+		imageString = "<img id='"+myMapId+"' name='mapimage' ";
+		imageString += "src='" + newMapURL + "' ";
+		imageString += "width='"+currentMapObject.width+"' ";
+		imageString += "height='"+currentMapObject.height+"' ";
+		imageString += "border='0'>";	
+	}
 
 	var newMapRequest = "<div id='"+myDivId+"' ";
 	newMapRequest += "style=\"position:absolute; top:0px; left:0px; ";
@@ -409,7 +412,14 @@
 				else if(path && validation){
 					newfeatureInfoRequest += requestParams;
 					try{
-						var p = new mb_popup("Feature Info","url:"+path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr,300,400);
+						var p = new mb_popup({
+							title:"Feature Info",
+							url:path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr,
+							width:600,
+							height:500,
+							top:200,
+							left:600
+						});
 						p.show();
 					}catch(e){
 						window.open(path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr, "" , "width=300,height=400,scrollbars=yes,resizable=yes");
@@ -419,7 +429,14 @@
 				else if(validation){
 					newfeatureInfoRequest += requestParams;
 					try{
-						var p = new mb_popup("Feature Info","url:"+newfeatureInfoRequest,300,400);
+						var p = new mb_popup({
+							title:"Feature Info",
+							url:newfeatureInfoRequest,
+							width:600,
+							height:500,
+							top:200,
+							left:600
+						});
 						p.show();
 					}
 					catch(e){

Modified: trunk/mapbender/http/javascripts/map.php
===================================================================
--- trunk/mapbender/http/javascripts/map.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/javascripts/map.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -45,7 +45,6 @@
 */
 $_SESSION["mb_user_gui"] = $gui_id;
 
-session_write_close();
 ob_start();
 header('Content-type: application/x-javascript');
 
@@ -169,4 +168,4 @@
 		}
 	}
 }
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList_ajax.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList_ajax.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList_ajax.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -20,270 +20,372 @@
 require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
 
 ?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset='<?php echo CHARSET;?>'>
-<title>Add WMS from Filtered Catalog</title>
-<link rel="stylesheet" type="text/css" href="../css/administration_alloc.css">
-<STYLE TYPE="text/css">
-<!--
-body{
-	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
-	font-size:10pt
-}    
-   
-table{
-	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
-	font-size:11;
-}   
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
-.wms_button{
-	color: black;
-	border: solid thin;
-	height:22px;
-	width:60px;
-}
--->
-</STYLE>
-<?php
-include '../include/dyn_css.php';
-?>
-<script type="text/javascript">
-<!--
-var global_source = "capabilities";  // "capabilities" || "db"
-var phpUrl = "../php/mod_addWMSfromfilteredList_server.php?<?php echo $urlParameters;?>";
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
-// ----------------- Load service --------------------
+<head>
+	<meta http-equiv="cache-control" content="no-cache" />
+	<meta http-equiv="pragma" content="no-cache" />
+	<meta http-equiv="expires" content="0" />
+	<?php printf("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\" />",CHARSET);	?>
+	<title>Add WMS</title>
+	<script type="text/javascript">
+	<!--
+	// Set default for element variables if they are undefined
+	option_all        = (typeof(option_all) !== 'undefined')        ? option_all        : '1';
+	option_group      = (typeof(option_group) !== 'undefined')      ? option_group      : '1';
+	option_gui        = (typeof(option_gui) !== 'undefined')        ? option_gui        : '1';
+	option_dball      = (typeof(option_dball) !== 'undefined')      ? option_dball      : '1';
+	option_dbgroup    = (typeof(option_dbgroup) !== 'undefined')    ? option_dbgroup    : '1';
+	option_dbgui      = (typeof(option_dbgui) !== 'undefined')      ? option_dbgui      : '1';
+	capabilitiesInput = (typeof(capabilitiesInput) !== 'undefined') ? capabilitiesInput : '0';
+	gui_list          = (typeof(gui_list) !== 'undefined')          ? gui_list          : '';
 
-function mod_addWMSfromDB(gui_id, wms_id) {
-	window.opener.mod_addWMSById_load(gui_id, wms_id);
-}
-
-function mod_addWMSfromfilteredList(pointer_name,version){
-
-	var load = false;
-	var conjunctionCharacter = window.opener.mb_getConjunctionCharacter(pointer_name);
+	var guis = gui_list.split(',');
 	
-	if (version == '1.0.0') {
-		load = pointer_name + conjunctionCharacter + "REQUEST=capabilities&WMTVER=1.0.0";
+	if(gui_list === '') {
+		guis = [];
 	}
-	else if (version == '1.1.0' || version == '1.1.1') {
-		load = pointer_name + conjunctionCharacter + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=" + version;
-	}
-	if (load !== false) {
-		window.opener.mod_addWMS_load(load);
-	}
-}
 
-// -----------------  Retrieve data --------------------
+	var global_source = 'capabilities';  // [capabilities,db]
+	var phpUrl        = '../php/mod_addWMSfromfilteredList_server.php?<?php echo $urlParameters;?>';
 
-function setSource(sourceValue) {
-	global_source = sourceValue;
-}
+	// Load service
 
-function getGroups() {
-	imageOn();
-	window.opener.mb_ajax_json(phpUrl, {"command":"getGroups"}, function (json, status) {
-		imageOff();
-		displayGroups(json.group);
-	});
-}
+	function mod_addWMSfromDB(gui_id,wms_id) {
+		parent.mod_addWMSById_load(gui_id,wms_id);
+	}
 
-function getGUIs() {
-	imageOn();
-	window.opener.mb_ajax_json(phpUrl, {"command":"getGUIs"}, function (json, status) {
-		imageOff();
-		displayGUIs(json.gui);
-	});
-}
+	function mod_addWMSfromfilteredList(pointer_name,version){
+		//TODO: load active
+		var load                 = false;
+		var conjunctionCharacter = parent.mb_getConjunctionCharacter(pointer_name);
+		
+		if(version == '1.0.0') {
+			load = pointer_name + conjunctionCharacter + 'REQUEST=capabilities&WMTVER=1.0.0';
+		}
+		else if(version == '1.1.0' || version == '1.1.1') {
+			load = pointer_name + conjunctionCharacter + 'REQUEST=GetCapabilities&SERVICE=WMS&VERSION=' + version;
+		}
+		if(load !== false) {
+			parent.mod_addWMS_load(load);
+		}
+	}
 
-function getWMSByGUI(guiId) {
-	imageOn();
-	window.opener.mb_ajax_json(phpUrl, {"command":"getWMSByGUI", "guiId":guiId}, function (json, status) {
-		imageOff();
-		displayWMS(json.wms, guiId);
-	});
-}
+	function mod_addWmsfromURL(){
+		var capabilities = document.getElementById('CapURL').value;
+		parent.mod_addWMS_load(capabilities);
+	}
 
-function getWMSByGroup(groupId) {
-	imageOn();
-	window.opener.mb_ajax_json(phpUrl, {"command":"getWMSByGroup", "groupId":groupId}, function (json, status) {
-		imageOff();
-		displayWMS(json.wms);
-	});
-}
+	// Retrieve data
 
-function getAllWMS() {
-	imageOn();
-	window.opener.mb_ajax_json(phpUrl, {"command":"getAllWMS"}, function (json, status) {
-		imageOff();
-		displayWMS(json.wms);
-	});
-}
+	function setSource(sourceValue) {
+		global_source = sourceValue;
+	}
 
-// -----------------  Display results --------------------
+	function getGroups() {
+		imageOn();
+		parent.mb_ajax_json(phpUrl, {"command":"getGroups"}, function (json, status) {
+			imageOff();
+			displayGroups(json.group);
+		});
+	}
 
-function removeChildNodes(node) {
-	while (node.childNodes.length > 0) {
-		var childNode = node.firstChild;
-		node.removeChild(childNode);
+	function getGUIs() {
+		imageOn();
+		parent.mb_ajax_json(phpUrl, {"command":"getGUIs"}, function (json, status) {
+			imageOff();
+			displayGUIs(json.gui);
+		});
 	}
-}
 
-function setTableHeader(text, titleLeft, titleRight) {
-	document.getElementById("resultTable").style.visibility = 'visible';
-	document.getElementById("resultString").innerHTML = text;
-	document.getElementById("titleLeft").innerHTML = titleLeft;
-	document.getElementById("titleRight").innerHTML = titleRight;
-	removeChildNodes(document.getElementById("resultTableBody"));
-}
+	function getWMSByGUI(guiId) {
+		if(guiId=="")
+			return getAllWMS();
+		imageOn();
+		parent.mb_ajax_json(phpUrl, {"command":"getWMSByGUI", "guiId":guiId}, function (json, status) {
+			imageOff();
+			displayWMS(json.wms, guiId);
+		});
+	}
 
-function addRow(tableId, leftText, rightText, onClick) {
-	var leftNode = document.createElement("td");
-	var leftDivNode = createDiv(leftText, onClick);
-	leftNode.appendChild(leftDivNode);
+	function getWMSByGroup(groupId) {
+		imageOn();
+		parent.mb_ajax_json(phpUrl, {"command":"getWMSByGroup", "groupId":groupId}, function (json, status) {
+			imageOff();
+			displayWMS(json.wms);
+		});
+	}
 
-	var rightNode = document.createElement("td");
-	var rightDivNode = createDiv(rightText, onClick);
-	rightNode.appendChild(rightDivNode);
+	function getAllWMS() {
+		imageOn();
+		parent.mb_ajax_json(phpUrl, {"command":"getAllWMS"}, function (json, status) {
+			imageOff();
+			displayWMS(json.wms);
+		});
+	}
 
-	var rowNode = document.createElement("tr");
-	rowNode.setAttribute("onmouseover", "this.style.backgroundColor = \"#F08080\"");
-	rowNode.setAttribute("onmouseout", "this.style.backgroundColor = \"#FFFFFF\"");
-	rowNode.appendChild(leftNode);
-	rowNode.appendChild(rightNode);
-	
-	document.getElementById(tableId).appendChild(rowNode);
-}
+	// -----------------  Display results --------------------
 
-function createDiv(text, onClick) {
-	var divNode = document.createElement("div");
-	divNode.style.cursor = "pointer";
-	divNode.setAttribute("onclick", onClick);
-	divNode.innerHTML = text;
-	return divNode;
-}
+	function removeChildNodes(node) {
+		while (node.childNodes.length > 0) {
+			var childNode = node.firstChild;
+			node.removeChild(childNode);
+		}
+	}
 
-function imageOn() {
-	document.getElementById("searchImage").style.visibility = "visible";
-	document.getElementById("resultTable").style.visibility = "hidden";
-	document.getElementById("resultString").style.visibility = "hidden";
-}
+	function setTableHeader(text,titleLeft,titleRight) {
+		document.getElementById('resultString').innerHTML = text;
+		document.getElementById('titleLeft').innerHTML    = titleLeft;
+		document.getElementById('titleRight').innerHTML   = titleRight;
+		
+		removeChildNodes(document.getElementById('resultTableBody'));
+	}
 
-function imageOff() {
-	document.getElementById("searchImage").style.visibility = "hidden";
-	document.getElementById("resultTable").style.visibility = "visible";
-	document.getElementById("resultString").style.visibility = "visible";
-}
+	function addTableRow(leftText,rightText,onClick) {
+		var resultTableBoy        = document.getElementById('resultTableBody');
+		var leftTableCell         = document.createElement('td');
+		var rightTableCell        = document.createElement('td');
+		var leftTableCellContent  = document.createElement('strong');
+		var rightTableCellContent = document.createElement('em');
+		var tableRow              = document.createElement('tr');
+				
+		leftTableCellContent.innerHTML  = leftText;
+		rightTableCellContent.innerHTML = rightText;
 
-function noResult() {
-	document.getElementById("resultTable").style.visibility = 'hidden';
-	document.getElementById("resultString").innerHTML = noResultText;
-}
+		leftTableCell.appendChild(leftTableCellContent);
+		rightTableCell.appendChild(rightTableCellContent);
+		tableRow.appendChild(leftTableCell);
+		tableRow.appendChild(rightTableCell);
+		
+		tableRow.setAttribute('onclick',onClick);
 
-function setButtons() {
-	if (typeof(option_all) != "undefined" && option_all == '0') {
-		var child = document.getElementById("button_all"); 
-		child.parentNode.removeChild(child);
+		if(resultTableBoy.childNodes.length % 2 !== 0) {
+			tableRow.className += tableRow.className + ' alternate';
+		}
+
+		resultTableBoy.appendChild(tableRow);
 	}
-	if (typeof(option_group) != "undefined" && option_group == '0') {
-		var child = document.getElementById("button_group");
-		child.parentNode.removeChild(child);
+
+	function imageOn() {
+		document.getElementById("progressIndicator").style.visibility = "visible";
+		document.getElementById("progressIndicator").style.display = "block";
+		document.getElementById("resultTable").style.visibility = "hidden";
+		document.getElementById("resultTable").style.display = "none";
+		document.getElementById("resultString").style.visibility = "hidden";
+		document.getElementById("resultString").style.display = "none";
 	}
-	if (typeof(option_gui) != "undefined" && option_gui == '0') {
-		var child = document.getElementById("button_gui");
-		child.parentNode.removeChild(child);
+
+	function imageOff() {
+		document.getElementById("progressIndicator").style.visibility = "hidden";
+		document.getElementById("progressIndicator").style.display = "none";
+		document.getElementById("resultTable").style.visibility = "visible";
+		document.getElementById("resultTable").style.display = "block";
+		document.getElementById("resultString").style.visibility = "visible";
+		document.getElementById("resultString").style.display = "block";
 	}
-	if (typeof(option_db) != "undefined" && option_db == '0') {
-		var child = document.getElementById("button_db");
-		child.parentNode.removeChild(child);
+
+	function noResult() {
+		document.getElementById("resultTable").style.visibility = 'hidden';
+		document.getElementById("resultString").innerHTML = noResultText;
 	}
-}
 
-function displayGroups (groupArray) {
-	if (groupArray.length > 0) {
-		setTableHeader(selectGroupText, groupNameText, groupAbstractText);
+	function setButtons() {
+		var containerCapabilities = document.getElementById('container_capabilities');
+		var containerButtons      = document.getElementById('container_buttons');
+		var optionButton          = false;
+
+		// If only one is active load list imidiately
+		if(
+			parseInt(option_all) + 
+			parseInt(option_group) + 
+			parseInt(option_gui) + 
+			parseInt(option_dbgui) + 
+			parseInt(option_dbgroup) + 
+			parseInt(option_dball)
+		=== 1) {
+			if(option_all === '1') {
+				optionButton = document.getElementById('button_all');
+			}
+			if(option_group === '1') {
+				optionButton = document.getElementById('button_group');
+			}
+			if(option_gui === '1') {
+				optionButton = document.getElementById('button_gui');
+			}
+			if(option_dball === '1'){
+				optionButton = document.getElementById('button_dbAll');
+			}
+			if(option_dbgroup === '1') {
+				optionButton = document.getElementById('button_dbGroup');
+			}
+			if(option_dbgui === '1') {
+				optionButton = document.getElementById('button_dbGui');
+			}
+
+			if(optionButton) {
+				optionButton.onclick();
+				containerButtons.parentNode.removeChild(containerButtons);
+				
+				return;
+			}
+		}
+
+		if(typeof(option_all) !== 'undefined' && option_all === '0') {
+			optionButton = document.getElementById('button_all'); 
+			optionButton.parentNode.removeChild(optionButton);
+		}
+		if(typeof(option_group) !== 'undefined' && option_group === '0') {
+			optionButton = document.getElementById('button_group');
+			optionButton.parentNode.removeChild(optionButton);
+		}
+		if(typeof(option_gui) !== 'undefined' && option_gui === '0') {
+			optionButton = document.getElementById('button_gui');
+			optionButton.parentNode.removeChild(optionButton);
+		}
+		if(option_dball === '0') {
+			optionButton = document.getElementById('button_dbAll');
+			optionButton.parentNode.removeChild(optionButton);
+		}
+		if(option_dbgroup === '0') {
+			optionButton = document.getElementById('button_dbGroup');
+			optionButton.parentNode.removeChild(optionButton);
+		}
+		if(option_dbgui === '0') {
+			optionButton = document.getElementById('button_dbGui');
+			optionButton.parentNode.removeChild(optionButton);
+		}
 		
-		for (var i = 0; i < groupArray.length; i++) {
-			var onClick = "getWMSByGroup('" + groupArray[i].id + "')";
-			addRow("resultTableBody", groupArray[i].name, groupArray[i].description, onClick);	
+		if(capabilitiesInput === '0') {
+			optionButton = document.getElementById('capabilitiesForm');
+			optionButton.parentNode.removeChild(optionButton);
+			containerCapabilities.parentNode.removeChild(containerCapabilities);
 		}
 	}
-	else {
-		noResult();
+
+	function displayGroups (groupArray) {
+		if (groupArray.length > 0) {
+			setTableHeader(selectGroupText, groupNameText, groupAbstractText);
+			
+			for (var i = 0; i < groupArray.length; i++) {
+				var onClick = "getWMSByGroup('" + groupArray[i].id + "')";
+				addTableRow(groupArray[i].name, groupArray[i].description, onClick);	
+			}
+		}
+		else {
+			noResult();
+		}
 	}
-}
 
-function displayGUIs (guiArray) {
-	if (guiArray.length > 0) {
-		setTableHeader(selectGuiText, guiNameText, guiAbstractText);
-		
-		for (var i = 0; i < guiArray.length; i++) {
-			var onClick = "getWMSByGUI('" + guiArray[i].id + "')";
-			addRow("resultTableBody", guiArray[i].name, guiArray[i].description, onClick);	
+	function displayGUIs (guiArray) {
+		if (guiArray.length > 0) {
+			setTableHeader(selectGuiText, guiNameText, guiAbstractText);
+			
+			for (var i = 0; i < guiArray.length; i++) {
+				var onClick = "getWMSByGUI('" + guiArray[i].id + "')";
+				if(guis.length>0){
+					for(var j=0; j < guis.length; j++){
+						if(guiArray[i].id==guis[j]){
+							addTableRow(guiArray[i].name, guiArray[i].description, onClick);	
+							break;
+						}
+					}
+				}
+				else
+					addTableRow(guiArray[i].name, guiArray[i].description, onClick);	
+			}
 		}
+		else {
+			noResult();
+		}
 	}
-	else {
-		noResult();
-	}
-}
 
-function displayWMS (wmsArray, guiId) {
-	if (wmsArray.length > 0) {
-		setTableHeader(selectWmsText, wmsNameText, wmsAbstractText);
+	function displayWMS (wmsArray, guiId) {
+		if (wmsArray.length > 0) {
+			setTableHeader(selectWmsText, wmsNameText, wmsAbstractText);
 
-		for (var i = 0; i < wmsArray.length; i++) {
+			for (var i = 0; i < wmsArray.length; i++) {
 
-			if (global_source == "db" && typeof(guiId) !== "undefined" ) {
-				var onClick = "mod_addWMSfromDB('" + guiId + "', '" + wmsArray[i].id + "')";
-			}		
-			else {
-				var onClick = "mod_addWMSfromDB('" + guiId + "', '" + wmsArray[i].id + "')";
-//				var onClick = "mod_addWMSfromfilteredList('" + wmsArray[i].getCapabilitiesUrl + "', '" + wmsArray[i].version + "')";
+				if (global_source == "db" && typeof(guiId) !== "undefined" ) {
+					var onClick = "mod_addWMSfromDB('" + guiId + "', '" + wmsArray[i].id + "')";
+				}		
+				else {
+					var onClick = "mod_addWMSfromfilteredList('" + wmsArray[i].getCapabilitiesUrl + "', '" + wmsArray[i].version + "')";
+				}
+				addTableRow(wmsArray[i].title, wmsArray[i].abstract, onClick);
 			}
-			addRow("resultTableBody", wmsArray[i].title, wmsArray[i].abstract, onClick);
 		}
+		else {
+			noResult();
+		}
 	}
-	else {
-		noResult();
-	}
-}
+	-->
+	</script>
+	<?php include("../include/dyn_css.php"); ?>
+	<script type="text/javascript">
+	var wmsNameText = '<?php echo _mb("WMS name");?>';
+	var wmsAbstractText = '<?php echo _mb("WMS abstract");?>';
+	var selectWmsText = '<?php echo _mb("Please select a WMS") . ":";?>';
+	var selectGuiText = '<?php echo _mb("Please select an application") . ":";?>';
+	var selectGroupText = '<?php echo _mb("Please select a group") . ":";?>';
+	var groupAbstractText = '<?php echo _mb("group abstract");?>';
+	var groupNameText = '<?php echo _mb("group name");?>';
+	var guiAbstractText = '<?php echo _mb("application abstract");?>';
+	var guiNameText = '<?php echo _mb("application name");?>';
+	var noResultText = '<?php echo _mb("no result");?>';
+	</script>
 
-// -->
-</script>
 </head>
-<body onLoad="window.focus();setButtons();">
 
-<form name='addWMSForm'>
-	<table border='0' cellpadding='3'  rules='rows'>
-		<tr>
-			<td><input type='button' class='wms_button' name='button_all' id='button_all' value='all wms' onclick='setSource("capabilities");getAllWMS()'></td>
-			<td><input type='button' class='wms_button' name='button_group' id='button_group' value='group' onclick = 'setSource("capabilities");getGroups()'></td>	
-			<td><input type='button' class='wms_button' name='button_gui' id='button_gui' value='gui' onclick = 'setSource("capabilities");getGUIs()'></td>
-			<td><input type='button' class='wms_button' name='button_db' id='button_db' value='db' onclick = 'setSource("db");getGUIs()'></td>
-		</tr>
-	</table>
+<body onLoad="setButtons();">
+<h1><?php echo _mb("Add WMS"); ?></h1>
+<p><?php echo _mb("Enter a Capabilities-URL of a WMS or select one or more WMS from list."); ?></p>
+<p><em><?php echo _mb("Hint: Possibly you need to zoom in for showing layers from external map service. The operator of the external service is responsible for the display ranges. PortalU does not have a stake in this behaviour."); ?></em></p>
+
+<form id="capabilitiesForm" name="addURLForm" method="post" action="">
+<fieldset id="container_capabilities">
+<legend>Capabilities</legend>
+	<p>
+		<label for="CapURL"><?php echo _mb("Capabilities-URL"); ?>:</label> 
+		<input type="text" id="CapURL" name="CapURL" /> 
+		<input type="button" id="addCapURL" name="addCapURL" value="<?php echo _mb("Add"); ?>" onclick="mod_addWmsfromURL();" />
+	</p>
+</fieldset>
 </form>
 
-<div id='searchImage' name='searchImage' style='visibility:hidden'>
-	<img src='../img/indicator_wheel.gif'>
-</div>
+<form id="addWMSForm" name="addWMSForm" method="post" action="">
+<fieldset id="container_buttons">
+<legend>WMS list(s)</legend>
+	<p>
+		<label><?php echo _mb("Available WMS list(s)"); ?>:</label> 
+		<input type="button" name="button_all"     id="button_all"     value="<?php echo _mb("All WMS"); ?>"            onclick="setSource('capabilities');getWMSByGUI(gui_list)"> 
+		<input type="button" name="button_group"   id="button_group"   value="<?php echo _mb("WMS by Group"); ?>"              onclick="setSource('capabilities');getGroups()"> 
+		<input type="button" name="button_gui"     id="button_gui"     value="<?php echo _mb("WMS by GUI"); ?>"                onclick="setSource('capabilities');getGUIs()"> 
+		<input type="button" name="button_dbAll"   id="button_dbAll"   value="<?php echo _mb("Database (All WMS)"); ?>" onclick="setSource('db');getWMSByGUI(gui_list)">
+		<input type="button" name="button_dbGroup" id="button_dbGroup" value="<?php echo _mb("Database (Group)"); ?>"   onclick="setSource('db');getGroups()"> 
+		<input type="button" name="button_dbGui"   id="button_dbGui"   value="<?php echo _mb("Database (GUI)"); ?>"     onclick="setSource('db');getGUIs()"> 
+	</p>
+</fieldset>
+</form>
 
-<div id='resultString' name='resultString'></div>
+<p id="progressIndicator" name="progressIndicator">
+	<img src="../img/indicator_wheel.gif" />
+	<?php echo _mb("Loading"); ?> ... 
+</p>
 
-<br>
+<h2 id="resultString" name="resultString"></h2>
 
-<table id='resultTable' name='resultTable' border=1 width="98%" cellpadding=3 rules='rows' style='visibility:hidden'>
-	<thead bgcolor="#FAEBD7">
+<table id="resultTable" name="resultTable">
+	<thead>
 		<tr>
-			<td id='titleLeft' name='titleLeft' width=200 height=10></td>
-			<td id='titleRight' name='titleRight' align=left class=fieldnames_s></td>
+			<th id="titleLeft" name="titleLeft"></th>
+			<th id="titleRight" name="titleRight"></th>
 		</tr>
 	</thead>
-	<tbody id='resultTableBody' name='resultTableBody'>
+	<tbody id="resultTableBody" name="resultTableBody">
 	</tbody>
 </table>
-</div>
 </body>
+
 </html>
\ No newline at end of file

Modified: trunk/mapbender/http/javascripts/mod_loadwmc.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_loadwmc.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/javascripts/mod_loadwmc.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -22,70 +22,75 @@
 
 include(dirname(__FILE__) . "/../include/dyn_js.php");
 
-/*
-// this may be added at a later stage
-if ($new_wmc == 1) {
-	include(dirname(__FILE__) . "/../generate_defaultWmc.php");
-	$startup = true;
-	$e = new mb_notice("loadwmc: new wmc");
-}
-else {
-	$startup = false;
-	$e = new mb_notice("loadwmc: old wmc");
-}
-if ($gui_changed == 0) {
-	if ($_REQUEST['portal_services']) {
-		$e = new mb_notice("loadwmc: merging layers");
-		include(dirname(__FILE__) . "/../merge_layers.php");
+function createJs ($mergeWms) {
+	$jsString = "";
+	$wmc = new wmc();
+	if (!isset($_SESSION['mb_wmc'])) {
+		$e = new mb_notice("wmc not set, generating from app: " . $_SESSION["mb_user_gui"]);
+		$wmc->createFromApplication($_SESSION["mb_user_gui"]);		
+		$_SESSION["mb_wmc"] = $wmc->toXml();
+		$e = new mb_exception("initial WMC: " . $_SESSION["mb_wmc"]);
 	}
-	if ($_SESSION['GML']) {
-		$e = new mb_notice("loadwmc: merging bbox");
-		include(dirname(__FILE__) . "/../merge_bbox.php");
+
+	if (isset($_SESSION['mb_wmc'])) {
+		$e = new mb_notice("merging with WMC.");
+
+		if ($wmc->createFromXml($_SESSION['mb_wmc'])) {
+	
+			if ($mergeWms) {
+				$wmsArray = array();
+				for ($i = 0; $i < count($_SESSION["wms"]); $i++) {
+					$currentWms = new wms();
+					$currentWms->createObjFromXML($_SESSION["wms"][$i]);
+					array_push($wmsArray, $currentWms);
+				}
+				$wmc->mergeWmsArray($wmsArray);
+				$_SESSION["command"] = "";
+				$_SESSION["wms"] = array();
+			}
+	
+			$javaScriptArray = array();
+			$javaScriptArray = $wmc->toJavaScript();
+
+			$jsString .= implode("", $javaScriptArray);
+		}
+		else {
+			$jsString .= "var e = new Mb_notice('mod_loadwmc: load_wmc_session: error parsing wmc');";
+		}
 	}
+	else {
+		$e = new mb_notice("not merging WMC");
+		$jsString .= "var e = new Mb_warning('mod_loadwmc: load_wmc_session: no wmc set!');";
+	}
+	return $jsString;
 }
-*/
 
 //
 // Creates the function load_wmc_session.
 // This function loads a WMC from the session, if the element var
 // "loadFromSession" is set to true.
 //
-echo "function load_wmc_session() {";
-if (isset($_SESSION['mb_wmc'])) {
-	$wmc = new wmc();
-	if ($wmc->createFromXml($_SESSION['mb_wmc'])) {
-		$jsArray = array();
-//		if ($_SESSION['layer_preview']) {
-//			$js = $wmc->createJsObjFromWMC("", $e_target, "load");
-//		}
-//		else if ($startup == true) {
-//			$js = $wmc->createJsObjFromWMC("", $e_target, "merge");
-//			$startup = false;
-//		}		
-//		else {
-			$jsArray = $wmc->toJavaScript();
-//		}
-		echo implode("", $jsArray);
-		
-		// test wmc from app
-		$newWmc = new wmc();
-		$newWmc->createFromApplication($_SESSION["mb_user_gui"]);
-		
-		
-	}
-	else {
-		echo "var e = new Mb_notice('mod_loadwmc: load_wmc_session: error parsing wmc');";
-	}
+?>
+function load_wmc_session() {
+<?php
+if ($_SESSION["command"] && $_SESSION["command"] == "ADDWMS") {
+	$e = new mb_notice("merging with WMS in Session...");
+	echo createJs(true);
 }
 else {
-	echo "var e = new Mb_warning('mod_loadwmc: load_wmc_session: no wmc set!');";
+	$e = new mb_notice("NOT merging with WMS in Session...");
+	echo createJs(false);
 }
-echo "}";
+?>
+}
 
+<?php 
+if ($e_src) {
+	sprintf("var mod_loadwmc_img = new Image(); 
+			mod_loadwmc_img.src = '%s'", $e_src);
+	
+}
 
-echo "var mod_loadwmc_img = new Image(); mod_loadwmc_img.src = '" . $e_src . "';";
-
-
 //
 // Creates a pop up with a dialogue to load, view or delete WMC documents
 //

Modified: trunk/mapbender/http/javascripts/mod_savewmc.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_savewmc.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/javascripts/mod_savewmc.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -40,8 +40,12 @@
 	mb_registerInitFunctions('setOnUnload()');
 }
 
-var mod_savewmc_img = new Image(); 
-mod_savewmc_img.src = "<?php  echo $e_src;  ?>";
+<?php 
+if ($e_src) {
+	sprintf("var mod_savewmc_img = new Image(); 
+			mod_savewmc_img.src = '%s';", $e_src);
+}
+?>
 //var mod_savewmc_img_over = new Image(); mod_savewmc_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
 
 function mod_savewmc_session(){
@@ -63,9 +67,8 @@
 	if (currentWmcExtensionData != null) {
 		extensionDataString = $.toJSON(currentWmcExtensionData);
 	}
-
 	if (storeInSession) {
 		$.ajaxSetup({async:false}); //TODO: find out why async doesn't work onunload
 	}
 	$.post("../php/mod_savewmc_server.php", {"saveInSession":storeInSession, "generalTitle":generalTitle, "extensionData":extensionDataString, "mapObject":$.toJSON(mb_mapObj)}, callbackFunction);
-}
\ No newline at end of file
+}

Modified: trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -18,18 +18,12 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-session_start();
+require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
 $gui_id = $_SESSION["mb_user_gui"];
 
 $target = $_REQUEST["e_target"];
-$e_id_css = $_REQUEST["e_id_css"];
-$e_id = $_REQUEST["e_id"];
 $isLoaded = $_REQUEST["isLoaded"];
 
-require_once(dirname(__FILE__) . "/../../conf/mapbender.conf");
-
-$con = db_connect($DBSERVER,$OWNER,$PW);
-db_select_db($DB,$con);
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
@@ -495,9 +489,7 @@
 	   selectNode.setAttribute("onchange", "if(typeof(resultGeometryPopup)!='undefined'){resultGeometryPopup.destroy();}if(typeof(wfsPopup)!='undefined'){wfsPopup.destroy();};global_selectedWfsConfId = this.value;setWfsInfo();appendStyles();appendWfsForm();");
 	}
 	var isSelected = false;
-
 	for (var wfsConfId in global_wfsConfObj) {
-	
 		var optionNode = document.createElement("option");
 		
 		optionNode.value = wfsConfId;
@@ -708,7 +700,6 @@
 	
 	return cnt;
 }
-
 function validate(){
 	if(geomArray.count()>0){
  		geomArray.empty();
@@ -1267,7 +1258,6 @@
 	}
 	return true;
 }
-
 function callPick(obj){
 	dTarget = obj;
 	var dp = window.open('../tools/datepicker/datepicker.php?m=Jan_Feb_Mar_Apr_May_June_July_Aug_Sept_Oct_Nov_Dec&d=Mon_Tue_Wed_Thu_Fri_Sat_Sun&t=today','dp','left=200,top=200,width=230,height=210,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0');

Modified: trunk/mapbender/http/javascripts/wfs.js
===================================================================
--- trunk/mapbender/http/javascripts/wfs.js	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/javascripts/wfs.js	2008-08-05 11:54:58 UTC (rev 2739)
@@ -239,7 +239,7 @@
 	if (ns_xsi == false) str += 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ';
 	if (ns_featureNS == false) str += 'xmlns:"+featureNS+"="http://www.someserver.com/"+featureNS+"" ';
 	if (ns_wfs == false) str += 'xmlns:wfs="http://www.opengis.net/wfs" ';
-
+	
 	str += 'xsi:schemaLocation="http://www.opengis.net/wfs';
 	str += ' http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd';
 	str += ' ' + strForSchemaLocation;

Modified: trunk/mapbender/http/php/mod_editGuiWms.php
===================================================================
--- trunk/mapbender/http/php/mod_editGuiWms.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/php/mod_editGuiWms.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -82,7 +82,6 @@
 			}
 		}
 	}
-
 }
 function checkBoxValue(){
    for(var i=0; i<document.forms[0].elements.length; i++){
@@ -171,19 +170,15 @@
 		$cnt++;
 	}
 	#if($cnt > 1){die("Error: WMS (ID) not unique!");}
-
 		$sql = "Delete from gui_wms where fkey_gui_id = $1 and fkey_wms_id = $2 ";
 		$v = array($guiList,$wmsList);
 		$t = array('s','i');
 		$res = db_prep_query($sql,$v,$t);
-
 		$sql = "Delete from gui_layer where fkey_gui_id = $1 and gui_layer_wms_id = $2";
 		$v = array($guiList,$wmsList);
 		$t = array('s','i');
 		$res = db_prep_query($sql,$v,$t);
-
 		$del='false';
-
 		$sql = "UPDATE gui_wms SET gui_wms_position = (gui_wms_position - 1) WHERE gui_wms_position > $1";
 		$sql .= " AND fkey_gui_id = $2 ";
 		$v = array($wms_position,$guiList);
@@ -484,7 +479,6 @@
    $cnt_le++;
 }
 
-
 echo "<div style='position:absolute;left:590px; top:180px;' ><input type='button' style='width:100px;height:100px;background-color:#0066cc' value='save' onclick='checkBoxValue()'></div>";
 echo "<table class='table_top'>";
 echo "<tr>";
@@ -573,7 +567,6 @@
 	}
 	echo "</select>";
 	echo "</td>";
-
 echo "</tr>";
 
 # opacity
@@ -589,7 +582,6 @@
 	}
 	echo "</select>";
 	echo "</td>";
-
 echo "</tr>";
 
 # sld support
@@ -641,7 +633,6 @@
 echo "</td><td></td><td></td><td></td></tr>";
 
 for($i=0; $i<count($layer_id); $i++){
-
 #layer_styles
 $sql_styles = "SELECT * FROM layer_style WHERE  fkey_layer_id = $1";
 $v = array($layer_id[$i]);
@@ -685,7 +676,6 @@
 
   echo "<td><input name='L_".$layer_id[$i]."___gui_layer_minscale' type='text' size='5' value='".$gui_layer_minscale[$i]."'></td>";
   echo "<td style='background:lightgrey'><input name='L_".$layer_id[$i]."___gui_layer_maxscale' type='text' size='5' value='".$gui_layer_maxscale[$i]."'></td>";
-
   /**/
   echo "<td>\n";
   echo "<select class='select_short' name='L_".$layer_id[$i]."___gui_layer_style'>\n";
@@ -698,7 +688,6 @@
        echo ">".$style[$j]."</option>\n";
  }
   echo "</select></td>\n";
-
   /**/
   echo "<td><select class='select_auto' name='L_".$layer_id[$i]."___gui_layer_priority'>";
   for($j=0; $j<count($gui_layer_priority); $j++){
@@ -745,4 +734,4 @@
 }
 ?>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/mapbender/http/php/mod_loadCapabilitiesList.php
===================================================================
--- trunk/mapbender/http/php/mod_loadCapabilitiesList.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/php/mod_loadCapabilitiesList.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -304,4 +304,4 @@
 echo "<div class='getcapabilities'>" . $wms_getcapabilities . "</div>";
 ?>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/mapbender/http/php/mod_map1.php
===================================================================
--- trunk/mapbender/http/php/mod_map1.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/php/mod_map1.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -41,6 +41,7 @@
    $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";
@@ -122,7 +123,6 @@
 <body leftmargin='0' topmargin='0' onload="init()" bgcolor='#ffffff'>
 <div id='markResult' name='maps' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index:26'> </div>
 <div id='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>

Modified: trunk/mapbender/http/php/mod_mapOV.php
===================================================================
--- trunk/mapbender/http/php/mod_mapOV.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/php/mod_mapOV.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -71,8 +71,6 @@
 		
 		var ind = parent.getMapObjIndexByName('overview');
 		var ov_extent = parent.mb_mapObj[ind].getExtentInfos();
-//		parent.mb_setWmcExtensionData({"ov_minx":ov_extent.minx,"ov_miny":ov_extent.miny,"ov_maxx":ov_extent.maxx,"ov_maxy":ov_extent.maxy});
-	
 		parent.mb_mapObj[ind].isOverview = true;
 	});
 }

Modified: trunk/mapbender/http/php/mod_wfs_gazetteer_server.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_gazetteer_server.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/php/mod_wfs_gazetteer_server.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -94,7 +94,6 @@
 	
 	$obj = new WfsConf();
 	$obj->load($wfsConfIdArray);
-
 	$json = new Mapbender_JSON();
 	$output = $json->encode($obj->confArray);
 	echo $output;

Modified: trunk/mapbender/http/php/mod_wfs_server.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_server.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/php/mod_wfs_server.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -186,7 +186,6 @@
 		return false;
 	}
 	$sql = "SELECT * FROM gui_wfs_conf WHERE fkey_gui_id = $1 AND fkey_wfs_conf_id IN (".join(",",$confs['id']).")";
-         	$e = new mb_exception("Error: aaaa " . $sql);
 	$v = array($obj->selectedGui);
 	$t = array('s');
 	$res = db_prep_query($sql,$v,$t);
@@ -316,4 +315,4 @@
 	header("Content-Type: text/x-json");
 	echo $output;
 }
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/http/print/mod_printPDF_pdf.php
===================================================================
--- trunk/mapbender/http/print/mod_printPDF_pdf.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/print/mod_printPDF_pdf.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -17,11 +17,7 @@
 # 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");
-ob_start();
-session_start();
-ini_set('error_reporting', 'E_ALL & ~ E_NOTICE');
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
 
 include (dirname(__FILE__)."/../classes/class.ezpdf.php");
 include (dirname(__FILE__)."/../classes/class_stripRequest.php");
@@ -30,7 +26,6 @@
 include (dirname(__FILE__)."/../print/".$_REQUEST["conf"]);
 include (dirname(__FILE__)."/../classes/class_SaveLegend.php");
 include (dirname(__FILE__)."/../print/print_functions.php");
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
 
 if($log == true){
 	include (dirname(__FILE__)."/../classes/class_log.php");
@@ -157,75 +152,77 @@
 }
 $coord = mb_split(",",$map_extent);
 
-// analyse overview url and draw rectangle with position
-$o_url = new stripRequest($overview_url);
-$overview_width = round($o_url->get("width"));
-$overview_height = round($o_url->get("height"));
-
-if($factor>1){
-	$o_url->set('width',(intval($o_url->get('width'))*4));
-	$o_url->set('height',(intval($o_url->get('height'))*4));
-	if(in_array($o_url->get('map'),$highqualitymapfiles)){	
-			$o_url->set('map',preg_replace("/\.map/","_4.map",$o_url->get('map')));		
-			$overview_url = $o_url->url;	
+if($overview === true){
+	// analyse overview url and draw rectangle with position
+	$o_url = new stripRequest($overview_url);
+	$overview_width = round($o_url->get("width"));
+	$overview_height = round($o_url->get("height"));
+	
+	if($factor>1){
+		$o_url->set('width',(intval($o_url->get('width'))*4));
+		$o_url->set('height',(intval($o_url->get('height'))*4));
+		if(in_array($o_url->get('map'),$highqualitymapfiles)){	
+				$o_url->set('map',preg_replace("/\.map/","_4.map",$o_url->get('map')));		
+				$overview_url = $o_url->url;	
+		}
 	}
-}
+	
+	if($matching == true){
+		$overview_url = preg_replace($pattern,$replacement,$overview_url);  
+	}
+	
+	
+	if ($size == "A4" && $format == "portrait"){
+		$overview_left = $a4p_overviewOffset_left;
+		$overview_bottom =$a4p_overviewOffset_bottom;
+	}elseif ($size == "A4" && $format == "landscape"){
+		$overview_left = $a4l_overviewOffset_left;
+		$overview_bottom =$a4l_overviewOffset_bottom;
+	}elseif ($size == "A3" && $format == "portrait"){
+		$overview_left = $a3p_overviewOffset_left;
+		$overview_bottom =$a3p_overviewOffset_bottom;
+	}elseif ($size == "A3" && $format == "landscape"){
+		$overview_left = $a3l_overviewOffset_left;
+		$overview_bottom = $a3l_overviewOffset_bottom;
+	}elseif ($size == "A2" && $format == "portrait"){
+		$overview_left = $a2p_overviewOffset_left;
+		$overview_bottom =$a2p_overviewOffset_bottom;
+	}elseif ($size == "A2" && $format == "landscape"){
+		$overview_left = $a2l_overviewOffset_left;
+		$overview_bottom = $a2l_overviewOffset_bottom;
+	}elseif ($size == "A1" && $format == "portrait"){
+		$overview_left = $a1p_overviewOffset_left;
+		$overview_bottom =$a1p_overviewOffset_bottom;
+	}elseif ($size == "A1" && $format == "landscape"){
+		$overview_left = $a1l_overviewOffset_left;
+		$overview_bottom = $a1l_overviewOffset_bottom;
+	}elseif ($size == "A0" && $format == "portrait"){
+		$overview_left = $a0p_overviewOffset_left;
+		$overview_bottom =$a0p_overviewOffset_bottom;
+	}elseif ($size == "A0" && $format == "landscape"){
+		$overview_left = $a0l_overviewOffset_left;
+		$overview_bottom = $a0l_overviewOffset_bottom;
+	}
+	
+	$o_extent = $o_url->get("BBOX");
+	
+	$array_overview_url[0] = $overview_url;
+	if($log == true){
+		$l = new log("printPDF_overview",$array_overview_url);
+	}
+	
+	/*
+	$o_new = new stripRequest($overview_url);
+	$o_new->set('width',50);
+	$o_new->set('height',50);
+	//$o->set('BBOX',$overview_extent);
+	$o_url_new =$o_new->url;
+	$array_overview[0] = $overview_url;
+	$array_overview[1] = $o_url;
+	*/
+}	
 
-if($matching == true){
-	$overview_url = preg_replace($pattern,$replacement,$overview_url);  
-}
-
-
-if ($size == "A4" && $format == "portrait"){
-	$overview_left = $a4p_overviewOffset_left;
-	$overview_bottom =$a4p_overviewOffset_bottom;
-}elseif ($size == "A4" && $format == "landscape"){
-	$overview_left = $a4l_overviewOffset_left;
-	$overview_bottom =$a4l_overviewOffset_bottom;
-}elseif ($size == "A3" && $format == "portrait"){
-	$overview_left = $a3p_overviewOffset_left;
-	$overview_bottom =$a3p_overviewOffset_bottom;
-}elseif ($size == "A3" && $format == "landscape"){
-	$overview_left = $a3l_overviewOffset_left;
-	$overview_bottom = $a3l_overviewOffset_bottom;
-}elseif ($size == "A2" && $format == "portrait"){
-	$overview_left = $a2p_overviewOffset_left;
-	$overview_bottom =$a2p_overviewOffset_bottom;
-}elseif ($size == "A2" && $format == "landscape"){
-	$overview_left = $a2l_overviewOffset_left;
-	$overview_bottom = $a2l_overviewOffset_bottom;
-}elseif ($size == "A1" && $format == "portrait"){
-	$overview_left = $a1p_overviewOffset_left;
-	$overview_bottom =$a1p_overviewOffset_bottom;
-}elseif ($size == "A1" && $format == "landscape"){
-	$overview_left = $a1l_overviewOffset_left;
-	$overview_bottom = $a1l_overviewOffset_bottom;
-}elseif ($size == "A0" && $format == "portrait"){
-	$overview_left = $a0p_overviewOffset_left;
-	$overview_bottom =$a0p_overviewOffset_bottom;
-}elseif ($size == "A0" && $format == "landscape"){
-	$overview_left = $a0l_overviewOffset_left;
-	$overview_bottom = $a0l_overviewOffset_bottom;
-}
-
-$o_extent = $o_url->get("BBOX");
-
-$array_overview_url[0] = $overview_url;
-if($log == true){
-	$l = new log("printPDF_overview",$array_overview_url);
-}
-
 /*
-$o_new = new stripRequest($overview_url);
-$o_new->set('width',50);
-$o_new->set('height',50);
-//$o->set('BBOX',$overview_extent);
-$o_url_new =$o_new->url;
-$array_overview[0] = $overview_url;
-$array_overview[1] = $o_url;
-*/
-
-/*
  * north arrow
  */
 if($size == "A4" && $format == "portrait"){

Modified: trunk/mapbender/http/print/printPDF.conf
===================================================================
--- trunk/mapbender/http/print/printPDF.conf	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/print/printPDF.conf	2008-08-05 11:54:58 UTC (rev 2739)
@@ -22,7 +22,7 @@
 * Legend
 */
 $legend=true;
-$label_legend = _mb('print legend');
+$label_legend = _mb('Print legend');
 $legendFilename = TMPDIR."/legend_".substr(md5(uniqid(rand())),0,7).".png";
 $legendFilenameUserPolygon = TMPDIR."/legend_".substr(md5(uniqid(rand())),0,7).".png";
 $legendText = _mb("Legend");
@@ -74,24 +74,27 @@
 * Labeling for buttons, textfields ...
 */
 
-$label_format = _mb("Format:");
+$label_format = _mb("Format");
 $label_format_a4 = "A4";
 $label_format_a3 = "A3";
 $label_format_a2 = "A2";
 $label_format_a1 = "A1";
 $label_format_a0 = "A0";
 
-$label_orientation = _mb("Orientation:");
+$label_orientation = _mb("Orientation");
 $label_portrait = _mb("portrait");
 $label_landscape = _mb("landscape");
 
-$label_72dpi = sprintf(_mb("Quality: %d dpi"), 72);
-$label_288dpi = sprintf(_mb("Quality: %d dpi"), 288);
+$label_quality = _mb("Quality");
+$label_72dpi = "72 dpi";
+$label_288dpi = "288 dpi";
 
-$label_comment = _mb("Comment (max. 30)");
-$comment_length = 30;
+$label_comment1 = _mb("Comment 1:");
+$label_comment2 = _mb("Comment 2:");
+$comment1_length = 30;
+$comment2_length = 30;
 
-$label_button = _mb('print');
+$label_button = _mb("print");
 
 /*
 * default
@@ -122,8 +125,8 @@
 $a4 = true;
 $a3 = true;
 $a2 = true;
-$a1 = false;
-$a0 = false;
+$a1 = true;
+$a0 = true;
 
 # dimensions of the map:
 

Modified: trunk/mapbender/http/print/printPDF_b.conf
===================================================================
--- trunk/mapbender/http/print/printPDF_b.conf	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/http/print/printPDF_b.conf	2008-08-05 11:54:58 UTC (rev 2739)
@@ -22,7 +22,7 @@
 * Legend
 */
 $legend=true;
-$label_legend = _mb('print legend');
+$label_legend = _mb('Print legend');
 $legendFilename = TMPDIR."/legend_".substr(md5(uniqid(rand())),0,7).".png";
 $legendFilenameUserPolygon = TMPDIR."/legend_".substr(md5(uniqid(rand())),0,7).".png";
 $legendText = _mb("Legend");
@@ -74,14 +74,14 @@
 * Labeling for buttons, textfields ...
 */
 
-$label_format = _mb("Format:");
+$label_format = _mb("Format");
 $label_format_a4 = "A4";
 $label_format_a3 = "A3";
 $label_format_a2 = "A2";
 $label_format_a1 = "A1";
 $label_format_a0 = "A0";
 
-$label_orientation = _mb("Orientation:");
+$label_orientation = _mb("Orientation");
 $label_portrait = _mb("portrait");
 $label_landscape = _mb("landscape");
 
@@ -91,7 +91,7 @@
 $label_comment = _mb("Comment (max. 30)");
 $comment_length = 30;
 
-$label_button = _mb('print');
+$label_button = _mb("print");
 
 /*
 * default

Modified: trunk/mapbender/lib/core.js
===================================================================
--- trunk/mapbender/lib/core.js	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/lib/core.js	2008-08-05 11:54:58 UTC (rev 2739)
@@ -36,54 +36,6 @@
  * Triggered before a feature info is requested.
  */
 var eventBeforeFeatureInfo = new MapbenderEvent();
-eventBeforeFeatureInfo.register(function() {
-	for (var j=0; j<mb_mapObj.length; j++) {
-		var mapObj = mb_mapObj[j];
-
-		//
-		// set list of visible layers, active querylayers 
-		// and styles for each WMS in this map
-		//
-		
-		var cnt_layers;
-		var cnt_querylayers;
-		var styles;
-		var layers;
-		var querylayers = "";
-		for(i=0; i< mapObj.wms.length; i++){
-			cnt_layers = 0;
-			cnt_querylayers = 0;
-			styles = "";
-			layers = "";
-			querylayers = "";
-	
-			for(var ii=0; ii<mapObj.wms[i].objLayer.length; ii++){
-				// layer is visible and not root layer
-				if(mapObj.wms[i].objLayer[ii].gui_layer_visible == 1 && ii>0){
-					if(cnt_layers > 0){
-						layers += ","; styles += ","; 
-					}
-					layers += wms[i].objLayer[ii].layer_name; 
-					styles += ""; 
-					cnt_layers++;
-				}            
-				// layer is queryable and not root layer
-				if(mapObj.wms[i].objLayer[ii].gui_layer_querylayer == 1 && ii>0){
-					if(cnt_querylayers > 0){
-						querylayers += ",";
-					}
-					querylayers += wms[i].objLayer[ii].layer_name; 
-					cnt_querylayers++;
-				}                          
-			}
-			mapObj.layers[i] = layers;
-			mapObj.styles[i] = styles;
-			mapObj.querylayers[i] = querylayers;
-		}
-		
-	}
-	
-});
 /**
  * Triggered after a WMS has been loaded.
  */
@@ -245,4 +197,4 @@
   else if(!frameName || frameName === ""){
        document.getElementById(elName).innerHTML = tagSource;
   }
-}
\ No newline at end of file
+}

Modified: trunk/mapbender/lib/database-mysql.php
===================================================================
--- trunk/mapbender/lib/database-mysql.php	2008-08-05 07:59:34 UTC (rev 2738)
+++ trunk/mapbender/lib/database-mysql.php	2008-08-05 11:54:58 UTC (rev 2739)
@@ -408,4 +408,4 @@
 	   return @mysql_field_len($lhandle,$fnumber);         
 } 
 
-?>
\ No newline at end of file
+?>



More information about the Mapbender_commits mailing list