ILIAS  release_8 Revision v8.24
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
 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...
 

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.

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)
@inheritDoc

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

+ 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.

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 }
getNodeHref($a_node)
Get href for node.
isNodeOpen($node_id)
Get all open nodes.
getNodeStateToggleCmdClasses($record)
Should return an array of ilCtrl-enabled command classes which should be used to build the URL for th...
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.
This describes a Tree Node.
Definition: Node.php:31
$factory
Definition: metadata.php:75
Class ChatMainBarProvider \MainMenu\Provider.
$url

◆ 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.

Reimplemented in ilForumExplorerGUI, and ilTaxonomyClassificationExplorerGUI.

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

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.
getNodeContent($a_node)
Get content of a node.
getNodeIconAlt($a_node)
Get node icon alt attribute.

References ILIAS\Repository\ui().

+ Here is the call 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.

Reimplemented in ilForumExplorerGUI.

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

338 : array
339 {
340 return $this->getChildsOfNode($record["child"]);
341 }
getChildsOfNode($a_parent_node_id)
Get childs of node.

◆ getChildsOfNode()

ilTreeExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get childs of node.

Parameters
int | string$a_parent_node_idparent id
Returns
array childs

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilForumExplorerGUI, ilOrgUnitExplorerGUI, ilAdministrationExplorerGUI, ilRepositoryExplorerGUI, ilRepositorySelectorExplorerGUI, ilPersonalSkillExplorerGUI, and ilSkillTemplateTreeExplorerGUI.

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

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)
matches($node)
Does a node match a search term (or is search term empty)
getTypeWhiteList()
Get type white list.
getTypeBlackList()
Get type black list.
$c
Definition: cli.php:38

References $c.

Referenced by ilPublicSectionExplorerGUI\getAllNodes().

+ 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.

325 : string
326 {
327 if ($this->getPreloadChilds()) {
328 $this->preloadChilds();
329 }
330 if (!$new) {
331 return parent::getHTML();
332 }
333 return $this->render();
334 }

◆ getNodeIconAlt()

ilTreeExplorerGUI::getNodeIconAlt (   $a_node)

Get node icon alt attribute.

Parameters
object | array$a_nodenode
Returns
string image alt attribute

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilLMEditorExplorerGUI, ilLMTOCExplorerGUI, ilAdministrationExplorerGUI, ilMailExplorer, ilRepositoryExplorerGUI, ilRepositorySelectorExplorerGUI, ilPersonalSkillExplorerGUI, and ilSkillTemplateTreeExplorerGUI.

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

273 : string
274 {
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...

References $lng.

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

+ 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

Reimplemented in ilForumExplorerGUI, ilMediaPoolExplorerGUI, and ilMailExplorer.

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

370 : array
371 {
372 return [];
373 }

◆ getOrderField()

ilTreeExplorerGUI::getOrderField ( )

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

73 : string
74 {
75 return $this->order_field;
76 }

◆ getPreloadChilds()

ilTreeExplorerGUI::getPreloadChilds ( )

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

119 : bool
120 {
122 }

◆ getRootId()

ilTreeExplorerGUI::getRootId ( )
protected

Reimplemented in ilPersonalSkillExplorerGUI.

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

301 : int
302 {
303 return $this->root_id
304 ?: $this->getTree()->readRootId();
305 }

Referenced by ilWorkspaceExplorerGUI\isNodeHighlighted().

+ Here is the caller graph for this function:

◆ 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.

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 }

◆ getTree()

ilTreeExplorerGUI::getTree ( )

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

60 : ilTree
61 {
62 return $this->tree;
63 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $tree.

Referenced by ilOrgUnitExplorerGUI\getRootNode(), ilRepositoryExplorerGUI\getRootNode(), ilSkillTemplateTreeExplorerGUI\getRootNode(), and ilTaxonomyClassificationExplorerGUI\getTreeComponent().

+ Here is the caller graph for this function:

◆ getTreeComponent()

ilTreeExplorerGUI::getTreeComponent ( )

Reimplemented in ilForumExplorerGUI, ilTaxonomyClassificationExplorerGUI, and ilMailExplorer.

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

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.
This describes a Tree Control.
Definition: Tree.php:29

References $data, Vendor\Package\$f, ilTree\getNodeData(), ilTree\readRootId(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ getTreeLabel()

ilTreeExplorerGUI::getTreeLabel ( )

Reimplemented in ilForumExplorerGUI, and ilMailExplorer.

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

411 : string
412 {
413 return $this->tree_label;
414 }

Referenced by ilTaxonomyClassificationExplorerGUI\getTreeComponent().

+ 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.

109 : array
110 {
112 }

◆ 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.

91 : array
92 {
94 }

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

+ 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.

248 : bool
249 {
250 return (
251 $this->getSearchTerm() === "" ||
252 is_int(ilStr::striPos($this->getNodeContent($node), $this->getSearchTerm()))
253 );
254 }

◆ preloadChilds()

ilTreeExplorerGUI::preloadChilds ( )
protected

Reimplemented in ilForumExplorerGUI.

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

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 }
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)

References $c, and ilArrayUtil\sortArray().

+ Here is the call graph for this function:

◆ render()

ilTreeExplorerGUI::render ( )
protected

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

458 : string
459 {
460 $r = $this->ui->renderer();
461
462 return $r->render([
463 $this->getTreeComponent()
464 ]);
465 }

References ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ setOrderField()

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

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

68 : void {
69 $this->order_field = $a_val;
70 $this->order_field_numeric = $a_numeric;
71 }

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

+ 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.

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

References $id, and $path.

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

+ Here is the caller graph for this function:

◆ setPreloadChilds()

ilTreeExplorerGUI::setPreloadChilds ( bool  $a_val)

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

114 : void
115 {
116 $this->preload_childs = $a_val;
117 }

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

+ 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()

ilTreeExplorerGUI::setTypeWhiteList ( array  $a_val)

◆ 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.

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

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

+ Here is the call 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.

◆ $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.

◆ $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.

◆ $root_node_data

array ilTreeExplorerGUI::$root_node_data = null
protected

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

◆ $tree

◆ $tree_label

string ilTreeExplorerGUI::$tree_label = ""
protected

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

◆ $type_black_list

array ilTreeExplorerGUI::$type_black_list = array()
protected

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

◆ $type_white_list

array ilTreeExplorerGUI::$type_white_list = array()
protected

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

◆ $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: