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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jan 12 23:45:30 PST 2016


Author: armin11
Date: 2016-01-12 23:45:30 -0800 (Tue, 12 Jan 2016)
New Revision: 9359

Modified:
   trunk/mapbender/http/plugins/mb_downloadFeedClient.php
Log:
Support for languageCode in INSPIRE Atom Feed

Modified: trunk/mapbender/http/plugins/mb_downloadFeedClient.php
===================================================================
--- trunk/mapbender/http/plugins/mb_downloadFeedClient.php	2016-01-12 23:09:57 UTC (rev 9358)
+++ trunk/mapbender/http/plugins/mb_downloadFeedClient.php	2016-01-13 07:45:30 UTC (rev 9359)
@@ -15,6 +15,28 @@
 	$testMatch = NULL;	
 }	
 //TODO: languageCode support	
+//languageCode: de, en, fr
+//get language parameter out of mapbender session if it is set else set default language to de_DE
+$sessionLang = Mapbender::session()->get("mb_lang");
+if (isset($sessionLang) && ($sessionLang!='')) {
+	$e = new mb_notice("mod_showMetadata.php: language found in session: ".$sessionLang);
+	$language = $sessionLang;
+	$langCode = explode("_", $language);
+	$langCode = $langCode[0]; # Hopefully de or s.th. else
+	$languageCode = $langCode; #overwrite the GET Parameter with the SESSION information
+}
+if (isset($_REQUEST["languageCode"]) & $_REQUEST["languageCode"] != "") {
+	//validate to csv integer list
+	$testMatch = $_REQUEST["languageCode"];
+	if (!($testMatch == 'de' or $testMatch == 'fr' or $testMatch == 'en')){ 
+		//echo 'languageCode: <b>'.$testMatch.'</b> is not valid.<br/>'; 
+		echo 'Parameter <b>languageCode</b> is not valid (de,fr,en).<br/>'; 
+		die(); 		
+ 	}
+	$languageCode = $testMatch;
+	$testMatch = NULL;
+}
+$localeObj->setCurrentLocale($languageCode);
 ?>
 <!DOCTYPE html>
 <html>



More information about the Mapbender_commits mailing list