svn commit: r928 - trunk/mapbender/http: classes html javascripts

christoph at osgeo.org christoph at osgeo.org
Tue Nov 21 10:33:51 EST 2006


Author: christoph
Date: 2006-11-21 15:33:51+0000
New Revision: 928

Modified:
   trunk/mapbender/http/classes/class_wmc.php
   trunk/mapbender/http/classes/class_wms.php
   trunk/mapbender/http/html/mod_treefolder.php
   trunk/mapbender/http/javascripts/map_obj.js
   trunk/mapbender/http/javascripts/mod_savewmc.php

Log:
added uid to layer object
(uid contains database id of layer)

Modified: trunk/mapbender/http/classes/class_wmc.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/classes/class_wmc.php?view=diff&rev=928&p1=trunk/mapbender/http/classes/class_wmc.php&p2=trunk/mapbender/http/classes/class_wmc.php&r1=927&r2=928
==============================================================================
--- trunk/mapbender/http/classes/class_wmc.php	(original)
+++ trunk/mapbender/http/classes/class_wmc.php	2006-11-21 15:33:51+0000
@@ -1,5 +1,5 @@
 <?php
-# $Id: class_wmc.php 505 2006-11-20 10:53:10Z christoph $
+# $Id: class_wmc.php 519 2006-11-21 15:33:24Z christoph $
 # http://www.mapbender.org/index.php/class_wmc.php
 # Copyright (C) 2002 CCGIS 
 #
@@ -27,6 +27,11 @@
 	if(CHARSET=="UTF-8") return utf8_decode($str);
 	return $str;
 }
