ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilSkillSelectorGUI Class Reference

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

+ Inheritance diagram for ilSkillSelectorGUI:
+ Collaboration diagram for ilSkillSelectorGUI:

Public Member Functions

 __construct ( $a_parent_obj, string $a_parent_cmd, $a_select_gui, string $a_select_cmd, string $a_select_par="selected_skill", int $a_skill_tree_id=0)
 
 setSkillSelected (string $a_id)
 
 getSelectedSkills ()
 
 getNodeHref ($a_node)
 
 isNodeClickable ($a_node)
 
- Public Member Functions inherited from ilVirtualSkillTreeExplorerGUI
 __construct (string $a_id, $a_parent_obj, string $a_parent_cmd, int $tree_id=0)
 
 setShowDraftNodes (bool $a_val)
 
 getShowDraftNodes ()
 
 setShowOutdatedNodes (bool $a_val)
 
 getShowOutdatedNodes ()
 
 getRootNode ()
 
 getNodeId ($a_node)
 
 getDomNodeIdForNodeId ($a_node_id)
 
 getNodeIdForDomNodeId (string $a_dom_node_id)
 
 getChildsOfNode ($a_parent_node_id)
 
 getNodeContent ($a_node)
 
 getNodeIcon ($a_node)
 
 getNodeHref ($a_node)
 
 isNodeClickable ($a_node)
 
 getNodeIconAlt ($a_node)
 
- 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)
 

Protected Member Functions

 isNodeSelectable ($a_node)
 
- 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

string $select_gui = ""
 
string $select_cmd = ""
 
string $select_par = ""
 
SkillAdminGUIRequest $admin_gui_request
 
- Protected Attributes inherited from ilVirtualSkillTreeExplorerGUI
ilLanguage $lng
 
ilVirtualSkillTree $vtree
 
SkillTreeManager $skill_tree_manager
 
SkillInternalFactoryService $tree_factory
 
bool $show_draft_nodes = false
 
bool $show_outdated_nodes = false
 
- 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
 

Private Member Functions

 nodeHasAction ($a_node)
 

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
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

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

Constructor & Destructor Documentation

◆ __construct()

ilSkillSelectorGUI::__construct (   $a_parent_obj,
string  $a_parent_cmd,
  $a_select_gui,
string  $a_select_cmd,
string  $a_select_par = "selected_skill",
int  $a_skill_tree_id = 0 
)

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), and ilExplorerBaseGUI\setSkipRootNode().

43  {
44  global $DIC;
45 
46  $this->ctrl = $DIC->ctrl();
47  $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
48  parent::__construct("skill_sel", $a_parent_obj, $a_parent_cmd, $a_skill_tree_id);
49  $this->select_gui = (is_object($a_select_gui))
50  ? strtolower(get_class($a_select_gui))
51  : $a_select_gui;
52  $this->select_cmd = $a_select_cmd;
53  $this->select_par = $a_select_par;
54  $this->setSkipRootNode(true);
55  }
global $DIC
Definition: shib_login.php:25
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getNodeHref()

ilSkillSelectorGUI::getNodeHref (   $a_node)

Definition at line 77 of file class.ilSkillSelectorGUI.php.

References ilExplorerBaseGUI\$ctrl.

77  : string
78  {
79  if ($this->select_multi) {
80  return "#";
81  }
82 
83  $ilCtrl = $this->ctrl;
84 
85  // we have a tree id like <skl_tree_id>:<skl_template_tree_id>
86  // and make a "common" skill id in format <skill_id>:<tref_id>
87 
88  $id_parts = explode(":", $a_node["id"]);
89  if (!isset($id_parts[1]) || $id_parts[1] == 0) {
90  // skill in main tree
91  $skill_id = $a_node["id"];
92  } else {
93  // skill in template
94  $skill_id = $id_parts[1] . ":" . $id_parts[0];
95  }
96 
97  $ilCtrl->setParameterByClass($this->select_gui, $this->select_par, $skill_id);
98  $ret = $ilCtrl->getLinkTargetByClass($this->select_gui, $this->select_cmd);
99  $ilCtrl->setParameterByClass($this->select_gui, $this->select_par, "");
100 
101  return $ret;
102  }

◆ getSelectedSkills()

ilSkillSelectorGUI::getSelectedSkills ( )

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

62  : array
63  {
64  $skills = [];
65  $pa = $this->admin_gui_request->getSelectedIds($this->select_postvar);
66  if (!empty($pa)) {
67  foreach ($pa as $p) {
68  $skills[] = $this->vtree->getCSkillIdForVTreeId($p);
69  }
70  }
71  return $skills;
72  }

◆ isNodeClickable()

ilSkillSelectorGUI::isNodeClickable (   $a_node)

Definition at line 107 of file class.ilSkillSelectorGUI.php.

References nodeHasAction().

107  : bool
108  {
109  return $this->nodeHasAction($a_node);
110  }
+ Here is the call graph for this function:

◆ isNodeSelectable()

ilSkillSelectorGUI::isNodeSelectable (   $a_node)
protected

Definition at line 115 of file class.ilSkillSelectorGUI.php.

References nodeHasAction().

115  : bool
116  {
117  return $this->nodeHasAction($a_node);
118  }
+ Here is the call graph for this function:

◆ nodeHasAction()

ilSkillSelectorGUI::nodeHasAction (   $a_node)
private
Parameters
array | object$a_node
Returns
bool

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

References ilSkillTreeNode\_lookupType().

Referenced by isNodeClickable(), and isNodeSelectable().

124  : bool
125  {
126  if (in_array($a_node["type"], array("skll", "sktp"))) {
127  return true;
128  }
129  // references that refer directly to a (basic) skill template
130  if ($a_node["type"] == "sktr" && ilSkillTreeNode::_lookupType((int) $a_node["skill_id"]) == "sktp") {
131  return true;
132  }
133 
134  return false;
135  }
static _lookupType(int $a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSkillSelected()

ilSkillSelectorGUI::setSkillSelected ( string  $a_id)

Definition at line 57 of file class.ilSkillSelectorGUI.php.

References ilExplorerBaseGUI\setNodeSelected().

57  : void
58  {
59  $this->setNodeSelected($this->vtree->getCSkillIdForVTreeId($a_id));
60  }
setNodeSelected($a_id)
Set node to be opened (additional custom opened node, not standard expand behaviour) ...
+ Here is the call graph for this function:

Field Documentation

◆ $admin_gui_request

SkillAdminGUIRequest ilSkillSelectorGUI::$admin_gui_request
protected

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

◆ $select_cmd

string ilSkillSelectorGUI::$select_cmd = ""
protected

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

◆ $select_gui

string ilSkillSelectorGUI::$select_gui = ""
protected

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

◆ $select_par

string ilSkillSelectorGUI::$select_par = ""
protected

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


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