[Mapbender-commits] r6950 - in trunk/mapbender/http: . frames php
x_geoportal
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Sep 27 14:13:36 EDT 2010
Author: armin11
Date: 2010-09-27 18:13:36 +0000 (Mon, 27 Sep 2010)
New Revision: 6950
Added:
trunk/mapbender/http/x_geoportal/
trunk/mapbender/http/x_geoportal/mod_revertGuiSessionSettings.php
trunk/mapbender/http/x_geoportal/mod_revertGuiSessionSettings_server.php
Modified:
trunk/mapbender/http/frames/index.php
trunk/mapbender/http/php/mb_validateSession.php
Log:
Some files for sync with geoportal.rlp. In this application, mapbender guis handles more than only map applications. E.g. the extended search form is a gui itself. The application stores the map configuration as an extented wmc document in the session of the user. Some guis should only be used temporary and should not show the current wmc. The moduls added here give this possibility. To handle those a new session variable - previous_gui - is introduced. Guis which are only temporary can add the module mod_revertGuiSessionSettings.php to set the mb_user_gui to the previous gui after loading the temporary gui.
Modified: trunk/mapbender/http/frames/index.php
===================================================================
--- trunk/mapbender/http/frames/index.php 2010-09-27 15:57:32 UTC (rev 6949)
+++ trunk/mapbender/http/frames/index.php 2010-09-27 18:13:36 UTC (rev 6950)
@@ -21,6 +21,10 @@
require_once("../php/mb_validateSession.php");
require_once(dirname(__FILE__)."/../classes/class_gui.php");
+//new for geoportal.rlp - some guis has special functions - for normal mapbender installation this doesn't matter
+if (Mapbender::session()->get("mb_user_gui") !== false) {
+ Mapbender::session()->set("previous_gui",Mapbender::session()->get("mb_user_gui"));
+}
Mapbender::session()->set("mb_user_gui",$gui_id);
//
Modified: trunk/mapbender/http/php/mb_validateSession.php
===================================================================
--- trunk/mapbender/http/php/mb_validateSession.php 2010-09-27 15:57:32 UTC (rev 6949)
+++ trunk/mapbender/http/php/mb_validateSession.php 2010-09-27 18:13:36 UTC (rev 6950)
@@ -49,6 +49,11 @@
$gui_id = $_REQUEST["guiID"];
$e = new mb_notice("gui id set to guiID: " . $gui_id);
}
+ //set this to hold the get parameters for login.php in sync
+ elseif (isset($_REQUEST["mb_user_myGui"])) {
+ $gui_id = $_REQUEST["mb_user_myGui"];
+ $e = new mb_notice("gui id set to gui_id: " . $gui_id);
+ }
elseif (isset($_REQUEST["gui_id"])) {
$gui_id = $_REQUEST["gui_id"];
$e = new mb_notice("gui id set to gui_id: " . $gui_id);
Added: trunk/mapbender/http/x_geoportal/mod_revertGuiSessionSettings.php
===================================================================
--- trunk/mapbender/http/x_geoportal/mod_revertGuiSessionSettings.php (rev 0)
+++ trunk/mapbender/http/x_geoportal/mod_revertGuiSessionSettings.php 2010-09-27 18:13:36 UTC (rev 6950)
@@ -0,0 +1,23 @@
+<?php
+#
+#
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+?>
+Mapbender.events.init.register(function () {
+ $.post("../x_geoportal/mod_revertGuiSessionSettings_server.php", {}, function () {
+ });
+});
Added: trunk/mapbender/http/x_geoportal/mod_revertGuiSessionSettings_server.php
===================================================================
--- trunk/mapbender/http/x_geoportal/mod_revertGuiSessionSettings_server.php (rev 0)
+++ trunk/mapbender/http/x_geoportal/mod_revertGuiSessionSettings_server.php 2010-09-27 18:13:36 UTC (rev 6950)
@@ -0,0 +1,26 @@
+<?php
+#
+#
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+include("../classes/class_mb_exception.php");
+session_start();
+$e = new mb_exception("revert GUI session settings:");
+$e = new mb_exception("curr: " . $_SESSION["mb_user_gui"]);
+$e = new mb_exception("prev: " . $_SESSION["previous_gui"]);
+$_SESSION["mb_user_gui"] = $_SESSION["previous_gui"];
+session_write_close();
+?>
More information about the Mapbender_commits
mailing list