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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jul 17 03:47:40 EDT 2007


Author: christoph
Date: 2007-07-17 03:47:39 -0400 (Tue, 17 Jul 2007)
New Revision: 1501

Added:
   trunk/mapbender/http/classes/class_wfs_conf.php
Removed:
   trunk/mapbender/http/classes/class_wfs_conf.php
Log:
new function exportToArray

Deleted: trunk/mapbender/http/classes/class_wfs_conf.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_conf.php	2007-07-17 07:39:38 UTC (rev 1500)
+++ trunk/mapbender/http/classes/class_wfs_conf.php	2007-07-17 07:47:39 UTC (rev 1501)
@@ -1,146 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/class_wfs_conf.php
-# 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.
-
-class wfs_conf{
-	
-	var $wfs_id;
-	var $wfs_name;
-	var $wfs_title;
-	var $wfs_abstract;
-	var $wfs_getcapabilities;
-	var $wfs_describefeaturetype;
-	var $wfs_getfeature;
-	
-	var $features;
-	var $elements;
-	var $namespaces;
-		
-	function getallwfs(){
-		$this->wfs_id = array();
-		$this->wfs_name = array();
-		$this->wfs_title = array();
-		$this->wfs_abstract = array();
-		
-		global $DBSERVER,$DB,$OWNER,$PW;
-		$con = db_connect($DBSERVER,$OWNER,$PW);
-		db_select_db($DB,$con);
-		$sql = "SELECT * FROM wfs"; // include permission handling
-		$res = db_query($sql);
-		$cnt = 0;
-		while ($row = db_fetch_array($res)){
-			$this->wfs_version[$cnt] = $row["wfs_version"];
-			$this->wfs_id[$cnt] = $row["wfs_id"];
-			$this->wfs_name[$cnt] = $row["wfs_name"];
-			$this->wfs_title[$cnt] = $row["wfs_title"];
-			$this->wfs_abstract[$cnt] = $row["wfs_abstract"];
-			$this->wfs_getcapabilities[$cnt] = $row["wfs_getcapabilities"];
-			$this->wfs_describefeaturetype[$cnt] = $row["wfs_describefeaturetype"];
-			$this->wfs_getfeature[$cnt] = $row["wfs_getfeature"];
-			$cnt++;
-		}	
-	}
-	function getfeatures($wfsid){
-		$this->features = new features($wfsid);
-	}
-	function getelements($feature){
-		$this->elements = new elements($feature);
-	}
-	function getnamespaces($feature){
-		$this->namespaces = new namespaces($feature);
-	}
-}
-class features extends wfs_conf{
-	
-	var $featuretype_id;
-	var $featuretype_name;
-	var $featuretype_title;
-	var $featuretype_srs;
-	
-	function features($id){		
-		
-		$featuretype_id = array();
-		$featuretype_name = array();
-		$featuretype_title = array();
-		$featuretype_srs = array();
-		
-		global $DBSERVER,$DB,$OWNER,$PW;
-		$con = db_connect($DBSERVER,$OWNER,$PW);
-		db_select_db($DB,$con);
-		$sql = "SELECT * FROM wfs_featuretype WHERE fkey_wfs_id = ".$id;
-		$res = db_query($sql);
-		$cnt = 0;
-		while ($row = db_fetch_array($res)){
-			$this->featuretype_id[$cnt] = $row["featuretype_id"];
-			$this->featuretype_name[$cnt] = $row["featuretype_name"];
-			$this->featuretype_title[$cnt] = $row["featuretype_title"];
-			$this->featuretype_srs[$cnt] = $row["featuretype_srs"];
-			$cnt++;
-		}	
-	}	
-}
-class elements extends wfs_conf{
-	
-	var $element_id;
-	var $element_name;
-	var $element_type;
-	
-	function elements($fid){
-		
-		$element_id = array();
-		$element_name = array();
-		$element_type = array();
-		
-		global $DBSERVER,$DB,$OWNER,$PW;
-		$con = db_connect($DBSERVER,$OWNER,$PW);
-		db_select_db($DB,$con);
-		$sql = "SELECT * FROM wfs_element WHERE fkey_featuretype_id = ".$fid;
-		$res = db_query($sql);
-		$cnt = 0;
-		while ($row = db_fetch_array($res)){
-			$this->element_id[$cnt] = $row["element_id"];
-			$this->element_name[$cnt] = $row["element_name"];
-			$this->element_type[$cnt] = $row["element_type"];
-			$cnt++;
-		}
-	}
-}
-class namespaces extends wfs_conf{
-	
-	var $namespace_name;
-	var $namespace_location;
-	
-	function namespaces($fid){
-		
-		$namespace_name = array();
-		$namespace_location = array();
-		
-		global $DBSERVER,$DB,$OWNER,$PW;
-		$con = db_connect($DBSERVER,$OWNER,$PW);
-		db_select_db($DB,$con);
-		$sql = "SELECT * FROM wfs_featuretype_namespace WHERE fkey_featuretype_id = ".$fid;
-		$res = db_query($sql);
-		$cnt = 0;
-		while ($row = db_fetch_array($res)){
-			$this->namespace_name[$cnt] = $row["namespace"];
-			$this->namespace_location[$cnt] = $row["namespace_location"];
-			$cnt++;
-		}
-	}
-}
-?>
\ No newline at end of file

