[Mapbender-commits] r6143 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon May 10 07:52:42 EDT 2010


Author: christoph
Date: 2010-05-10 07:52:41 -0400 (Mon, 10 May 2010)
New Revision: 6143

Modified:
   trunk/mapbender/http/plugins/mb_metadata_edit.js
   trunk/mapbender/http/plugins/mb_metadata_edit.php
   trunk/mapbender/http/plugins/mb_metadata_layer.js
   trunk/mapbender/http/plugins/mb_metadata_server.php
Log:


Modified: trunk/mapbender/http/plugins/mb_metadata_edit.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_edit.js	2010-05-10 10:32:04 UTC (rev 6142)
+++ trunk/mapbender/http/plugins/mb_metadata_edit.js	2010-05-10 11:52:41 UTC (rev 6143)
@@ -28,9 +28,18 @@
 	var wmsId;
 	
 	this.events = {
-		showOriginalMetadata : new Mapbender.Event()
+		showOriginalMetadata : new Mapbender.Event(),
+		submit: new Mapbender.Event()
 	};
 	
+	this.serialize = function (callback) {
+		var data = $metadataForm.easyform("serialize");
+		if ($.isFunction(callback)) {
+			callback(data);
+		}
+		return data;
+	};
+	
 	this.valid = function () {
 		if (validator && validator.numberOfInvalids() > 0) {
 			$metadataForm.valid();

Modified: trunk/mapbender/http/plugins/mb_metadata_edit.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_edit.php	2010-05-10 10:32:04 UTC (rev 6142)
+++ trunk/mapbender/http/plugins/mb_metadata_edit.php	2010-05-10 11:52:41 UTC (rev 6143)
@@ -20,8 +20,8 @@
     	<img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
 	</p>
 	<p>
-		<label for="">WMS Keywords (OWS):</label>
-    	<input name=" "id=""/>
+		<label for="wms_keywords">WMS Keywords (OWS):</label>
+    	<input name="wms_keywords" id="wms_keywords"/>
     	<img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
 	</p>
 	<p>
@@ -89,13 +89,13 @@
      	<img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
 	</p>
 	<p>
-	  	<label for="">Date of first registration (Registry):</label>
-      	<input name="" id=""/>
+	  	<label for="wms_timestamp_create">Date of first registration (Registry):</label>
+      	<input name="wms_timestamp_create" id="wms_timestamp_create"/>
       	<img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
 	</p>
 	<p>
-	  	<label for="">Date of last revision (Registry):</label>
-      	<td><input name="" id=""/>
+	  	<label for="wms_timestamp">Date of last revision (Registry):</label>
+      	<td><input name="wms_timestamp" id="wms_timestamp"/>
       	<img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
 	</p>
 </fieldset>

Modified: trunk/mapbender/http/plugins/mb_metadata_layer.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_layer.js	2010-05-10 10:32:04 UTC (rev 6142)
+++ trunk/mapbender/http/plugins/mb_metadata_layer.js	2010-05-10 11:52:41 UTC (rev 6143)
@@ -32,8 +32,18 @@
 		}
 	};
 
+	this.serialize = function (callback) {
+		var data = $metadataForm.easyform("serialize");
+		if ($.isFunction(callback)) {
+			callback(data);
+		}
+		return data;
+	};
+
+
 	this.events = {
-		initialized: new Mapbender.Event()
+		initialized: new Mapbender.Event(),
+		submit: new Mapbender.Event()
 	};
 
 	var initialized = function (obj) {

Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php	2010-05-10 10:32:04 UTC (rev 6142)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php	2010-05-10 11:52:41 UTC (rev 6143)
@@ -78,21 +78,43 @@
 
 		$sql = <<<SQL
 	
-SELECT * FROM wms WHERE wms_id = $wmsId;
+SELECT wms_id, wms_abstract, wms_title, fees, accessconstraints, 
+contactperson, contactposition, contactvoicetelephone, 
+contactfacsimiletelephone, contactorganization, address, city, 
+stateorprovince, postcode, country, contactelectronicmailaddress 
+FROM wms WHERE wms_id = $wmsId;
 
 SQL;
+
 		$res = db_query($sql);
 
 		$resultObj = array();
-		while ($row = db_fetch_assoc($res)) {
-			foreach ($row as $key => $value) {
-//				$resultObj["wms:".$key] = $value;
-				$resultObj[$key] = $value;
-			}
+		$row = db_fetch_assoc($res);
+
+		foreach ($row as $key => $value) {
+			$resultObj[$key] = $value;
 		}
+		
+		$keywordSql = <<<SQL
+	
+SELECT keyword FROM keyword, layer_keyword 
+WHERE keyword_id = fkey_keyword_id AND fkey_layer_id IN (
+	SELECT layer_id from layer, wms 
+	WHERE layer_pos = 0 AND fkey_wms_id = wms_id AND wms_id = $wmsId
+)
+
+SQL;
+
+		$keywordRes = db_query($keywordSql);
+		$keywords = array();
+		while ($keywordRow = db_fetch_assoc($keywordRes)) {
+			$keywords[]= $keywordRow["keyword"];
+		}
+
+		$resultObj["wms_keywords"] = implode(", ", $keywords);
+
 		$ajaxResponse->setResult($resultObj);
 		$ajaxResponse->setSuccess(true);
-		
 
 		break;
 		



More information about the Mapbender_commits mailing list