[Mapbender-commits] r6503 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jul 2 14:00:03 EDT 2010


Author: verenadiewald
Date: 2010-07-02 18:00:03 +0000 (Fri, 02 Jul 2010)
New Revision: 6503

Modified:
   trunk/mapbender/http/javascripts/mod_loadwmc.js
   trunk/mapbender/http/javascripts/mod_savewmc.js
Log:
control the edit function -> show when save wmc is set and overwrite is true 

Modified: trunk/mapbender/http/javascripts/mod_loadwmc.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_loadwmc.js	2010-07-02 17:15:01 UTC (rev 6502)
+++ trunk/mapbender/http/javascripts/mod_loadwmc.js	2010-07-02 18:00:03 UTC (rev 6503)
@@ -12,9 +12,18 @@
 options.deleteWmc = typeof options.deleteWmc === "number" ? options.deleteWmc : 1;
 options.uploadWmc = typeof options.uploadWmc === "number" ? options.uploadWmc : 1;
 options.listWmc = typeof options.listWmc === "number" ? options.listWmc : 1;
+options.saveWmcTarget = typeof options.saveWmcTarget === "string" ? options.saveWmcTarget : "savewmc";
 options.editWmc = typeof options.editWmc === "number" ? options.editWmc : 1;
-options.saveWmcTarget = typeof options.saveWmcTarget === "string" ? options.saveWmcTarget : "savewmc";
 
+Mapbender.events.init.register(function () {
+	if(Mapbender.modules[options.saveWmcTarget] && Mapbender.modules[options.saveWmcTarget].overwrite === 1) {
+		options.editWmc = 1;
+	}
+	else {
+		options.editWmc = 0;
+	}	
+});
+
 var originalI18nObject = {
 	"labelList": "List",
 	"labelUpload": "Upload",

Modified: trunk/mapbender/http/javascripts/mod_savewmc.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_savewmc.js	2010-07-02 17:15:01 UTC (rev 6502)
+++ trunk/mapbender/http/javascripts/mod_savewmc.js	2010-07-02 18:00:03 UTC (rev 6503)
@@ -73,6 +73,8 @@
 
 	this.extensionData = {};
 	
+	this.overwrite = overwrite;
+	
 	this.events = {
 		saved: new Mapbender.Event()
 	};



More information about the Mapbender_commits mailing list