ILIAS  release_8 Revision v8.23
ilTreeExplorerGUI Class Reference

Explorer class that works on tree objects (Services/Tree) More...

+ Inheritance diagram for ilTreeExplorerGUI:
+ Collaboration diagram for ilTreeExplorerGUI:

Public Member Functions

 __construct (string $a_expl_id, $a_parent_obj, string $a_parent_cmd, ilTree $a_tree, string $a_node_parameter_name="node_id")
 
 getTree ()
 
 setOrderField (string $a_val, bool $a_numeric=false)
 
 getOrderField ()
 
 setTypeWhiteList (array $a_val)
 Set type white list. More...
 
 getTypeWhiteList ()
 Get type white list. More...
 
 setTypeBlackList (array $a_val)
 Set type black list. More...
 
 getTypeBlackList ()
 Get type black list. More...
 
 setPreloadChilds (bool $a_val)
 
 getPreloadChilds ()
 
 getSuccessorNode ( $a_node_id, string $a_type="")
 Get successor node (currently only(!) based on lft/rgt tree values) More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 getNodeId ($a_node)
 Get id for node. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getRootNode ()
 Get root node. More...
 
 setRootId ($a_root)
 
 setPathOpen ($a_id)
 Set node path to be opened. More...
 
 getHTML ($new=false)
 Get HTML. More...
 
 getChildren ($record, $environment=null)
 Get a list of records (that list can also be empty). More...
 
 build (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record, $environment=null)
 
 getTreeLabel ()
 
 getTreeComponent ()
 
 toggleExplorerNodeState ()
 Should be called by an ilCtrl-enabled command class if a tree node toggle action should be processed. More...
 
- Public Member Functions inherited from ilExplorerBaseGUI
 setChildLimit (int $a_val)
 
 getChildLimit ()
 
 setSearchTerm (string $a_val)
 
 getSearchTerm ()
 
 setMainTemplate (ilGlobalTemplateInterface $a_main_tpl=null)
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get children of node. More...
 
 getNodeContent ($a_node)
 Get content of a node. More...
 
 getNodeId ($a_node)
 Get id of a node. More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
 nodeHasVisibleChilds ($a_node)
 Node has children Please note that this standard method may not be optimal depending on what a derived class does in isNodeVisible. More...
 
 sortChilds (array $a_childs, $a_parent_node_id)
 Sort childs. More...
 
 getNodeIcon ($a_node)
 Get node icon path. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getNodeTarget ($a_node)
 Get node target (frame) attribute. More...
 
 getNodeOnClick ($a_node)
 Get node onclick attribute. More...
 
 isNodeVisible ($a_node)
 Is node visible? More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 getId ()
 Get id of explorer element. More...
 
 setSkipRootNode (bool $a_val)
 
 getSkipRootNode ()
 
 setAjax (bool $a_val)
 
 getAjax ()
 
 setSecondaryHighlightedNodes (array $a_val)
 Set secondary (background) highlighted nodes. More...
 
 getSecondaryHighlightedNodes ()
 Get secondary (background) highlighted nodes. More...
 
 setNodeOpen ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setSelectMode (string $a_postvar, bool $a_multi=false)
 Set select mode (to deactivate, pass an empty string as postvar) More...
 
 setNodeSelected ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setOfflineMode (bool $a_val)
 
 getOfflineMode ()
 
 handleCommand ()
 Handle explorer internal command. More...
 
 getContainerId ()
 
 openNode ()
 Open node. More...
 
 closeNode ()
 Close node. More...
 
 getNodeAsync ()
 Get node asynchronously. More...
 
 beforeRendering ()
 Before rendering. More...
 
 getOnLoadCode ()
 Get on load code. More...
 
 getHTML ()
 
 renderNode ($a_node, ilTemplate $tpl)
 Render node. More...
 
 renderChilds ($a_node_id, ilTemplate $tpl)
 Render childs. More...
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id. More...
 
 getNodeIdForDomNodeId (string $a_dom_node_id)
 Get node id for dom node id. More...
 
 listItemStart (ilTemplate $tpl, $a_node)
 List item start. More...
 
 listItemEnd (ilTemplate $tpl)
 
 listStart (ilTemplate $tpl)
 
 listEnd (ilTemplate $tpl)
 
 isNodeOnclickEnabled ()
 
 setNodeOnclickEnabled (bool $nodeOnclickEnabled)
 
 isEnableDnd ()
 
 setEnableDnd (bool $enable_dnd)
 
