ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 = "assets/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
Deprecated:
with ILIAS 12

Definition at line 28 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 46 of file class.ilTreeExplorerGUI.php.

52 {
53 global $DIC;
54
55 $this->httpRequest = $DIC->http()->request();
56 $this->ui = $DIC->ui();
57 $this->lng = $DIC->language();
58 parent::__construct($a_expl_id, $a_parent_obj, $a_parent_cmd, $a_node_parameter_name);
59 $this->tree = $a_tree;
60 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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 378 of file class.ilTreeExplorerGUI.php.

383 $node = $this->createNode($factory, $record);
384
385 $href = $this->getNodeHref($record);
386 if ($href !== '' && '#' !== $href && $this->isNodeClickable($record)) {
387 $node = $node->withLink(new \ILIAS\Data\URI(ILIAS_HTTP_PATH . '/' . $href));
388 }
389
390 if ($this->isNodeOpen((int) $this->getNodeId($record))) {
391 $node = $node->withExpanded(true);
392 }
393
394 $nodeStateToggleCmdClasses = $this->getNodeStateToggleCmdClasses($record);
395 $cmdClass = end($nodeStateToggleCmdClasses);
396
397 if (is_string($cmdClass) && $cmdClass !== '') {
398 $node = $node->withAdditionalOnLoadCode(function ($id) use ($record, $nodeStateToggleCmdClasses, $cmdClass): string {
399 $serverNodeId = $this->getNodeId($record);
400
401 $this->ctrl->setParameterByClass($cmdClass, $this->node_parameter_name, $serverNodeId);
402 $url = $this->ctrl->getLinkTargetByClass($nodeStateToggleCmdClasses, 'toggleExplorerNodeState', '', true, false);
403 $this->ctrl->setParameterByClass($cmdClass, $this->node_parameter_name, null);
404
405 $javascript = "il.UI.tree.registerToggleNodeAsyncAction('$id', '$url', 'prior_state');";
406
407 return $javascript;
408 });
409 }
410
411 return $node;
412 }
isNodeClickable($a_node)
Is node clickable?
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
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$url
Definition: shib_logout.php:68

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

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

353 $nodeIconPath = $this->getNodeIcon($record);
354
355 $icon = null;
356 if ($nodeIconPath !== '') {
357 $icon = $this->ui
358 ->factory()
359 ->symbol()
360 ->icon()
361 ->custom($nodeIconPath, $this->getNodeIconAlt($record));
362 }
363
364 return $factory->simple($this->getNodeContent($record), $icon);
365 }
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 341 of file class.ilTreeExplorerGUI.php.

341 : array
342 {
343 return $this->getChildsOfNode($record["child"]);
344 }
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 ilAdministrationExplorerGUI, ilForumExplorerGUI, ilOrgUnitExplorerGUI, ilRepositoryExplorerGUI, ilRepositorySelectorExplorerGUI, ilPersonalSkillExplorerGUI, and ilSkillTemplateTreeExplorerGUI.

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

208 : array
209 {
210 if ($this->preloaded && $this->getSearchTerm() === "") {
211 if (isset($this->childs[$a_parent_node_id]) && is_array($this->childs[$a_parent_node_id])) {
212 return $this->childs[$a_parent_node_id];
213 }
214 return array();
215 }
216
217 $wl = $this->getTypeWhiteList();
218 if (count($wl) > 0) {
219 $childs = $this->tree->getChildsByTypeFilter($a_parent_node_id, $wl, $this->getOrderField());
220 } else {
221 $childs = $this->tree->getChilds($a_parent_node_id, $this->getOrderField());
222 }
223
224 // apply black list filter
225 $bl = $this->getTypeBlackList();
226 if (is_array($bl) && count($bl) > 0) {
227 $bl_childs = array();
228 foreach ($childs as $k => $c) {
229 if (!in_array($c["type"], $bl, true) && ($this->matches($c) || !$this->isNodeRequested($a_parent_node_id))) {
230 $bl_childs[$k] = $c;
231 }
232 }
233 return $bl_childs;
234 }
235
236 $final_childs = [];
237 foreach ($childs as $k => $c) {
238 if ($this->isNodeVisible($c)
239 && ($this->matches($c) || !$this->isNodeRequested($a_parent_node_id))) {
240 $final_childs[$k] = $c;
241 }
242 }
243 return $final_childs;
244 }
isNodeRequested(string $a_node_id)
isNodeVisible($a_node)
Is node visible?
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: deliver.php:25

References $c.

◆ getHTML()

ilTreeExplorerGUI::getHTML (   $new = false)

Get HTML.

Returns
string html

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

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

◆ 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 ilAdministrationExplorerGUI, ilLMEditorExplorerGUI, ilLMTOCExplorerGUI, ilMailExplorer, ilRepositoryExplorerGUI, ilRepositorySelectorExplorerGUI, ilPersonalSkillExplorerGUI, and ilSkillTemplateTreeExplorerGUI.

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

276 : string
277 {
279
280 return $lng->txt("icon") . " " . $lng->txt("obj_" . ($a_node["type"] ?? ''));
281 }
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 ilTaxonomyClassificationExplorerGUI\createNode(), and ilForumExplorerGUI\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, ilMailExplorer, and ilMediaPoolExplorerGUI.

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

373 : array
374 {
375 return [];
376 }

◆ getOrderField()

ilTreeExplorerGUI::getOrderField ( )

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

75 : string
76 {
77 return $this->order_field;
78 }

◆ getPreloadChilds()

ilTreeExplorerGUI::getPreloadChilds ( )

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

121 : bool
122 {
124 }

◆ getRootId()

ilTreeExplorerGUI::getRootId ( )
protected

Reimplemented in ilPersonalSkillExplorerGUI.

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

304 : int
305 {
306 return $this->root_id
307 ?: $this->getTree()->readRootId();
308 }

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 179 of file class.ilTreeExplorerGUI.php.

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

◆ getTree()

ilTreeExplorerGUI::getTree ( )

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

62 : ilTree
63 {
64 return $this->tree;
65 }
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...

References $tree.

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

+ Here is the caller graph for this function:

◆ getTreeComponent()

ilTreeExplorerGUI::getTreeComponent ( )

Reimplemented in ilForumExplorerGUI, and ilMailExplorer.

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

419 : Tree
420 {
421 $f = $this->ui->factory();
422 $tree = $this->getTree();
423
424 if (!$this->getSkipRootNode()) {
425 $data = array(
427 );
428 } else {
430 }
431
432 $label = $this->getTreeLabel();
433 if ($this->getTreeLabel() === "" && $this->getNodeContent($this->getRootNode())) {
434 $label = $this->getNodeContent($this->getRootNode());
435 }
436
437 $tree = $f->tree()->expandable($label, $this)
438 ->withData($data)
439 ->withHighlightOnNodeClick(true);
440
441 return $tree;
442 }
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
getChilds(int $a_node_id, string $a_order="", string $a_direction="ASC")
get child nodes of given node
This describes a Tree Control.
Definition: Tree.php:29

References $data, Vendor\Package\$f, ilTree\getChilds(), 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 414 of file class.ilTreeExplorerGUI.php.

414 : string
415 {
416 return $this->tree_label;
417 }

◆ getTypeBlackList()

ilTreeExplorerGUI::getTypeBlackList ( )

Get type black list.

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

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

111 : array
112 {
114 }

◆ getTypeWhiteList()

ilTreeExplorerGUI::getTypeWhiteList ( )

Get type white list.

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

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

93 : array
94 {
96 }

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 251 of file class.ilTreeExplorerGUI.php.

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

◆ preloadChilds()

ilTreeExplorerGUI::preloadChilds ( )
protected

Reimplemented in ilForumExplorerGUI.

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

