|
|
@@ -8,10 +8,30 @@ function testFetchWfs($typeName, $featureId) {
|
|
|
try {
|
|
|
$acl = ACL::getAclByTypeName($typeName);
|
|
|
$pk = substr($featureId, strpos($featureId, '.') + 1);
|
|
|
- $item = $acl->buildQuery([])->getItem($pk);
|
|
|
+ $item = $acl->buildQuery([ 'cols' => array_keys($acl->getXsdTypes()) ])->getItem($pk);
|
|
|
if (!$item) throw new Exception("Object with primary key = '{$pk}' not found");
|
|
|
+ DBG::log($item, 'array', "testFetchWfs feature found");
|
|
|
foreach ($item as $fieldName => $value) {
|
|
|
- $tmp->appendXML('<p>' . $fieldName .': "' . $value . '"</p>');
|
|
|
+ if (is_scalar($value)) {
|
|
|
+ $tmp->appendXML('<p>' . $fieldName .': "' . $value . '"</p>');
|
|
|
+ }
|
|
|
+ else if (is_array($value)) {
|
|
|
+ $out = '<details open="true"><summary>' . $fieldName .':</summary><div>';
|
|
|
+ foreach ($value as $refItem) {
|
|
|
+ if (1 === count($refItem) && !empty($refItem['xlink'])) {
|
|
|
+ $out .= '<p> - ' . $refItem['xlink'] .':</p>';
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $out .= '<p>';
|
|
|
+ foreach ($refItem as $refField => $refValue) {
|
|
|
+ $out .= '- <b>' . $refField . ':</b> ' . $refValue .'<br>';
|
|
|
+ }
|
|
|
+ $out .= '</p>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $out .= '</div></details>';
|
|
|
+ $tmp->appendXML($out);
|
|
|
+ }
|
|
|
}
|
|
|
} catch (Exception $e) {
|
|
|
$tmp->appendXML('<div class="alert alert-danger">' . $e->getMessage() . '</div>');
|