- Public Member Functions inherited from ILIAS\UI\Component\Tree\TreeRecursion
 build (Node\Factory $factory, $record, $environment=null)
 Build and return a Node. More...
 

Protected Member Functions

 preloadChilds ()
 
 matches ($node)
 Does a node match a search term (or is search term empty) More...
 
 getRootId ()
 
 createNode (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record)
 Creates at tree node, can be overwritten in derivatives if another node type should be used. More...
 
 getNodeStateToggleCmdClasses ($record)
 Should return an array of ilCtrl-enabled command classes which should be used to build the URL for the expand/collapse actions applied on a tree node. More...
 
 render ()
 
- Protected Member Functions inherited from ilExplorerBaseGUI
 isNodeSelectable ($a_node)
 Is node selectable? More...
 
 getNodeToggleOnClick ($a_node)
 Get onclick attribute for node toggling. More...
 
 getSelectOnClick ($a_node)
 Get onclick attribute for selecting radio/checkbox. More...
 
 isNodeOpen ($node_id)
 Get all open nodes. More...
 
 getJSTreePlugins ()
 
 isNodeRequested (string $a_node_id)
 

Protected Attributes

ilLanguage $lng
 
Psr Http Message ServerRequestInterface $httpRequest
 
ilTree $tree = null
 
string $tree_label = ""
 
string $order_field = ""
 
bool $order_field_numeric = false
 
array $type_white_list = array()
 
array $type_black_list = array()
 
array $childs = array()
 
bool $preloaded = false
 
bool $preload_childs = false
 
array $root_node_data = null
 
array $all_childs = array()
 
 $root_id = 0
 
ILIAS DI UIServices $ui
 
- Protected Attributes inherited from ilExplorerBaseGUI
string $node_parameter_name
 
ilLogger $log
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
bool $skip_root_node = false
 
bool $ajax = false
 
array $custom_open_nodes = array()
 
array $selected_nodes = array()
 
string $select_postvar = ""
 
bool $offline_mode = false
 
array $sec_highl_nodes = array()
 
bool $enable_dnd = false
 
string $search_term = ""
 
array $open_nodes = []
 
ilSessionIStorage $store
 
bool $select_multi = false
 
 $parent_obj
 
int $child_limit = 0
 
string $parent_cmd = ''
 
string $requested_exp_cmd = ""
 
string $requested_exp_cont = ""
 
string $requested_searchterm = ""
 
string $requested_node_id = ""
 
string $id
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 
static getLocalJsTreeJsPath ()
 
static getLocalJsTreeCssPath ()
 
static createHTMLExportDirs (string $a_target_dir)
 
static init (ilGlobalTemplateInterface $a_main_tpl=null)
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static string $js_tree_path = "./node_modules/jstree/dist/jstree.js"
 
static string $js_tree_path_css = "./node_modules/jstree/dist/themes/default/style.min.css"
 
static string $js_expl_path = "./Services/UIComponent/Explorer2/js/Explorer2.js"
 

Detailed Description

Explorer class that works on tree objects (Services/Tree)

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 26 of file class.ilTreeExplorerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTreeExplorerGUI::__construct ( string  $a_expl_id,
  $a_parent_obj,
string  $a_parent_cmd,
ilTree  $a_tree,
string  $a_node_parameter_name = "node_id" 
)

Definition at line 44 of file class.ilTreeExplorerGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

