[Mapbender-commits] r5025 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Nov 24 05:00:33 EST 2009


Author: verenadiewald
Date: 2009-11-24 05:00:33 -0500 (Tue, 24 Nov 2009)
New Revision: 5025

Modified:
   trunk/mapbender/http/php/mod_customTree_server.php
Log:
check if wms exists still in gui

Modified: trunk/mapbender/http/php/mod_customTree_server.php
===================================================================
--- trunk/mapbender/http/php/mod_customTree_server.php	2009-11-23 20:14:12 UTC (rev 5024)
+++ trunk/mapbender/http/php/mod_customTree_server.php	2009-11-24 10:00:33 UTC (rev 5025)
@@ -2,6 +2,7 @@
 require_once dirname(__FILE__) . "/../classes/class_json.php";
 require_once dirname(__FILE__) . "/../classes/class_json.php";
 require_once dirname(__FILE__) . "/../classes/class_user.php";
+require_once dirname(__FILE__) . "/../classes/class_administration.php";
 
 /**
  * encodes and delivers the data
@@ -115,18 +116,27 @@
 			$res = db_prep_query($sql,$v,$t);
 
 			$nodeArray = array();
+			
+			//check if wms exists in gui
+			$n = new administration();
+			$applicationArray = array($applicationId);
+			$mywms = $n->getWmsByOwnGuis($applicationArray);
+
 			while ($row = db_fetch_array($res)) {
 				
 				$wmsIdArray = explode(",", $row["wms_id"]);
 				$wmsArray = array();
+				
 				foreach ($wmsIdArray as $wmsId) {
-					if (is_numeric($wmsId)) {
-						$sqlWms = "SELECT wms_title FROM wms WHERE wms_id = $1";
-						$vWms = array($wmsId);
-						$tWms = array("i");
-						$resWms = db_prep_query($sqlWms, $vWms, $tWms);
-						$rowWms = db_fetch_array($resWms);
-						$wmsArray[$wmsId] = $rowWms[0];
+					if (in_array($wmsId, $mywms)) {
+						if (is_numeric($wmsId)) {
+							$sqlWms = "SELECT wms_title FROM wms WHERE wms_id = $1";
+							$vWms = array($wmsId);
+							$tWms = array("i");
+							$resWms = db_prep_query($sqlWms, $vWms, $tWms);
+							$rowWms = db_fetch_array($resWms);
+							$wmsArray[$wmsId] = $rowWms[0];
+						}
 					}
 				}
 				$currentNode = array(



More information about the Mapbender_commits mailing list