Explorar o código

added namespace siblings in acl struct

Piotr Labudda %!s(int64=8) %!d(string=hai) anos
pai
achega
0a615b0ef2
Modificáronse 1 ficheiros con 18 adicións e 1 borrados
  1. 18 1
      SE/se-lib/Route/Storage/AclStruct.php

+ 18 - 1
SE/se-lib/Route/Storage/AclStruct.php

@@ -730,7 +730,24 @@ class Route_Storage_AclStruct extends RouteBase {
 			$refFields = array_filter($item['field'], function ($field) {
 				return ('ref:' === substr($field['xsdType'], 0, 4) && $field['isActive']);
 			});
-			echo UI::h('h3', [], "Obiekty powiązane");
+			$nsSiblings = ACL::getNamespaceSiblings($item['namespace']);
+			$siblingSelected = $item['namespace'];
+			$baseUrl = $this->getLink();
+			echo UI::h('h3', [], [
+				"Obiekty powiązane",
+				(empty($nsSiblings))
+				? ''
+				: UI::h('small', [ 'class' => "pull-right" ],
+						UI::h('select', [
+							'onChange' => "window.location.href='{$baseUrl}&namespace=' + this.value"
+						], array_map(function ($sibling) use ($siblingSelected) {
+							return UI::h('option', array_merge(
+								[ 'value' => $sibling ],
+								($siblingSelected === $sibling) ? [ 'selected' => "selected" ] : []
+							), $sibling);
+						}, $nsSiblings))
+					),
+			]);
 			UI::table([
 				'rows' => array_map(function ($backRef) use ($thisGetLink) {
 					$refNamespace = $backRef['namespace'];