+function sepNameSpace($s){
+	$c = strpos($s,":"); 
+	if($c>0)return substr($s,$c+1);
+	return $s;
+}
 class wmc {
 
 		var $wmc_id;
@@ -66,8 +71,10 @@
 		var $wmc_wms_title = array();
 		var $wmc_layer_queryable = array();
 		var $wmc_layer_hidden = array();
+		var $wmc_wms_id = array();
 		var $wmc_wms_service = array();
 		var $wmc_wms_version = array();
+		var $wmc_layer_id = array();
 		var $wmc_layer_title = array();
 		var $wmc_layer_name = array();
 		var $wmc_layer_abstract = array();
@@ -156,15 +163,17 @@
 	$request = NULL; 
 	$layer_style = array();
 	$cnt_styles = -1;
+	$extension = false;
 	
 	$general = false;
 	$layerlist = false;
 	$layer = false;
 	
 	foreach ($values as $element) {
+					$verbose .= ".";
 		if(strtoupper($element[tag]) == "VIEWCONTEXT" && $element[type] == "open"){
-			$this->wmc_id = $element[attributes]["id"];
-			$this->wmc_version = $element[attributes]["version"];
+				$this->wmc_id = $element[attributes]["id"];
+				$this->wmc_version = $element[attributes]["version"];
 		}
 		if(strtoupper($element[tag]) == "GENERAL" && $element[type] == "open"){
 		   $general = true;
@@ -173,127 +182,128 @@
 		   $layerlist = true;
 		}
 		if ($general) {
-			if(strtoupper($element[tag]) == "WINDOW"){
-				$this->wmc_windowWidth = $element[attributes]["width"];
-				$this->wmc_windowHeight = $element[attributes]["height"];
-			}
-			if(strtoupper($element[tag]) == "BOUNDINGBOX"){
-				$this->wmc_bBox_SRS = $element[attributes]["SRS"];
-				$this->wmc_bBox_minx = $element[attributes]["minx"];
-				$this->wmc_bBox_miny = $element[attributes]["miny"];
-				$this->wmc_bBox_maxx = $element[attributes]["maxx"];
-				$this->wmc_bBox_maxy = $element[attributes]["maxy"];
-			}
-			if(strtoupper($element[tag]) == "NAME"){
-				$this->wmc_name = mb_utf8_decode($element[value]);
-			}
-			if(strtoupper($element[tag]) == "TITLE"){
-				$this->wmc_title = mb_utf8_decode($element[value]);
-			}
-			if(strtoupper($element[tag]) == "ABSTRACT"){
-				$this->wmc_abstract = mb_utf8_decode($element[value]);
-			}
-			if(strtoupper($element[tag]) == "CONTACTINFORMATION" && $element['type'] == "open"){
-				$contactinformation = true;
-			}
-			if ($contactinformation) {
-				if(strtoupper($element[tag]) == "CONTACTPOSITION"){
-					$this->wmc_contactposition = mb_utf8_decode($element[value]);
+				if(strtoupper($element[tag]) == "WINDOW"){
+						$this->wmc_windowWidth = $element[attributes]["width"];
+						$this->wmc_windowHeight = $element[attributes]["height"];
+				}
+				if(strtoupper($element[tag]) == "BOUNDINGBOX"){
+						$this->wmc_bBox_SRS = $element[attributes]["SRS"];
+						$this->wmc_bBox_minx = $element[attributes]["minx"];
+						$this->wmc_bBox_miny = $element[attributes]["miny"];
+						$this->wmc_bBox_maxx = $element[attributes]["maxx"];
+						$this->wmc_bBox_maxy = $element[attributes]["maxy"];
 				}
-				if(strtoupper($element[tag]) == "CONTACTVOICETELEPHONE"){
-					$this->wmc_contactvoicetelephone = $element[value];
+				if(strtoupper($element[tag]) == "NAME"){
+						$this->wmc_name = mb_utf8_decode($element[value]);
 				}
-				if(strtoupper($element[tag]) == "CONTACTFACSIMILETELEPHONE"){
-					$this->wmc_contactfacsimiletelephone = $element[value];
+				if(strtoupper($element[tag]) == "TITLE"){
+						$this->wmc_title = mb_utf8_decode($element[value]);
 				}
-				if(strtoupper($element[tag]) == "CONTACTELECTRONICMAILADDRESS"){
-					$this->wmc_contactemail = mb_utf8_decode($element[value]);
+				if(strtoupper($element[tag]) == "ABSTRACT"){
+						$this->wmc_abstract = mb_utf8_decode($element[value]);
 				}
-				if(strtoupper($element[tag]) == "CONTACTPERSONPRIMARY" && $element['type'] == "open"){
-					$contactpersonprimary = true;
+				if(strtoupper($element[tag]) == "CONTACTINFORMATION" && $element['type'] == "open"){
+						$contactinformation = true;
 				}
-				if ($contactpersonprimary) {
-					if(strtoupper($element[tag]) == "CONTACTPERSON"){
-						$this->wmc_contactperson = mb_utf8_decode($element[value]);
+				if ($contactinformation) {
+					if(strtoupper($element[tag]) == "CONTACTPOSITION"){
+							$this->wmc_contactposition = mb_utf8_decode($element[value]);
 					}
-					if(strtoupper($element[tag]) == "CONTACTORGANIZATION"){
-						$this->wmc_contactorganization = mb_utf8_decode($element[value]);
+					if(strtoupper($element[tag]) == "CONTACTVOICETELEPHONE"){
+							$this->wmc_contactvoicetelephone = $element[value];
 					}
-					if(strtoupper($element[tag]) == "CONTACTPERSONPRIMARY" && $element['type'] == "close"){
-						$contactpersonprimary = false;
+					if(strtoupper($element[tag]) == "CONTACTFACSIMILETELEPHONE"){
+							$this->wmc_contactfacsimiletelephone = $element[value];
 					}
-				}
-				if(strtoupper($element[tag]) == "CONTACTADDRESS" && $element['type'] == "open"){
-					$contactaddress = true;
-				}
-				if ($contactaddress) {
-					if(strtoupper($element[tag]) == "ADDRESSTYPE"){
-						$this->wmc_contactaddresstype = mb_utf8_decode($element[value]);
+					if(strtoupper($element[tag]) == "CONTACTELECTRONICMAILADDRESS"){
+							$this->wmc_contactemail = mb_utf8_decode($element[value]);
 					}
-					if(strtoupper($element[tag]) == "ADDRESS"){
-						$this->wmc_contactaddress = mb_utf8_decode($element[value]);
+					if(strtoupper($element[tag]) == "CONTACTPERSONPRIMARY" && $element['type'] == "open"){
+							$contactpersonprimary = true;
 					}
-					if(strtoupper($element[tag]) == "CITY"){
-						$this->wmc_contactcity = mb_utf8_decode($element[value]);
+					if ($contactpersonprimary) {
+						if(strtoupper($element[tag]) == "CONTACTPERSON"){
+								$this->wmc_contactperson = mb_utf8_decode($element[value]);
+						}
+						if(strtoupper($element[tag]) == "CONTACTORGANIZATION"){
+								$this->wmc_contactorganization = mb_utf8_decode($element[value]);
+						}
+						if(strtoupper($element[tag]) == "CONTACTPERSONPRIMARY" && $element['type'] == "close"){
+								$contactpersonprimary = false;
+						}
 					}
-					if(strtoupper($element[tag]) == "STATEORPROVINCE"){
-						$this->wmc_contactstateorprovince = mb_utf8_decode($element[value]);
+					if(strtoupper($element[tag]) == "CONTACTADDRESS" && $element['type'] == "open"){
+							$contactaddress = true;
 					}
-					if(strtoupper($element[tag]) == "POSTCODE"){
-						$this->wmc_contactpostcode = $element[value];
+					if ($contactaddress) {
+						if(strtoupper($element[tag]) == "ADDRESSTYPE"){
+								$this->wmc_contactaddresstype = mb_utf8_decode($element[value]);
+						}
+						if(strtoupper($element[tag]) == "ADDRESS"){
+								$this->wmc_contactaddress = mb_utf8_decode($element[value]);
+						}
+						if(strtoupper($element[tag]) == "CITY"){
+								$this->wmc_contactcity = mb_utf8_decode($element[value]);
+						}
+						if(strtoupper($element[tag]) == "STATEORPROVINCE"){
+								$this->wmc_contactstateorprovince = mb_utf8_decode($element[value]);
+						}
+						if(strtoupper($element[tag]) == "POSTCODE"){
+								$this->wmc_contactpostcode = $element[value];
+						}
+						if(strtoupper($element[tag]) == "COUNTRY"){
+								$this->wmc_contactcountry = mb_utf8_decode($element[value]);
+						}
+						if(strtoupper($element[tag]) == "CONTACTADDRESS" && $element['type'] == "close"){
+								$contactaddress = false;
+						}
 					}
-					if(strtoupper($element[tag]) == "COUNTRY"){
-						$this->wmc_contactcountry = mb_utf8_decode($element[value]);
+				}
+				if(strtoupper($element[tag]) == "LOGOURL" && $element['type'] == "open"){
+						$logourl = true;
+						$this->wmc_logourl_width = $element[attributes]["width"];
+						$this->wmc_logourl_height = $element[attributes]["height"];
+						$this->wmc_logourl_format = $element[attributes]["format"];
+				}
+				if ($logourl) {
+					if(strtoupper($element[tag]) == "LOGOURL" && $element['type'] == "close"){
+							$logourl = false;
 					}
-					if(strtoupper($element[tag]) == "CONTACTADDRESS" && $element['type'] == "close"){
-						$contactaddress = false;
+					if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+						$this->wmc_logourl_type = $element[attributes]["xlink:type"];
+						$this->wmc_logourl = $element[attributes]["xlink:href"];
 					}
 				}
-			}
-			if(strtoupper($element[tag]) == "LOGOURL" && $element['type'] == "open"){
-				$logourl = true;
-				$this->wmc_logourl_width = $element[attributes]["width"];
-				$this->wmc_logourl_height = $element[attributes]["height"];
-				$this->wmc_logourl_format = $element[attributes]["format"];
-			}
-			if ($logourl) {
-				if(strtoupper($element[tag]) == "LOGOURL" && $element['type'] == "close"){
-					$logourl = false;
-				}
-				if(strtoupper($element[tag]) == "ONLINERESOURCE"){
-					$this->wmc_logourl_type = $element[attributes]["xlink:type"];
-					$this->wmc_logourl = $element[attributes]["xlink:href"];
+				if(strtoupper($element[tag]) == "DESCRIPTIONURL" && $element['type'] == "open"){
+						$descriptionurl = true;
+						$this->wmc_descriptionurl_format = $element[attributes]["format"];
 				}
-			}
-			if(strtoupper($element[tag]) == "DESCRIPTIONURL" && $element['type'] == "open"){
-				$descriptionurl = true;
-				$this->wmc_descriptionurl_format = $element[attributes]["format"];
-			}
-			if ($descriptionurl) {
-				if(strtoupper($element[tag]) == "DESCRIPTIONURL" && $element['type'] == "close"){
-					$descriptionurl = false;
-				}
-				if(strtoupper($element[tag]) == "ONLINERESOURCE"){
-					$this->wmc_descriptionurl_type = $element[attributes]["xlink:type"];
-					$this->wmc_descriptionurl = $element[attributes]["xlink:href"];
+				if ($descriptionurl) {
+					if(strtoupper($element[tag]) == "DESCRIPTIONURL" && $element['type'] == "close"){
+							$descriptionurl = false;
+					}
+					if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+						$this->wmc_descriptionurl_type = $element[attributes]["xlink:type"];
+						$this->wmc_descriptionurl = $element[attributes]["xlink:href"];
+					}
 				}
-			}
-			if(strtoupper($element[tag]) == "KEYWORDLIST" && $element['type'] == "open"){
-				$keywordlist = true;
-			}
-			if ($keywordlist) {
-				if(strtoupper($element[tag]) == "KEYWORDLIST" && $element['type'] == "close"){
-					$keywordlist = false;
-					$cnt_keyword = -1;
-				}
-				if(strtoupper($element[tag]) == "KEYWORD"){
-					$cnt_keyword++;
-					$this->wmc_keyword[$cnt_keyword] = mb_utf8_decode($element[value]);
+				if(strtoupper($element[tag]) == "KEYWORDLIST" && $element['type'] == "open"){
+						$keywordlist = true;
 				}
-			}
-			if(strtoupper($element[tag]) == "GENERAL" && $element['type'] == "close"){
-	   			$general = false;
-		 	}
+				if ($keywordlist) {
+					if(strtoupper($element[tag]) == "KEYWORDLIST" && $element['type'] == "close"){
+							$keywordlist = false;
+							$cnt_keyword = -1;
+					}
+					if(strtoupper($element[tag]) == "KEYWORD"){
+						$cnt_keyword++;
+						$this->wmc_keyword[$cnt_keyword] = mb_utf8_decode($element[value]);
+					}
+				}
+						
+				if(strtoupper($element[tag]) == "GENERAL" && $element['type'] == "close"){
+		   			$general = false;
+			 	}
 		}
 		if ($layerlist) {
 				if(strtoupper($element[tag]) == "LAYERLIST" && $element['type'] == "close"){
@@ -308,7 +318,7 @@
 				}
 				if ($layer) {
 					 if(strtoupper($element[tag]) == "LAYER" && $element[type] == "close"){
-				 		$layer = false;
+					 		$layer = false;
 					 }
 					 if ($formatlist) {
 						 if(strtoupper($element[tag]) == "FORMAT"){
@@ -421,10 +431,22 @@
 								 $cnt_epsg++;
 					 		 }
 						 }
-						 if(strtoupper($element[tag]) == "SCALEHINT"){
+						 if (strtoupper($element[tag]) == "EXTENSION" && $element[type] == "open") {
+						 	$extension = true;
+						 }
+						 if (strtoupper($element[tag]) == "EXTENSION" && $element[type] == "close") {
+						 	$extension = false;
+						 }
+						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "SCALEHINT"){
 					 		 $this->wmc_layer_minscale[$cnt_layer] = $element[attributes]["min"];
 					 		 $this->wmc_layer_maxscale[$cnt_layer] = $element[attributes]["max"];
 						 }
+						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "LAYER_ID"){
+					 		 $this->wmc_layer_id[$cnt_layer] = $element[value];
+						 }
+						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "WMS_ID"){
+					 		 $this->wmc_wms_id[$cnt_layer] = $element[value];
+						 }
 						 if(strtoupper($element[tag]) == "METADATAURL" && $element[type] == "open"){
 							 $metadataurl = true;
 						 }
@@ -444,6 +466,7 @@
 			}
 		}
 		return true;
+	  //return $verbose;
 	}
 
 	function createJsObjFromWMC($target, $mapObj, $action){
@@ -547,7 +570,7 @@
 									$wmc_string .= "if (!wms_exists) {\n\t";
 								} 
 								// add parent layer
-								$wmc_string .= $target . "wms_add_layer('','','". $this->wmc_wms_title[$i] ."','','0','0','0','0','','".$id."','1','1','1','0','0','0','0');\n";
+								$wmc_string .= $target . "wms_add_layer('','".$this->wmc_layer_id[$i]."','','". $this->wmc_wms_title[$i] ."','','0','0','0','0','','".$id."','1','1','1','0','0','0','0');\n";
 								if ($action == "merge") {
 									$wmc_string .= "}\n";
 								} 
@@ -584,6 +607,7 @@
 
 							// add layer
 							$wmc_string .= "\t" . $target . "wms_add_layer('0','". 
+								$this->wmc_layer_id[$ii] . "','". 
 								$this->wmc_layer_name[$ii] . "','". 
 								$this->wmc_layer_title[$ii] ."','". 
 								$this->wmc_layer_dataurl[$ii] . "','". 

Modified: trunk/mapbender/http/classes/class_wms.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/classes/class_wms.php?view=diff&rev=928&p1=trunk/mapbender/http/classes/class_wms.php&p2=trunk/mapbender/http/classes/class_wms.php&r1=927&r2=928
==============================================================================
--- trunk/mapbender/http/classes/class_wms.php	(original)
+++ trunk/mapbender/http/classes/class_wms.php	2006-11-21 15:33:51+0000
@@ -651,8 +651,8 @@
 			echo "parent.";
 		}
 		print ("wms_add_layer('". 
-			#$this->objLayer[$i]->layer_id ."','". 
 			$this->objLayer[$i]->layer_parent ."','". 
+			$this->objLayer[$i]->layer_uid ."','". 
 			$this->objLayer[$i]->layer_name . "','". 
 			$this->objLayer[$i]->layer_title ."','". 
 			$this->objLayer[$i]->layer_dataurl_href ."','". 
@@ -1345,6 +1345,7 @@
 		while($row2 = db_fetch_array($res_layer)){
 			$this->addLayer($row2["layer_pos"],$row2["layer_parent"]);
 			$layer_cnt=count($this->objLayer)-1;
+			$this->objLayer[$layer_cnt]->layer_uid = $layer_id;
 			$this->objLayer[$layer_cnt]->layer_name =$row2["layer_name"];
 			$this->objLayer[$layer_cnt]->layer_title =$row2["layer_title"];			
 			$this->objLayer[$layer_cnt]->layer_dataurl_href =$row2["layer_dataurl"];
@@ -1356,6 +1357,7 @@
 			$this->objLayer[$layer_cnt]->layer_maxscale = $row2["layer_maxscale"];
 			$count_layer++;
 		}
+		$this->objLayer[$layer_cnt]->layer_uid = $layer_id;
 		$this->objLayer[$layer_cnt]->gui_layer_wms_id = $row["gui_layer_wms_id"];
 		$this->objLayer[$layer_cnt]->gui_layer_selectable = $row["gui_layer_selectable"];
 		$this->objLayer[$layer_cnt]->gui_layer_visible = $row["gui_layer_visible"];

Modified: trunk/mapbender/http/html/mod_treefolder.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/html/mod_treefolder.php?view=diff&rev=928&p1=trunk/mapbender/http/html/mod_treefolder.php&p2=trunk/mapbender/http/html/mod_treefolder.php&r1=927&r2=928
==============================================================================
--- trunk/mapbender/http/html/mod_treefolder.php	(original)
+++ trunk/mapbender/http/html/mod_treefolder.php	2006-11-21 15:33:51+0000
@@ -1,666 +1,671 @@
-<?php
-session_start();
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
-$gui_id = $_SESSION["mb_user_gui"];
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-<META NAME="Generator" CONTENT="Cosmo Create 1.0.3">
-<?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 pop_up(name, einstellungen)
-{
-	window.open ('',name,einstellungen);
-}
-</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="JavaScript1.2">
-  <!--  
-  /*
-   * sitemap.js 1.31 05/02/2000
-   *  - Opera 5
-   *
-   * sitemap.js 1.3 27/11/2000
-   *  - Netscape 6
-   *
-   * sitemap.js 1.2 20/05/2000
-   *  - split array tree into arrays for each element old tree
-   *  - no mory type flag, an folder is an entry which has sons
-   *  - a folder can have an link
-   *  - while initing an default layers is shown 
-   *
-   * sitemap.js 1.1 20/10/1999
-   *  - showTree only updates and init layers new which have been really changed
-   *  - add deep to knot entry
-   *  - substitute knotDeep[ id ] w/ tree[ id2treeIndex[ id ] ].deep
-   *  - add alignment to img and a &nbsp; at the beginning of eyery line
-   *  - add a fake img for bookmarks on top panel
-   *
-   * sitemap.js 1.02 14/10/1999
-   *  - fix bug in initStyles
-   *
-   * sitemap.js 1.01 06/10/1999
-   *  - fix bug in knotDeep for Netscape 4.00-4.0.5
-   *
-   * sitemap.js 1.0 20/09/1999
-   *
-   * Javascript function for displaying hierarchic directory structures with
-   * the ability to collapse and expand directories.
-   *
-   * Copyright (c) 1999 Polzin GmbH, Duesseldorf. All Rights Reserved.
-   * Author: Lutz Eymers <ixtab at polzin.com>
-   * Download: http://www.polzin.com/inet/fset_inet.phtml?w=goodies
-   *
-   * Permission to use, copy, modify, and distribute this software
-   * and its documentation for any purposes and without fee
-   * is hereby granted provided that this copyright notice
-   * appears in all copies. 
-   *
-   * Of course, this software is provided "as is" without express or implied
-   * warranty of any kind.
-   *
-   */
-
-// some defaults
-try{if (switchwms){}}catch(e){switchwms = 'false';}
-try{if (ficheckbox){}}catch(e){ficheckbox = 'true';}
-try{if (metadatalink){}}catch(e){metadatalink = 'false';}
-
-  
-  parent.mb_registerSubFunctions("window.frames['treeGDE'].mod_treeGDE();");
-  parent.mb_registerloadWmsSubFunctions("window.frames['treeGDE'].deleteInputTags();");
-  parent.mb_registerloadWmsSubFunctions("window.frames['treeGDE'].document.location.reload();");
-  
-
-function deleteInputTags() {
-	var max = document.getElementsByTagName("input").length;
-	for (var i=0; i<max; i++) {
-		var aNode = document.getElementsByTagName("input")[0];
-		var aNodeParent = aNode.parentNode;
-		aNodeParent.removeChild(aNode);
-	}
-}
-function handleSelectedLayer(mapObj,wms_id,layername,type,status){
-	var mywms = new Array();
-	mywms[0] = wms_id;
-	var mylayername = new Array();
-	mylayername[0] = layername;
-	parent.handleSelectedLayer_array(mapObj, mywms, mylayername, type, status);
-}
-function switchWMS(w,s){
-	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].wms_id == w){
-					for(var iii=1; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
-						if(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_selectable == '1'){
-							parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_visible = s;
-						}
-						if(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_queryable == '1'){
-							//parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_querylayer = s;
-						}
-					}
-				}
-			}
-		}
-	}
-	parent.mb_restateLayers(mod_treeGDE_map,w);
-	parent.setSingleMapRequest(mod_treeGDE_map,w);
-}
-function mod_treeGDE(){
-  /**/
-	var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
-	//if(ind == false){ alert("error, no mapobject specified");}
-	for(var i=0; i<document.getElementsByTagName("input").length; i++){
-		//layer_shortname,wms_id,{visible | querylayer}
-		var myID = document.getElementsByTagName("input")[i].id;
-		var arrayID = document.getElementsByTagName("input")[i].id.split("###");
-		var wms_ind = parent.getWMSIndexById(mod_treeGDE_map,arrayID[1]);
-		if(arrayID[2] == "visible" && typeof(wms_ind) != "undefined"){
-			var arrayLayer = parent.mb_mapObj[ind].layers[wms_ind].split(",");
-			var isOn = false;
-			for(var ii=0; ii<arrayLayer.length; ii++){
-				if(arrayID[0] == arrayLayer[ii]){
-					isOn = true;
-				}
-			}
-			if(isOn == true){ document.getElementById(myID).checked = true;}
-			if(isOn == false){ document.getElementById(myID).checked = false;}
-		}
-		if(arrayID[2] == "querylayer" && typeof(wms_ind) != "undefined"){
-			var arrayLayer = parent.mb_mapObj[ind].querylayers[wms_ind].split(",");
-			var isOn = false;
-			for(var ii=0; ii<arrayLayer.length; ii++){
-				if(arrayID[0] == arrayLayer[ii]){
-					isOn = true;
-				}
-			}
-			if(isOn == true){ document.getElementById(myID).checked = true;}
-			if(isOn == false){ document.getElementById(myID).checked = false;}
-		}
-	}
-    /*consider scalhints*/
-	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(document.getElementById(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name+"_"+parent.mb_mapObj[i].wms[ii].wms_id)){
-						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){                    
-							document.getElementById(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name+"_"+parent.mb_mapObj[i].wms[ii].wms_id).style.color = '#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){
-							document.getElementById(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name+"_"+parent.mb_mapObj[i].wms[ii].wms_id).style.color = '#999999';
-						}
-						else{
-							document.getElementById(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name+"_"+parent.mb_mapObj[i].wms[ii].wms_id).style.color = '#000000';
-						}
-					}                   
-				}
-			}
-		}
-	}
-} 
-  window.onError=null;
-
-  var idx=0
-  var treeId = new Array();
-  var treeP_id = new Array();
-  var treeIsOn = new Array();
-  var treeTyp = new Array();
-  var treeName = new Array();
-  var treeUrl = new Array();
-  var treeWasOn = new Array();
-  var treeDeep = new Array();
-  var treeLastY = new Array();
-  var treeIsShown = new Array();
-  var treeSelectable = new Array();
-  var treeVisible = new Array();
-  var treeQueryable = new Array();
-  var treeQuerylayer = new Array();
-  var treeWMS = new Array();
-  var treeShortname = new Array();
-
-
-  function Note( id,p_id,name,url,selectable,visible,queryable,querylayer,wms,shortname) {
-    treeId[ idx ] = id
-    treeP_id[ idx ] = p_id
-    treeIsOn[ idx ] = false
-    treeTyp[ idx ] = 'f'
-    treeName[ idx ] = name
-    treeUrl[ idx ] = url 
-    treeWasOn[ idx ] = false
-    treeDeep[ idx ] = 0
-    treeLastY[ idx ] = 0
-    treeIsShown[ idx ] = false
-    treeSelectable[ idx ] = selectable
-    treeVisible[ idx ] = visible
-    treeQueryable[ idx ] = queryable
-    treeQuerylayer[ idx ] = querylayer
-    treeWMS[ idx ] = wms
-    treeShortname[ idx ] = shortname
-
-    idx++
-  }
-
-  function openwindow(Adresse) {
-    Fenster1 = window.open(Adresse, "Informationen", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
-    Fenster1.focus();
-  }
-
-  function initDiv ( )
-  {
-    if ( isDOM || isDomIE )
-    {
-      divPrefix='<DIV CLASS="sitemap" style="position:absolute; left:0; top:0; visibility:hidden;" ID="sitemap'
-      divInfo='<DIV CLASS="sitemap" style="position:absolute; visibility:visible" ID="sitemap'
-    }
-    else
-    {
-      divPrefix='<DIV CLASS="sitemap" ID="sitemap'
-      divInfo='<DIV CLASS="sitemap" ID="sitemap'
-    }
-    document.writeln( divInfo +  'info">Bitte haben Sie etwas Geduld.<BR>&nbsp;<BR>Es werden die Eintr&auml;ge aus<BR>&nbsp;<BR>der Datenbank initialisiert.</DIV> ' );
-    for ( var i=1; i<idx; i++ )
-    {
-      // linked Name ? 
-      if ( treeUrl[i] != '' ){
-
-        linkedName = "<input id='"+treeShortname[i]+"###"+treeWMS[i]+"###visible###' type='checkbox' ";
-         if(treeVisible[i] == '1'){ linkedName += "checked ";}
-         
-         if(treeSelectable[i] != '1'){ 
-         	linkedName += "disabled ";
-         }
-        linkedName += "onClick = 'if(this.checked){handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"visible\",1);";
-		if(ficheckbox == 'false'){
-			linkedName += "handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"querylayer\",1);";
-		}
-        linkedName += "}";
-        linkedName += "else{handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"visible\",0);";
-        if(ficheckbox == 'false'){
-			linkedName += "handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"querylayer\",0);";
-		}
-        linkedName += "}'";
-        linkedName += '>';
-        
-        if (ficheckbox == 'true'){
-            linkedName += "<input id='"+treeShortname[i]+"###"+treeWMS[i]+"###querylayer' type='checkbox' ";
-            if(treeQuerylayer[i] == '1'){ linkedName += "checked ";}
-            if(treeQueryable[i] != '1'){ linkedName += "disabled ";}
-            linkedName += "onClick = 'if(this.checked){handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"querylayer\",1);}";
-            linkedName += "else{handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"querylayer\",0);}'";
-            linkedName += '>';
-        }
-      
-        //linkedName += '<A id="'+treeWMS[i]+'_'+treeShortname[i]+'"  HREF="' + treeUrl[i] + '" TARGET="' + defaultTarget + '"><IMG SRC="'+imagedir+'/1w.gif" BORDER="0" WIDTH="3">' + treeName[i] + '</A>';
-        
-        linkedName += '<A id="'+treeShortname[i]+'_'+treeWMS[i];
-        
-        if (metadatalink == 'true'){
-           linkedName += '"  HREF="' + treeUrl[i];
-        }
-//        linkedName += '"  HREF="../php/mod_layerMetadata.php?id=' + ;
-
-
-        linkedName +='" TARGET="' + defaultTarget + '" onclick="openwindow(this.href); return false"><IMG SRC="'+imagedir+'/1w.gif" BORDER="0" WIDTH="3">' + treeName[i] + '</A>';
-       
-       
-      }  
-      else{
-        linkedName =  '<IMG SRC="'+imagedir+'/1w.gif" BORDER="0" WIDTH="3">';
-        if(switchwms == 'true'){
-        	linkedName += '<input type="checkbox" onclick="if(this.checked){switchWMS(\''+treeWMS[i]+'\',1)}else{switchWMS(\''+treeWMS[i]+'\',0)}">';
-        }
-        linkedName += treeName[i];
-      }
-      // don't link folder icon if node has no sons
-      if ( i == idx-1 || treeP_id[i+1] != treeId[i] ) {
-        if ( treeDeep[ i ] == 0 )
-          folderImg = '<IMG ALIGN="BOTTOM" SRC="'+imagedir+'/file_empty.gif" BORDER="0" HEIGHT="16" WIDTH="1" HSPACE="0">'
-        else
-          folderImg = ''
-      } else {
-        folderImg = '<A  HREF="javascript:sitemapClick(' + treeId[i] + ')"><IMG ALIGN="BOTTOM" SRC="'+imagedir+'/folder_off.gif" BORDER="0" NAME="folder' + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0"></A>'
-      }
-      // which type of file icon should be displayed?
-      if ( treeP_id[i] != 0 )
-      {
-        if ( lastEntryInFolder( treeId[i] ) )
-          fileImg = '<IMG ALIGN="BOTTOM" SRC="'+imagedir+'/file_last.gif" BORDER="0" NAME="file'
-            + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0">'  
-        else    
-          fileImg = '<IMG ALIGN="BOTTOM" SRC="'+imagedir+'/file.gif" BORDER="0" NAME="file'
-            + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0">'  
-      }
-      else
-        fileImg = ''
-      // traverse parents up to root and show vertical lines if parent 
-      // is not the last entry on this layer
-      verticales = ''
-      for( var act_id=treeId[i] ; treeDeep[ id2treeIndex[ act_id ] ] > 1;  )
-      {  
-        act_id = treeP_id[ id2treeIndex[ act_id ]]
-        if ( lastEntryInFolder( act_id ) )
-        {
-          verticales = '<IMG ALIGN="BOTTOM" SRC="'+imagedir+'/file_empty.gif" BORDER="0" HEIGHT="16" WIDTH="30" HSPACE="0">' + verticales
-        }
-        else
-        {
-          verticales = '<IMG ALIGN="BOTTOM" SRC="'+imagedir+'/file_vert.gif" BORDER="0" HEIGHT="16" WIDTH="30" HSPACE="0">' + verticales
-        }
-      }
-
-      
-      document.writeln( divPrefix + treeId[i] + '"><NOBR>&nbsp;' + verticales + fileImg + folderImg + linkedName + '</NOBR></DIV>'
-      )  
-    }
-  }
-
-  function initStyles ( )
-  {
-    document.writeln( '<STYLE TYPE="text/css">' + "\n" + '<!--' )
-    for ( var i=1,y=y0; i<idx; i++ )
-    {  
-      document.writeln( '#sitemap' + treeId[i] + ' {POSITION: absolute; VISIBILITY: hidden;}' )
-      if ( treeIsOn[ id2treeIndex[ treeP_id[i] ] ] )
-        y += deltaY
-    }
-    document.writeln( '#sitemapinfo {POSITION: absolute; VISIBILITY: visible;}' )
-    document.writeln( '//-->' + "\n" + '</STYLE>' )
-  }
-
-
-
-  function sitemapClick( id )
-  {
-    var i = id2treeIndex[ id ]
-
-    if ( treeIsOn[ i ] )
-    // close directory
-    {
-      // mark node as invisible
-      treeIsOn[ i ]=false
-      // mark all sons as invisible
-      actDeep = treeDeep[ i ]
-      for( var j=i+1; j<idx && treeDeep[j] > actDeep; j++ )
-      {
-        treeWasOn[ j ] = treeIsOn[ j ]
-        treeIsOn[ j ]=false
-      }
-      gif_off( id )
-    }
-    else
-    // open directory
-    { 
-      treeIsOn[ i ]=true
-      // remember and restore old status
-      actDeep = treeDeep[ i ]
-      for( var j=i+1; j<idx && treeDeep[j] > actDeep; j++ )
-      {
-        treeIsOn[ j ] = treeWasOn[ j ]
-      }
-      gif_on( id )
-    }
-    showTree()
-  }
-
-  function knotDeep( id )
-  {
-    var deep=0
-    while ( true )
-      if ( treeP_id[ id2treeIndex[id] ] == 0 )
-        return deep
-      else
-      {
-        ++deep
-        id = treeP_id[ id2treeIndex[id] ]
-      }
-    return deep  
-  }
-
-  function initTree( id )
-  {
-    treeIsOn[ id2treeIndex[id] ] = true
-    if ( treeTyp[ id2treeIndex[id] ] != 'b' )
-      gif_on( id ) 
-    while ( treeP_id[ id2treeIndex[id] ] != 0 )
-    {
-      id = treeP_id[ id2treeIndex[id] ]
-      treeIsOn[ id2treeIndex[id] ] = true
-      if ( treeTyp[ id2treeIndex[id] ] != 'b' )
-        gif_on( id ) 
-    }
-  }
-
-  function lastEntryInFolder( id )
-  {
-    var i = id2treeIndex[id]
-    if ( i == idx-1 )
-      return true
-    if ( treeTyp[i] == 'b' )
-    {
-      if ( treeP_id[i+1] != treeP_id[i] )
-        return true
-      else 
-        return false
-    }
-    else
-    {
-      var actDeep = treeDeep[i]
-      for( var j=i+1; j<idx && treeDeep[j] > actDeep ; j++ )
-      ;
-      if ( j<idx && treeDeep[j] == actDeep )
-        return false
-      else
-        return true
-    }
-  }
-
-  function showTree()
-  {
-    for( var i=1, y=y0, x=x0; i<idx; i++ )
-    {
-      if ( treeIsOn[ id2treeIndex[ treeP_id[i] ] ] )
-      {
-        // show current node
-        if ( !(y == treeLastY[i] && treeIsShown[i] ) )
-        {
-          showLayer( "sitemap"+ treeId[i] ) 
-          setyLayer( "sitemap"+ treeId[i], y )
-          treeIsShown[i] = true
-        } 
-        treeLastY[i] = y
-        y += deltaY
-      }
-      else
-      {
-        // hide current node and all sons
-        if ( treeIsShown[ i ] )
-        {
-          hideLayer( "sitemap"+ treeId[i] ) 
-          treeIsShown[i] = false
-        }
-      }
-    }
-  }
-
-  function initIndex() {
-    for( var i=0; i<idx; i++ )
-      id2treeIndex[ treeId[i] ] = i
-  }
-
-  function gif_name (name, width, height) {
-    this.on = new Image (width, height);
-    this.on.src = imagedir+ "/" +name + "_on.gif"
-    this.off = new Image (width, height);
-    this.off.src = imagedir+ "/"+name + "_off.gif"
-  }
-
-  function load_gif (name, width, height) {
-    gif_name [name] = new gif_name (name,width,height);
-  }
-
-  function load_all () {
-    load_gif ('folder',30,16)
-    file_last = new Image( 30,16 )
-    file_last.src = imagedir+ "/file_last.gif"
-    file_middle = new Image( 30,16 )
-    file_middle.src = imagedir+ "/file.gif"
-    file_vert = new Image( 30,16 )
-    file_vert.src = imagedir+ "/file_vert.gif"
-    file_empty = new Image( 30,16 )
-    file_empty = imagedir+ "/file_empty.gif"
-  }
-
-  function gif_on ( id ) {
-    eval("document['folder" + id + "'].src = gif_name['folder'].on.src")
-  }
-
-  function gif_off ( id ) {
-    eval("document['folder" + id + "'].src = gif_name['folder'].off.src")
-  }
- 
-  // global configuration
-  var deltaX = 30
-  var deltaY = 16
-  var x0 = 5
-  var y0 = 5
-  var defaultTarget = '_blank'
-
-  var browserName = navigator.appName;
-  var browserVersion = parseInt(navigator.appVersion);
-  var isIE = false;
-  var isNN = false;
-  var isDOM = false;
-  var isDomIE = false;
-  var isDomNN = false;
-  var layerok = false;
-
-  var isIE = browserName.indexOf("Microsoft Internet Explorer" )==-1?false:true;
-  var isNN = browserName.indexOf("Netscape")==-1?false:true;
-  var isOpera = browserName.indexOf("Opera")==-1?false:true;
-  var isDOM = document.getElementById?true:false;
-  var isDomNN = document.layers?true:false;
-  var isDomIE = document.all?true:false;
-
-  if ( isNN && browserVersion>=4 ) layerok=true;
-  if ( isIE && browserVersion>=4 ) layerok=true;
-  if ( isOpera && browserVersion>=5 ) layerok=true;
-
-    
-  function hideLayer(layerName) {
-    if (isDOM)
-      document.getElementById(layerName).style.visibility="hidden"
-    else if (isDomIE)
-      document.all[layerName].style.visibility="hidden";
-    else if (isDomNN) 
-      document.layers[layerName].visibility="hidden";
-  }
-
-  function showLayer(layerName) {
-    if (isDOM)
-      document.getElementById(layerName).style.visibility="visible"
-    else if (isDomIE)
-      document.all[layerName].style.visibility="visible";
-    else if (isDomNN)
-      document.layers[layerName].visibility="visible";
-  }
-
-  function setyLayer(layerName, y) {
-    if (isDOM)
-      document.getElementById(layerName).style.top=y
-    else if (isDomIE)
-      document.all[layerName].style.top=y;
-    else if (isDomNN)
-      document.layers[layerName].top=y;
-  }
-
-  var id2treeIndex = new Array()
-
-  // the structure is easy to understand with a simple example
-  // p_id is the id of the parent
-  // E0                                      ( id=0,p_id=-1 )
-  //          E11                            ( id=1,p_id=0)
-  //                     E111                ( id=2,p_id=1 )
-  //                     E112                ( id=3,p_id=1 )
-  //          E12                            ( id=4,p_id=0 )
-  //                     E121                ( id=5,p_id=4 ) 
-  //          E13                            ( id=6,p_id=0 ) 
-  //                     E131                ( id=7,p_id=6 ) 
-  //                                 E1311   ( id=8,p_id=7 ) 
-  //                     E132                ( id=9,p_id=6 ) 
-  // this is a multinary tree structure which is easy to
-  // populate with database data :)
-function initArray(){
-	var parentObj = 0;
-	if(parent.mb_mapObj.length == 0){ window.setTimeout("initArray()",100); }    
-	else if(parent.mb_mapObj.length > 0){
-		Note(0,-1,'','');
-		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 == ""){                    
-								//alert((parseInt(temp.layer_id)+1) + " , " +0 + " , " +temp.layer_title + " , " +" , "+temp.layer_metadataurl);
-								Note((parseInt(temp.layer_id)+1),0,temp.layer_title,'','','','','',parent.mb_mapObj[i].wms[ii].wms_id,'');
-								parentObj = temp.layer_id+1;                  
-							}
-							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == "0"){
-								//alert((parseInt(temp.layer_id)+1) + " , " +parentObj + " , " +temp.layer_title + " , " +temp.layer_metadataurl);
-								if(temp.gui_layer_selectable == '1' || temp.gui_layer_queryable == '1'){
-									//alert((parseInt(temp.layer_id)+1) + " , " +parentObj + " , " +temp.layer_title + " , " +temp.layer_metadataurl + " , " +temp.gui_layer_selectable + " , " +temp.gui_layer_visible + " , " +temp.gui_layer_queryable + " , " +temp.gui_layer_querylayer);
-									Note((parseInt(temp.layer_id)+1),parentObj,temp.layer_title,'../php/mod_layerMetadata.php?wms='+encodeURIComponent(parent.mb_mapObj[i].wms[ii].wms_getmap)+'&name='+encodeURIComponent(temp.layer_name),temp.gui_layer_selectable,temp.gui_layer_visible,temp.gui_layer_queryable,temp.gui_layer_querylayer,parent.mb_mapObj[i].wms[ii].wms_id,temp.layer_name);
-/*
-									if(temp.layer_metadataurl!=''){
-										Note((parseInt(temp.layer_id)+1),parentObj,temp.layer_title,temp.layer_metadataurl,temp.gui_layer_selectable,temp.gui_layer_visible,temp.gui_layer_queryable,temp.gui_layer_querylayer,parent.mb_mapObj[i].wms[ii].wms_id,temp.layer_name);
-									}else{
-										Note((parseInt(temp.layer_id)+1),parentObj,temp.layer_title,'../metadata/'+temp.layer_name+".html",temp.gui_layer_selectable,temp.gui_layer_visible,temp.gui_layer_queryable,temp.gui_layer_querylayer,parent.mb_mapObj[i].wms[ii].wms_id,temp.layer_name);
-									}
-*/
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-		treeTyp[0] = 'f'
-		treeIsOn[0] = true
-		treeWasOn[0] = true
-	}       
-} 
-/*
-  function initArray_()
-  {
-    Note(0,-1,'','')	  
-    Note(1,0,'Tutorials','')	  	  
-    Note(8,1,'HTML','')
-    Note(10,8,'SelfHtml','http://www.teamone.de/selfaktuell/') 
-	  Note(9,1,'willi','')
-    Note(100,9,'SelfHtml','http://www.teamone.de/selfaktuell/')       
-	  Note(3,1,'JavaScript','')
-    Note(4,3, 'Netscape Guide 1.3','http://developer.netscape.com/docs/manuals/js/client/jsguide/index.htm')
-    Note(7,3, 'Introduction to Javascript','http://rummelplatz.uni-mannheim.de/~skoch/js/script.htm')	  
-    Note(12,1, 'Perl','')
-    Note(14,12, 'Perl Tutorial','http://www.awu.id.ethz.ch/~didi/perl/perl_start.html')
-    Note(13,1,'SQL','')
-    Note(15,13, 'Introduction to SQL','http://w3.one.net/~jhoffman/sqltut.htm')
-	  Note(111,1, 'Introduction to SQL','http://w3.one.net/~jhoffman/sqltut.htm')
-    Note(2,0, 'Reference Manuals','')
-    Note(11,2, 'HTML Version 3.2 Referenz','http://www.cls-online.de/htmlref/index.htm')
-    Note(6,2,'Netscape Reference 1.3','http://developer.netscape.com/docs/manuals/js/client/jsref/index.htm')
-    Note(17,2,'PHP Manual','http://www.php.net/manual/html/')	  
-    treeTyp[0] = 'f'
-    treeIsOn[0] = true
-    treeWasOn[0] = true
-  }
-*/
-  var idx=0
-  initArray()
-  initIndex()
-  load_all()
-  for( i=1; i<idx; i++ )
-  {
-    treeDeep[i] = knotDeep( treeId[i] )
-    if ( treeDeep[i] == 0 )
-      treeIsShown[i] = true
-  }
-  if ( isDomNN )
-    initStyles();
-  //-->  
-  </SCRIPT>
-</HEAD>
-<BODY VLINK="#000000" ALINK="#000000" LINK="#000000" BGCOLOR="#ffffff" TEXT="#000000"
- onLoad="if (layerok) showTree();mod_treeGDE();"
- MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0">
-<SCRIPT language="JavaScript1.2">
-<!--
-  initDiv()
-  hideLayer("sitemapinfo")
-//-->
-</SCRIPT>
-</BODY>
-</HTML>
+<?php
+session_start();
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+$con = db_connect(DBSERVER,OWNER,PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+<META NAME="Generator" CONTENT="Cosmo Create 1.0.3">
+<?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 pop_up(name, einstellungen)
+{
+	window.open ('',name,einstellungen);
+}
+</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="JavaScript1.2">
+  <!--  
+  /*
+   * sitemap.js 1.31 05/02/2000
+   *  - Opera 5
+   *
+   * sitemap.js 1.3 27/11/2000
+   *  - Netscape 6
+   *
+   * sitemap.js 1.2 20/05/2000
+   *  - split array tree into arrays for each element old tree
+   *  - no mory type flag, an folder is an entry which has sons
+   *  - a folder can have an link
+   *  - while initing an default layers is shown 
+   *
+   * sitemap.js 1.1 20/10/1999
+   *  - showTree only updates and init layers new which have been really changed
+   *  - add deep to knot entry
+   *  - substitute knotDeep[ id ] w/ tree[ id2treeIndex[ id ] ].deep
+   *  - add alignment to img and a &nbsp; at the beginning of eyery line
+   *  - add a fake img for bookmarks on top panel
+   *
+   * sitemap.js 1.02 14/10/1999
+   *  - fix bug in initStyles
+   *
+   * sitemap.js 1.01 06/10/1999
+   *  - fix bug in knotDeep for Netscape 4.00-4.0.5
+   *
+   * sitemap.js 1.0 20/09/1999
+   *
+   * Javascript function for displaying hierarchic directory structures with
+   * the ability to collapse and expand directories.
+   *
+   * Copyright (c) 1999 Polzin GmbH, Duesseldorf. All Rights Reserved.
+   * Author: Lutz Eymers <ixtab at polzin.com>
+   * Download: http://www.polzin.com/inet/fset_inet.phtml?w=goodies
+   *
+   * Permission to use, copy, modify, and distribute this software
+   * and its documentation for any purposes and without fee
+   * is hereby granted provided that this copyright notice
+   * appears in all copies. 
+   *
+   * Of course, this software is provided "as is" without express or implied
+   * warranty of any kind.
+   *
+   */
+
+// some defaults
+try{if (switchwms){}}catch(e){switchwms = 'false';}
+try{if (ficheckbox){}}catch(e){ficheckbox = 'true';}
+try{if (metadatalink){}}catch(e){metadatalink = 'false';}
+
+  
+  parent.mb_registerSubFunctions("window.frames['treeGDE'].mod_treeGDE();");
+  parent.mb_registerloadWmsSubFunctions("window.frames['treeGDE'].deleteInputTags();");
+  parent.mb_registerloadWmsSubFunctions("window.frames['treeGDE'].document.location.reload();");
+  
+
+function deleteInputTags() {
+	var max = document.getElementsByTagName("input").length;
+	for (var i=0; i<max; i++) {
+		var aNode = document.getElementsByTagName("input")[0];
+		var aNodeParent = aNode.parentNode;
+		aNodeParent.removeChild(aNode);
+	}
+}
+function handleSelectedLayer(mapObj,wms_id,layername,type,status){
+	var mywms = new Array();
+	mywms[0] = wms_id;
+	var mylayername = new Array();
+	mylayername[0] = layername;
+	parent.handleSelectedLayer_array(mapObj, mywms, mylayername, type, status);
+}
+function switchWMS(w,s){
+	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].wms_id == w){
+					for(var iii=1; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
+						if(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_selectable == '1'){
+							parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_visible = s;
+						}
+						if(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_queryable == '1'){
+							//parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_querylayer = s;
+						}
+					}
+				}
+			}
+		}
+	}
+	parent.mb_restateLayers(mod_treeGDE_map,w);
+	parent.setSingleMapRequest(mod_treeGDE_map,w);
+}
+function mod_treeGDE(){
+  /**/
+	var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
+	//if(ind == false){ alert("error, no mapobject specified");}
+	for(var i=0; i<document.getElementsByTagName("input").length; i++){
+		//layer_shortname,wms_id,{visible | querylayer}
+		var myID = document.getElementsByTagName("input")[i].id;
+		var arrayID = document.getElementsByTagName("input")[i].id.split("###");
+		var wms_ind = parent.getWMSIndexById(mod_treeGDE_map,arrayID[1]);
+		if(arrayID[2] == "visible" && typeof(wms_ind) != "undefined"){
+			var arrayLayer = parent.mb_mapObj[ind].layers[wms_ind].split(",");
+			var isOn = false;
+			for(var ii=0; ii<arrayLayer.length; ii++){
+				if(arrayID[0] == arrayLayer[ii]){
+					isOn = true;
+				}
+			}
+			if(isOn == true){ document.getElementById(myID).checked = true;}
+			if(isOn == false){ document.getElementById(myID).checked = false;}
+		}
+		if(arrayID[2] == "querylayer" && typeof(wms_ind) != "undefined"){
+			var arrayLayer = parent.mb_mapObj[ind].querylayers[wms_ind].split(",");
+			var isOn = false;
+			for(var ii=0; ii<arrayLayer.length; ii++){
+				if(arrayID[0] == arrayLayer[ii]){
+					isOn = true;
+				}
+			}
+			if(isOn == true){ document.getElementById(myID).checked = true;}
+			if(isOn == false){ document.getElementById(myID).checked = false;}
+		}
+	}
+    /*consider scalhints*/
+	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(document.getElementById(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name+"_"+parent.mb_mapObj[i].wms[ii].wms_id)){
+						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){                    
+							document.getElementById(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name+"_"+parent.mb_mapObj[i].wms[ii].wms_id).style.color = '#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){
+							document.getElementById(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name+"_"+parent.mb_mapObj[i].wms[ii].wms_id).style.color = '#999999';
+						}
+						else{
+							document.getElementById(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_name+"_"+parent.mb_mapObj[i].wms[ii].wms_id).style.color = '#000000';
+						}
+					}                   
+				}
+			}
+		}
+	}
+} 
+  window.onError=null;
+
+  var idx=0
+  var treeId = new Array();
+  var treeP_id = new Array();
+  var treeIsOn = new Array();
+  var treeTyp = new Array();
+  var treeName = new Array();
+  var treeUrl = new Array();
+  var treeWasOn = new Array();
+  var treeDeep = new Array();
+  var treeLastY = new Array();
+  var treeIsShown = new Array();
+  var treeSelectable = new Array();
+  var treeVisible = new Array();
+  var treeQueryable = new Array();
+  var treeQuerylayer = new Array();
+  var treeWMS = new Array();
+  var treeShortname = new Array();
+
+
+  function Note( id,p_id,name,url,selectable,visible,queryable,querylayer,wms,shortname) {
+    treeId[ idx ] = id
+    treeP_id[ idx ] = p_id
+    treeIsOn[ idx ] = false
+    treeTyp[ idx ] = 'f'
+    treeName[ idx ] = name
+    treeUrl[ idx ] = url 
+    treeWasOn[ idx ] = false
+    treeDeep[ idx ] = 0
+    treeLastY[ idx ] = 0
+    treeIsShown[ idx ] = false
+    treeSelectable[ idx ] = selectable
+    treeVisible[ idx ] = visible
+    treeQueryable[ idx ] = queryable
+    treeQuerylayer[ idx ] = querylayer
+    treeWMS[ idx ] = wms
+    treeShortname[ idx ] = shortname
+
+    idx++
+  }
+
+  function openwindow(Adresse) {
+    Fenster1 = window.open(Adresse, "Informationen", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
+    Fenster1.focus();
+  }
+
+  function initDiv ( )
+  {
+    if ( isDOM || isDomIE )
+    {
+      divPrefix='<DIV CLASS="sitemap" style="position:absolute; left:0; top:0; visibility:hidden;" ID="sitemap'
+      divInfo='<DIV CLASS="sitemap" style="position:absolute; visibility:visible" ID="sitemap'
+    }
+    else
+    {
+      divPrefix='<DIV CLASS="sitemap" ID="sitemap'
+      divInfo='<DIV CLASS="sitemap" ID="sitemap'
+    }
+    document.writeln( divInfo +  'info">Bitte haben Sie etwas Geduld.<BR>&nbsp;<BR>Es werden die Eintr&auml;ge aus<BR>&nbsp;<BR>der Datenbank initialisiert.</DIV> ' );
+    for ( var i=1; i<idx; i++ )
+    {
+      // linked Name ? 
+      if ( treeUrl[i] != '' ){
+
+        linkedName = "<input id='"+treeShortname[i]+"###"+treeWMS[i]+"###visible###' type='checkbox' ";
+         if(treeVisible[i] == '1'){ linkedName += "checked ";}
+         
+         if(treeSelectable[i] != '1'){ 
+         	linkedName += "disabled ";
+         }
+        linkedName += "onClick = 'if(this.checked){handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"visible\",1);";
+		if(ficheckbox == 'false'){
+			linkedName += "handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"querylayer\",1);";
+		}
+        linkedName += "}";
+        linkedName += "else{handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"visible\",0);";
+        if(ficheckbox == 'false'){
+			linkedName += "handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"querylayer\",0);";
+		}
+        linkedName += "}'";
+        linkedName += '>';
+        
+        if (ficheckbox == 'true'){
+            linkedName += "<input id='"+treeShortname[i]+"###"+treeWMS[i]+"###querylayer' type='checkbox' ";
+            if(treeQuerylayer[i] == '1'){ linkedName += "checked ";}
+            if(treeQueryable[i] != '1'){ linkedName += "disabled ";}
+            linkedName += "onClick = 'if(this.checked){handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"querylayer\",1);}";
+            linkedName += "else{handleSelectedLayer(\""+mod_treeGDE_map+"\",\""+treeWMS[i]+"\",\""+treeShortname[i]+"\",\"querylayer\",0);}'";
+            linkedName += '>';
+        }
+      
+        //linkedName += '<A id="'+treeWMS[i]+'_'+treeShortname[i]+'"  HREF="' + treeUrl[i] + '" TARGET="' + defaultTarget + '"><IMG SRC="'+imagedir+'/1w.gif" BORDER="0" WIDTH="3">' + treeName[i] + '</A>';
+        
+        linkedName += '<A id="'+treeShortname[i]+'_'+treeWMS[i];
+        
+        if (metadatalink == 'true'){
+           linkedName += '"  HREF="' + treeUrl[i];
+        }
+//        linkedName += '"  HREF="../php/mod_layerMetadata.php?id=' + ;
+
+
+        linkedName +='" TARGET="' + defaultTarget + '" onclick="openwindow(this.href); return false"><IMG SRC="'+imagedir+'/1w.gif" BORDER="0" WIDTH="3">' + treeName[i] + '</A>';
+       
+       
+      }  
+      else{
+        linkedName =  '<IMG SRC="'+imagedir+'/1w.gif" BORDER="0" WIDTH="3">';
+        if(switchwms == 'true'){
+        	linkedName += '<input type="checkbox" onclick="if(this.checked){switchWMS(\''+treeWMS[i]+'\',1)}else{switchWMS(\''+treeWMS[i]+'\',0)}">';
+        }
+        linkedName += treeName[i];
+      }
+      // don't link folder icon if node has no sons
+      if ( i == idx-1 || treeP_id[i+1] != treeId[i] ) {
+        if ( treeDeep[ i ] == 0 )
+          folderImg = '<IMG ALIGN="BOTTOM" SRC="'+imagedir+'/file_empty.gif" BORDER="0" HEIGHT="16" WIDTH="1" HSPACE="0">'
+        else
+          folderImg = ''
+      } else {
+        folderImg = '<A  HREF="javascript:sitemapClick(' + treeId[i] + ')"><IMG ALIGN="BOTTOM" SRC="'+imagedir+'/folder_off.gif" BORDER="0" NAME="folder' + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0"></A>'
+      }
+      // which type of file icon should be displayed?
+      if ( treeP_id[i] != 0 )
+      {
+        if ( lastEntryInFolder( treeId[i] ) )
+          fileImg = '<IMG ALIGN="BOTTOM" SRC="'+imagedir+'/file_last.gif" BORDER="0" NAME="file'
+            + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0">'  
+        else    
+          fileImg = '<IMG ALIGN="BOTTOM" SRC="'+imagedir+'/file.gif" BORDER="0" NAME="file'
+            + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0">'  
+      }
+      else
+        fileImg = ''
+      // traverse parents up to root and show vertical lines if parent 
+      // is not the last entry on this layer
+      verticales = ''
+      for( var act_id=treeId[i] ; treeDeep[ id2treeIndex[ act_id ] ] > 1;  )
+      {  
+        act_id = treeP_id[ id2treeIndex[ act_id ]]
+        if ( lastEntryInFolder( act_id ) )
+        {
+          verticales = '<IMG ALIGN="BOTTOM" SRC="'+imagedir+'/file_empty.gif" BORDER="0" HEIGHT="16" WIDTH="30" HSPACE="0">' + verticales
+        }
+        else
+        {
+          verticales = '<IMG ALIGN="BOTTOM" SRC="'+imagedir+'/file_vert.gif" BORDER="0" HEIGHT="16" WIDTH="30" HSPACE="0">' + verticales
+        }
+      }
+
+      
+      document.writeln( divPrefix + treeId[i] + '"><NOBR>&nbsp;' + verticales + fileImg + folderImg + linkedName + '</NOBR></DIV>'
+      )  
+    }
+  }
+
+  function initStyles ( )
+  {
+    document.writeln( '<STYLE TYPE="text/css">' + "\n" + '<!--' )
+    for ( var i=1,y=y0; i<idx; i++ )
+    {  
+      document.writeln( '#sitemap' + treeId[i] + ' {POSITION: absolute; VISIBILITY: hidden;}' )
+      if ( treeIsOn[ id2treeIndex[ treeP_id[i] ] ] )
+        y += deltaY
+    }
+    document.writeln( '#sitemapinfo {POSITION: absolute; VISIBILITY: visible;}' )
+    document.writeln( '//-->' + "\n" + '</STYLE>' )
+  }
+
+
+
+  function sitemapClick( id )
+  {
+    var i = id2treeIndex[ id ]
+
+    if ( treeIsOn[ i ] )
+    // close directory
+    {
+      // mark node as invisible
+      treeIsOn[ i ]=false
+      // mark all sons as invisible
+      actDeep = treeDeep[ i ]
+      for( var j=i+1; j<idx && treeDeep[j] > actDeep; j++ )
+      {
+        treeWasOn[ j ] = treeIsOn[ j ]
+        treeIsOn[ j ]=false
+      }
+      gif_off( id )
+    }
+    else
+    // open directory
+    { 
+      treeIsOn[ i ]=true
+      // remember and restore old status
+      actDeep = treeDeep[ i ]
+      for( var j=i+1; j<idx && treeDeep[j] > actDeep; j++ )
+      {
+        treeIsOn[ j ] = treeWasOn[ j ]
+      }
+      gif_on( id )
+    }
+    showTree()
+  }
+
+  function knotDeep( id )
+  {
+    var deep=0
+    while ( true )
+      if ( treeP_id[ id2treeIndex[id] ] == 0 )
+        return deep
+      else
+      {
+        ++deep
+        id = treeP_id[ id2treeIndex[id] ]
+      }
+    return deep  
+  }
+
+  function initTree( id )
+  {
+    treeIsOn[ id2treeIndex[id] ] = true
+    if ( treeTyp[ id2treeIndex[id] ] != 'b' )
+      gif_on( id ) 
+    while ( treeP_id[ id2treeIndex[id] ] != 0 )
+    {
+      id = treeP_id[ id2treeIndex[id] ]
+      treeIsOn[ id2treeIndex[id] ] = true
+      if ( treeTyp[ id2treeIndex[id] ] != 'b' )
+        gif_on( id ) 
+    }
+  }
+
+  function lastEntryInFolder( id )
+  {
+    var i = id2treeIndex[id]
+    if ( i == idx-1 )
+      return true
+    if ( treeTyp[i] == 'b' )
+    {
+      if ( treeP_id[i+1] != treeP_id[i] )
+        return true
+      else 
+        return false
+    }
+    else
+    {
+      var actDeep = treeDeep[i]
+      for( var j=i+1; j<idx && treeDeep[j] > actDeep ; j++ )
+      ;
+      if ( j<idx && treeDeep[j] == actDeep )
+        return false
+      else
+        return true
+    }
+  }
+
+  function showTree()
+  {
+    for( var i=1, y=y0, x=x0; i<idx; i++ )
+    {
+      if ( treeIsOn[ id2treeIndex[ treeP_id[i] ] ] )
+      {
+        // show current node
+        if ( !(y == treeLastY[i] && treeIsShown[i] ) )
+        {
+          showLayer( "sitemap"+ treeId[i] ) 
+          setyLayer( "sitemap"+ treeId[i], y )
+          treeIsShown[i] = true
+        } 
+        treeLastY[i] = y
+        y += deltaY
+      }
+      else
+      {
+        // hide current node and all sons
+        if ( treeIsShown[ i ] )
+        {
+          hideLayer( "sitemap"+ treeId[i] ) 
+          treeIsShown[i] = false
+        }
+      }
+    }
+  }
+
+  function initIndex() {
+    for( var i=0; i<idx; i++ )
+      id2treeIndex[ treeId[i] ] = i
+  }
+
+  function gif_name (name, width, height) {
+    this.on = new Image (width, height);
+    this.on.src = imagedir+ "/" +name + "_on.gif"
+    this.off = new Image (width, height);
+    this.off.src = imagedir+ "/"+name + "_off.gif"
+  }
+
+  function load_gif (name, width, height) {
+    gif_name [name] = new gif_name (name,width,height);
+  }
+
+  function load_all () {
+    load_gif ('folder',30,16)
+    file_last = new Image( 30,16 )
+    file_last.src = imagedir+ "/file_last.gif"
+    file_middle = new Image( 30,16 )
+    file_middle.src = imagedir+ "/file.gif"
+    file_vert = new Image( 30,16 )
+    file_vert.src = imagedir+ "/file_vert.gif"
+    file_empty = new Image( 30,16 )
+    file_empty = imagedir+ "/file_empty.gif"
+  }
+
+  function gif_on ( id ) {
+    eval("document['folder" + id + "'].src = gif_name['folder'].on.src")
+  }
+
+  function gif_off ( id ) {
+    eval("document['folder" + id + "'].src = gif_name['folder'].off.src")
+  }
+ 
+  // global configuration
+  var deltaX = 30
+  var deltaY = 16
+  var x0 = 5
+  var y0 = 5
+  var defaultTarget = '_blank'
+
+  var browserName = navigator.appName;
+  var browserVersion = parseInt(navigator.appVersion);
+  var isIE = false;
+  var isNN = false;
+  var isDOM = false;
+  var isDomIE = false;
+  var isDomNN = false;
+  var layerok = false;
+
+  var isIE = browserName.indexOf("Microsoft Internet Explorer" )==-1?false:true;
+  var isNN = browserName.indexOf("Netscape")==-1?false:true;
+  var isOpera = browserName.indexOf("Opera")==-1?false:true;
+  var isDOM = document.getElementById?true:false;
+  var isDomNN = document.layers?true:false;
+  var isDomIE = document.all?true:false;
+
+  if ( isNN && browserVersion>=4 ) layerok=true;
+  if ( isIE && browserVersion>=4 ) layerok=true;
+  if ( isOpera && browserVersion>=5 ) layerok=true;
+
+    
+  function hideLayer(layerName) {
+    if (isDOM)
+      document.getElementById(layerName).style.visibility="hidden"
+    else if (isDomIE)
+      document.all[layerName].style.visibility="hidden";
+    else if (isDomNN) 
+      document.layers[layerName].visibility="hidden";
+  }
+
+  function showLayer(layerName) {
+    if (isDOM)
+      document.getElementById(layerName).style.visibility="visible"
+    else if (isDomIE)
+      document.all[layerName].style.visibility="visible";
+    else if (isDomNN)
+      document.layers[layerName].visibility="visible";
+  }
+
+  function setyLayer(layerName, y) {
+    if (isDOM)
+      document.getElementById(layerName).style.top=y
+    else if (isDomIE)
+      document.all[layerName].style.top=y;
+    else if (isDomNN)
+      document.layers[layerName].top=y;
+  }
+
+  var id2treeIndex = new Array()
+
+  // the structure is easy to understand with a simple example
+  // p_id is the id of the parent
+  // E0                                      ( id=0,p_id=-1 )
+  //          E11                            ( id=1,p_id=0)
+  //                     E111                ( id=2,p_id=1 )
+  //                     E112                ( id=3,p_id=1 )
+  //          E12                            ( id=4,p_id=0 )
+  //                     E121                ( id=5,p_id=4 ) 
+  //          E13                            ( id=6,p_id=0 ) 
+  //                     E131                ( id=7,p_id=6 ) 
+  //                                 E1311   ( id=8,p_id=7 ) 
+  //                     E132                ( id=9,p_id=6 ) 
+  // this is a multinary tree structure which is easy to
+  // populate with database data :)
+function initArray(){
+	var parentObj = 0;
+	if(parent.mb_mapObj.length == 0){ window.setTimeout("initArray()",100); }    
+	else if(parent.mb_mapObj.length > 0){
+		Note(0,-1,'','');
+		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 == ""){                    
+								//alert((parseInt(temp.layer_id)+1) + " , " +0 + " , " +temp.layer_title + " , " +" , "+temp.layer_metadataurl);
+								Note((parseInt(temp.layer_id)+1),0,temp.layer_title,'','','','','',parent.mb_mapObj[i].wms[ii].wms_id,'');
+								parentObj = temp.layer_id+1;                  
+							}
+							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == "0"){
+								//alert((parseInt(temp.layer_id)+1) + " , " +parentObj + " , " +temp.layer_title + " , " +temp.layer_metadataurl);
+								if(temp.gui_layer_selectable == '1' || temp.gui_layer_queryable == '1'){
+									//alert((parseInt(temp.layer_id)+1) + " , " +parentObj + " , " +temp.layer_title + " , " +temp.layer_metadataurl + " , " +temp.gui_layer_selectable + " , " +temp.gui_layer_visible + " , " +temp.gui_layer_queryable + " , " +temp.gui_layer_querylayer);
+									if (temp.layer_uid) {
+										Note((parseInt(temp.layer_id)+1),parentObj,temp.layer_title,'../php/mod_layerMetadata.php?id='+temp.layer_uid,temp.gui_layer_selectable,temp.gui_layer_visible,temp.gui_layer_queryable,temp.gui_layer_querylayer,parent.mb_mapObj[i].wms[ii].wms_id,temp.layer_name);
+									}
+									else {
+										Note((parseInt(temp.layer_id)+1),parentObj,temp.layer_title,'',temp.gui_layer_selectable,temp.gui_layer_visible,temp.gui_layer_queryable,temp.gui_layer_querylayer,parent.mb_mapObj[i].wms[ii].wms_id,temp.layer_name);
+									}
+/*
+									if(temp.layer_metadataurl!=''){
+										Note((parseInt(temp.layer_id)+1),parentObj,temp.layer_title,temp.layer_metadataurl,temp.gui_layer_selectable,temp.gui_layer_visible,temp.gui_layer_queryable,temp.gui_layer_querylayer,parent.mb_mapObj[i].wms[ii].wms_id,temp.layer_name);
+									}else{
+										Note((parseInt(temp.layer_id)+1),parentObj,temp.layer_title,'../metadata/'+temp.layer_name+".html",temp.gui_layer_selectable,temp.gui_layer_visible,temp.gui_layer_queryable,temp.gui_layer_querylayer,parent.mb_mapObj[i].wms[ii].wms_id,temp.layer_name);
+									}
+*/
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+		treeTyp[0] = 'f'
+		treeIsOn[0] = true
+		treeWasOn[0] = true
+	}       
+} 
+/*
+  function initArray_()
+  {
+    Note(0,-1,'','')	  
+    Note(1,0,'Tutorials','')	  	  
+    Note(8,1,'HTML','')
+    Note(10,8,'SelfHtml','http://www.teamone.de/selfaktuell/') 
+	  Note(9,1,'willi','')
+    Note(100,9,'SelfHtml','http://www.teamone.de/selfaktuell/')       
+	  Note(3,1,'JavaScript','')
+    Note(4,3, 'Netscape Guide 1.3','http://developer.netscape.com/docs/manuals/js/client/jsguide/index.htm')
+    Note(7,3, 'Introduction to Javascript','http://rummelplatz.uni-mannheim.de/~skoch/js/script.htm')	  
+    Note(12,1, 'Perl','')
+    Note(14,12, 'Perl Tutorial','http://www.awu.id.ethz.ch/~didi/perl/perl_start.html')
+    Note(13,1,'SQL','')
+    Note(15,13, 'Introduction to SQL','http://w3.one.net/~jhoffman/sqltut.htm')
+	  Note(111,1, 'Introduction to SQL','http://w3.one.net/~jhoffman/sqltut.htm')
+    Note(2,0, 'Reference Manuals','')
+    Note(11,2, 'HTML Version 3.2 Referenz','http://www.cls-online.de/htmlref/index.htm')
+    Note(6,2,'Netscape Reference 1.3','http://developer.netscape.com/docs/manuals/js/client/jsref/index.htm')
+    Note(17,2,'PHP Manual','http://www.php.net/manual/html/')	  
+    treeTyp[0] = 'f'
+    treeIsOn[0] = true
+    treeWasOn[0] = true
+  }
+*/
+  var idx=0
+  initArray()
+  initIndex()
+  load_all()
+  for( i=1; i<idx; i++ )
+  {
+    treeDeep[i] = knotDeep( treeId[i] )
+    if ( treeDeep[i] == 0 )
+      treeIsShown[i] = true
+  }
+  if ( isDomNN )
+    initStyles();
+  //-->  
+  </SCRIPT>
+</HEAD>
+<BODY VLINK="#000000" ALINK="#000000" LINK="#000000" BGCOLOR="#ffffff" TEXT="#000000"
+ onLoad="if (layerok) showTree();mod_treeGDE();"
+ MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0">
+<SCRIPT language="JavaScript1.2">
+<!--
+  initDiv()
+  hideLayer("sitemapinfo")
+//-->
+</SCRIPT>
+</BODY>
+</HTML>

Modified: trunk/mapbender/http/javascripts/map_obj.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/map_obj.js?view=diff&rev=928&p1=trunk/mapbender/http/javascripts/map_obj.js&p2=trunk/mapbender/http/javascripts/map_obj.js&r1=927&r2=928
==============================================================================
--- trunk/mapbender/http/javascripts/map_obj.js	(original)
+++ trunk/mapbender/http/javascripts/map_obj.js	2006-11-21 15:33:51+0000
@@ -120,6 +120,7 @@
 //layer
 function wms_add_layer(
 			layer_parent,
+			layer_uid,
 			layer_name,
 			layer_title,
 			layer_dataurl_href,
@@ -140,6 +141,7 @@
                       
 	wms[wms.length-1].objLayer[wms[wms.length-1].objLayer.length] = new wms_layer(
 											layer_parent,
+											layer_uid,
 											layer_name,
 											layer_title,
 											layer_dataurl_href,
@@ -160,6 +162,7 @@
 }
 function wms_layer(
 			layer_parent,
+			wms_layer_uid,
 			layer_name,
 			layer_title,
 			layer_dataurl_href,
@@ -178,6 +181,7 @@
 			gui_layer_maxscale,
 			gui_layer_wfs_featuretype){
 	this.layer_id = wms_layer_count;
+	this.layer_uid = wms_layer_uid;
 	this.layer_parent = layer_parent;
 	this.layer_name = layer_name;
 	this.layer_title = layer_title;

Modified: trunk/mapbender/http/javascripts/mod_savewmc.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_savewmc.php?view=diff&rev=928&p1=trunk/mapbender/http/javascripts/mod_savewmc.php&p2=trunk/mapbender/http/javascripts/mod_savewmc.php&r1=927&r2=928
==============================================================================
--- trunk/mapbender/http/javascripts/mod_savewmc.php	(original)
+++ trunk/mapbender/http/javascripts/mod_savewmc.php	2006-11-21 15:33:51+0000
@@ -124,7 +124,7 @@
 		var generalContactFacsimileTelephone = "";
 		var generalContactElectronicMailAddress = "";
 
-		// Missing: Extension
+		var extension_namespace = "mapbender";
 
 		// LayerList variables
 		var layerHidden = "";
@@ -150,7 +150,7 @@
 		// wmc += "&lt;!ENTITY amp    \"&amp;#38;#38;\"&gt;\n";
 		wmc += "&lt;ViewContext version=\"" + version + "\" ";
 		wmc += "id = \"" + id + "\" ";
-		wmc += "xmlns=\"http://www.opengis.net/context\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:SchemaLocation=\"http://schemas.opengis.net/context/1.0.0/context.xsd\" ";
+		wmc += "xmlns=\"http://www.opengis.net/context\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:mapbender=\"http://www.mapbender.org\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:SchemaLocation=\"http://schemas.opengis.net/context/1.0.0/context.xsd\" ";
 		wmc += "&gt;\n";
 
 		//General
@@ -248,20 +248,13 @@
 		wmc += "\t&lt;LayerList&gt;\n";
 		for (var i = 0; i < mb_mapObj[ind].wms.length; i++){
 
-			// BEGIN: new code
+			wmsId = mb_mapObj[ind].wms[i].wms_id;
 
-			// in the end, this array contains all epsgs of this wms 
 			var wms_epsg = new Array();
-
-			// the gui_wms_epsg is always the first epsg in this layers epsg list
 			wms_epsg[0] = mb_mapObj[ind].epsg;
-
-			// the epsg of the mapObj has to be in this list
 			if (mb_mapObj[ind].wms[i].gui_wms_epsg != mb_mapObj[ind].epsg){
 				wms_epsg[1] = mb_mapObj[ind].wms[i].gui_wms_epsg;
 			}
-				  
-			// add all gui_epsg if not already in the array
 			for (q = 0; q < mb_mapObj[ind].wms[i].gui_epsg.length ; q ++){
 				var isInArray = false;
 				for (r = 0 ; r < wms_epsg.length ; r ++){
@@ -273,8 +266,6 @@
 					wms_epsg[wms_epsg.length] = mb_mapObj[ind].wms[i].gui_epsg[q];
 				}
 			}
-		  
-			// END: new code
 
 			for (var j = 0; j < mb_mapObj[ind].wms[i].objLayer.length; j++){
 				if (mb_mapObj[ind].wms[i].objLayer[j].layer_parent != ''){
@@ -285,6 +276,7 @@
 						layerHidden = 1;
 					}
 					layerQueryable = mb_mapObj[ind].wms[i].objLayer[j].layer_queryable;
+					layerId = mb_mapObj[ind].wms[i].objLayer[j].layer_uid;
 					layerName = htmlspecialchars(mb_mapObj[ind].wms[i].objLayer[j].layer_name,0);
 					layerTitle = htmlspecialchars(mb_mapObj[ind].wms[i].objLayer[j].layer_title, 0);
 					layerAbstract = mb_mapObj[ind].wms[i].wms_abstract; //To Do: insert actual abstract
@@ -329,9 +321,13 @@
 						wmc += "\t\t\t&lt;/MetadataURL&gt;\n";
 					}
 
+					wmc += "\t\t\t&lt;Extension&gt;\n";
 					if (layerMinscale && layerMaxscale) {
-						wmc += "\t\t\t&lt;ScaleHint min=\""+layerMinscale+"\" max=\""+layerMaxscale+"\"/&gt;\n";
+						wmc += "\t\t\t\t&lt;"+extension_namespace+":ScaleHint min=\""+layerMinscale+"\" max=\""+layerMaxscale+"\"/&gt;\n";
 					}
+					wmc += "\t\t\t\t&lt;"+extension_namespace+":layer_id&gt;"+layerId+"&lt;/"+extension_namespace+":layer_id&gt;\n";
+					wmc += "\t\t\t\t&lt;"+extension_namespace+":wms_id&gt;"+wmsId+"&lt;/"+extension_namespace+":wms_id&gt;\n";
+					wmc += "\t\t\t&lt;/Extension&gt;\n";
 
 					//layerFormat
 					wmc += "\t\t\t&lt;FormatList&gt;\n";




More information about the Mapbender_commits mailing list