[Mapbender-commits] r2289 - in branches/nimix_dev/http: javascripts php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Mar 25 07:07:20 EDT 2008


Author: nimix
Date: 2008-03-25 07:07:20 -0400 (Tue, 25 Mar 2008)
New Revision: 2289

Modified:
   branches/nimix_dev/http/javascripts/mod_addWMSfromfilteredList_ajax.php
   branches/nimix_dev/http/php/mod_addWMSfromfilteredList_server.php
Log:
add wms enhacements

Modified: branches/nimix_dev/http/javascripts/mod_addWMSfromfilteredList_ajax.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_addWMSfromfilteredList_ajax.php	2008-03-25 10:39:07 UTC (rev 2288)
+++ branches/nimix_dev/http/javascripts/mod_addWMSfromfilteredList_ajax.php	2008-03-25 11:07:20 UTC (rev 2289)
@@ -52,11 +52,13 @@
 <!--
 //set defaults of element vars
 try{if(option_all){}}catch(e){option_all='1';};
-try{if(option_group){}}catch(e){option_all='1';};
-try{if(option_gui){}}catch(e){option_all='1';};
-try{if(option_db){}}catch(e){option_all='1';};
+try{if(option_group){}}catch(e){option_group='1';};
+try{if(option_gui){}}catch(e){option_gui='1';};
+try{if(option_dbgui){}}catch(e){option_dbgui='1';};
+try{if(option_dbgroup){}}catch(e){option_dbgroup='1';};
+try{if(option_dball){}}catch(e){option_dball='1';};
 try{if(capabilitiesInput){}}catch(e){capabilitiesInput='0';};
-try{if(gui_list){}}catch(e){gui_list='gui,gui1'};
+try{if(gui_list){}}catch(e){gui_list=''};
 
 var guis = gui_list.split(",");
 if(gui_list==='')
@@ -203,7 +205,8 @@
 function setButtons() {
 	//if only one is active load list imidiately
 	if(parseInt(option_all)+parseInt(option_group)
-		+parseInt(option_gui)+parseInt(option_db)===1){
+		+parseInt(option_gui)+parseInt(option_dbgui)+
+		parseInt(option_dbgroup)+parseInt(option_dball)===1){
 		var child;
 		if(option_all=='1')
 			child = document.getElementById("button_all"); 
@@ -211,9 +214,13 @@
 			child = document.getElementById("button_group");
 		else if(option_gui=='1')
 			child = document.getElementById("button_gui");
-		else
-			child = document.getElementById("button_db");
-		
+		else if(option_dbgui=='1')
+			child = document.getElementById("button_dbGui");
+		else if(option_dbgroup=='1')
+			child = document.getElementById("button_dbGroup");
+		else//if(option_dball=='1')
+			child = document.getElementById("button_dbAll");
+
 		child.onclick();
 		child.parentNode.removeChild(child);
 	}
@@ -230,10 +237,18 @@
 		var child = document.getElementById("button_gui");
 		child.parentNode.removeChild(child);
 	}
