[Mapbender-commits] r1936 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Dec 20 09:59:42 EST 2007
Author: christoph
Date: 2007-12-20 09:59:42 -0500 (Thu, 20 Dec 2007)
New Revision: 1936
Modified:
trunk/mapbender/http/javascripts/mod_savewmc.php
Log:
bug fix
- saveInSession
- JSON
Modified: trunk/mapbender/http/javascripts/mod_savewmc.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_savewmc.php 2007-12-19 15:35:43 UTC (rev 1935)
+++ trunk/mapbender/http/javascripts/mod_savewmc.php 2007-12-20 14:59:42 UTC (rev 1936)
@@ -57,19 +57,19 @@
var mod_savewmc_img = new Image(); mod_savewmc_img.src = "<?php echo $e_src; ?>";
//var mod_savewmc_img_over = new Image(); mod_savewmc_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
-
-function mod_savewmc_session(){
- sendMapDataToServer("session", function(result, status) {});
-}
+function mod_savewmc_session(){
+ sendMapDataToServer("session", 1, function(result, status) {});
+}
+
function mod_savewmc(title){
var generalTitle = title ? title : prompt("Save WMC as...");
if (generalTitle != "" && generalTitle != null) {
- sendMapDataToServer(generalTitle, function(result, status) {alert(status + ": " + result);});
+ sendMapDataToServer(generalTitle, 0, function(result, status) {alert(status + ": " + result);});
}
}
-function sendMapDataToServer(generalTitle, callbackFunction) {
+function sendMapDataToServer(generalTitle, storeInSession, callbackFunction) {
var user = "<?php echo $_SESSION["mb_user_id"]; ?>";
var ind = getMapObjIndexByName(mod_savewmc_target);
@@ -78,6 +78,8 @@
extensionDataString = $.toJSON(currentWmcExtensionData);
}
- $.ajaxSetup({async:false}); //TODO: find out why async doesn't work onunload
- $.post("../php/mod_insertWmcIntoDb.php", {"saveInSession":saveInSession, "generalTitle":generalTitle, "extensionData":extensionDataString, "mapObject":$.toJSON(mb_mapObj[ind])}, callbackFunction);
+ if (storeInSession) {
+ $.ajaxSetup({async:false}); //TODO: find out why async doesn't work onunload
+ }
+ $.post("../php/mod_insertWmcIntoDb.php", {"saveInSession":storeInSession, "generalTitle":generalTitle, "extensionData":extensionDataString, "mapObject":$.toJSON(mb_mapObj[ind])}, callbackFunction);
}
\ No newline at end of file
More information about the Mapbender_commits
mailing list