50  {
51  global $DIC;
52 
53  $this->httpRequest = $DIC->http()->request();
54  $this->ui = $DIC->ui();
55  $this->lng = $DIC->language();
56  parent::__construct($a_expl_id, $a_parent_obj, $a_parent_cmd, $a_node_parameter_name);
57  $this->tree = $a_tree;
58  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ build()

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

Definition at line 375 of file class.ilTreeExplorerGUI.php.

References ilExplorerBaseGUI\$id, $url, createNode(), ILIAS\Repository\ctrl(), ilExplorerBaseGUI\getNodeHref(), getNodeId(), getNodeStateToggleCmdClasses(), and ilExplorerBaseGUI\isNodeOpen().

380  $node = $this->createNode($factory, $record);
381 
382  $href = $this->getNodeHref($record);
383  if ($href !== '' && '#' !== $href) {
384  $node = $node->withLink(new \ILIAS\Data\URI(ILIAS_HTTP_PATH . '/' . $href));
385  }
386 
387  if ($this->isNodeOpen((int) $this->getNodeId($record))) {
388  $node = $node->withExpanded(true);
389  }
390 
391  $nodeStateToggleCmdClasses = $this->getNodeStateToggleCmdClasses($record);
392  $cmdClass = end($nodeStateToggleCmdClasses);
393 
394  if (is_string($cmdClass) && $cmdClass !== '') {
395  $node = $node->withAdditionalOnLoadCode(function ($id) use ($record, $nodeStateToggleCmdClasses, $cmdClass): string {
396  $serverNodeId = $this->getNodeId($record);
397 
398  $this->ctrl->setParameterByClass($cmdClass, $this->node_parameter_name, $serverNodeId);
399  $url = $this->ctrl->getLinkTargetByClass($nodeStateToggleCmdClasses, 'toggleExplorerNodeState', '', true, false);
400  $this->ctrl->setParameterByClass($cmdClass, $this->node_parameter_name, null);
401 
402  $javascript = "il.UI.tree.registerToggleNodeAsyncAction('$id', '$url', 'prior_state');";
403 
404  return $javascript;
405  });
406  }
407 
408  return $node;
409  }
Class ChatMainBarProvider .
This describes a Tree Node.
Definition: Node.php:30
createNode(\ILIAS\UI\Component\Tree\Node\Factory $factory, $record)
Creates at tree node, can be overwritten in derivatives if another node type should be used...
getNodeId($a_node)
Get id for node.
getNodeStateToggleCmdClasses($record)
Should return an array of ilCtrl-enabled command classes which should be used to build the URL for th...
$url
isNodeOpen($node_id)
Get all open nodes.
getNodeHref($a_node)
Get href for node.
$factory
Definition: metadata.php:75
+ Here is the call graph for this function:

◆ createNode()

ilTreeExplorerGUI::createNode ( \ILIAS\UI\Component\Tree\Node\Factory  $factory,
  $record 
)
protected

Creates at tree node, can be overwritten in derivatives if another node type should be used.

Definition at line 346 of file class.ilTreeExplorerGUI.php.

References ilExplorerBaseGUI\getNodeContent(), ilExplorerBaseGUI\getNodeIcon(), getNodeIconAlt(), and ILIAS\Repository\ui().

Referenced by build().

350  $nodeIconPath = $this->getNodeIcon($record);
351 
352  $icon = null;
353  if ($nodeIconPath !== '') {
354  $icon = $this->ui
355  ->factory()
356  ->symbol()
357  ->icon()
358  ->custom($nodeIconPath, $this->getNodeIconAlt($record));
359  }
360 
361  return $factory->simple($this->getNodeContent($record), $icon);
362  }
getNodeIcon($a_node)
Get node icon path.
This describes a Tree Node.
Definition: Node.php:30
getNodeIconAlt($a_node)
Get node icon alt attribute.
getNodeContent($a_node)
Get content of a node.
$factory
Definition: metadata.php:75
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getChildren()

ilTreeExplorerGUI::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.

Implements ILIAS\UI\Component\Tree\TreeRecursion.

Definition at line 338 of file class.ilTreeExplorerGUI.php.

References getChildsOfNode().

Referenced by ilLMTOCExplorerGUI\renderLSTocNode().

338  : array
339  {
340  return $this->getChildsOfNode($record["child"]);
341  }
getChildsOfNode($a_parent_node_id)
Get childs of node.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getChildsOfNode()

ilTreeExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get childs of node.

Parameters
int | string$a_parent_node_idparent id
Returns
array childs

Definition at line 206 of file class.ilTreeExplorerGUI.php.

References $c, getOrderField(), ilExplorerBaseGUI\getSearchTerm(), getTypeBlackList(), getTypeWhiteList(), ilExplorerBaseGUI\isNodeRequested(), and matches().

Referenced by ilPublicSectionExplorerGUI\getAllNodes(), and getChildren().