126 : void
127 {
128 $subtree = $this->tree->getSubTree($this->getRootNode());
129 foreach ($subtree as $s) {
130 $wl = $this->getTypeWhiteList();
131 if (is_array($wl) && count($wl) > 0 && !in_array($s["type"], $wl)) {
132 continue;
133 }
134 $bl = $this->getTypeBlackList();
135 if (is_array($bl) && count($bl) > 0 && in_array($s["type"], $bl)) {
136 continue;
137 }
138 $this->childs[$s["parent"]][] = $s;
139 $this->all_childs[$s["child"]] = $s;
140 }
141
142 if ($this->order_field !== "") {
143 foreach ($this->childs as $k => $childs) {
144 $this->childs[$k] = ilArrayUtil::sortArray(
145 $childs,
146 $this->order_field,
147 "asc",
148 $this->order_field_numeric
149 );
150 }
151 }
152
153 // sort childs and store prev/next reference
154 if ($this->order_field === "") {
155 $this->all_childs =
156 ilArrayUtil::sortArray($this->all_childs, "lft", "asc", true, true);
157 $prev = false;
158 foreach ($this->all_childs as $k => $c) {
159 if ($prev) {
160 $this->all_childs[$prev]["next_node_id"] = $k;
161 }
162 $this->all_childs[$k]["prev_node_id"] = $prev;
163 $this->all_childs[$k]["next_node_id"] = false;
164 $prev = $k;
165 }
166 }
167
168 $this->preloaded = true;
169 }
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 465 of file class.ilTreeExplorerGUI.php.

465 : string
466 {
467 $r = $this->ui->renderer();
468
469 return $r->render([
470 $this->getTreeComponent()
471 ]);
472 }

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 67 of file class.ilTreeExplorerGUI.php.

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

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 315 of file class.ilTreeExplorerGUI.php.

315 : void
316 {
317 $path = $this->getTree()->getPathId($a_id);
318 foreach ($path as $id) {
319 $this->setNodeOpen($id);
320 }
321 }
setNodeOpen($a_id)
Set node to be opened (additional custom opened node, not standard expand behaviour)
$path
Definition: ltiservices.php:30

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 116 of file class.ilTreeExplorerGUI.php.

116 : void
117 {
118 $this->preload_childs = $a_val;
119 }

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 299 of file class.ilTreeExplorerGUI.php.

299 : void
300 {
301 $this->root_id = $a_root;
302 }

◆ 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 102 of file class.ilTreeExplorerGUI.php.

102 : void
103 {
104 $this->type_black_list = $a_val;
105 }

◆ 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 447 of file class.ilTreeExplorerGUI.php.

447 : void
448 {
449 $nodeId = (int) ($this->httpRequest->getQueryParams()[$this->node_parameter_name] ?? 0);
450 $priorState = (int) ($this->httpRequest->getQueryParams()['prior_state'] ?? 0);
451
452 if ($nodeId > 0) {
453 if (0 === $priorState && !in_array($nodeId, $this->open_nodes)) {
454 $this->open_nodes[] = $nodeId;
455 } elseif (1 === $priorState && in_array($nodeId, $this->open_nodes)) {
456 $key = array_search($nodeId, $this->open_nodes);
457 unset($this->open_nodes[$key]);
458 }
459
460 $this->store->set('on_' . $this->id, serialize($this->open_nodes));
461 }
462 exit();
463 }
exit

References 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 42 of file class.ilTreeExplorerGUI.php.

◆ $childs

◆ $httpRequest

Psr Http Message ServerRequestInterface ilTreeExplorerGUI::$httpRequest
protected

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

◆ $lng

◆ $order_field

string ilTreeExplorerGUI::$order_field = ""
protected

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

◆ $order_field_numeric

bool ilTreeExplorerGUI::$order_field_numeric = false
protected

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

◆ $preload_childs

bool ilTreeExplorerGUI::$preload_childs = false
protected

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

◆ $preloaded

bool ilTreeExplorerGUI::$preloaded = false
protected

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

◆ $root_id

ilTreeExplorerGUI::$root_id = 0
protected

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

◆ $root_node_data

array ilTreeExplorerGUI::$root_node_data = null
protected

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

◆ $tree

◆ $tree_label

string ilTreeExplorerGUI::$tree_label = ""
protected

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

◆ $type_black_list

array ilTreeExplorerGUI::$type_black_list = array()
protected

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

◆ $type_white_list

array ilTreeExplorerGUI::$type_white_list = array()
protected

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

◆ $ui

ILIAS DI UIServices ilTreeExplorerGUI::$ui
protected

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


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