Quellcode durchsuchen

fixed root arg in GetFeature print recurse

Piotr Labudda vor 8 Jahren
Ursprung
Commit
79f03139da
2 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
  1. 3 2
      SE/se-lib/Api/Wfs/GetFeature.php
  2. 1 0
      SE/se-lib/Api/WfsDataServer.php

+ 3 - 2
SE/se-lib/Api/Wfs/GetFeature.php

@@ -317,6 +317,7 @@ class Api_Wfs_GetFeature {
 		$attrs = V::get('xsdAttributes', [], $params, 'array');
 		$showAdvancedAttrs = V::get('showAdvancedAttrs', false, $params, 'bool');
 		$dbgFid = V::get('fid', 0, $attrs);
+		$isRoot = V::get('root', false, $params, 'bool');
 		$outputBlobFormat = V::get('outputBlobFormat', '', $params, 'word');
 		if(V::get('DBG_XML', '', $_GET))$xmlWriter->writeComment("DBG: print Xml Feature Recurse... '{$tagName}'" . ( $dbgFid ? " fid='{$dbgFid}'" : "" )); // TODO: DBG
 		// DBG::log($acl, 'array', "DBG: print Xml Feature Recurse( ... {$tagName}, \$acl)" . ( $dbgFid ? " fid='{$dbgFid}'" : "" ) . " \$acl");
@@ -420,8 +421,8 @@ class Api_Wfs_GetFeature {
 			DBG::log(">>> loop {$idZasob} => {$fldName}...");
 			$fldType = $acl->getXsdFieldType($fldName);
 			DBG::log(">>> loop '{$fldName}' xsdType: '{$fldType}'");
-			if (!$acl->canReadObjectField($fldName, (object)$item)) if(V::get('DBG_XML', '', $_GET))$xmlWriter->writeComment("DBG: skip - !canReadObjectField('{$fldName}')"); // TODO: DBG
-			if (!$acl->canReadObjectField($fldName, (object)$item)) continue;
+			if (!$acl->canReadObjectField($fldName, (object)$item)) if(V::get('DBG_XML', '', $_GET))$xmlWriter->writeComment("DBG: skip - !canReadObjectField('{$fldName}') isRoot({$isRoot})"); // TODO: DBG
+			if (!$acl->canReadObjectField($fldName, (object)$item) && !$isRoot) continue;
 			DBG::log(">>> loop '{$fldName}' can read...");
 
 			if ($geomFld != null && $fldName == $geomFld) {

+ 1 - 0
SE/se-lib/Api/WfsDataServer.php

@@ -275,6 +275,7 @@ class Api_WfsDataServer extends Api_WfsServerBase {
 				),
 				'showAdvancedAttrs' => !$simple,
 				'outputBlobFormat' => $args['outputBlobFormat'],
+				'root' => $args['root'],
 			], $schemaCache);
 			$xmlWriter->endElement();// gml:featureMember
 		}