206  : array
207  {
208  if ($this->preloaded && $this->getSearchTerm() === "") {
209  if (isset($this->childs[$a_parent_node_id]) && is_array($this->childs[$a_parent_node_id])) {
210  return $this->childs[$a_parent_node_id];
211  }
212  return array();
213  }
214 
215  $wl = $this->getTypeWhiteList();
216  if (count($wl) > 0) {
217  $childs = $this->tree->getChildsByTypeFilter($a_parent_node_id, $wl, $this->getOrderField());
218  } else {
219  $childs = $this->tree->getChilds($a_parent_node_id, $this->getOrderField());
220  }
221 
222  // apply black list filter
223  $bl = $this->getTypeBlackList();
224  if (is_array($bl) && count($bl) > 0) {
225  $bl_childs = array();
226  foreach ($childs as $k => $c) {
227  if (!in_array($c["type"], $bl, true) && ($this->matches($c) || !$this->isNodeRequested($a_parent_node_id))) {
228  $bl_childs[$k] = $c;
229  }
230  }
231  return $bl_childs;
232  }
233 
234  $final_childs = [];
235  foreach ($childs as $k => $c) {
236  if ($this->matches($c) || !$this->isNodeRequested($a_parent_node_id)) {
237  $final_childs[$k] = $c;
238  }
239  }
240  return $final_childs;
241  }
isNodeRequested(string $a_node_id)
$c
Definition: cli.php:38
getTypeBlackList()
Get type black list.
matches($node)
Does a node match a search term (or is search term empty)
getTypeWhiteList()
Get type white list.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilTreeExplorerGUI::getHTML (   $new = false)

Get HTML.

Returns
string html

Definition at line 325 of file class.ilTreeExplorerGUI.php.

References getPreloadChilds(), preloadChilds(), and render().

325  : string
326  {
327  if ($this->getPreloadChilds()) {
328  $this->preloadChilds();
329  }
330  if (!$new) {
331  return parent::getHTML();
332  }
333  return $this->render();
334  }
+ Here is the call graph for this function:

◆ getNodeIconAlt()

ilTreeExplorerGUI::getNodeIconAlt (   $a_node)

Get node icon alt attribute.

Parameters
object | array$a_nodenode
Returns
string image alt attribute

Definition at line 273 of file class.ilTreeExplorerGUI.php.

References $lng, and ilLanguage\txt().

Referenced by ilTaxonomyClassificationExplorerGUI\createNode(), ilForumExplorerGUI\createNode(), and createNode().

