[Mapbender-commits] r7124 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Nov 15 06:02:46 EST 2010


Author: christoph
Date: 2010-11-15 03:02:46 -0800 (Mon, 15 Nov 2010)
New Revision: 7124

Modified:
   trunk/mapbender/http/plugins/mb_sessionWmc.js
Log:
check if any wms have to be confirmed (formerly, we checked if any html had been generated, but that's always the case)

Modified: trunk/mapbender/http/plugins/mb_sessionWmc.js
===================================================================
--- trunk/mapbender/http/plugins/mb_sessionWmc.js	2010-11-15 10:56:13 UTC (rev 7123)
+++ trunk/mapbender/http/plugins/mb_sessionWmc.js	2010-11-15 11:02:46 UTC (rev 7124)
@@ -85,6 +85,8 @@
 	var displayConstraints = function (obj) {
 		var html = "";
 		var constraintTypeArray = [];
+		var wmsCount = 0;
+
 		for (var constraintType in obj) {
 			var caseObj = obj[constraintType];
 			//check if terms of use has been set - then there are tou given in the message!
@@ -92,7 +94,7 @@
 				html += "<fieldset>"+caseObj.message+"</fieldset>";
 				continue;
 			}
-			if (caseObj.wms.length === 0) {
+			if (caseObj.wms && caseObj.wms.length === 0) {
 				continue;
 			}
 
@@ -104,15 +106,14 @@
 				html += "<label for='" + constraintType + "_" + wms.index + "'>" +
 				(constraintType === "noPermission" ? "<li>" : "<input id='" + options.id + "_" + constraintType + "_" + wms.index + "' " + "type='checkbox' />") +
 				wms.title  + "</label><br>";
+				wmsCount++;
 			}
 			html += (constraintType === "noPermission" ? "</ul>" : "");
 			html += "</fieldset><br>";
 			constraintTypeArray.push(constraintType);
 		}
-
-
 		
-		if (html === "") {
+		if (wmsCount === 0) {
 			return;
 		}
 



More information about the Mapbender_commits mailing list