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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Aug 28 08:23:54 EDT 2009


Author: christoph
Date: 2009-08-28 08:23:53 -0400 (Fri, 28 Aug 2009)
New Revision: 4539

Modified:
   trunk/mapbender/http/php/mod_layerMetadata.php
Log:
now accepts WMS ID as GET parameter, not only just a layer ID

Modified: trunk/mapbender/http/php/mod_layerMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_layerMetadata.php	2009-08-28 12:22:15 UTC (rev 4538)
+++ trunk/mapbender/http/php/mod_layerMetadata.php	2009-08-28 12:23:53 UTC (rev 4539)
@@ -60,7 +60,17 @@
 		'<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">' . 	
 	'</head>'.
 	'<body>';
+	$wms_id = $_GET['wmsid'];
 	
+	if ($wms_id) {
+		$sql = "SELECT layer_id FROM layer WHERE fkey_wms_id = $1 AND layer_pos = 0";
+		$v = array($wms_id);
+		$t = array("i");
+		$res = db_prep_query($sql, $v, $t);
+		$row = db_fetch_array($res);
+		$layer_id = $row["layer_id"];
+	}
+	
 	if ($layer_id) {
 		$sql = "SELECT ";
 		$sql .= "layer.layer_id, layer.layer_title, layer.layer_abstract, layer.layer_pos, layer.layer_parent, ";
@@ -143,8 +153,6 @@
 	$layer['Metadaten'] = $row['layer_metadataurl'];
 	$metadataUrl = $row['layer_metadataurl'];
 
-
-
 	if ($layer['Metadaten'] && $redirectToMetadataUrl) {
 		header("Location: " . $layer['Metadaten']);		
 	}	



More information about the Mapbender_commits mailing list