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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jul 22 04:03:07 EDT 2008


Author: christoph
Date: 2008-07-22 04:03:07 -0400 (Tue, 22 Jul 2008)
New Revision: 2692

Modified:
   trunk/mapbender/http/php/mod_loadCapabilitiesList.php
   trunk/mapbender/http/php/mod_setLocale.php
   trunk/mapbender/http/php/mod_wfs.php
   trunk/mapbender/http/php/mod_wfs_gazetteer_server.php
   trunk/mapbender/http/php/mod_wfs_server.php
Log:
merged w/ 2.5

Modified: trunk/mapbender/http/php/mod_loadCapabilitiesList.php
===================================================================
--- trunk/mapbender/http/php/mod_loadCapabilitiesList.php	2008-07-22 08:02:21 UTC (rev 2691)
+++ trunk/mapbender/http/php/mod_loadCapabilitiesList.php	2008-07-22 08:03:07 UTC (rev 2692)
@@ -1,292 +1,307 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/Administration
-# Copyright (C) 2002 CCGIS 
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import_request_variables("PG");
-require(dirname(__FILE__)."/../php/mb_validatePermission.php");
-?>
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html>
-<head>
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-<title>Load WMS from Catalog</title>
-<?php
-include '../include/dyn_css.php';
-?>
-<style type="text/css">
-  	<!--
-  	body{
-      background-color: #ffffff;
-  		font-family: Arial, Helvetica, sans-serif;
-  		font-size : 12px;
-  		color: #808080
-  	}
-  	.list_guis{
-  		font-family: Arial, Helvetica, sans-serif;
-  		font-size : 12px;
-  		color: #808080;
-  	}
-.text1{
-   font-family: Arial, Helvetica, sans-serif;
-   font-size : 15px;
-   position:absolute;
-   top:190px;
-}
-.select1{
-   position:absolute;
-   top:210px;
-   width:270px;
-}
-.text2{
-   font-family: Arial, Helvetica, sans-serif;
-   font-size : 15px;
-   position:absolute;
-   top:190px;
-   left:300px;
-}
-.select2{
-   position:absolute;
-   top:210px;
-   left:300px;
-}
-.getcapabilities{
-   font-family: Arial, Helvetica, sans-serif;
-   font-size : 15px;
-   position:absolute;
-   top:570px;
-}
-
-  	-->
-</style>
-<script language="JavaScript">
-function validate(wert){
-   if(wert == 'guiList'){
-      var listIndex = document.form1.guiList.selectedIndex;
-      if(listIndex<0){
-		   alert("Please select a GUI.");
-			return false;
-      }
-      else{
-         var gui_id=document.form1.guiList.options[listIndex].value;
-			document.form1.action='../php/mod_loadwms.php<?php echo SID;?>';
-			document.form1.submit();
-      }
-   }
-}
-function load(){
-      if(document.form1.guiList.selectedIndex<0){
-		   alert("Please select a GUI.");
-			return false;
-      }
-      var gui_ind = document.form1.guiList.selectedIndex;
-      var ind = document.form1.wmsID.selectedIndex;
-      var ind2 = document.form1.guiID_.selectedIndex;
-      var permission = confirm("Load " + document.form1.wmsID.options[ind].text + " FROM " + document.form1.guiID_.options[ind2].value + " INTO "+document.form1.guiList.options[gui_ind].value+" ?");
-      if(permission == true){
-         document.form1.submit();
-      }
-      else{
-         document.form1.guiID_.selectedIndex = -1;
-      }
-}
-</script>
-</head>
-<body>
-
-<?php
-
-require_once(dirname(__FILE__)."/../classes/class_administration.php");
-$admin = new administration();
-$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"],true);
-
-
-
-###INSERT
-if(isset($wmsID) && isset($guiID_)){
-	$sql_pos = "SELECT MAX(gui_wms_position) AS my_gui_wms_position FROM gui_wms WHERE fkey_gui_id = $1";
-	$v = array($guiList);
-	$t = array('s');
-	$res_pos = db_prep_query($sql_pos,$v,$t);
-	if(db_result($res_pos,0,"my_gui_wms_position") > -1){
-		$gui_wms_position = db_result($res_pos,0,"my_gui_wms_position") + 1;
-	}
-	else{
-		$gui_wms_position = 0;
-	}
-
-	$sql = "SELECT * FROM gui_wms WHERE fkey_gui_id = $1 AND fkey_wms_id = $2";
-	$v = array($guiID_,$wmsID);
-	$t = array('s','i');
-	$res = db_prep_query($sql,$v,$t);
-	$cnt = 0;
-	while($row = db_fetch_array($res)){
-		$sql_ins = "INSERT INTO gui_wms (fkey_gui_id,fkey_wms_id,gui_wms_position,gui_wms_mapformat,";
-		$sql_ins .= "gui_wms_featureinfoformat,gui_wms_exceptionformat,gui_wms_epsg,gui_wms_visible,gui_wms_opacity,gui_wms_sldurl) ";
-		$sql_ins .= "VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10)";
-		$v = array($guiList,$wmsID,$gui_wms_position,$row["gui_wms_mapformat"],$row["gui_wms_featureinfoformat"],
-		$row["gui_wms_exceptionformat"],$row["gui_wms_epsg"],$row["gui_wms_visible"],$row["gui_wms_opacity"],$row["gui_wms_sldurl"]);
-		$t = array('s','i','i','s','s','s','s','i','i','s');
-		db_prep_query($sql_ins,$v,$t);
-		$cnt++;
-	}
-
-	$sql = "SELECT * FROM gui_layer WHERE fkey_gui_id = $1 AND gui_layer_wms_id = $2";
-	$v = array($guiID_, $wmsID);
-	$t = array("s", "i");
-	$res = db_prep_query($sql, $v, $t);
-	$cnt = 0;
-	while($row = db_fetch_array($res)){
-		$sql_ins = "INSERT INTO gui_layer (fkey_gui_id,fkey_layer_id,gui_layer_wms_id,gui_layer_status,gui_layer_selectable,";
-		$sql_ins .= "gui_layer_visible,gui_layer_queryable,gui_layer_querylayer,gui_layer_minscale,gui_layer_maxscale,gui_layer_priority,gui_layer_style,gui_layer_wfs_featuretype) ";
-		$sql_ins .= "VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)";
-		$v = array($guiList,$row["fkey_layer_id"],$wmsID,$row["gui_layer_status"],$row["gui_layer_selectable"],
-		$row["gui_layer_visible"],$row["gui_layer_queryable"],$row["gui_layer_querylayer"],$row["gui_layer_minscale"],
-		$row["gui_layer_maxscale"],$row["gui_layer_priority"],$row["gui_layer_style"],$row["gui_layer_wfs_featuretype"]);
-		$t = array('s','i','i','i','i','i','i','i','i','i','i','s','s');
-		db_prep_query($sql_ins,$v,$t);
-		$cnt++;
-	}
-}
-
-echo "<form name='form1' action='" . $self."' method='post'>";
-
-echo "<table cellpadding='0' cellspacing='0' border='0'>";
-echo "<tr>";
-echo "<td>";
-if (count($ownguis)>0){
-	echo"GUI";
-	echo"<br>";
-	 
-	$sql = "SELECT * FROM gui WHERE gui_id IN (";
-	$v = $ownguis;
-	$t = array();
-	for ($i = 1; $i <= count($ownguis); $i++){
-		if ($i > 1) { 
-			$sql .= ",";
-		}
-		$sql .= "$".$i;
-		array_push($t, "s");
-	}
-	$sql .= ") ORDER BY gui_name";	
-	$res = db_prep_query($sql, $v, $t);
-	$count=0;
-	echo"<select size='8' name='guiList' style='width:200px' onClick='submit()'>";
-	while($row = db_fetch_array($res)){
-		$gui_name[$count]=$row["gui_name"];
-		$gui_description[$count]=$row["gui_description"];
-		$count++;
-		echo "<option value='".$row["gui_id"]."' ";
-		if($guiList && $guiList == $row["gui_name"]){
-			echo "selected";
-		}
-		echo ">".$row["gui_name"]."</option>";
-	}
-	
-	$arrayGUIs=$_SESSION["mb_user_guis"];
-	echo count($arrayGUIs);
-	echo "</select><br><br>";
-	
-	echo "</td>";
-	echo "<td>";
-	echo"WMS";
-	echo"<br>";
-	if(isset($guiList) && $guiList!=""){
-		$sql = "SELECT DISTINCT wms.wms_title, gui_wms_position FROM gui_wms ";
-		$sql .= "JOIN gui ON gui_wms.fkey_gui_id = gui.gui_id JOIN wms ON gui_wms.fkey_wms_id=wms.wms_id ";
-		$sql .= "AND gui_wms.fkey_gui_id=gui.gui_id WHERE gui.gui_name = $1 ORDER BY gui_wms_position";
-		$v = array($guiList);
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);	
-		$count=0;
-		echo"<select size='8' name='wmsList' style='width:200px'>";
-	
-		while($row = db_fetch_array($res)){
-			if ($row["wms_title"]!=""){
-				echo "<option value='' ";
-				echo ">".$row["wms_title"]."</option>";
-			}
-			$count++;
-		}
-		echo "</select><br><br>";
-	}else{
-		echo"<select size='8' name='wmsList' style='width:200px' on Click='submit()'>";
-		echo "</select><br><br>";
-	}
-	echo "</td>";
-	echo "<tr></table><br>";
-	
-	echo"<div class='text1'>Load WMS</div>";
-	$sql = "SELECT DISTINCT wms.wms_id,wms.wms_title,wms.wms_abstract,wms.wms_owner FROM gui_wms JOIN wms ON ";
-	$sql .= "wms.wms_id = gui_wms.fkey_wms_id WHERE gui_wms.fkey_gui_id IN(";
-	$v = $arrayGUIs;
-	$t = array();
-	for ($i = 1; $i <= count($arrayGUIs); $i++){
-		if ($i > 1) {
-			$sql .= ",";
-		}
-		$sql .= "$" . $i;
-		array_push($t, "s");
-	}
-	$sql .= ") ORDER BY wms.wms_title";
-	$res = db_prep_query($sql, $v, $t);
-	echo "<select class='select1' name='wmsID' size='20' onchange='submit()'>";
-	$cnt = 0;
-	while($row = db_fetch_array($res)){
-		echo "<option value='".$row["wms_id"]."' ";
-		if($row["wms_owner"] == $_SESSION["mb_user_id"]){
-			echo "style='color:green' ";	
-		}
-		else{
-			echo "style='color:red' ";
-		}
-		if(isset($wmsID) && $wmsID == $row["wms_id"]){
-			echo "selected";
-			$wms_getcapabilities = $row["wms_getcapabilities"];
-		}
-		echo ">".$row["wms_title"]."</option>";
-		$cnt++;
-	}
-	echo "</select>";
-	
-	if(isset($wmsID)){
-		echo "<div class='text2'>FROM:</div>";
-		$sql = "SELECT * from gui_wms WHERE fkey_wms_id = $1 ORDER BY fkey_gui_id";
-		$v = array($wmsID);
-		$t = array("s");
-		$res = db_prep_query($sql, $v, $t);
-		echo "<select class='select2' name='guiID_' size='20' onchange='load()'>";
-		$cnt = 0;
-		while($row = db_fetch_array($res)){
-			echo "<option value='".$row["fkey_gui_id"]."' ";
-			echo ">".$row["fkey_gui_id"]."</option>";
-			$cnt++;
-		}
-	echo "</select>";
-}
-echo "</form>";
-}else{
-	echo "There are no guis available for this user. Please create a gui first.";
-}
-echo "<div class='getcapabilities'>" . $wms_getcapabilities . "</div>";
-?>
-</body>
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/Administration
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+require(dirname(__FILE__)."/../php/mb_validatePermission.php");
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Load WMS from Catalog</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+  	<!--
+  	body{
+      background-color: #ffffff;
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080
+  	}
+  	.list_guis{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080;
+  	}
+.text1{
+   font-family: Arial, Helvetica, sans-serif;
+   font-size : 15px;
+   position:absolute;
+   top:190px;
+}
+.select1{
+   position:absolute;
+   top:210px;
+   width:270px;
+}
+.text2{
+   font-family: Arial, Helvetica, sans-serif;
+   font-size : 15px;
+   position:absolute;
+   top:190px;
+   left:300px;
+}
+.select2{
+   position:absolute;
+   top:210px;
+   left:300px;
+}
+.getcapabilities{
+   font-family: Arial, Helvetica, sans-serif;
+   font-size : 15px;
+   position:absolute;
+   top:570px;
+}
+
+  	-->
+</style>
+<script language="JavaScript">
+function validate(wert){
+   if(wert == 'guiList'){
+      var listIndex = document.form1.guiList.selectedIndex;
+      if(listIndex<0){
+		   alert("Please select a GUI.");
+			return false;
+      }
+      else{
+         var gui_id=document.form1.guiList.options[listIndex].value;
+			document.form1.action='../php/mod_loadwms.php<?php echo SID;?>';
+			document.form1.submit();
+      }
+   }
+}
+function load(){
+      if(document.form1.guiList.selectedIndex<0){
+		   alert("Please select a GUI.");
+			return false;
+      }
+      var gui_ind = document.form1.guiList.selectedIndex;
+      var ind = document.form1.wmsID.selectedIndex;
+      var ind2 = document.form1.guiID_.selectedIndex;
+			var indexWMSList = document.form1.wmsID.selectedIndex;
+			var permission = true;
+
+			var selectedWmsId = document.form1.wmsID.options[document.form1.wmsID.selectedIndex].value;
+			for (i = 0; i < document.form1.wmsList.length; i++) {
+						if (document.form1.wmsList.options[i].value == selectedWmsId){
+							 permission = false;							 
+							 alert ('The WMS (' + selectedWmsId + ') is already loaded in this application.');
+							 break;
+						}
+			}			 
+			
+  			if (permission) { // only check if permission is not false 
+        	var loadConfirmed = confirm("Load " + document.form1.wmsID.options[ind].text + " FROM " + document.form1.guiID_.options[ind2].value + " INTO "+document.form1.guiList.options[gui_ind].value+" ?");
+          if(loadConfirmed){
+             document.form1.submit();
+          }
+          else{
+             document.form1.guiID_.selectedIndex = -1;
+          }
+			}	
+			
+}
+</script>
+</head>
+<body>
+
+<?php
+
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"],true);
+
+
+
+###INSERT
+if(isset($wmsID) && isset($guiID_)){
+	$sql_pos = "SELECT MAX(gui_wms_position) AS my_gui_wms_position FROM gui_wms WHERE fkey_gui_id = $1";
+	$v = array($guiList);
+	$t = array('s');
+	$res_pos = db_prep_query($sql_pos,$v,$t);
+	if(db_result($res_pos,0,"my_gui_wms_position") > -1){
+		$gui_wms_position = db_result($res_pos,0,"my_gui_wms_position") + 1;
+	}
+	else{
+		$gui_wms_position = 0;
+	}
+
+	$sql = "SELECT * FROM gui_wms WHERE fkey_gui_id = $1 AND fkey_wms_id = $2";
+	$v = array($guiID_,$wmsID);
+	$t = array('s','i');
+	$res = db_prep_query($sql,$v,$t);
+	$cnt = 0;
+	while($row = db_fetch_array($res)){
+		$sql_ins = "INSERT INTO gui_wms (fkey_gui_id,fkey_wms_id,gui_wms_position,gui_wms_mapformat,";
+		$sql_ins .= "gui_wms_featureinfoformat,gui_wms_exceptionformat,gui_wms_epsg,gui_wms_visible,gui_wms_opacity,gui_wms_sldurl) ";
+		$sql_ins .= "VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10)";
+		$v = array($guiList,$wmsID,$gui_wms_position,$row["gui_wms_mapformat"],$row["gui_wms_featureinfoformat"],
+		$row["gui_wms_exceptionformat"],$row["gui_wms_epsg"],$row["gui_wms_visible"],$row["gui_wms_opacity"],$row["gui_wms_sldurl"]);
+		$t = array('s','i','i','s','s','s','s','i','i','s');
+		db_prep_query($sql_ins,$v,$t);
+		$cnt++;
+	}
+
+	$sql = "SELECT * FROM gui_layer WHERE fkey_gui_id = $1 AND gui_layer_wms_id = $2";
+	$v = array($guiID_, $wmsID);
+	$t = array("s", "i");
+	$res = db_prep_query($sql, $v, $t);
+	$cnt = 0;
+	while($row = db_fetch_array($res)){
+		$sql_ins = "INSERT INTO gui_layer (fkey_gui_id,fkey_layer_id,gui_layer_wms_id,gui_layer_status,gui_layer_selectable,";
+		$sql_ins .= "gui_layer_visible,gui_layer_queryable,gui_layer_querylayer,gui_layer_minscale,gui_layer_maxscale,gui_layer_priority,gui_layer_style,gui_layer_wfs_featuretype) ";
+		$sql_ins .= "VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)";
+		$v = array($guiList,$row["fkey_layer_id"],$wmsID,$row["gui_layer_status"],$row["gui_layer_selectable"],
+		$row["gui_layer_visible"],$row["gui_layer_queryable"],$row["gui_layer_querylayer"],$row["gui_layer_minscale"],
+		$row["gui_layer_maxscale"],$row["gui_layer_priority"],$row["gui_layer_style"],$row["gui_layer_wfs_featuretype"]);
+		$t = array('s','i','i','i','i','i','i','i','i','i','i','s','s');
+		db_prep_query($sql_ins,$v,$t);
+		$cnt++;
+	}
+}
+
+echo "<form name='form1' action='" . $self."' method='post'>";
+
+echo "<table cellpadding='0' cellspacing='0' border='0'>";
+echo "<tr>";
+echo "<td>";
+if (count($ownguis)>0){
+	echo"GUI";
+	echo"<br>";
+	 
+	$sql = "SELECT * FROM gui WHERE gui_id IN (";
+	$v = $ownguis;
+	$t = array();
+	for ($i = 1; $i <= count($ownguis); $i++){
+		if ($i > 1) { 
+			$sql .= ",";
+		}
+		$sql .= "$".$i;
+		array_push($t, "s");
+	}
+	$sql .= ") ORDER BY gui_name";	
+	$res = db_prep_query($sql, $v, $t);
+	$count=0;
+	echo"<select size='8' name='guiList' style='width:200px' onClick='submit()'>";
+	while($row = db_fetch_array($res)){
+		$gui_name[$count]=$row["gui_name"];
+		$gui_description[$count]=$row["gui_description"];
+		$count++;
+		echo "<option value='".$row["gui_id"]."' ";
+		if($guiList && $guiList == $row["gui_name"]){
+			echo "selected";
+		}
+		echo ">".$row["gui_name"]."</option>";
+	}
+	
+	$arrayGUIs=$_SESSION["mb_user_guis"];
+	echo count($arrayGUIs);
+	echo "</select><br><br>";
+	
+	echo "</td>";
+	echo "<td>";
+	echo"WMS";
+	echo"<br>";
+	if(isset($guiList) && $guiList!=""){
+		$sql = "SELECT DISTINCT wms_id, wms.wms_title, gui_wms_position FROM gui_wms ";
+		$sql .= "JOIN gui ON gui_wms.fkey_gui_id = gui.gui_id JOIN wms ON gui_wms.fkey_wms_id=wms.wms_id ";
+		$sql .= "AND gui_wms.fkey_gui_id=gui.gui_id WHERE gui.gui_name = $1 ORDER BY gui_wms_position";
+		$v = array($guiList);
+		$t = array('s');
+		$res = db_prep_query($sql,$v,$t);	
+		$count=0;
+		echo"<select size='8' name='wmsList' style='width:200px'>";
+	
+		while($row = db_fetch_array($res)){
+			if ($row["wms_title"]!=""){
+				echo "<option value='".$row["wms_id"]."' ";
+				echo ">".$row["wms_title"]."</option>";
+			}
+			$count++;
+		}
+		echo "</select><br><br>";
+	}else{
+		echo"<select size='8' name='wmsList' style='width:200px' on Click='submit()'>";
+		echo "</select><br><br>";
+	}
+	echo "</td>";
+	echo "<tr></table><br>";
+	
+	echo"<div class='text1'>Load WMS</div>";
+	$sql = "SELECT DISTINCT wms.wms_id,wms.wms_title,wms.wms_abstract,wms.wms_owner FROM gui_wms JOIN wms ON ";
+	$sql .= "wms.wms_id = gui_wms.fkey_wms_id WHERE gui_wms.fkey_gui_id IN(";
+	$v = $arrayGUIs;
+	$t = array();
+	for ($i = 1; $i <= count($arrayGUIs); $i++){
+		if ($i > 1) {
+			$sql .= ",";
+		}
+		$sql .= "$" . $i;
+		array_push($t, "s");
+	}
+	$sql .= ") ORDER BY wms.wms_title";
+	$res = db_prep_query($sql, $v, $t);
+	echo "<select class='select1' name='wmsID' size='20' onchange='submit()'>";
+	$cnt = 0;
+	while($row = db_fetch_array($res)){
+		echo "<option value='".$row["wms_id"]."' ";
+		if($row["wms_owner"] == $_SESSION["mb_user_id"]){
+			echo "style='color:green' ";	
+		}
+		else{
+			echo "style='color:red' ";
+		}
+		if(isset($wmsID) && $wmsID == $row["wms_id"]){
+			echo "selected";
+			$wms_getcapabilities = $row["wms_getcapabilities"];
+		}
+		echo ">".$row["wms_title"]."</option>";
+		$cnt++;
+	}
+	echo "</select>";
+	
+	if(isset($wmsID)){
+		echo "<div class='text2'>FROM:</div>";
+		$sql = "SELECT * from gui_wms WHERE fkey_wms_id = $1 ORDER BY fkey_gui_id";
+		$v = array($wmsID);
+		$t = array("s");
+		$res = db_prep_query($sql, $v, $t);
+		echo "<select class='select2' name='guiID_' size='20' onchange='load()'>";
+		$cnt = 0;
+		while($row = db_fetch_array($res)){
+			echo "<option value='".$row["fkey_gui_id"]."' ";
+			echo ">".$row["fkey_gui_id"]."</option>";
+			$cnt++;
+		}
+	echo "</select>";
+}
+echo "</form>";
+}else{
+	echo "There are no guis available for this user. Please create a gui first.";
+}
+echo "<div class='getcapabilities'>" . $wms_getcapabilities . "</div>";
+?>
+</body>
 </html>
