[Mapbender-commits] r6724 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Aug 10 03:55:51 EDT 2010


Author: verenadiewald
Date: 2010-08-10 07:55:51 +0000 (Tue, 10 Aug 2010)
New Revision: 6724

Modified:
   trunk/mapbender/http/classes/class_wms.php
Log:
changes for initWMCObj

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2010-08-10 07:53:41 UTC (rev 6723)
+++ trunk/mapbender/http/classes/class_wms.php	2010-08-10 07:55:51 UTC (rev 6724)
@@ -327,12 +327,12 @@
 		for ($i = 0; $i < count($this->objLayer); $i++) {
 			$name1 = $this->objLayer[$i]->layer_name;
 			$name2 = $anotherWms->objLayer[$i]->layer_name;
-			
 			if ($name1 != $name2) {
 //				$e = new mb_notice($this . " != " . $anotherWms . " (layer names, " . $name1 . " vs. " . $name2 . ")");
 				return false;
 			}
 		}
+		
 //		$e = new mb_notice($this . " == " . $anotherWms);
 		return true;
 	}  
@@ -345,13 +345,13 @@
 	 * @param $wmsArray wms[]
 	 */
 	public static function merge ($wmsArray) {
-		$e = new mb_notice("before: " . implode(", ", $wmsArray));
+//		$e = new mb_notice("before: " . implode(", ", $wmsArray));
 		if (!is_array($wmsArray)) {
-			$e = new mb_exception("class_wms.php: merge(): parameter is NOT an array.");
+			$e = new mb_notice("class_wms.php: merge(): parameter is NOT an array.");
 			return array();
 		}
 		if (count($wmsArray) == 0) {
-			$e = new mb_exception("class_wms.php: merge(): parameter is an EMPTY array.");
+			$e = new mb_notice("class_wms.php: merge(): parameter is an EMPTY array.");
 			return array();
 		}
 		
@@ -363,7 +363,7 @@
 			$isNewWms = true;
 
 			if (get_class($currentWms) != "wms") {
-				$e = new mb_exception("class_wms.php: merge(): current WMS is not a WMS object, but a " . get_class($currentWms));
+				$e = new mb_notice("class_wms.php: merge(): current WMS is not a WMS object, but a " . get_class($currentWms));
 			}
 			else {
 				for ($i = 0; $i < count($newWmsArray) && $isNewWms; $i++) {
@@ -372,14 +372,18 @@
 					}
 				}
 				if ($isNewWms) {
-//					$e = new mb_notice("adding WMS " . $currentWms);
+					$e = new mb_notice("adding WMS " . $currentWms);
 					array_push($newWmsArray, $currentWms);
 				}
+				else {
+					//newWmsArray contains currentWms
+					// --> TODO: check which layers have to be merged into the existing WMS 
+				}
 			}
 		}
 		// reversal of the array, because the elements were popped 
 		// from another array before.
-//		$e = new mb_notice("after: " . implode(", ", array_reverse($newWmsArray)));
+		$e = new mb_notice("after: " . implode(", ", array_reverse($newWmsArray)));
 		return array_reverse($newWmsArray);
 	}
 
@@ -2440,8 +2444,8 @@
 		while($row2 = db_fetch_array($res_wms)){
 			$this->wms_id = $row2["wms_id"];
 			$this->wms_version = $row2["wms_version"];
-			$this->wms_title = $this->stripEndlineAndCarriageReturn($row2["wms_title"]);
-			$this->wms_abstract = $this->stripEndlineAndCarriageReturn($row2["wms_abstract"]);
+			$this->wms_title = administration::convertIncomingString($this->stripEndlineAndCarriageReturn($row2["wms_title"]));
+			$this->wms_abstract = administration::convertIncomingString($this->stripEndlineAndCarriageReturn($row2["wms_abstract"]));
 			$wmsowsproxy = $row2["wms_owsproxy"];
 			#$wmsowsproxy = "test";
 			if($wmsowsproxy != ""){
@@ -2524,9 +2528,9 @@
 		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 = $row2["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_uid = $layer_id;
+			$this->objLayer[$layer_cnt]->layer_name = administration::convertIncomingString($row2["layer_name"]);
+			$this->objLayer[$layer_cnt]->layer_title = administration::convertIncomingString($row2["layer_title"]);				
 			$this->objLayer[$layer_cnt]->layer_dataurl_href =$row2["layer_dataurl"];
 			$this->objLayer[$layer_cnt]->layer_metadataurl =$row2["layer_metadataurl"];
 			$this->objLayer[$layer_cnt]->layer_searchable =$row2["layer_searchable"];



More information about the Mapbender_commits mailing list