273  : string
274  {
275  $lng = $this->lng;
276 
277  return $lng->txt("icon") . " " . $lng->txt("obj_" . ($a_node["type"] ?? ''));
278  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNodeId()

◆ getNodeStateToggleCmdClasses()

ilTreeExplorerGUI::getNodeStateToggleCmdClasses (   $record)
protected

Should return an array of ilCtrl-enabled command classes which should be used to build the URL for the expand/collapse actions applied on a tree node.

Parameters
$record
Returns
array

Definition at line 370 of file class.ilTreeExplorerGUI.php.

Referenced by build().

370  : array
371  {
372  return [];
373  }
+ Here is the caller graph for this function:

◆ getOrderField()

ilTreeExplorerGUI::getOrderField ( )

Definition at line 73 of file class.ilTreeExplorerGUI.php.

References $order_field.

Referenced by getChildsOfNode().

73  : string
74  {
75  return $this->order_field;
76  }
+ Here is the caller graph for this function:

◆ getPreloadChilds()

ilTreeExplorerGUI::getPreloadChilds ( )

Definition at line 119 of file class.ilTreeExplorerGUI.php.

References $preload_childs.

Referenced by getHTML().

119  : bool
120  {
121  return $this->preload_childs;
122  }
+ Here is the caller graph for this function:

◆ getRootId()

ilTreeExplorerGUI::getRootId ( )
protected

Definition at line 301 of file class.ilTreeExplorerGUI.php.

References getTree().

Referenced by getRootNode(), and ilWorkspaceExplorerGUI\isNodeHighlighted().

301  : int
302  {
303  return $this->root_id
304  ?: $this->getTree()->readRootId();
305  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRootNode()

ilTreeExplorerGUI::getRootNode ( )

◆ getSuccessorNode()

ilTreeExplorerGUI::getSuccessorNode (   $a_node_id,
string  $a_type = "" 
)

Get successor node (currently only(!) based on lft/rgt tree values)

Parameters
int | string$a_node_idnode id
Returns
mixed node id or false

Definition at line 177 of file class.ilTreeExplorerGUI.php.

References getTree().

Referenced by ilLMTOCExplorerGUI\isNodeClickable().

180  {
181  if ($this->order_field !== "") {
182  die("ilTreeExplorerGUI::getSuccessorNode not implemented for order field " . $this->order_field);
183  }
184 
185  if ($this->preloaded) {
186  $next_id = $a_node_id;
187  while (($next_id = $this->all_childs[$next_id]["next_node_id"]) && $a_type !== "" &&
188  $this->all_childs[$next_id]["type"] !== $a_type) {
189  // do nothing
190  }
191  if ($next_id) {
192  return $this->all_childs[$next_id];
193  }
194  return false;
195  }
196  return $this->getTree()->fetchSuccessorNode($a_node_id, $a_type);
197  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTree()

◆ getTreeComponent()

ilTreeExplorerGUI::getTreeComponent ( )

Definition at line 416 of file class.ilTreeExplorerGUI.php.

References $data, Vendor\Package\$f, $tree, ilExplorerBaseGUI\getNodeContent(), ilTree\getNodeData(), getRootNode(), getTree(), getTreeLabel(), ilTree\readRootId(), and ILIAS\Repository\ui().

Referenced by render().

416  : Tree
417  {
418  $f = $this->ui->factory();
419  $tree = $this->getTree();
420 
421  $data = array(
423  );
424 
425  $label = $this->getTreeLabel();
426  if ($this->getTreeLabel() === "" && $this->getNodeContent($this->getRootNode())) {
427  $label = $this->getNodeContent($this->getRootNode());
428  }
429 
430  $tree = $f->tree()->expandable($label, $this)
431  ->withData($data)
432  ->withHighlightOnNodeClick(true);
433 
434  return $tree;
435  }
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
getNodeContent($a_node)
Get content of a node.
getRootNode()
Get root node.
This describes a Tree Control.
Definition: Tree.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTreeLabel()

ilTreeExplorerGUI::getTreeLabel ( )

Definition at line 411 of file class.ilTreeExplorerGUI.php.

References $tree_label.

Referenced by ilTaxonomyClassificationExplorerGUI\getTreeComponent(), and getTreeComponent().

411  : string
412  {
413  return $this->tree_label;
414  }
+ Here is the caller graph for this function:

◆ getTypeBlackList()

ilTreeExplorerGUI::getTypeBlackList ( )

Get type black list.

Returns
array array of strings of node types that should be filtered out

Definition at line 109 of file class.ilTreeExplorerGUI.php.

References $type_black_list.

Referenced by getChildsOfNode(), and preloadChilds().

109  : array
110  {
111  return $this->type_black_list;
112  }
+ Here is the caller graph for this function:

◆ getTypeWhiteList()

ilTreeExplorerGUI::getTypeWhiteList ( )

Get type white list.

Returns
array array of strings of node types that should be retrieved

Definition at line 91 of file class.ilTreeExplorerGUI.php.

References $type_white_list.

Referenced by ilIntLinkRepItemExplorerGUI\__construct(), getChildsOfNode(), preloadChilds(), ilConditionSelector\setRefId(), and ilRepositorySelectorExplorerGUI\sortChilds().

91  : array
92  {
94  }
+ Here is the caller graph for this function:

◆ matches()

ilTreeExplorerGUI::matches (   $node)
protected

Does a node match a search term (or is search term empty)

Parameters
object | array$node
Returns
bool

Definition at line 248 of file class.ilTreeExplorerGUI.php.

References ilExplorerBaseGUI\getNodeContent(), and ilExplorerBaseGUI\getSearchTerm().

Referenced by getChildsOfNode().

248  : bool
249  {
250  return (
251  $this->getSearchTerm() === "" ||
252  is_int(ilStr::striPos($this->getNodeContent($node), $this->getSearchTerm()))
253  );
254  }
getNodeContent($a_node)
Get content of a node.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ preloadChilds()

ilTreeExplorerGUI::preloadChilds ( )
protected

Definition at line 124 of file class.ilTreeExplorerGUI.php.

References $c, getRootNode(), getTypeBlackList(), getTypeWhiteList(), and ilArrayUtil\sortArray().

Referenced by getHTML().

124  : void
125  {
126  $subtree = $this->tree->getSubTree($this->getRootNode());
127  foreach ($subtree as $s) {
128  $wl = $this->getTypeWhiteList();
129  if (is_array($wl) && count($wl) > 0 && !in_array($s["type"], $wl)) {
130  continue;
131  }
132  $bl = $this->getTypeBlackList();
133  if (is_array($bl) && count($bl) > 0 && in_array($s["type"], $bl)) {
134  continue;
135  }
136  $this->childs[$s["parent"]][] = $s;
137  $this->all_childs[$s["child"]] = $s;
138  }
139 
140  if ($this->order_field !== "") {
141  foreach ($this->childs as $k => $childs) {
142  $this->childs[$k] = ilArrayUtil::sortArray(
143  $childs,
144  $this->order_field,
145  "asc",
146  $this->order_field_numeric
147  );
148  }
149  }
150 
151  // sort childs and store prev/next reference
152  if ($this->order_field === "") {
153  $this->all_childs =
154  ilArrayUtil::sortArray($this->all_childs, "lft", "asc", true, true);
155  $prev = false;
156  foreach ($this->all_childs as $k => $c) {
157  if ($prev) {
158  $this->all_childs[$prev]["next_node_id"] = $k;
159  }
160  $this->all_childs[$k]["prev_node_id"] = $prev;
161  $this->all_childs[$k]["next_node_id"] = false;
162  $prev = $k;
163  }
164  }
165 
166  $this->preloaded = true;
167  }
$c
Definition: cli.php:38
getTypeBlackList()
Get type black list.
getRootNode()
Get root node.
getTypeWhiteList()
Get type white list.
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ render()

ilTreeExplorerGUI::render ( )
protected

Definition at line 458 of file class.ilTreeExplorerGUI.php.

References getTreeComponent(), and ILIAS\Repository\ui().

Referenced by getHTML().

458  : string
459  {
460  $r = $this->ui->renderer();
461 
462  return $r->render([
463  $this->getTreeComponent()
464  ]);
465  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setOrderField()

ilTreeExplorerGUI::setOrderField ( string  $a_val,
bool  $a_numeric = false 
)

Definition at line 65 of file class.ilTreeExplorerGUI.php.

Referenced by ilMediaPoolExplorerGUI\__construct(), ilMailExplorer\__construct(), ilTaxonomyExplorerGUI\__construct(), ilAdministrationExplorerGUI\__construct(), and ilSkillTemplateTreeExplorerGUI\__construct().

68  : void {
69  $this->order_field = $a_val;
70  $this->order_field_numeric = $a_numeric;
71  }
+ Here is the caller graph for this function:

◆ setPathOpen()

ilTreeExplorerGUI::setPathOpen (   $a_id)

Set node path to be opened.

Parameters
string$a_idnode id

Definition at line 312 of file class.ilTreeExplorerGUI.php.

References ilExplorerBaseGUI\$id, $path, getTree(), and ilExplorerBaseGUI\setNodeOpen().

Referenced by ilGroupActionTargetExplorerGUI\__construct(), ilLMExplorerGUI\__construct(), ilAdministrationExplorerGUI\__construct(), ilWorkspaceExplorerGUI\__construct(), and SurveyQuestionGUI\addMaterial().

312  : void
313  {
314  $path = $this->getTree()->getPathId($a_id);
315  foreach ($path as $id) {
316  $this->setNodeOpen($id);
317  }
318  }
setNodeOpen($a_id)
Set node to be opened (additional custom opened node, not standard expand behaviour) ...
$path
Definition: ltiservices.php:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPreloadChilds()

ilTreeExplorerGUI::setPreloadChilds ( bool  $a_val)

Definition at line 114 of file class.ilTreeExplorerGUI.php.

Referenced by ilLMExplorerGUI\__construct(), ilForumExplorerGUI\__construct(), and ilTaxonomyExplorerGUI\__construct().

114  : void
115  {
116  $this->preload_childs = $a_val;
117  }
+ Here is the caller graph for this function:

◆ setRootId()

ilTreeExplorerGUI::setRootId (   $a_root)
Parameters
int | string$a_root

Definition at line 296 of file class.ilTreeExplorerGUI.php.

296  : void
297  {
298  $this->root_id = $a_root;
299  }

◆ setTypeBlackList()

ilTreeExplorerGUI::setTypeBlackList ( array  $a_val)

Set type black list.

Parameters
array$a_valarray of strings of node types that should be filtered out

Definition at line 100 of file class.ilTreeExplorerGUI.php.

100  : void
101  {
102  $this->type_black_list = $a_val;
103  }

◆ setTypeWhiteList()

◆ toggleExplorerNodeState()

ilTreeExplorerGUI::toggleExplorerNodeState ( )

Should be called by an ilCtrl-enabled command class if a tree node toggle action should be processed.

Definition at line 440 of file class.ilTreeExplorerGUI.php.

References ILIAS\LTI\ToolProvider\$key, ilExplorerBaseGUI\$node_parameter_name, exit, and ILIAS\Repository\int().

Referenced by ilObjForumGUI\toggleExplorerNodeStateObject().

440  : void
441  {
442  $nodeId = (int) ($this->httpRequest->getQueryParams()[$this->node_parameter_name] ?? 0);
443  $priorState = (int) ($this->httpRequest->getQueryParams()['prior_state'] ?? 0);
444 
445  if ($nodeId > 0) {
446  if (0 === $priorState && !in_array($nodeId, $this->open_nodes)) {
447  $this->open_nodes[] = $nodeId;
448  } elseif (1 === $priorState && in_array($nodeId, $this->open_nodes)) {
449  $key = array_search($nodeId, $this->open_nodes);
450  unset($this->open_nodes[$key]);
451  }
452 
453  $this->store->set('on_' . $this->id, serialize($this->open_nodes));
454  }
455  exit();
456  }
exit
Definition: login.php:28
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $all_childs

array ilTreeExplorerGUI::$all_childs = array()
protected

Definition at line 40 of file class.ilTreeExplorerGUI.php.

◆ $childs

◆ $httpRequest

Psr Http Message ServerRequestInterface ilTreeExplorerGUI::$httpRequest
protected

Definition at line 29 of file class.ilTreeExplorerGUI.php.

◆ $lng

◆ $order_field

string ilTreeExplorerGUI::$order_field = ""
protected

Definition at line 32 of file class.ilTreeExplorerGUI.php.

Referenced by getOrderField().

◆ $order_field_numeric

bool ilTreeExplorerGUI::$order_field_numeric = false
protected

Definition at line 33 of file class.ilTreeExplorerGUI.php.

◆ $preload_childs

bool ilTreeExplorerGUI::$preload_childs = false
protected

Definition at line 38 of file class.ilTreeExplorerGUI.php.

Referenced by getPreloadChilds().

◆ $preloaded

bool ilTreeExplorerGUI::$preloaded = false
protected

Definition at line 37 of file class.ilTreeExplorerGUI.php.

◆ $root_id

ilTreeExplorerGUI::$root_id = 0
protected

Definition at line 41 of file class.ilTreeExplorerGUI.php.

Referenced by ilLMTOCExplorerGUI\getRootNode().

◆ $root_node_data

array ilTreeExplorerGUI::$root_node_data = null
protected

Definition at line 39 of file class.ilTreeExplorerGUI.php.

Referenced by getRootNode().

◆ $tree

◆ $tree_label

string ilTreeExplorerGUI::$tree_label = ""
protected

Definition at line 31 of file class.ilTreeExplorerGUI.php.

Referenced by getTreeLabel().

◆ $type_black_list

array ilTreeExplorerGUI::$type_black_list = array()
protected

Definition at line 35 of file class.ilTreeExplorerGUI.php.

Referenced by getTypeBlackList().

◆ $type_white_list

array ilTreeExplorerGUI::$type_white_list = array()
protected

Definition at line 34 of file class.ilTreeExplorerGUI.php.

Referenced by getTypeWhiteList().

◆ $ui

ILIAS DI UIServices ilTreeExplorerGUI::$ui
protected

Definition at line 42 of file class.ilTreeExplorerGUI.php.


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