ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSkillTemplateTreeExplorerGUI Class Reference

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

+ Inheritance diagram for ilSkillTemplateTreeExplorerGUI:
+ Collaboration diagram for ilSkillTemplateTreeExplorerGUI:

Public Member Functions

 __construct ($a_parent_obj, string $a_parent_cmd, int $tree_id)
 
 getRootNode ()
 
 getChildsOfNode ($a_parent_node_id)
 
 getNodeContent ($a_node)
 
 getNodeIcon ($a_node)
 
 isNodeHighlighted ($a_node)
 
 getNodeHref ($a_node)
 
 getNodeIconAlt ($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

SkillAdminGUIRequest $admin_gui_request
 
int $requested_skill_node_id = 0
 
array $parent = []
 
array $draft = []
 
- 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

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

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

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

Constructor & Destructor Documentation

◆ __construct()

ilSkillTemplateTreeExplorerGUI::__construct (   $a_parent_obj,
string  $a_parent_cmd,
int  $tree_id 
)
Parameters
object|string[]$a_parent_obj parent gui object(s)
string$a_parent_cmdparent command

Definition at line 46 of file class.ilSkillTemplateTreeExplorerGUI.php.

References $DIC, ilTreeExplorerGUI\$tree, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilExplorerBaseGUI\setAjax(), ilTreeExplorerGUI\setOrderField(), ilExplorerBaseGUI\setSkipRootNode(), and ilTreeExplorerGUI\setTypeWhiteList().

47  {
48  global $DIC;
49 
50  $this->lng = $DIC->language();
51  $this->ctrl = $DIC->ctrl();
52  $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
53  $tree = $DIC->skills()->internal()->factory()->tree()->getTreeById($tree_id);
54  parent::__construct("skill_exp", $a_parent_obj, $a_parent_cmd, $tree);
55 
56  $this->requested_skill_node_id = $this->admin_gui_request->getNodeId();
57 
58  $this->setTypeWhiteList(array("skrt", "sktp", "sctp"));
59 
60  $this->setSkipRootNode(false);
61  $this->setAjax(true);
62  $this->setOrderField("order_nr");
63  }
setTypeWhiteList(array $a_val)
Set type white list.
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
setOrderField(string $a_val, bool $a_numeric=false)
+ Here is the call graph for this function:

Member Function Documentation

◆ getChildsOfNode()

ilSkillTemplateTreeExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Definition at line 74 of file class.ilSkillTemplateTreeExplorerGUI.php.

References Vendor\Package\$c, ilTreeExplorerGUI\$childs, ilSkillTreeNode\_lookupStatus(), and ilSkillTreeNode\STATUS_DRAFT.

74  : array
75  {
76  $childs = parent::getChildsOfNode($a_parent_node_id);
77 
78  foreach ($childs as $c) {
79  $this->parent[$c["child"]] = $c["parent"];
80  if ($this->draft[$c["parent"]]) {
81  $this->draft[$c["child"]] = true;
82  } else {
83  $this->draft[$c["child"]] = (ilSkillTreeNode::_lookupStatus((int) $c["child"]) == ilSkillTreeNode::STATUS_DRAFT);
84  }
85  }
86  return $childs;
87  }
static _lookupStatus(int $a_obj_id)
+ Here is the call graph for this function:

◆ getNodeContent()

ilSkillTemplateTreeExplorerGUI::getNodeContent (   $a_node)

Definition at line 92 of file class.ilSkillTemplateTreeExplorerGUI.php.

References ilTreeExplorerGUI\$lng, ilSkillTreeNode\_lookupSelfEvaluation(), ilSkillTemplateReference\_lookupTemplateId(), ilSkillTreeNode\_lookupTitle(), and ilLanguage\txt().

92  : string
93  {
94  $lng = $this->lng;
95 
96  // title
97  $title = $a_node["title"];
98 
99  // root?
100  if ($a_node["type"] == "skrt") {
101  $title = $lng->txt("skmg_skill_templates");
102  } else {
103  if ($a_node["type"] == "sktr") {
104  $tid = ilSkillTemplateReference::_lookupTemplateId((int) $a_node["child"]);
105  $title .= " (" . ilSkillTreeNode::_lookupTitle($tid) . ")";
106  }
107  if (ilSkillTreeNode::_lookupSelfEvaluation((int) $a_node["child"])) {
108  $title = "<u>" . $title . "</u>";
109  }
110  }
111 
112  return $title;
113  }
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...
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
static _lookupSelfEvaluation(int $a_obj_id)
+ Here is the call graph for this function:

◆ getNodeHref()

ilSkillTemplateTreeExplorerGUI::getNodeHref (   $a_node)

Definition at line 152 of file class.ilSkillTemplateTreeExplorerGUI.php.

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

152  : string
153  {
154  $ilCtrl = $this->ctrl;
155 
156  switch ($a_node["type"]) {
157  // root
158  case "skrt":
159  $ilCtrl->setParameterByClass("ilskillrootgui", "node_id", $a_node["child"]);
160  $ret = $ilCtrl->getLinkTargetByClass(["ilAdministrationGUI",
161  "ilObjSkillManagementGUI",
162  "ilSkillTreeAdminGUI",
163  "ilObjSkillTreeGUI",
164  "ilskillrootgui"
165  ], "listTemplates");
166  $ilCtrl->setParameterByClass("ilskillrootgui", "node_id", $this->requested_skill_node_id);
167  return $ret;
168 
169  // template
170  case "sktp":
171  $ilCtrl->setParameterByClass("ilbasicskilltemplategui", "node_id", $a_node["child"]);
172  $ret = $ilCtrl->getLinkTargetByClass(["ilAdministrationGUI",
173  "ilObjSkillManagementGUI",
174  "ilSkillTreeAdminGUI",
175  "ilObjSkillTreeGUI",
176  "ilbasicskilltemplategui"
177  ], "edit");
178  $ilCtrl->setParameterByClass("ilbasicskilltemplategui", "node_id", $this->requested_skill_node_id);
179  return $ret;
180 
181  // template category
182  case "sctp":
183  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "node_id", $a_node["child"]);
184  $ret = $ilCtrl->getLinkTargetByClass(["ilAdministrationGUI",
185  "ilObjSkillManagementGUI",
186  "ilSkillTreeAdminGUI",
187  "ilObjSkillTreeGUI",
188  "ilskilltemplatecategorygui"
189  ], "listItems");
190  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "node_id", $this->requested_skill_node_id);
191  return $ret;
192 
193  default:
194  return "";
195  }
196  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ getNodeIcon()

ilSkillTemplateTreeExplorerGUI::getNodeIcon (   $a_node)

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

References ilSkillTreeNode\getIconPath(), and ilUtil\getImagePath().

118  : string
119  {
120  // root?
121  if ($a_node["type"] == "skrt") {
122  $icon = ilUtil::getImagePath("standard/icon_sctp.svg");
123  } elseif (in_array($a_node["type"], array("skll", "scat", "sctr", "sktr"))) {
125  $a_node["child"],
126  $a_node["type"],
127  "",
128  (int) $this->draft[$a_node["child"]]
129  );
130  } else {
131  $icon = ilUtil::getImagePath("standard/icon_" . $a_node["type"] . ".svg");
132  }
133 
134  return $icon;
135  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static getIconPath(int $a_obj_id, string $a_type, string $a_size="", int $a_status=0)
+ Here is the call graph for this function:

◆ getNodeIconAlt()

ilSkillTemplateTreeExplorerGUI::getNodeIconAlt (   $a_node)

Definition at line 201 of file class.ilSkillTemplateTreeExplorerGUI.php.

References ilTreeExplorerGUI\$lng, ilLanguage\exists(), and ilLanguage\txt().

201  : string
202  {
203  $lng = $this->lng;
204 
205  if ($lng->exists("skmg_" . $a_node["type"])) {
206  return $lng->txt("skmg_" . $a_node["type"]);
207  }
208 
209  return $lng->txt($a_node["type"]);
210  }
exists(string $a_topic)
Check if language entry exists.
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:

◆ getRootNode()

ilSkillTemplateTreeExplorerGUI::getRootNode ( )

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

References $path, and ilTreeExplorerGUI\getTree().

65  : array
66  {
67  $path = $this->getTree()->getPathId($this->requested_skill_node_id);
68  return $this->getTree()->getNodeData($path[1]);
69  }
$path
Definition: ltiservices.php:32
+ Here is the call graph for this function:

◆ isNodeHighlighted()

ilSkillTemplateTreeExplorerGUI::isNodeHighlighted (   $a_node)

Definition at line 140 of file class.ilSkillTemplateTreeExplorerGUI.php.

140  : bool
141  {
142  if ($a_node["child"] == $this->requested_skill_node_id ||
143  ($this->requested_skill_node_id == "" && $a_node["type"] == "skrt")) {
144  return true;
145  }
146  return false;
147  }

Field Documentation

◆ $admin_gui_request

SkillAdminGUIRequest ilSkillTemplateTreeExplorerGUI::$admin_gui_request
protected

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

◆ $draft

array ilSkillTemplateTreeExplorerGUI::$draft = []
protected

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

◆ $parent

array ilSkillTemplateTreeExplorerGUI::$parent = []
protected

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

◆ $requested_skill_node_id

int ilSkillTemplateTreeExplorerGUI::$requested_skill_node_id = 0
protected

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


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