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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sat Jun 27 02:30:58 EDT 2009


Author: christoph
Date: 2009-06-27 02:30:55 -0400 (Sat, 27 Jun 2009)
New Revision: 4258

Modified:
   trunk/mapbender/http/javascripts/mod_loadwmc.php
Log:


Modified: trunk/mapbender/http/javascripts/mod_loadwmc.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_loadwmc.php	2009-06-26 14:59:23 UTC (rev 4257)
+++ trunk/mapbender/http/javascripts/mod_loadwmc.php	2009-06-27 06:30:55 UTC (rev 4258)
@@ -25,24 +25,27 @@
 function createJs ($mergeWms) {
 	$jsString = "";
 	$wmc = new wmc();
-	if (!isset(Mapbender::session()->get("mb_wmc"))) {
+	if (!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(Mapbender::session()->get("mb_wmc"))) {
+	if (Mapbender::session()->get("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(Mapbender::session()->get("wms")); $i++) {
-					$currentWms = new wms();
-					$currentWms->createObjFromXML(Mapbender::session()->get("wms")[$i]);
-					array_push($wmsArray, $currentWms);
+				$inputWmsArray = Mapbender::session()->get("wms");
+				if ($inputWmsArray && is_array($inputWmsArray)) {
+					for ($i = 0; $i < count(); $i++) {
+						$currentWms = new wms();
+						$currentWms->createObjFromXML($inputWmsArray[$i]);
+						array_push($wmsArray, $currentWms);
+					}
 				}
 				$wmc->mergeWmsArray($wmsArray);
 				Mapbender::session()->set("command","");



More information about the Mapbender_commits mailing list