\ No newline at end of file

Modified: trunk/mapbender/http/php/mod_setLocale.php
===================================================================
--- trunk/mapbender/http/php/mod_setLocale.php	2008-07-22 08:02:21 UTC (rev 2691)
+++ trunk/mapbender/http/php/mod_setLocale.php	2008-07-22 08:03:07 UTC (rev 2692)
@@ -24,6 +24,6 @@
 $localeObj = new Mb_locale($_SESSION["mb_lang"]);
 session_write_close();
 
-header("Content-type='text/plain';Charset='utf-8'");
+header("Content-type='text/plain';Charset=utf-8");
 echo $localeObj->name;
 ?>

Modified: trunk/mapbender/http/php/mod_wfs.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs.php	2008-07-22 08:02:21 UTC (rev 2691)
+++ trunk/mapbender/http/php/mod_wfs.php	2008-07-22 08:03:07 UTC (rev 2692)
@@ -101,7 +101,9 @@
 			echo "wfs_conf[".$i."]['g_use_wzgraphics']  = '".$row["g_use_wzgraphics"]."';";
 			echo "wfs_conf[".$i."]['fkey_featuretype_id']  = '".$row["fkey_featuretype_id"]."';";
 			echo "wfs_conf[".$i."]['wfs_getfeature']  = '".$row["wfs_getfeature"]."';";
