[Mapbender-commits] r6989 - in trunk/mapbender/http: html php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Oct 1 09:17:24 EDT 2010


Author: christoph
Date: 2010-10-01 13:17:23 +0000 (Fri, 01 Oct 2010)
New Revision: 6989

Modified:
   trunk/mapbender/http/html/mod_treefolderPlain.php
   trunk/mapbender/http/php/mod_treefolder2_l10n.php
Log:
avoid php warning

Modified: trunk/mapbender/http/html/mod_treefolderPlain.php
===================================================================
--- trunk/mapbender/http/html/mod_treefolderPlain.php	2010-10-01 07:40:43 UTC (rev 6988)
+++ trunk/mapbender/http/html/mod_treefolderPlain.php	2010-10-01 13:17:23 UTC (rev 6989)
@@ -79,7 +79,9 @@
 				
 				for(var j = 0; j < currentWms.objLayer.length; j++) {
 					var currentLayer = currentWms.objLayer[j];
-					currentLayer.layer_currentTitle = translatedTitleArray[i].layer[j].title;
+					if (translatedTitleArray[i].layer.length > j) {
+						currentLayer.layer_currentTitle = translatedTitleArray[i].layer[j].title;
+					}
 				}
 			}
 			reloadTree();

Modified: trunk/mapbender/http/php/mod_treefolder2_l10n.php
===================================================================
--- trunk/mapbender/http/php/mod_treefolder2_l10n.php	2010-10-01 07:40:43 UTC (rev 6988)
+++ trunk/mapbender/http/php/mod_treefolder2_l10n.php	2010-10-01 13:17:23 UTC (rev 6989)
@@ -28,15 +28,19 @@
 		$msg_obj = $ajaxResponse->getParameter("data");
 		$newMsgObj = array();
 		
-		foreach ($msg_obj as $wmsId => $wmsObj) {
-			$newMsgObj[$wmsId] = array(
-				"title" => _mb($wmsObj->title),
-				"layer" => array()
-			);
-			foreach ($wmsObj->layer as $layerId => $layerObj) {
-				$newMsgObj[$wmsId]["layer"][$layerId] = array(
-					"title" => _mb($layerObj->title)
+		if (is_array($msg_obj)) {
+			foreach ($msg_obj as $wmsId => $wmsObj) {
+				$newMsgObj[$wmsId] = array(
+					"title" => _mb($wmsObj->title),
+					"layer" => array()
 				);
+				if (is_array($msg_obj->layer)) {
+					foreach ($wmsObj->layer as $layerId => $layerObj) {
+						$newMsgObj[$wmsId]["layer"][$layerId] = array(
+							"title" => _mb($layerObj->title)
+						);
+					}
+				}
 			}
 		}
 		$ajaxResponse->setSuccess(true);



More information about the Mapbender_commits mailing list