Added: trunk/mapbender/http/classes/class_wfs_conf.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_conf.php	                        (rev 0)
+++ trunk/mapbender/http/classes/class_wfs_conf.php	2007-07-17 07:47:39 UTC (rev 1501)
@@ -0,0 +1,155 @@
+<?php
+# $Id: class_wfs_conf.php 530 2006-06-19 15:08:35Z vera_schulze $
+# http://www.mapbender.org/index.php/class_wfs_conf.php
+# 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.
+
+class wfs_conf{
+	
+	var $wfs_id;
+	var $wfs_name;
+	var $wfs_title;
+	var $wfs_abstract;
+	var $wfs_getcapabilities;
+	var $wfs_describefeaturetype;
+	var $wfs_getfeature;
+	
+	var $features;
+	var $elements;
+	var $namespaces;
+
+	function exportToArray() {
+		$obj = array();
+		for ($i = 0; $i < count($this->wfs_id); $i++) {
+			$obj[$this->wfs_id[$i]] = $this->wfs_title[$i];;
+			 
+		}
+		return $obj;
+	}
+		
+	function getallwfs(){
+		$this->wfs_id = array();
+		$this->wfs_name = array();
+		$this->wfs_title = array();
+		$this->wfs_abstract = array();
+		
+		global $DBSERVER,$DB,$OWNER,$PW;
+		$con = db_connect($DBSERVER,$OWNER,$PW);
+		db_select_db($DB,$con);
+		$sql = "SELECT * FROM wfs"; // include permission handling
+		$res = db_query($sql);
+		$cnt = 0;
+		while ($row = db_fetch_array($res)){
+			$this->wfs_version[$cnt] = $row["wfs_version"];
+			$this->wfs_id[$cnt] = $row["wfs_id"];
+			$this->wfs_name[$cnt] = $row["wfs_name"];
+			$this->wfs_title[$cnt] = $row["wfs_title"];
+			$this->wfs_abstract[$cnt] = $row["wfs_abstract"];
+			$this->wfs_getcapabilities[$cnt] = $row["wfs_getcapabilities"];
+			$this->wfs_describefeaturetype[$cnt] = $row["wfs_describefeaturetype"];
+			$this->wfs_getfeature[$cnt] = $row["wfs_getfeature"];
+			$cnt++;
+		}	
+	}
+	function getfeatures($wfsid){
+		$this->features = new features($wfsid);
+	}
+	function getelements($feature){
+		$this->elements = new elements($feature);
+	}
+	function getnamespaces($feature){
+		$this->namespaces = new namespaces($feature);
+	}
+}
+class features extends wfs_conf{
+	
+	var $featuretype_id;
+	var $featuretype_name;
+	var $featuretype_title;
+	var $featuretype_srs;
+	
+	function features($id){		
+		
+		$featuretype_id = array();
+		$featuretype_name = array();
+		$featuretype_title = array();
+		$featuretype_srs = array();
+		
+		global $DBSERVER,$DB,$OWNER,$PW;
+		$con = db_connect($DBSERVER,$OWNER,$PW);
+		db_select_db($DB,$con);
+		$sql = "SELECT * FROM wfs_featuretype WHERE fkey_wfs_id = ".$id;
+		$res = db_query($sql);
+		$cnt = 0;
+		while ($row = db_fetch_array($res)){
+			$this->featuretype_id[$cnt] = $row["featuretype_id"];
+			$this->featuretype_name[$cnt] = $row["featuretype_name"];
+			$this->featuretype_title[$cnt] = $row["featuretype_title"];
+			$this->featuretype_srs[$cnt] = $row["featuretype_srs"];
+			$cnt++;
+		}	
+	}	
+}
+class elements extends wfs_conf{
+	
+	var $element_id;
+	var $element_name;
+	var $element_type;
+	
+	function elements($fid){
+		
+		$element_id = array();
+		$element_name = array();
+		$element_type = array();
+		
+		global $DBSERVER,$DB,$OWNER,$PW;
+		$con = db_connect($DBSERVER,$OWNER,$PW);
+		db_select_db($DB,$con);
+		$sql = "SELECT * FROM wfs_element WHERE fkey_featuretype_id = ".$fid;
+		$res = db_query($sql);
+		$cnt = 0;
+		while ($row = db_fetch_array($res)){
+			$this->element_id[$cnt] = $row["element_id"];
+			$this->element_name[$cnt] = $row["element_name"];
+			$this->element_type[$cnt] = $row["element_type"];
+			$cnt++;
+		}
+	}
+}
+class namespaces extends wfs_conf{
+	
+	var $namespace_name;
+	var $namespace_location;
+	
+	function namespaces($fid){
+		
+		$namespace_name = array();
+		$namespace_location = array();
+		
+		global $DBSERVER,$DB,$OWNER,$PW;
+		$con = db_connect($DBSERVER,$OWNER,$PW);
+		db_select_db($DB,$con);
+		$sql = "SELECT * FROM wfs_featuretype_namespace WHERE fkey_featuretype_id = ".$fid;
+		$res = db_query($sql);
+		$cnt = 0;
+		while ($row = db_fetch_array($res)){
+			$this->namespace_name[$cnt] = $row["namespace"];
+			$this->namespace_location[$cnt] = $row["namespace_location"];
+			$cnt++;
+		}
+	}
+}
+?>
\ No newline at end of file



More information about the Mapbender_commits mailing list