[Mapbender-commits] r7781 - in trunk/mapbender/http: classes javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Apr 19 11:16:42 EDT 2011


Author: armin11
Date: 2011-04-19 08:16:42 -0700 (Tue, 19 Apr 2011)
New Revision: 7781

Modified:
   trunk/mapbender/http/classes/class_wfs.php
   trunk/mapbender/http/javascripts/mod_digitize_tab.php
Log:
Bugfix for update wfs-t: don't send feature attributes that are declared not editable in wfs-conf. Show pretty tabs in digitize module. If the value NULL is defined in the attribute editor - don't send the tags!

Modified: trunk/mapbender/http/classes/class_wfs.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs.php	2011-04-19 05:48:35 UTC (rev 7780)
+++ trunk/mapbender/http/classes/class_wfs.php	2011-04-19 15:16:42 UTC (rev 7781)
@@ -201,7 +201,14 @@
 		$propertiesSegment = "";
 		foreach ($feature->properties as $key => $value) {
 			if (isset($value)) {
-				$propertiesSegment .= "<$ns:$key><![CDATA[$value]]></$ns:$key>";
+				if (is_numeric($value) || $value == "" || $value == "NULL") {
+					$value = $value;
+				} else {
+					$value = "<![CDATA[$value]]>";
+				}
+				if ($value != "NULL") {
+					$propertiesSegment .= "<$ns:$key>$value</$ns:$key>";
+				}
 			}
 		}
 
@@ -232,14 +239,16 @@
 		$propertiesSegment = "";
 		foreach ($feature->properties as $key => $value) {
 			if (isset($value)) {
-				if (is_numeric($value) || $value == "") {
+				if (is_numeric($value) || $value == "" || $value == "NULL") {
 					$value = $value;
 				}
 				else {
 					$value = "<![CDATA[$value]]>";
 				}
-				$propertiesSegment .= "<wfs:Property><wfs:Name>$featureNS:$key</wfs:Name>" . 
-					"<wfs:Value>$value</wfs:Value></wfs:Property>";
+				if ($value != "NULL") {
+					$propertiesSegment .= "<wfs:Property><wfs:Name>$featureNS:$key</wfs:Name>" . 
+						"<wfs:Value>$value</wfs:Value></wfs:Property>";
+				}
 			}
 		}
 

Modified: trunk/mapbender/http/javascripts/mod_digitize_tab.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_digitize_tab.php	2011-04-19 05:48:35 UTC (rev 7780)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab.php	2011-04-19 15:16:42 UTC (rev 7781)
@@ -2360,9 +2360,9 @@
 		var headStr = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=<?php echo CHARSET;?>'><style type='text/css'>" + wfsConf[defaultIndex]['g_style'] + "</style>";
 		headStr += '<link rel="stylesheet" type="text/css" href="../extensions/jquery-ui-1.7.2.custom/development-bundle/themes/base/ui.all.css" />';
 		headStr += '<style type="text/css">'
-		headStr += 'a.tabheader { margin: 0 3px 0 0;padding: 1px 5px;text-decoration: none;color: #999;background-color: #F5F5F5;border: 1px solid #999;border-bottom: 0; }';
-		headStr += 'a.tabheader.active { color: #666;background-color: transparent;border-color: #666;border-bottom: 1px solid #FFF;cursor: default; }';
-		headStr += 'div.tabcontent { visibility: hidden;display: none;margin: 1px 0 5px 0;padding: 5px;border: 1px solid #666; }';
+		headStr += 'a.tabheader {float:left; margin: 0 3px 0 0;padding: 1px 5px;text-decoration: none;color: #999;background-color: #F5F5F5;border: 1px solid #999;border-bottom: 0; }';
+		headStr += 'a.tabheader.active {float:left; color: #666;background-color: transparent;border-color: #666;border-bottom: 0px solid #FFF;cursor: default; }';
+		headStr += 'div.tabcontent {clear:left; visibility: hidden;display: none;margin: 1px 0 5px 0;padding: 5px;border: 1px solid #666; }';
 		headStr += 'div.helptext { visibility: hidden;display: none;position: absolute;top: 5%;left: 5%;width: 85%;padding: 5px;color: #000;background-color: #EEEEEE;border: 1px solid #000;-moz-border-radius: 10px;-webkit-border-radius: 10px;}';
 		headStr += 'div.helptext p { margin: 0 ; }';
 		headStr += 'div.helptext p a.close { display: block;margin: 5px auto;text-align: center; }';
@@ -2585,9 +2585,11 @@
 			elementCategories.sort();
 			
 			initialTab = elementCategories[0];
+			str +='<table><tr><td>';
 			for (var currentCategory = 0; currentCategory < elementCategories.length; currentCategory++) {
 				str += '<a href="#" id="tabheader_' + elementCategories[currentCategory] + '" class="tabheader" onclick="return window.opener.toggleTabs(\'' + elementCategories[currentCategory] + '\')">' + elementCategories[currentCategory] + '</a>';
 			}
+			str +='</td></tr></table>';
 		}
 			
 		for (var currentCategory = 0; currentCategory < elementCategories.length || !hasCategories; currentCategory++) {
@@ -2903,7 +2905,7 @@
                         
                         var validElement = false;
 			for(var j in newWfsConf.element) {
-				if(e.name[i] == newWfsConf.element[j]['element_name']) {
+				if(e.name[i] == newWfsConf.element[j]['element_name'] && newWfsConf.element[j]['f_edit'] === "1") {
 					validElement = true;
 					break;
 				}



More information about the Mapbender_commits mailing list