[Mapbender-commits] r8098 - in trunk/mapbender: http/javascripts resources/locale/de_DE/LC_MESSAGES

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Sep 5 05:53:18 EDT 2011


Author: armin11
Date: 2011-09-05 02:53:18 -0700 (Mon, 05 Sep 2011)
New Revision: 8098

Modified:
   trunk/mapbender/http/javascripts/mod_displayWmc.php
   trunk/mapbender/http/javascripts/mod_loadwmc.js
   trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
Log:
Extent loadWMC with function to download the wmc xml.

Modified: trunk/mapbender/http/javascripts/mod_displayWmc.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_displayWmc.php	2011-09-05 09:51:13 UTC (rev 8097)
+++ trunk/mapbender/http/javascripts/mod_displayWmc.php	2011-09-05 09:53:18 UTC (rev 8098)
@@ -20,6 +20,7 @@
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
 
 $wmc_id = $_GET["wmc_id"];
+$download = $_GET["download"];
 
 if ($wmc_id){
 	require_once(dirname(__FILE__)."/../classes/class_wmc.php");
@@ -28,16 +29,21 @@
 
 	if ($wmc_gml){
 		//Display WMC
- 
- 			// if "short open tags" is activated, the xml output is interpreted
+ 		// if "short open tags" is activated, the xml output is interpreted
 		// as php, because the XML begins with "<?xml "
 		if (ini_get("short_open_tag") == 1) {
 			echo htmlentities($wmc_gml);
 			$e = new mb_warning("'Allow short open tags' is 'On' in php.ini...you might want to turn it off to allow proper WMC display.'");
 		}
 		else {
-			header("Content-type: application/xhtml+xml; charset=".CHARSET);
-			echo $wmc_gml;
+			if ($download == 'true') {
+				header('Content-disposition: attachment; filename=mapbender_wmc.xml');
+				header("Content-type: application/xhtml+xml; charset=".CHARSET);
+				echo $wmc_gml;
+			} else {
+				header("Content-type: application/xhtml+xml; charset=".CHARSET);
+				echo $wmc_gml;
+			}
 		}
 	}
 	else{

Modified: trunk/mapbender/http/javascripts/mod_loadwmc.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_loadwmc.js	2011-09-05 09:51:13 UTC (rev 8097)
+++ trunk/mapbender/http/javascripts/mod_loadwmc.js	2011-09-05 09:53:18 UTC (rev 8098)
@@ -46,7 +46,7 @@
 	"labelMerge": "merge",
 	"labelAppend": "append",
 	"labelPublic": "public",
-	"labelShow": "show",
+	"labelShow": "show/save",
 	"labelDelete": "delete",
 	"labelEditWmc": "edit",
 	"labelOpenLayers": "OpenLayers",
@@ -196,7 +196,7 @@
 	this.showWmcXml = function (id) {
 		this.hideWmcXml();
 		var url = "../javascripts/mod_displayWmc.php?wmc_id=" + id + "&" + mb_session_name + "=" + mb_nr;
-		var $wmcDisplayPopup = $('<div class="wmcDisplayPopup"><iframe style="width:99%;height:99%;" src="' + url + '"></iframe></div>');
+		var $wmcDisplayPopup = $('<div class="wmcDisplayPopup"><a href="'+ url + '&download=true' +'"><h3>Download</h3><img src="../img/gnome/document-save.png"/></a><br><br><iframe style="width:99%;height:99%;" src="' + url + '"></iframe></div>');
 		$wmcDisplayPopup.dialog({
 			title: translatedI18nObject.labelWmcDocument,
 			bgiframe: true,
@@ -239,7 +239,7 @@
 		this.hideOpenLayersUrl();
 		var url = Mapbender.loginUrl;
 		url = url.replace("frames/login.php", "");
-		url = url.replace("http/frames/login.php", "");
+		url = Mapbender.baseUrl + "/mapbender/";
 		url = url + "php/mod_wmc2ol.php?wmc_id=" + id ;
 		var $wmcOpenLayersUrlPopup = $('<div><input size="35" type="text" value="' + url + '"/></div>');
 		$wmcOpenLayersUrlPopup.dialog({

Modified: trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
===================================================================
--- trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po	2011-09-05 09:51:13 UTC (rev 8097)
+++ trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po	2011-09-05 09:53:18 UTC (rev 8098)
@@ -1068,8 +1068,8 @@
 msgstr "öffentlich"
 
 #: ../http/javascripts/mod_loadwmc.js:87
-msgid "show"
-msgstr "anzeigen"
+msgid "show/save"
+msgstr "anzeigen/speichern"
 
 #: ../http/javascripts/mod_loadwmc.js:88
 #: ../http/javascripts/mod_loadwmc.js:294



More information about the Mapbender_commits mailing list