ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\UI\Component\Tree\TreeRecursion Interface Reference

Interface for mapping data-structures to the Tree. More...

+ Inheritance diagram for ILIAS\UI\Component\Tree\TreeRecursion:
+ Collaboration diagram for ILIAS\UI\Component\Tree\TreeRecursion:

Public Member Functions

 getChildren ( $record, $environment=null)
 Get a list of records (that list can also be empty). More...
 
 build (Node\Factory $factory, $record, $environment=null)
 Build and return a Node. More...
 

Detailed Description

Interface for mapping data-structures to the Tree.

The Tree is configured with a not further defined set of data. This data MUST be iterable, i.e. an array; a Node is build from each entry (=record) via TreeRecursion::build. A record MAY provide further children/sub-structures, again, not further specified. Therefore, potential children are retrieved by TreeRecursion::getChildren called with the respective record. Additionally, a Tree can be configured with an $environment, which can be virtually anything that is usefull or required for the proper construction of nodes (or identifying children). For example, if you want to present certain nodes depending on the user's permissions, you should use something like "$env['ilaccess'] = $DIC['ilAccess'];" and pass $env to the implementation of TreeRecursion. Please refer to the examples in components/ILIAS/UI/src/examples/Tree to see how this works.

Definition at line 38 of file TreeRecursion.php.

Member Function Documentation

◆ build()

ILIAS\UI\Component\Tree\TreeRecursion::build ( Node\Factory  $factory,
  $record,
  $environment = null 
)

Build and return a Node.

The renderer will provide the $factory-parameter which is the UI-factory for nodes, as well as the (unspecified) $environment as configured at the Tree. $record is the data the node should be build for.

Referenced by KSDocumentationTreeRecursion\__construct(), and ILIAS\MetaData\Editor\Tree\Recursion\getCollectedSubElements().

+ Here is the caller graph for this function:

◆ getChildren()

ILIAS\UI\Component\Tree\TreeRecursion::getChildren (   $record,
  $environment = null 
)

Get a list of records (that list can also be empty).

Each record will be relayed to $this->build to retrieve a Node. Also, each record will be asked for Sub-Nodes using this function.

Implemented in ilTreeExplorerGUI, and ilForumExplorerGUI.

Referenced by KSDocumentationTreeRecursion\__construct(), and ILIAS\MetaData\Editor\Tree\Recursion\__construct().

+ Here is the caller graph for this function:

The documentation for this interface was generated from the following file: