ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTaxonomyExplorerGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilTaxonomyExplorerGUI:
+ Collaboration diagram for ilTaxonomyExplorerGUI:

Public Member Functions

 __construct ( $a_parent_obj, string $a_parent_cmd, int $a_tax_id, string $a_target_gui, string $a_target_cmd, string $a_id="")
 Constructor. More...
 
 getNodeContent ($a_node)
 
 getNodeHref ($a_node)
 
 getNodeIcon ($a_node)
 
 isNodeHighlighted ($a_node)
 
 setOnClick (string $a_value)
 
 getNodeOnClick ($a_node)
 
- Public Member Functions inherited from ilTreeExplorerGUI
 __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 Attributes

string $requested_tax_node
 
string $onclick = ""
 
ilTaxonomyTree $tax_tree
 
string $id
 
string $target_gui
 
string $target_cmd
 
- Protected Attributes inherited from ilTreeExplorerGUI
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)
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 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)
 
- 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Taxonomy explorer GUI class

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

Definition at line 23 of file class.ilTaxonomyExplorerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTaxonomyExplorerGUI::__construct (   $a_parent_obj,
string  $a_parent_cmd,
int  $a_tax_id,
string  $a_target_gui,
string  $a_target_cmd,
string  $a_id = "" 
)

Constructor.

Parameters
object | string | array$a_parent_obj

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

References $DIC, $params, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ilObjTaxonomy\lookupSortingMode(), ilTreeExplorerGUI\setOrderField(), ilTreeExplorerGUI\setPreloadChilds(), ilObjTaxonomy\SORT_ALPHABETICAL, and ilUtil\stripSlashes().

46  {
47  global $DIC;
48  $this->ctrl = $DIC->ctrl();
49  $this->tax_tree = new ilTaxonomyTree((int) $a_tax_id);
50  $this->id = $a_id != "" ? $a_id : "tax_expl_" . $this->tax_tree->getTreeId();
52  $this->setOrderField("title");
53  } else {
54  $this->setOrderField("order_nr", true);
55  }
56  $this->setPreloadChilds(true);
57  $this->target_gui = $a_target_gui;
58  $this->target_cmd = $a_target_cmd;
59  $params = $DIC->http()->request()->getQueryParams();
60  $tax_node = (string) ($params["tax_node"] ?? "");
61  $this->requested_tax_node = (string) ilUtil::stripSlashes($tax_node);
62  parent::__construct($this->id, $a_parent_obj, $a_parent_cmd, $this->tax_tree);
63  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
static lookupSortingMode(int $a_id)
__construct(Container $dic, ilPlugin $plugin)
setOrderField(string $a_val, bool $a_numeric=false)
+ Here is the call graph for this function:

Member Function Documentation

◆ getNodeContent()

ilTaxonomyExplorerGUI::getNodeContent (   $a_node)

Definition at line 68 of file class.ilTaxonomyExplorerGUI.php.

References ilObject\_lookupTitle(), and ilTreeExplorerGUI\getRootNode().

68  : string
69  {
70  $rn = $this->getRootNode();
71  if ($rn["child"] == $a_node["child"]) {
72  return ilObject::_lookupTitle($this->tax_tree->getTreeId());
73  } else {
74  return $a_node["title"];
75  }
76  }
static _lookupTitle(int $obj_id)
getRootNode()
Get root node.
+ Here is the call graph for this function:

◆ getNodeHref()

ilTaxonomyExplorerGUI::getNodeHref (   $a_node)
Parameters
array | object$a_node
Returns
string
Exceptions
ilCtrlException

Definition at line 83 of file class.ilTaxonomyExplorerGUI.php.

References ilExplorerBaseGUI\$ctrl, and ilCtrl\setParameterByClass().

83  : string
84  {
85  $ilCtrl = $this->ctrl;
86 
87  if (!$this->onclick && $this->target_gui != "") {
88  $ilCtrl->setParameterByClass($this->target_gui, "tax_node", $a_node["child"]);
89  if (is_array($this->parent_obj)) {
90  // Used for taxonomies in categories
91  $href = $ilCtrl->getLinkTargetByClass($this->parent_obj, $this->target_cmd);
92  } else {
93  // See: https://mantis.ilias.de/view.php?id=27727
94  $href = $ilCtrl->getLinkTargetByClass($this->target_gui, $this->target_cmd);
95  }
96  if ($this->requested_tax_node != "" && !is_array($this->requested_tax_node)) {
97  $ilCtrl->setParameterByClass($this->target_gui, "tax_node", $this->requested_tax_node);
98  }
99  return $href;
100  } else {
101  return "#";
102  }
103  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ getNodeIcon()

ilTaxonomyExplorerGUI::getNodeIcon (   $a_node)
Parameters
array | object$a_node
Returns
string

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

References ilUtil\getImagePath().

Referenced by ilTaxonomyClassificationExplorerGUI\createNode().

109  : string
110  {
111  return ilUtil::getImagePath("icon_taxn.svg");
112  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNodeOnClick()

ilTaxonomyExplorerGUI::getNodeOnClick (   $a_node)
Parameters
array | object$a_node
Returns
string

Definition at line 133 of file class.ilTaxonomyExplorerGUI.php.

Referenced by ilTaxonomyClassificationExplorerGUI\createNode().

133  : string
134  {
135  if ($this->onclick !== '') {
136  return str_replace("{NODE_CHILD}", $a_node["child"], $this->onclick);
137  } else {
138  // #14623
139  return parent::getNodeOnClick($a_node);
140  }
141  }
+ Here is the caller graph for this function:

◆ isNodeHighlighted()

ilTaxonomyExplorerGUI::isNodeHighlighted (   $a_node)
Parameters
array | object$a_node
Returns
bool

Definition at line 118 of file class.ilTaxonomyExplorerGUI.php.

118  : bool
119  {
120  return (!$this->onclick && $a_node["child"] == $this->requested_tax_node) ||
121  ($this->onclick && is_array($this->selected_nodes) && in_array($a_node["child"], $this->selected_nodes));
122  }

◆ setOnClick()

ilTaxonomyExplorerGUI::setOnClick ( string  $a_value)

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

124  : void
125  {
126  $this->onclick = $a_value;
127  }

Field Documentation

◆ $id

string ilTaxonomyExplorerGUI::$id
protected

◆ $onclick

string ilTaxonomyExplorerGUI::$onclick = ""
protected

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

◆ $requested_tax_node

string ilTaxonomyExplorerGUI::$requested_tax_node
protected

Definition at line 25 of file class.ilTaxonomyExplorerGUI.php.

◆ $target_cmd

string ilTaxonomyExplorerGUI::$target_cmd
protected

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

◆ $target_gui

string ilTaxonomyExplorerGUI::$target_gui
protected

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

◆ $tax_tree

ilTaxonomyTree ilTaxonomyExplorerGUI::$tax_tree
protected

Definition at line 27 of file class.ilTaxonomyExplorerGUI.php.


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