+			echo "wfs_conf[".$i."]['wfs_describefeaturetype']  = '".$row["wfs_describefeaturetype"]."';";
 			echo "wfs_conf[".$i."]['wfs_transaction']  = '".$row["wfs_transaction"]."';";
+			#wfs_describefeaturetype - wfs_describefeaturetype
 			
 		}else{die("wfs_conf data not available");}
 		
@@ -175,4 +177,4 @@
 </head>
 <body leftmargin='0' topmargin='10'  bgcolor='#ffffff' onload='register()'>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/mapbender/http/php/mod_wfs_gazetteer_server.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_gazetteer_server.php	2008-07-22 08:02:21 UTC (rev 2691)
+++ trunk/mapbender/http/php/mod_wfs_gazetteer_server.php	2008-07-22 08:03:07 UTC (rev 2692)
@@ -95,7 +95,7 @@
 	$obj = new WfsConf();
 	$obj->load($wfsConfIdArray);
 
-	$json = new Services_JSON();
+	$json = new Mapbender_JSON();
 	$output = $json->encode($obj->confArray);
 	echo $output;
 }
@@ -152,4 +152,4 @@
 else {
 	echo "please enter a valid command.";
 }
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/http/php/mod_wfs_server.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_server.php	2008-07-22 08:02:21 UTC (rev 2691)
+++ trunk/mapbender/http/php/mod_wfs_server.php	2008-07-22 08:03:07 UTC (rev 2692)
@@ -24,27 +24,27 @@
 	case 'getAssignedConfs':
 		$obj->assignedConfs = getAssignedConfs($obj);
 		sendOutput($obj);