-	if (option_db == '0') {
-		var child = document.getElementById("button_db");
+	if (option_dbgui == '0') {
+		var child = document.getElementById("button_dbGui");
 		child.parentNode.removeChild(child);
 	}
+	if (option_dbgroup == '0') {
+		var child = document.getElementById("button_dbGroup");
+		child.parentNode.removeChild(child);
+	}
+	if (option_dball == '0') {
+		var child = document.getElementById("button_dbAll");
+		child.parentNode.removeChild(child);
+	}
 	if (capabilitiesInput == '0') {
 		var child = document.getElementById("capabilitiesForm");
 		child.parentNode.removeChild(child);

Modified: branches/nimix_dev/http/php/mod_addWMSfromfilteredList_server.php
===================================================================
--- branches/nimix_dev/http/php/mod_addWMSfromfilteredList_server.php	2008-03-25 10:39:07 UTC (rev 2288)
+++ branches/nimix_dev/http/php/mod_addWMSfromfilteredList_server.php	2008-03-25 11:07:20 UTC (rev 2289)
@@ -76,7 +76,7 @@
 else if ($command == "getAllWMS") {
 	$resultObj["wms"] = array();
 					 
-	$sql = "SELECT wms.wms_id, wms.wms_title, gettext($1, wms.wms_abstract) as wms_abstract, wms.wms_getcapabilities, wms.wms_version, MIN(gui_wms.fkey_gui_id) ";
+	$sql = "SELECT wms.wms_id, wms.wms_title, gettext($1, wms.wms_abstract) as wms_abstract, wms.wms_getcapabilities, wms.wms_version, MIN(gui_wms.fkey_gui_id) AS gui ";
 	$sql .= "FROM wms, gui_wms ";
 	$sql .= "WHERE wms.wms_id = gui_wms.fkey_wms_id AND gui_wms.fkey_gui_id IN (";
 	$v = array($_SESSION["mb_lang"]);
@@ -96,14 +96,14 @@
 	$res = db_prep_query($sql,$v,$t);
 	
 	while ($row = db_fetch_array($res)) {
-		$resultArray = array("id" => $row["wms_id"], "title" => $row["wms_title"], "abstract" => $row["wms_abstract"], "getCapabilitiesUrl" => $row["wms_getcapabilities"], "version" => $row["wms_version"], "guiId" => $row["fkey_gui_id"]);
+		$resultArray = array("id" => $row["wms_id"], "title" => $row["wms_title"], "abstract" => $row["wms_abstract"], "getCapabilitiesUrl" => $row["wms_getcapabilities"], "version" => $row["wms_version"], "guiId" => $row["gui"]);
 		array_push($resultObj["wms"], $resultArray);
 	}							 
 }
 else if ($command == "getWMSByGroup") {
 	$resultObj["wms"] = array();
 	
-	$sql = "SELECT wms_id, wms_title, gettext($1, wms_abstract) as wms_abstract, wms_getcapabilities, wms_version, MIN(gui_wms.fkey_gui_id) ";
+	$sql = "SELECT wms_id, wms_title, gettext($1, wms_abstract) as wms_abstract, wms_getcapabilities, wms_version, MIN(gui_wms.fkey_gui_id) AS gui ";
 	$sql .= "FROM wms, gui_wms, gui_mb_group ";
 	$sql .= "WHERE wms.wms_id = gui_wms.fkey_wms_id AND gui_wms.fkey_gui_id = gui_mb_group.fkey_gui_id AND gui_mb_group.fkey_mb_group_id = $2 ";
 	$sql .= "GROUP BY wms_id, wms_title, wms_abstract, wms_getcapabilities, wms_version ";
@@ -112,14 +112,14 @@
 	$res = db_prep_query($sql, $v, $t);
 	
 	while ($row = db_fetch_array($res)) {
-		$resultArray = array("id" => $row["wms_id"], "title" => $row["wms_title"], "abstract" => $row["wms_abstract"], "getCapabilitiesUrl" => $row["wms_getcapabilities"], "version" => $row["wms_version"], "guiId" => $row["fkey_gui_id"]);
+		$resultArray = array("id" => $row["wms_id"], "title" => $row["wms_title"], "abstract" => $row["wms_abstract"], "getCapabilitiesUrl" => $row["wms_getcapabilities"], "version" => $row["wms_version"], "guiId" => $row["gui"]);
 		array_push($resultObj["wms"], $resultArray);
 	}		
 }
 else if ($command == "getWMSByGUI") {
 	$resultObj["wms"] = array();
 
-	$sql = "SELECT wms_id, wms_title, gettext($1, wms_abstract) as wms_abstract, wms_getcapabilities, wms_version, MIN(fkey_gui_id) ";
+	$sql = "SELECT wms_id, wms_title, gettext($1, wms_abstract) as wms_abstract, wms_getcapabilities, wms_version, MIN(fkey_gui_id) AS gui ";
 	$sql .= "FROM wms, gui_wms WHERE wms.wms_id = gui_wms.fkey_wms_id AND fkey_gui_id IN (";
 	$v = array($_SESSION["mb_lang"]);
 	$t = array("s");
@@ -135,7 +135,7 @@
 	$res = db_prep_query($sql, $v, $t);
 	
 	while ($row = db_fetch_array($res)) {
-		$resultArray = array("id" => $row["wms_id"], "title" => $row["wms_title"], "abstract" => $row["wms_abstract"], "getCapabilitiesUrl" => $row["wms_getcapabilities"], "version" => $row["wms_version"], "guiId" => $row["fkey_gui_id"]);
+		$resultArray = array("id" => $row["wms_id"], "title" => $row["wms_title"], "abstract" => $row["wms_abstract"], "getCapabilitiesUrl" => $row["wms_getcapabilities"], "version" => $row["wms_version"], "guiId" => $row["gui"]);
 		array_push($resultObj["wms"], $resultArray);
 	}		
 }



More information about the Mapbender_commits mailing list