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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Sep 28 09:45:23 EDT 2010


Author: armin11
Date: 2010-09-28 13:45:23 +0000 (Tue, 28 Sep 2010)
New Revision: 6956

Modified:
   trunk/mapbender/http/php/mb_validateSession.php
   trunk/mapbender/http/php/mod_layerISOMetadata.php
Log:
Adoption to see previews in geonetwork if geonetworks harvest service metadata. Possibility to give a GET lang-parameter from external programs to start mapbender by invoking its index.php.

Modified: trunk/mapbender/http/php/mb_validateSession.php
===================================================================
--- trunk/mapbender/http/php/mb_validateSession.php	2010-09-28 13:15:03 UTC (rev 6955)
+++ trunk/mapbender/http/php/mb_validateSession.php	2010-09-28 13:45:23 UTC (rev 6956)
@@ -66,8 +66,22 @@
 		$e = new mb_notice("mb_validateSession.php: gui_id not set in script: " . $_SERVER["SCRIPT_NAME"]);
 	}
 }
-
 //
+//use lang parameter to set the session var mb_lang
+if (isset($_REQUEST["lang"]) & $_REQUEST["lang"] != "") {
+	//validate to de, en, fr, ... give a whitelist
+	$testMatch = $_REQUEST["lang"];	
+ 	if (!($testMatch == 'de' or $testMatch == 'en' or $testMatch == 'fr')){ 
+		echo 'lang: <b>'.$testMatch.'</b> is not valid.<br/>'; 
+		die(); 		
+ 	}
+	$lang = $testMatch;
+	//set the 
+	Mapbender::session()->set("mb_lang",$lang);
+	$e = new mb_exception("mb_validateSession.php: lang was set by GET to: " .$lang);
+	$testMatch = NULL;
+}
+//
 // set the global var e_id
 //
 if (!isset($e_id)) {

Modified: trunk/mapbender/http/php/mod_layerISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_layerISOMetadata.php	2010-09-28 13:15:03 UTC (rev 6955)
+++ trunk/mapbender/http/php/mod_layerISOMetadata.php	2010-09-28 13:45:23 UTC (rev 6956)
@@ -397,8 +397,8 @@
 	$t = array('i');
 	$res = db_prep_query($sql,$v,$t);
 	$row = db_fetch_array($res);
-	
-	if (isset($row['layer_map_preview_filename']) & $row['layer_map_preview_filename'] != '') {
+	#old version 
+/*	if (isset($row['layer_map_preview_filename']) & $row['layer_map_preview_filename'] != '') {
 		$graphicOverview=$iso19139->createElement("gmd:graphicOverview");
 		$MD_BrowseGraphic=$iso19139->createElement("gmd:MD_BrowseGraphic");
 		$fileName=$iso19139->createElement("gmd:fileName");
@@ -410,7 +410,48 @@
 		$graphicOverview->appendChild($MD_BrowseGraphic);
 		$SV_ServiceIdentification->appendChild($graphicOverview);
 	}
+*/	
+	#version of bavaria
+	if (isset($row['layer_map_preview_filename']) & $row['layer_map_preview_filename'] != '') {
+		$graphicOverview=$iso19139->createElement("gmd:graphicOverview");
+		$MD_BrowseGraphic=$iso19139->createElement("gmd:MD_BrowseGraphic");
+		$fileName=$iso19139->createElement("gmd:fileName");
+		$fileName_cs=$iso19139->createElement("gco:CharacterString");
+		$previewFilenameText = $iso19139->createTextNode("http://www.gdi-rp-dienste3.rlp.de/mapbender/x_geoportal/layer_preview/".$row['layer_map_preview_filename']);
+		$fileName_cs->appendChild($previewFilenameText);
+		$fileName->appendChild($fileName_cs);
+
+		$fileDescription=$iso19139->createElement("gmd:fileDescription");
+		$fileDescription_cs=$iso19139->createElement("gco:CharacterString");
+		$fileDescription_text=$iso19139->createTextNode("Thumbnail");
+
+		$fileDescription_cs->appendChild($fileDescription_text);
+		$fileDescription->appendChild($fileDescription_cs);
+		
+
+		$fileType=$iso19139->createElement("gmd:fileType");
+		$fileType_cs=$iso19139->createElement("gco:CharacterString");
+		$fileType_text=$iso19139->createTextNode("PNG");
+
+		$fileType_cs->appendChild($fileType_text);
+		$fileType->appendChild($fileType_cs);
+
+
+
+		$MD_BrowseGraphic->appendChild($fileName);
+
+		$MD_BrowseGraphic->appendChild($fileDescription);
+		$MD_BrowseGraphic->appendChild($fileType);
+
+		$graphicOverview->appendChild($MD_BrowseGraphic);
+		$SV_ServiceIdentification->appendChild($graphicOverview);
+	}
 	
+
+
+
+
+
 	/*<gmd:graphicOverview>
   		<gmd:MD_BrowseGraphic>
    			 <gmd:fileName>



More information about the Mapbender_commits mailing list