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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jun 25 08:01:28 EDT 2009


Author: vera
Date: 2009-06-25 08:01:28 -0400 (Thu, 25 Jun 2009)
New Revision: 4228

Modified:
   trunk/mapbender/http/javascripts/mod_loadwmc.php
Log:
session var angepasst

Modified: trunk/mapbender/http/javascripts/mod_loadwmc.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_loadwmc.php	2009-06-25 11:52:00 UTC (rev 4227)
+++ trunk/mapbender/http/javascripts/mod_loadwmc.php	2009-06-25 12:01:28 UTC (rev 4228)
@@ -25,28 +25,29 @@
 function createJs ($mergeWms) {
 	$jsString = "";
 	$wmc = new wmc();
-	if (!isset($_SESSION['mb_wmc'])) {
-		$e = new mb_notice("wmc not set, generating from app: " . $_SESSION["mb_user_gui"]);
-		$wmc->createFromApplication($_SESSION["mb_user_gui"]);		
-		$_SESSION["mb_wmc"] = $wmc->toXml();
+	if (!isset(Mapbender::session()->get("mb_wmc"))) {
+		$e = new mb_notice("wmc not set, generating from app: " . Mapbender::session()->get("mb_user_gui"));
+		$wmc->createFromApplication(Mapbender::session()->get("mb_user_gui"));		
+		Mapbender::session()->set("mb_wmc",$wmc->toXml());
 		$e = new mb_notice("creating initial WMC.");
 	}
 
-	if (isset($_SESSION['mb_wmc'])) {
+	if (isset(Mapbender::session()->get("mb_wmc"))) {
 
-		if ($wmc->createFromXml($_SESSION['mb_wmc'])) {
+		if ($wmc->createFromXml(Mapbender::session()->get("mb_wmc"))) {
 	
 			if ($mergeWms) {
 				$e = new mb_notice("merging with WMS.");
 				$wmsArray = array();
-				for ($i = 0; $i < count($_SESSION["wms"]); $i++) {
+				for ($i = 0; $i < count(Mapbender::session()->get("wms")); $i++) {
 					$currentWms = new wms();
-					$currentWms->createObjFromXML($_SESSION["wms"][$i]);
+					$currentWms->createObjFromXML(Mapbender::session()->get("wms")[$i]);
 					array_push($wmsArray, $currentWms);
 				}
 				$wmc->mergeWmsArray($wmsArray);
-				$_SESSION["command"] = "";
-				$_SESSION["wms"] = array();
+				Mapbender::session()->set("command","");
+				Mapbender::session()->set("wms",array());
+
 			}
 	
 			$javaScriptArray = array();
@@ -72,7 +73,7 @@
 ?>
 function load_wmc_session() {
 <?php
-if ($_SESSION["command"] && $_SESSION["command"] == "ADDWMS") {
+if (Mapbender::session()->get("command") && Mapbender::session()->get("command") == "ADDWMS") {
 	$e = new mb_notice("merging with WMS in Session...");
 	$output = createJs(true);
 }



More information about the Mapbender_commits mailing list