-	break;
-	case 'getUpdateUrl':
-		$obj->url = getUpdateUrl($obj);
-		sendOutput($obj);	
-	break;
+	break;
+	case 'getUpdateUrl':
+		$obj->url = getUpdateUrl($obj);
+		sendOutput($obj);
+	break;
 		case 'add':
 		addConfsToGui($obj);
 		sendOutput($obj);
 	break;
 	case 'remove':
 		removeConfsFromGui($obj);
-		sendOutput($obj);
-	break;
-	case 'updateWfs':
-		updateWfs($obj);
 		sendOutput($obj);
-	break;
-	case 'deleteWfs':
-		deleteWfs($obj);
-		sendOutput($obj);
 	break;
+	case 'updateWfs':
+		updateWfs($obj);
+		sendOutput($obj);
+	break;
+	case 'deleteWfs':
+		deleteWfs($obj);
+		sendOutput($obj);
+	break;
 	case 'setOwsproxy':
 		$ows = array();
 		$ows['string'] = setOwsproxy($obj);
@@ -70,7 +70,7 @@
 
 /*
  * Get all services (ids and titles) where the current user is owner
- * 
+ *
  * @return mixed[] services the ids and titles of the services
  */
 function getServices(){
@@ -81,11 +81,11 @@
 	$adm = new administration();
 	$serviceList = $adm->getWfsByOwner($_SESSION['mb_user_id']);
 	if(count($serviceList) == 0){
-		return false;	
+		return false;
 	}
 	$sql = "SELECT * FROM wfs WHERE wfs_id IN (";
 	$v = $serviceList;
-	$t = array(); 
+	$t = array();
 	for ($i = 1; $i <= count($serviceList); $i++) {
 		if ($i > 1) {
 			$sql .= ", ";
@@ -103,13 +103,13 @@
 }
 
 /*
- * Get all configurations of the selcted wfs if the current user is owner 
- * 
- * @return mixed[] 
+ * Get all configurations of the selcted wfs if the current user is owner
+ *
+ * @return mixed[]
  */
 function getWfsConfData($wfsID){
 	global $con;
-	// re-check permission 
+	// re-check permission
 	$adm = new administration();
 	$serviceList = $adm->getWfsByOwner($_SESSION['mb_user_id']);
 	if(in_array($wfsID, $serviceList)){
@@ -127,41 +127,41 @@
 			$cnt++;
 		}
 		if($cnt == 0){
-			return false;	
+			return false;
 		}
 		else{
 			return $wfsConf;
 		}
-	}
-	else if($wfsID==="gui_confs"){
-		$wfsConf = array();
-		$wfsConf['id'] = array();
-		$wfsConf['abstract'] = array();
-		$wfsConf['id'] = $adm->getWfsConfByPermission($_SESSION['mb_user_id']);
-		$cnt = 0;
-		foreach($wfsConf['id'] as $wfscid){
-			$sql = "SELECT wfs_conf_abstract FROM wfs_conf WHERE wfs_conf_id = $1";
-			$v = array($wfscid);
-			$t = array('i');
-			$res = db_prep_query($sql,$v,$t);
-			while($row = db_fetch_array($res)){
-				array_push($wfsConf['abstract'], $row['wfs_conf_abstract']);
-			}	
-			$cnt++;
-		}
-		if($cnt == 0){
-			return false;	
-		}
-		else{
-			return $wfsConf;
-		}
 	}
+	else if($wfsID==="gui_confs"){
+		$wfsConf = array();
+		$wfsConf['id'] = array();
+		$wfsConf['abstract'] = array();
+		$wfsConf['id'] = $adm->getWfsConfByPermission($_SESSION['mb_user_id']);
+		$cnt = 0;
+		foreach($wfsConf['id'] as $wfscid){
+			$sql = "SELECT wfs_conf_abstract FROM wfs_conf WHERE wfs_conf_id = $1";
+			$v = array($wfscid);
+			$t = array('i');
+			$res = db_prep_query($sql,$v,$t);
+			while($row = db_fetch_array($res)){
+				array_push($wfsConf['abstract'], $row['wfs_conf_abstract']);
+			}
+			$cnt++;
+		}
+		if($cnt == 0){
+			return false;
+		}
+		else{
+			return $wfsConf;
+		}
+	}
 }
 /*
  * Get all GUIs where the current user is owner. This are the GUIs where the user could publish his
  * wfs configurations
- * 
- * @return mixed[] 
+ *
+ * @return mixed[]
  */
 function getGuis(){
 	$adm = new administration();
@@ -175,19 +175,20 @@
 
 /*
  * get all wfs_confs of the selected WFS which are assigned to the selected gui
- * @param 
- * @return mixed[] 
+ * @param
+ * @return mixed[]
  */
 function getAssignedConfs($obj){
 	global $con;
 	$assignedConfs = array();
 	$confs = getWfsConfData($obj->selectedWfs);
 	if($confs === false){
-		return false;	
+		return false;
 	}
 	$sql = "SELECT * FROM gui_wfs_conf WHERE fkey_gui_id = $1 AND fkey_wfs_conf_id IN (".join(",",$confs['id']).")";
+         	$e = new mb_exception("Error: aaaa " . $sql);
 	$v = array($obj->selectedGui);
-	$t = array('s');	
+	$t = array('s');
 	$res = db_prep_query($sql,$v,$t);
 	if(!$res){
 		$e = new mb_exception("Error: SQL: " . $sql . " -> Gui: " .$obj->selectedGui);
@@ -205,7 +206,7 @@
 		$sql = "SELECT * FROM gui_wfs_conf WHERE fkey_gui_id = $1 AND fkey_wfs_conf_id = $2";
 		$v = array($obj->gui,$obj->confs->$i);
 		$t = array('s','i');
-		$res = db_prep_query($sql,$v,$t);		
+		$res = db_prep_query($sql,$v,$t);
 		if(!$row = db_fetch_array($res)){
 			$sql1 = "INSERT INTO gui_wfs_conf (fkey_gui_id,fkey_wfs_conf_id) VALUES ($1,$2)";
 			$v1 = array($obj->gui, $obj->confs->$i);
@@ -224,82 +225,90 @@
 		$res = db_prep_query($sql,$v,$t);
 	}
 }
-/*
- * updates an WFS
- * 
- * @param object the un-encoded object 
- * @return boolean success
- */
-function updateWfs($obj){
-	$obj->success = false;
-	$mywfs = new wfs();
-	$mywfs->createObjFromDB($obj->wfs);
-	if(!$mywfs->updateObjFromXML($obj->url)){
-		return false;
-	}
-	if(!$mywfs->wfs2db("")){
-		return false;
-	}		
-	$obj->success = true;
-	return true;
-}
-/*
- * deletes an WFS
- * 
- * @param object the un-encoded object 
- * @return boolean success
- */
-function deleteWfs($obj){
-	//$obj->success = false;
-	$sql = "DELETE FROM wfs WHERE wfs_id = $1";
-	$v = array($obj->wfs);
-	$t = array('i');	
-	$res = db_prep_query($sql,$v,$t);
-	$obj->success = true;
-	return true;
-}
-
-/*
- * gets the specified url column from db
- * 
- * @param object the un-encoded object
- * @return string requested url
- */
-
-function getUpdateUrl($obj){
-	global $con;
-	$sql = "SELECT * FROM wfs WHERE wfs_id = $1;";
-	$v = array($obj->wfs);
-	$t = array('i');
-	$res = db_prep_query($sql,$v,$t);
-	while($row = db_fetch_array($res)){
-		return $row[$obj->column];
-	}
-	return "";
-}
+/*
+ * updates an WFS
+ *
+ * @param object the un-encoded object
+ * @return boolean success
+ */
+function updateWfs($obj){
+	$obj->success = false;
+	$mywfs = new wfs();
+	$mywfs->createObjFromDB($obj->wfs);
+	if(!$mywfs->updateObjFromXML($obj->url)){
+		return false;
+	}
+	if(!$mywfs->wfs2db("")){
+		return false;
+	}
+	$obj->success = true;
+	return true;
+}
+/*
+ * deletes an WFS
+ *
+ * @param object the un-encoded object
+ * @return boolean success
+ */
+function deleteWfs($obj){
+	//$obj->success = false;
+	$sql = "DELETE FROM wfs WHERE wfs_id = $1";
+	$v = array($obj->wfs);
+	$t = array('i');
+	$res = db_prep_query($sql,$v,$t);
+	$obj->success = true;
+	return true;
+}
 
+/*
+ * gets the specified url column from db
+ *
+ * @param object the un-encoded object
+ * @return string requested url
+ */
+
+function getUpdateUrl($obj){
+	global $con;
+	$sql = "SELECT * FROM wfs WHERE wfs_id = $1;";
+	$v = array($obj->wfs);
+	$t = array('i');
+	$res = db_prep_query($sql,$v,$t);
+	while($row = db_fetch_array($res)){
+		$ContentOfColumn = $row[$obj->column];
+		if($obj->column == 'wfs_getcapabilities'){
+										$n = new administration();
+										$updateUrl = $n->checkURL($ContentOfColumn)."Version=".$row['wfs_version']."&Request=getCapabilities&SERVICE=WFS";
+		}else{
+					$updateUrl = $ContentOfColumn;
+		}
+			
+		return $updateUrl;
+	}
+	return "";
+}
+
 function getOwsproxy($obj){
-	$n = new administration();
-	if($obj->wfs=="gui_confs")
+	$n = new administration();
+	if($obj->wfs=="gui_confs")
 		return false;
-	return $n->getWfsOwsproxyString($obj->wfs); 
+	return $n->getWfsOwsproxyString($obj->wfs);
 }
 function setOwsproxy($obj){
 	$n = new administration();
-	if($obj->wfs=="gui_confs")
-		return false;
+	if($obj->wfs=="gui_confs")
+		return false;
 	return $n->setWfsOwsproxyString($obj->wfs,true);
 }
 function removeOwsproxy($obj){
 	$n = new administration();
-	if($obj->wfs=="gui_confs")
-		return false;
+	if($obj->wfs=="gui_confs")
+		return false;
 	return $n->setWfsOwsproxyString($obj->wfs,false);
 }
 /*
  * encodes and delivers the data
- * 
- * @param object the un-encoded object 
+ *
+ * @param object the un-encoded object
  */
 function sendOutput($out){
 	global $json;



More information about the Mapbender_commits mailing list