[Mapbender-commits] r3558 - in branches/print_dev/http: classes javascripts print

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Feb 17 10:11:50 EST 2009


Author: mschulz
Date: 2009-02-17 10:11:49 -0500 (Tue, 17 Feb 2009)
New Revision: 3558

Modified:
   branches/print_dev/http/classes/class_connector.php
   branches/print_dev/http/classes/class_gml_3_factory.php
   branches/print_dev/http/classes/class_universal_gml_factory.php
   branches/print_dev/http/classes/class_wfs.php
   branches/print_dev/http/classes/class_wmc.php
   branches/print_dev/http/classes/class_wmcToXml.php
   branches/print_dev/http/classes/class_wms.php
   branches/print_dev/http/javascripts/map.php
   branches/print_dev/http/javascripts/mod_addWMSgeneralFunctions.js
   branches/print_dev/http/javascripts/mod_wfs_gazetteer_client.php
   branches/print_dev/http/javascripts/requestGeometryConstructor.js
   branches/print_dev/http/print/mod_printPDF.php
Log:
merged from trunk

Modified: branches/print_dev/http/classes/class_connector.php
===================================================================
--- branches/print_dev/http/classes/class_connector.php	2009-02-17 14:58:46 UTC (rev 3557)
+++ branches/print_dev/http/classes/class_connector.php	2009-02-17 15:11:49 UTC (rev 3558)
@@ -139,7 +139,7 @@
 	private function isValidHttpContentType ($value) {
 		$validHttpContentTypeArray = array("XML");
 		if (in_array(mb_strtoupper($value), $validHttpContentTypeArray)) {
-			switch ($value) {
+			switch (mb_strtoupper($value)) {
 				case "XML":
 					$this->httpContentType = "application/xml";
 					break;
@@ -181,16 +181,36 @@
 				$port = 80;		
 			}	
 			$path = $urlComponentArray["path"];
+			$query = $urlComponentArray["query"];
 			$buf = '';
 		    $fp = fsockopen($host, $port);
-		    fputs($fp, "POST $path HTTP/".$this->httpVersion . "\r\n");
-		    fputs($fp, "Host: $host\r\n");
+			$postStr = "";
+			$postPath = "POST " . $path . "?" . $query . " HTTP/".$this->httpVersion . "\r\n";
+			$postStr .= $postPath;
+		    fputs($fp, $postPath);
+			
+			$postHost = "Host: " . $host . "\r\n";
+			$postStr .= $postHost;
+		    fputs($fp, $postHost);
+			
 		    if ($this->isValidHttpContentType($this->httpContentType)) {
-		    	fputs($fp,"Content-type: " . $this->httpContentType . "\r\n");
+				$postContentType = "Content-type: " . $this->httpContentType . "\r\n";
+				$postStr .= $postContentType;
+		    	fputs($fp, $postContentType);
 		    }
-		    fputs($fp, "Content-length: " . strlen($this->httpPostData) . "\r\n");
-		    fputs($fp, "Connection: close\r\n\r\n");
-		    fputs($fp, $this->httpPostData);
+			$postContentLength = "Content-length: " . strlen($this->httpPostData) . "\r\n";
+			$postStr .= $postContentLength;
+		    fputs($fp, $postContentLength);
+			
+			$postClose = "Connection: close\r\n\r\n";
+			$postStr .= $postClose;
+		    fputs($fp, $postClose);
+
+		    $postStr .= $this->httpPostData;
+			fputs($fp, $this->httpPostData);
+
+			new mb_exception($postStr);
+			
 		    $xmlstr = false;
 		    while (!feof($fp)) {
 		    	$content = fgets($fp,4096);

Modified: branches/print_dev/http/classes/class_gml_3_factory.php
===================================================================
--- branches/print_dev/http/classes/class_gml_3_factory.php	2009-02-17 14:58:46 UTC (rev 3557)
+++ branches/print_dev/http/classes/class_gml_3_factory.php	2009-02-17 15:11:49 UTC (rev 3558)
@@ -45,8 +45,17 @@
 		return parent::createFromXml($xml, $gml3);
 	}	
 
+	protected function getDimensionFromNode ($domNode) {
+		if (!$domNode->hasAttribute("srsDimension")) {
+			return 2;
+		}
+		$dim = intval($domNode->getAttribute("srsDimension"), 10);
+		if (2 == $dim || 3 == $dim) {
+			return $dim;
+		}
+		return 2;
+	}
 	
-	
 	function findNameSpace($s){
 		list($ns,$FeaturePropertyName) = split(":",$s);
 		$nodeName = array('ns' => $ns, 'value' => $FeaturePropertyName);
@@ -56,8 +65,8 @@
 	private function parsePoint ($domNode, $gmlPoint) {
 		$currentSibling = $domNode->firstChild;
 		while ($currentSibling) {
-			list($x, $y, $z) = explode(",", $currentSibling->nodeValue);
-			$gmlPoint->setPoint($x, $y);
+			$coordArray = explode(" ", $currentSibling->nodeValue);
+			$gmlPoint->setPoint($coordArray[0], $coordArray[1]);
 			$currentSibling = $currentSibling->nextSibling;
 		}
 	}
@@ -65,9 +74,12 @@
 	private function parseLine ($domNode, $gmlLine) {
 		$currentSibling = $domNode->firstChild;
 		while ($currentSibling) {
-			
-			foreach(explode(' ',$currentSibling->nodeValue) as $cords){
-				list($x,$y,$z) = explode(',',$cords);
+
+			$dim = $this->getDimensionFromNode($currentSibling);
+			$coordArray = explode(' ', trim($currentSibling->nodeValue));
+			for ($i = 0; $i < count($coordArray); $i += $dim) {
+				$x = $coordArray[$i];
+				$y = $coordArray[$i+1];
 				$gmlLine->addPoint($x, $y);
 			}
 			$currentSibling = $currentSibling->nextSibling;
@@ -84,16 +96,14 @@
 		$cnt=0;
 		foreach ($allCoords as $Coords) {
 			$coordsDom = dom_import_simplexml($Coords);
-				
-			$dim = $coordsDom->getAttribute("srsDimension");
-			if ($dim == "2") {
-				$coordArray = explode(' ', trim($coordsDom->nodeValue));
-				for ($i = 0; $i < count($coordArray); $i += 2) {
-					$x = $coordArray[$i];
-					$y = $coordArray[$i+1];
-					$gmlPolygon->addPoint($x, $y);
-				}
-			}		
+			
+			$dim = $this->getDimensionFromNode($coordsDom);
+			$coordArray = explode(' ', trim($coordsDom->nodeValue));
+			for ($i = 0; $i < count($coordArray); $i += $dim) {
+				$x = $coordArray[$i];
+				$y = $coordArray[$i+1];
+				$gmlPolygon->addPoint($x, $y);
+			}
 			$cnt++;
 		}
 		
@@ -105,14 +115,12 @@
 				foreach ($coordinates as $coordinate) {
 					$coordsDom = dom_import_simplexml($coordinate);
 						
-					$dim = $coordsDom->getAttribute("srsDimension");
-					if ($dim == "2") {
-						$coordArray = explode(' ', trim($coordsDom->nodeValue));
-						for ($i = 0; $i < count($coordArray); $i += 2) {
-							$x = $coordArray[$i];
-							$y = $coordArray[$i+1];
-							$gmlPolygon->addPointToRing($ringCount, $x, $y);
-						}
+					$dim = $this->getDimensionFromNode($coordsDom);
+					$coordArray = explode(' ', trim($coordsDom->nodeValue));
+					for ($i = 0; $i < count($coordArray); $i += $dim) {
+						$x = $coordArray[$i];
+						$y = $coordArray[$i+1];
+						$gmlPolygon->addPointToRing($ringCount, $x, $y);
 					}
 				}
 				$ringCount++;
@@ -125,7 +133,7 @@
 
 		$simpleXMLNode->registerXPathNamespace('gml', 'http://www.opengis.net/gml');
 		
-		$allCoords = $simpleXMLNode->xpath("gml:lineStringMember/gml:LineString/gml:coordinates");
+		$allCoords = $simpleXMLNode->xpath("gml:curveMembers/gml:LineString/gml:posList");
 			
 		$cnt=0;
 		foreach ($allCoords as $Coords) {
@@ -133,16 +141,14 @@
 			$gmlMultiLine->lineArray[$cnt] = array();
 			
 			$coordsDom = dom_import_simplexml($Coords);
-				
-//			$name = $coordsDom->nodeName;
-//			$value = $coordsDom->nodeValue;				
-//			echo "===> name: ".$name. ", Value: ".$value."<br>";
-			
-			foreach(explode(' ',$coordsDom->nodeValue) as $pointCoords){
-				list($x,$y,$z) = explode(',',$pointCoords);
+
+			$dim = $this->getDimensionFromNode($coordsDom);
+			$coordArray = explode(' ', trim($coordsDom->nodeValue));
+			for ($i = 0; $i < count($coordArray); $i += $dim) {
+				$x = $coordArray[$i];
+				$y = $coordArray[$i+1];
 				$gmlMultiLine->addPoint($x, $y, $cnt);
-				}
-			
+			}
 			$cnt++;
 		}
 	}		
@@ -163,19 +169,14 @@
 			foreach ($allCoords as $Coords) {
 				
 				$coordsDom = dom_import_simplexml($Coords);
-				$dim = $coordsDom->getAttribute("srsDimension");
-				if ($dim == "2") {
-					$coordArray = explode(' ', trim($coordsDom->nodeValue));
-					for ($i = 0; $i < count($coordArray); $i += 2) {
-						$x = $coordArray[$i];
-						$y = $coordArray[$i+1];
-						$gmlMultiPolygon->addPoint($x, $y, $cnt);
-					}
+
+				$dim = $this->getDimensionFromNode($coordsDom);
+				$coordArray = explode(' ', trim($coordsDom->nodeValue));
+				for ($i = 0; $i < count($coordArray); $i += $dim) {
+					$x = $coordArray[$i];
+					$y = $coordArray[$i+1];
+					$gmlMultiPolygon->addPoint($x, $y, $cnt);
 				}
-				// assume $dim == "3"
-				else {
-					$e = new mb_exception("GML with three-dimensional coordinates are not supported.");
-				}	
 			}
 			
 			$gmlMultiPolygon->innerRingArray[$cnt] = array();
@@ -189,19 +190,13 @@
 						foreach ($coordinates as $coordinate) {
 							$coordsDom = dom_import_simplexml($coordinate);
 								
-							$dim = $coordsDom->getAttribute("srsDimension");
-							if ($dim == "2") {
-								$coordArray = explode(' ', trim($coordsDom->nodeValue));
-								for ($i = 0; $i < count($coordArray); $i += 2) {
-									$x = $coordArray[$i];
-									$y = $coordArray[$i+1];
-									$gmlMultiPolygon->addPointToRing($cnt, $ringCount, $x, $y);
-								}
+							$dim = $this->getDimensionFromNode($coordsDom);
+							$coordArray = explode(' ', trim($coordsDom->nodeValue));
+							for ($i = 0; $i < count($coordArray); $i += $dim) {
+								$x = $coordArray[$i];
+								$y = $coordArray[$i+1];
+								$gmlMultiPolygon->addPointToRing($cnt, $ringCount, $x, $y);
 							}
-							// assume $dim == "3"
-							else {
-								$e = new mb_exception("GML with three-dimensional coordinates are not supported.");
-							}
 						}
 						$ringCount++;
 						
@@ -291,11 +286,11 @@
 				$geomNode = $currentSibling->firstChild; 
 					$geomType = $geomNode->nodeName;
 					switch ($geomType) {
-						case "gml:Polygon" :
+						case "gml:Polygon" :// untested!
 							$feature->geometry = new GMLPolygon();
 							$this->parsePolygon($geomNode, $feature->geometry);
 							break;
-						case "gml:LineString" :
+						case "gml:LineString" :// untested!
 							$feature->geometry = new GMLLine();
 							$this->parseLine($geomNode, $feature->geometry);
 							break;
@@ -307,7 +302,7 @@
 							$feature->geometry = new GMLMultiLine();
 							$this->parseMultiLine($geomNode, $feature->geometry);
 							break;
-						case "gml:MultiSurface" :
+						case "gml:MultiSurface" : 
 							$feature->geometry = new GMLMultiPolygon();
 							$this->parseMultiPolygon($geomNode, $feature->geometry);
 							break;

Modified: branches/print_dev/http/classes/class_universal_gml_factory.php
===================================================================
--- branches/print_dev/http/classes/class_universal_gml_factory.php	2009-02-17 14:58:46 UTC (rev 3557)
+++ branches/print_dev/http/classes/class_universal_gml_factory.php	2009-02-17 15:11:49 UTC (rev 3558)
@@ -45,6 +45,12 @@
 		if (count($nodeArray) > 0 ) {
 			return "3";
 		}
+
+		$nodeArray = $simpleXml->xpath("gml:featureMember//gml:pos");
+		if (count($nodeArray) > 0 ) {
+			return "3";
+		}
+
 		return "2";
 		throw new Exception("GML version could not be determined from XML.");
 	}

Modified: branches/print_dev/http/classes/class_wfs.php
===================================================================
--- branches/print_dev/http/classes/class_wfs.php	2009-02-17 14:58:46 UTC (rev 3557)
+++ branches/print_dev/http/classes/class_wfs.php	2009-02-17 15:11:49 UTC (rev 3558)
@@ -55,9 +55,24 @@
 		return null;
 	}
 	
-	public function getFeature ($featureTypeName, $filter) {
-/* POST */
+	protected function getFeatureGet ($featureTypeName, $filter) {
+		$url = $this->getFeature .
+				$this->getConjunctionCharacter($this->getFeature) . 
+				"service=WFS&request=getFeature&version=" . 
+				$this->getVersion() . "&typename=" . $featureTypeName . 
+				"&filter=" . urlencode($filter);
 
+		$connection = new connector($url);
+		$data = $connection->file;
+		if (!$data) {
+			$e = new mb_exception("WFS request returned no result: " . $url);
+			return null;
+		}
+		new mb_exception("Reply from WFS: " . $url . "\n\n" . $data);
+		return $data;
+	}
+	
+	protected function getFeaturePost ($featureTypeName, $filter) {
 		$postData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" . 
 			"<wfs:GetFeature version=\"" . $this->getVersion() . "\" " . 
 			"xmlns:wfs=\"http://www.opengis.net/wfs\">" . 
@@ -86,25 +101,16 @@
 			return null;
 		}
 		return $data;
-		
-
-/* GET */
-//		$url = $this->getFeature .
-//				$this->getConjunctionCharacter($this->getFeature) . 
-//				"service=WFS&request=getFeature&version=" . 
-//				$this->getVersion() . "&typename=" . $featureTypeName . 
-//				"&filter=" . urlencode($filter);
-//
-//		$connection = new connector($url);
-//		$data = $connection->file;
-//		if (!$data) {
-//			$e = new mb_exception("WFS request returned no result: " . $url);
-//			return null;
-//		}
-//		return $data;
 	}
 	
+	public function getFeature ($featureTypeName, $filter) {
+		if (strpos($this->getFeature, "?") === false) {
+			return $this->getFeaturePost($featureTypeName, $filter);
+		}
+		return $this->getFeatureGet($featureTypeName, $filter);
+	}
 	
+	
 	// -----------------------------------------------------------------------
 	//
 	// Output formats

Modified: branches/print_dev/http/classes/class_wmc.php
===================================================================
--- branches/print_dev/http/classes/class_wmc.php	2009-02-17 14:58:46 UTC (rev 3557)
+++ branches/print_dev/http/classes/class_wmc.php	2009-02-17 15:11:49 UTC (rev 3558)
@@ -1007,7 +1007,7 @@
 			$wms->objLayer[0]->layer_maxscale = 0;
 			$wms->objLayer[0]->gui_layer_wms_id = $currentLayer["extension"]["WMS_ID"];
 			$wms->objLayer[0]->gui_layer_status = 1;
-			$wms->objLayer[0]->gui_layer_selectable = 1; 
+			$wms->objLayer[0]->gui_layer_selectable = $currentLayer["extension"]["WMS_SELECTABLE"];
 			$wms->objLayer[0]->gui_layer_visible = 1;
 			$wms->objLayer[0]->gui_layer_queryable = 0;
 			$wms->objLayer[0]->gui_layer_querylayer = 0;

Modified: branches/print_dev/http/classes/class_wmcToXml.php
===================================================================
--- branches/print_dev/http/classes/class_wmcToXml.php	2009-02-17 14:58:46 UTC (rev 3557)
+++ branches/print_dev/http/classes/class_wmcToXml.php	2009-02-17 15:11:49 UTC (rev 3558)
@@ -400,6 +400,7 @@
 		$layerExtensionData["gui_maxscale"] = $currentLayer->gui_layer_maxscale;
 		$layerExtensionData["layer_id"] = $currentLayer->layer_uid;
 		$layerExtensionData["wms_layer_id"] = $currentWms->objLayer[0]->layer_uid;
+		$layerExtensionData["wms_selectable"] = $currentWms->objLayer[0]->gui_layer_selectable;
 		$layerExtensionData["layer_pos"] = $currentLayer->layer_pos;
 		$layerExtensionData["layer_parent"] = $currentLayer->layer_parent;
 		$layerExtensionData["wms_id"] = $currentLayer->gui_layer_wms_id;
@@ -416,7 +417,7 @@
 			$layerExtensionData["wfsFeatureType"] = $currentLayer->gui_layer_wfs_featuretype;
 		}
 
-		if (1 == 0 && count($layerExtensionData) > 0) {
+		if (count($layerExtensionData) > 0) {
 			$e_extension = $this->doc->createElement("Extension");
 			
 			foreach ($layerExtensionData as $keyExtensionData => $valueExtensionData) {

Modified: branches/print_dev/http/classes/class_wms.php
===================================================================
--- branches/print_dev/http/classes/class_wms.php	2009-02-17 14:58:46 UTC (rev 3557)
+++ branches/print_dev/http/classes/class_wms.php	2009-02-17 15:11:49 UTC (rev 3558)
@@ -225,6 +225,16 @@
 //		$e = new mb_notice("after: " . implode(", ", array_reverse($newWmsArray)));
 		return array_reverse($newWmsArray);
 	}
+
+	private function formatExists ($type, $format) {
+		for ($i = 0; $i < count($this->data_type); $i++) {
+			if ($type == $this->data_type[$i] && $format == $this->data_format[$i]) {
+				$e = new mb_warning("WMS format already exists ($type, $format). Violation of WMS spec. Ignoring this WMS format.");
+				return true;
+			}
+		}
+		return false;
+	}
 	
 	public function __toString () {
 		return $this->wms_title;
@@ -339,9 +349,11 @@
 					$format = "map";
 				}
 				if(mb_strtoupper($element[tag]) != "FORMAT" && $section == "map" && $format == "map"){
-					$this->data_type[$cnt_format] = "map";
-					$this->data_format[$cnt_format] = trim($element[tag]);
-					$cnt_format++;
+					if (!$this->formatExists("map", trim($element[tag]))) {
+						$this->data_type[$cnt_format] = "map";
+						$this->data_format[$cnt_format] = trim($element[tag]);
+						$cnt_format++;
+					}
 				}
 				if(mb_strtoupper($element[tag]) == "FORMAT" && $element[type] == "close"){
 					$format = "";
@@ -361,9 +373,11 @@
 					$this->wms_getmap = $element[attributes]["xlink:href"];
 				}
 				if($section == "map" && mb_strtoupper($element[tag]) == "FORMAT"){
-					$this->data_type[$cnt_format] = "map";
-					$this->data_format[$cnt_format] = trim($element[value]);
-					$cnt_format++;
+					if (!$this->formatExists("map", trim($element[value]))) {
+						$this->data_type[$cnt_format] = "map";
+						$this->data_format[$cnt_format] = trim($element[value]);
+						$cnt_format++;
+					}
 				}
 				if($section == "map" && mb_strtoupper($element[tag]) == "GET" && $element[type] == "close"){
 					$request = "";
@@ -413,9 +427,11 @@
 					$format = "featureinfo";
 				}
 				if(mb_strtoupper($element[tag]) != "FORMAT" && $section == "featureinfo" && $format == "featureinfo"){
-					$this->data_type[$cnt_format] = "featureinfo";
-					$this->data_format[$cnt_format] = trim($element[tag]);
-					$cnt_format++;
+					if (!$this->formatExists("featureinfo", trim($element[tag]))) {
+						$this->data_type[$cnt_format] = "featureinfo";
+						$this->data_format[$cnt_format] = trim($element[tag]);
+						$cnt_format++;
+					}
 				}
 				if(mb_strtoupper($element[tag]) == "FORMAT" && $element[type] == "close"){
 					$format = "";
@@ -435,9 +451,11 @@
 					$this->wms_getfeatureinfo = $element[attributes]["xlink:href"];
 				}
 				if($section == "featureinfo" && mb_strtoupper($element[tag]) == "FORMAT"){
-					$this->data_type[$cnt_format] = "featureinfo";
-					$this->data_format[$cnt_format] = trim($element[value]);
-					$cnt_format++;
+					if (!$this->formatExists("featureinfo", trim($element[value]))) {
+						$this->data_type[$cnt_format] = "featureinfo";
+						$this->data_format[$cnt_format] = trim($element[value]);
+						$cnt_format++;
+					}
 				}
 				if($section == "featureinfo" && mb_strtoupper($element[tag]) == "GET" && $element[type] == "close"){
 					$request = "";

Modified: branches/print_dev/http/javascripts/map.php
===================================================================
--- branches/print_dev/http/javascripts/map.php	2009-02-17 14:58:46 UTC (rev 3557)
+++ branches/print_dev/http/javascripts/map.php	2009-02-17 15:11:49 UTC (rev 3558)
@@ -52,6 +52,7 @@
 // Define global variables (TODO: move to mapbender object later on)
 //
 echo "var mb_nr = '".session_id()."';";
+echo "var mb_session_name = '".session_name()."';";
 echo "var mb_myLogin = '".$_SESSION["mb_login"]."';";
 echo "var mb_styleID = '".md5($_SESSION["mb_user_name"])."';";
 echo "var mb_myBBOX = '".$_SESSION["mb_myBBOX"]."';";

Modified: branches/print_dev/http/javascripts/mod_addWMSgeneralFunctions.js
===================================================================
--- branches/print_dev/http/javascripts/mod_addWMSgeneralFunctions.js	2009-02-17 14:58:46 UTC (rev 3557)
+++ branches/print_dev/http/javascripts/mod_addWMSgeneralFunctions.js	2009-02-17 15:11:49 UTC (rev 3558)
@@ -20,7 +20,8 @@
 }
 
 function mod_addWMS_load(caps){
-	window.frames['loadData'].document.location.href = "../php/mod_createJSObjFromXML.php?caps=" + encodeURIComponent(caps);
+	var capUrl = "../php/mod_createJSObjFromXML.php?" + mb_session_name + "=" + mb_nr + "&caps=" + encodeURIComponent(caps);
+	window.frames['loadData'].document.location.href = capUrl;
 }
 
 function mod_addLayer_load(caps,layer_name){

Modified: branches/print_dev/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- branches/print_dev/http/javascripts/mod_wfs_gazetteer_client.php	2009-02-17 14:58:46 UTC (rev 3557)
+++ branches/print_dev/http/javascripts/mod_wfs_gazetteer_client.php	2009-02-17 15:11:49 UTC (rev 3558)
@@ -192,7 +192,8 @@
 }
 
 function wfsEnable(obj) {
-   	var el = parent.window.frames["mapframe1"].document;
+	var ind = parent.getMapObjIndexByName("mapframe1");
+	var el = parent.mb_mapObj[ind].getDomElement();
    	el.onmouseover = null;
    	el.onmousedown = null;
    	el.onmouseup = null;
@@ -274,12 +275,13 @@
 }
 
 function wfsDisable(obj) {
-	var el = parent.window.frames["mapframe1"].document; 
+	var ind = parent.getMapObjIndexByName("mapframe1");
+	var el = parent.mb_mapObj[ind].getDomElement();
 	el.onmousedown = null;
 	el.ondblclick = null;
 	el.onmousemove = null;
-	parent.writeTag("mapframe1","measure_display","");
-	parent.writeTag("mapframe1","measure_sub","");
+	parent.writeTag("","measure_display","");
+	parent.writeTag("","measure_sub","");
 	activeButton = null;
 }
 
@@ -579,7 +581,7 @@
 	delFilterButton.className = global_wfsConfObj[global_selectedWfsConfId].g_button_id;
 	delFilterButton.value = clearFilterButtonLabel;
 	// Internet explorer
-	if (parent.ie) {$_REQUEST['pdfPathString']
+	if (parent.ie) {
 		delFilterButton.onclick = function() {
 			var x = new Function ("", "clearFilter();"); 
 			x(); 
@@ -1054,12 +1056,13 @@
 			resultGeometryPopup = new parent.mb_popup(searchPopupTitle,contentHtml,searchPopupWidth,searchPopupHeight,searchPopupX,searchPopupY);
 		}
 		resultGeometryPopup.show();
-	
+		parent.$("#resultTable").tablesorter({
+     		sortList: [[0,0]]
+        });
 	}
 	else{
 		document.getElementById("res").innerHTML = contentHtml;
 	}
-	
 } 
 
 function createListOfGeometries(){
@@ -1069,22 +1072,22 @@
 	else{
 		var domPath = "";
 	}
-	var listOfGeom = "<form name='resultListForm'><table style='background-color:#EEEEEE;'>\n";
+	var listOfGeom = "<form name='resultListForm'><table class='tablesorter' id='resultTable'>\n";
 	var wfsConf = global_wfsConfObj[global_selectedWfsConfId];
 	var labelArray = [];
 	if (geomArray.count() > 0) {
 				
 		if(showResultInPopup==1){
-			listOfGeom += "<tr>";
+			listOfGeom += "<thead><tr>";
 			var labelObj = getListTitle();
 			for (var k = 1 ; k < labelObj.length; k ++) {
-				listOfGeom += "<td>";
+				listOfGeom += "<th>";
 				listOfGeom += labelObj[k];
-				listOfGeom += "</td>";
+				listOfGeom += "</th>";
 			}
-			listOfGeom += "</tr>";
+			listOfGeom += "</tr></thead>";
 		}
-						
+		listOfGeom += "<tbody>";				
 		for (var i = 0 ; i < geomArray.count(); i ++) {
 			if (geomArray.get(i).get(-1).isComplete()) {
 				listOfGeom += "<tr>\n";
@@ -1118,7 +1121,7 @@
 			}
 		}
 	}
-	listOfGeom += "</table></form>\n";
+	listOfGeom += "</tbody></table></form>\n";
 	return listOfGeom; 
 }
 

Modified: branches/print_dev/http/javascripts/requestGeometryConstructor.js
===================================================================
--- branches/print_dev/http/javascripts/requestGeometryConstructor.js	2009-02-17 14:58:46 UTC (rev 3557)
+++ branches/print_dev/http/javascripts/requestGeometryConstructor.js	2009-02-17 15:11:49 UTC (rev 3558)
@@ -26,7 +26,8 @@
 		s = new Snapping(this.geomTarget);
 		callback = callbackFunction;
 		
-	   	var el = window.frames[target].document;
+		var ind = getMapObjIndexByName(target);
+		var el = mb_mapObj[ind].getDomElement();
 	   	el.onmouseover = null;
 	   	el.onmousedown = null;
 	   	el.onmouseup = null;
@@ -100,7 +101,8 @@
 			callback(that.geomTarget,queryGeom);
 			writeTag(that.geomTarget,"measuring","");
 			writeTag(that.geomTarget,"measure_display","");
-			var el = window.frames[that.geomTarget].document;
+			var ind = getMapObjIndexByName("mapframe1");
+			var el = mb_mapObj[ind].getDomElement();
 			el.onmouseover = null;
    			el.onmousedown = null;
    			el.onmouseup = null;
@@ -184,7 +186,8 @@
 			
 			if(queryGeom.count() == 2){
 				callback(that.geomTarget,queryGeom);
-				var el = window.frames[that.geomTarget].document;
+				var ind = getMapObjIndexByName("mapframe1");
+				var el = mb_mapObj[ind].getDomElement();
 				el.onmouseover = null;
 	   			el.onmousedown = null;
 	   			el.onmouseup = null;

Modified: branches/print_dev/http/print/mod_printPDF.php
===================================================================
--- branches/print_dev/http/print/mod_printPDF.php	2009-02-17 14:58:46 UTC (rev 3557)
+++ branches/print_dev/http/print/mod_printPDF.php	2009-02-17 15:11:49 UTC (rev 3558)
@@ -320,7 +320,7 @@
 </head>
 
 <body>
-<form name="form1" method="post" action="../print/testfactories.php?<?php echo SID; ?>" target="_blank">
+<form name="form1" method="post" action="../print/mod_printPDF_pdf.php?<?php echo SID; ?>" target="_blank">
 <p id="container_size">
 	<label for="size"><?php echo $label_format ?></label>
 	<select id="size" name="size" onchange="validate();">



More information about the Mapbender_commits mailing list