[Mapbender-commits] r3285 - branches/beck_dev/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Dec 10 08:26:10 EST 2008


Author: beck
Date: 2008-12-10 08:26:10 -0500 (Wed, 10 Dec 2008)
New Revision: 3285

Modified:
   branches/beck_dev/http/javascripts/mod_mapCookie.php
Log:


Modified: branches/beck_dev/http/javascripts/mod_mapCookie.php
===================================================================
--- branches/beck_dev/http/javascripts/mod_mapCookie.php	2008-12-09 13:16:34 UTC (rev 3284)
+++ branches/beck_dev/http/javascripts/mod_mapCookie.php	2008-12-10 13:26:10 UTC (rev 3285)
@@ -1,5 +1,5 @@
 <?php
-# $Id: mod_mapCookie.php 264 2008-12-09 12:10:19Z beck
+# $Id: mod_mapCookie.php 3284 2008-12-09 12:10:19Z beck
 # http://www.mapbender.org/index.php/mod_savewmc.php
 # Copyright (C) 2002 CCGIS
 #
@@ -21,7 +21,8 @@
 
 echo "var mod_mapCookie_target = '".trim($e_target[0])."';";
 
-$sql  = "SELECT * FROM gui_element_vars ";
+$sql  = "SELECT var_name,var_value ";
+$sql .= "FROM gui_element_vars ";
 $sql .= "WHERE fkey_gui_id = $1 ";
 $sql .= "AND fkey_e_id = $2";
 
@@ -29,17 +30,11 @@
 $t = array("s","s");
 
 $result = db_prep_query($sql,$v,$t);
-$row    = db_fetch_array($result);
-
-/*
-echo "var mod_mapCookie_cookieLifetime = ".(int)trim(row["cookieLifetime"]).";";	
-echo "var mod_mapCookie_cookieName     = '".trim(row["cookieName"])."';";
-*/
+while($row = db_fetch_array($result)) {
+	echo "var mod_mapCookie_".trim($row["var_name"])." = '".trim($row["var_value"])."';";
+}
 ?>
 
-var mod_mapCookie_cookieLifetime = 7;			// Cookie lifetime in days
-var mod_mapCookie_cookieName     = 'stored_map_state';	// Cookie name
-
 eventInit.register(restoreMapState);
 eventInit.register(triggerUnload);
 
@@ -70,7 +65,7 @@
 	var cookieExpires   = new Date();
 	var cookieData      = {}
 	
-	cookieExpires.setTime(cookieExpires.getTime() + (mod_mapCookie_cookieLifetime * 24 * 60 * 60 * 1000));
+	cookieExpires.setTime(cookieExpires.getTime() + (parseInt(mod_mapCookie_cookieLifetime) * 24 * 60 * 60 * 1000));
 
 	cookieData.extent = currentMapState.extent;
 	cookieData.epsg   = currentMapState.epsg;



More information about the Mapbender_commits mailing list