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

Basic GUI class for skill tree nodes. More...

+ Inheritance diagram for ilSkillTreeNodeGUI:
+ Collaboration diagram for ilSkillTreeNodeGUI:

Public Member Functions

 __construct (Tree\SkillTreeNodeManager $node_manager, int $a_node_id=0)
 
 isInUse ()
 
 setParentGUI (object $a_parentgui)
 
 getParentGUI ()
 
 readNodeObject (int $a_node_id)
 Get node object instance. More...
 
 saveAllTitles ()
 
 deleteNodes ()
 Delete nodes in the hierarchy. More...
 
 cutItems ()
 Copy items to clipboard, then cut them from the current tree. More...
 
 copyItems ()
 Copy items to clipboard. More...
 
 cancelDelete ()
 
 confirmedDelete ()
 confirmed delete More...
 
 setSkillNodeDescription ()
 
 create ()
 Create skill tree node. More...
 
 addStatusInput (ilPropertyFormGUI $a_form)
 
 editProperties ()
 
 getPropertyValues ()
 Get property values for edit form. More...
 
 save ()
 Save skill tree node. More...
 
 afterSave ()
 
 update ()
 Update skill tree node. More...
 
 afterUpdate ()
 
 initForm (string $a_mode="edit")
 
 cancelSave ()
 
 redirectToParent (bool $a_tmp_mode=false)
 Redirect to parent (identified by current node_id) More...
 
 saveOrder ()
 
 insertBasicSkillClip ()
 
 insertSkillCategoryClip ()
 
 insertTemplateReferenceClip ()
 
 insertSkillTemplateClip ()
 
 insertTemplateCategoryClip ()
 
 setTitleIcon ()
 
 addUsageTab (ilTabsGUI $a_tabs)
 
 showUsage ()
 
 addObjectsTab (ilTabsGUI $a_tabs)
 
 showObjects ()
 
 exportSelectedNodes ()
 

Data Fields

object $node_object = null
 
bool $in_use = false
 
bool $use_checked = false
 
ilAccessHandler $access
 

Protected Attributes

ilCtrl $ctrl
 
ilLanguage $lng
 
ilLocatorGUI $locator
 
ilGlobalTemplateInterface $tpl
 
ilObjUser $user
 
ilTree $tree
 
ilPropertyFormGUI $form
 
object $parentgui
 
int $tref_id = 0
 
Tree SkillTreeNodeManager $skill_tree_node_manager
 
SkillTreeAccess $tree_access_manager
 
ilSkillTreeRepository $tree_repo
 
int $skill_tree_id = 0
 
ilTabsGUI $tabs
 
SkillAdminGUIRequest $admin_gui_request
 
int $requested_ref_id = 0
 
int $requested_node_id = 0
 
string $requested_backcmd = ""
 
int $requested_tmpmode = 0
 
int $base_skill_id = 0
 
array $requested_node_ids = []
 
array $requested_node_order = []
 

Detailed Description

Basic GUI class for skill tree nodes.

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.ilSkillTreeNodeGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSkillTreeNodeGUI::__construct ( Tree\SkillTreeNodeManager  $node_manager,
int  $a_node_id = 0 
)

Definition at line 66 of file class.ilSkillTreeNodeGUI.php.

References $DIC, ilSkillTreeNode\_lookupType(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\locator(), readNodeObject(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

67  {
68  global $DIC;
69 
70  $this->ctrl = $DIC->ctrl();
71  $this->lng = $DIC->language();
72  $this->locator = $DIC["ilLocator"];
73  $this->tpl = $DIC["tpl"];
74  $this->user = $DIC->user();
75  $ilAccess = $DIC->access();
76  $this->tree = $DIC->repositoryTree();
77  $this->tabs = $DIC->tabs();
78  $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
79 
80  $this->node_object = null;
81  $this->access = $ilAccess;
82 
83  $this->requested_ref_id = $this->admin_gui_request->getRefId();
84  $this->requested_node_id = $this->admin_gui_request->getNodeId();
85  $this->requested_backcmd = $this->admin_gui_request->getBackCommand();
86  $this->requested_tmpmode = $this->admin_gui_request->getTemplateMode();
87  $this->requested_node_ids = $this->admin_gui_request->getNodeIds();
88  $this->requested_node_order = $this->admin_gui_request->getOrder();
89 
90  $this->skill_tree_node_manager = $node_manager;
91  $this->tree_access_manager = $DIC->skills()->internal()->manager()->getTreeAccessManager($this->requested_ref_id);
92  $this->tree_repo = $DIC->skills()->internal()->repo()->getTreeRepo();
93  $this->skill_tree_id = $this->tree_repo->getTreeIdForNodeId($this->requested_node_id);
94 
95  if ($a_node_id > 0 &&
96  $this->getType() == ilSkillTreeNode::_lookupType($a_node_id)) {
97  $this->readNodeObject($a_node_id);
98  }
99  }
readNodeObject(int $a_node_id)
Get node object instance.
static _lookupType(int $a_obj_id)
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ addObjectsTab()

ilSkillTreeNodeGUI::addObjectsTab ( ilTabsGUI  $a_tabs)

Definition at line 570 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, $lng, ilTabsGUI\addTab(), and ilLanguage\txt().

Referenced by ilSkillTemplateReferenceGUI\setTabs(), ilBasicSkillTemplateGUI\setTabs(), and ilBasicSkillGUI\setTabs().

570  : void
571  {
572  $lng = $this->lng;
573  $ilCtrl = $this->ctrl;
574 
575  $a_tabs->addTab(
576  "objects",
577  $lng->txt("skmg_assigned_objects"),
578  $ilCtrl->getLinkTarget($this, "showObjects")
579  );
580  }
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...
addTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
Add a Tab.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addStatusInput()

ilSkillTreeNodeGUI::addStatusInput ( ilPropertyFormGUI  $a_form)

Definition at line 284 of file class.ilSkillTreeNodeGUI.php.

References $lng, ilPropertyFormGUI\addItem(), ilSkillTreeNode\getAllStatus(), ilSkillTreeNode\getStatusInfo(), ilSkillTreeNode\STATUS_PUBLISH, and ilLanguage\txt().

Referenced by ilSkillCategoryGUI\initForm(), ilSkillTemplateReferenceGUI\initForm(), and ilBasicSkillGUI\initForm().

284  : void
285  {
286  $lng = $this->lng;
287 
288  // status
289  $radg = new ilRadioGroupInputGUI($lng->txt("skmg_status"), "status");
290  foreach (ilSkillTreeNode::getAllStatus() as $k => $op) {
291  $op = new ilRadioOption($op, $k, ilSkillTreeNode::getStatusInfo($k));
292  $radg->addOption($op);
293  }
294  $radg->setValue((string) ilSkillTreeNode::STATUS_PUBLISH);
295  $a_form->addItem($radg);
296  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAllStatus()
Get all status as array, key is value, value is lang text.
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...
This class represents a property in a property form.
static getStatusInfo(int $a_status)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUsageTab()

ilSkillTreeNodeGUI::addUsageTab ( ilTabsGUI  $a_tabs)

Definition at line 537 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, $lng, ilTabsGUI\addTab(), and ilLanguage\txt().

Referenced by ilSkillCategoryGUI\setTabs(), ilSkillTemplateReferenceGUI\setTabs(), ilSkillTemplateCategoryGUI\setTabs(), ilBasicSkillTemplateGUI\setTabs(), and ilBasicSkillGUI\setTabs().

537  : void
538  {
539  $lng = $this->lng;
540  $ilCtrl = $this->ctrl;
541 
542  $a_tabs->addTab(
543  "usage",
544  $lng->txt("skmg_usage"),
545  $ilCtrl->getLinkTarget($this, "showUsage")
546  );
547  }
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...
addTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
Add a Tab.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterSave()

ilSkillTreeNodeGUI::afterSave ( )

Definition at line 358 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

Referenced by save().

358  : void
359  {
360  $this->redirectToParent();
361  }
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterUpdate()

ilSkillTreeNodeGUI::afterUpdate ( )

Definition at line 389 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, and ilCtrl\redirect().

Referenced by update().

389  : void
390  {
391  $ilCtrl = $this->ctrl;
392 
393  $ilCtrl->redirect($this, "editProperties");
394  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelDelete()

ilSkillTreeNodeGUI::cancelDelete ( )

Definition at line 230 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, and redirectToParent().

230  : void
231  {
232  $ilCtrl = $this->ctrl;
233 
234  $this->redirectToParent();
235  }
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
+ Here is the call graph for this function:

◆ cancelSave()

ilSkillTreeNodeGUI::cancelSave ( )

Definition at line 429 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

429  : void
430  {
431  $this->redirectToParent();
432  }
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
+ Here is the call graph for this function:

◆ confirmedDelete()

ilSkillTreeNodeGUI::confirmedDelete ( )

confirmed delete

Definition at line 240 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, getParentGUI(), and redirectToParent().

240  : void
241  {
242  $ilCtrl = $this->ctrl;
243 
244  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
245  return;
246  }
247 
248  $this->getParentGUI()->confirmedDelete(false);
249  $this->skill_tree_node_manager->saveChildsOrder(
250  $this->requested_node_id,
251  [],
252  $this->requested_tmpmode
253  );
254 
255  $this->redirectToParent();
256  }
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
+ Here is the call graph for this function:

◆ copyItems()

ilSkillTreeNodeGUI::copyItems ( )

Copy items to clipboard.

Definition at line 200 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, $lng, $requested_node_ids, redirectToParent(), ilLanguage\txt(), and ilSkillTreeNode\uniqueTypesCheck().

200  : void
201  {
202  $ilCtrl = $this->ctrl;
203  $lng = $this->lng;
204 
205  if (empty($this->requested_node_ids)) {
206  $this->redirectToParent();
207  }
208 
209  $items = $this->requested_node_ids;
210  $todel = []; // delete IDs < 0 (needed for non-js editing)
211  foreach ($items as $k => $item) {
212  if ($item < 0) {
213  $todel[] = $k;
214  }
215  }
216  foreach ($todel as $k) {
217  unset($items[$k]);
218  }
219  if (!ilSkillTreeNode::uniqueTypesCheck($items)) {
220  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_insert_please_choose_one_type_only"), true);
221  $this->redirectToParent();
222  }
223  $this->skill_tree_node_manager->clipboardCopy($items);
224 
225  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_selected_items_have_been_copied"), true);
226 
227  $this->redirectToParent();
228  }
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...
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
static uniqueTypesCheck(array $a_items)
Check for unique types.
+ Here is the call graph for this function:

◆ create()

ilSkillTreeNodeGUI::create ( )

Create skill tree node.

Definition at line 268 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, $lng, $tabs, $tpl, ILIAS\Repository\form(), initForm(), ilTabsGUI\setBackTarget(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

268  : void
269  {
270  $lng = $this->lng;
271  $tpl = $this->tpl;
272  $tabs = $this->tabs;
273  $ilCtrl = $this->ctrl;
274 
276  $lng->txt("back"),
277  $ilCtrl->getLinkTarget($this, "redirectToParent")
278  );
279 
280  $this->initForm("create");
281  $tpl->setContent($this->form->getHTML());
282  }
initForm(string $a_mode="edit")
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...
setContent(string $a_html)
Sets content for standard template.
setBackTarget(string $a_title, string $a_target, string $a_frame="")
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd)
+ Here is the call graph for this function:

◆ cutItems()

ilSkillTreeNodeGUI::cutItems ( )

Copy items to clipboard, then cut them from the current tree.

Definition at line 160 of file class.ilSkillTreeNodeGUI.php.

References $lng, $requested_node_ids, redirectToParent(), ilLanguage\txt(), and ilSkillTreeNode\uniqueTypesCheck().

160  : void
161  {
162  $lng = $this->lng;
163 
164  if (empty($this->requested_node_ids)) {
165  $this->redirectToParent();
166  }
167 
168  $items = $this->requested_node_ids;
169  $todel = []; // delete IDs < 0 (needed for non-js editing)
170  foreach ($items as $k => $item) {
171  if ($item < 0) {
172  $todel[] = $k;
173  }
174  }
175  foreach ($todel as $k) {
176  unset($items[$k]);
177  }
178 
179  if (!ilSkillTreeNode::uniqueTypesCheck($items)) {
180  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_insert_please_choose_one_type_only"), true);
181  $this->redirectToParent();
182  }
183 
184  $this->skill_tree_node_manager->clipboardCut($items);
185 
186  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_selected_items_have_been_cut"), true);
187 
188  $this->skill_tree_node_manager->saveChildsOrder(
189  $this->requested_node_id,
190  [],
191  $this->requested_tmpmode
192  );
193 
194  $this->redirectToParent();
195  }
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...
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
static uniqueTypesCheck(array $a_items)
Check for unique types.
+ Here is the call graph for this function:

◆ deleteNodes()

ilSkillTreeNodeGUI::deleteNodes ( )

Delete nodes in the hierarchy.

Definition at line 149 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, getParentGUI(), and ilCtrl\setParameter().

149  : void
150  {
151  $ilCtrl = $this->ctrl;
152 
153  $ilCtrl->setParameter($this, "backcmd", $this->requested_backcmd);
154  $this->getParentGUI()->deleteNodes($this);
155  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ editProperties()

ilSkillTreeNodeGUI::editProperties ( )

Definition at line 298 of file class.ilSkillTreeNodeGUI.php.

References $lng, $tpl, ILIAS\Repository\form(), getPropertyValues(), initForm(), isInUse(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

298  : void
299  {
300  $tpl = $this->tpl;
301  $lng = $this->lng;
302 
303  if ($this->isInUse()) {
304  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
305  }
306 
307  $this->initForm("edit");
308  $this->getPropertyValues();
309  $tpl->setContent($this->form->getHTML());
310  }
initForm(string $a_mode="edit")
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...
getPropertyValues()
Get property values for edit form.
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd)
+ Here is the call graph for this function:

◆ exportSelectedNodes()

ilSkillTreeNodeGUI::exportSelectedNodes ( )

Definition at line 599 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, ilObject\_lookupObjId(), and redirectToParent().

599  : void
600  {
601  $ilCtrl = $this->ctrl;
602 
603  if (empty($this->requested_node_ids)) {
604  $this->redirectToParent();
605  }
606 
607  $exp = new ilExport();
608  $conf = $exp->getConfig("Services/Skill");
609  $conf->setSelectedNodes($this->requested_node_ids);
610  $conf->setSkillTreeId($this->skill_tree_id);
611  $exp->exportObject("skmg", ilObject::_lookupObjId($this->requested_ref_id));
612 
613  $ilCtrl->redirectByClass(array("ilobjskilltreegui", "ilexportgui"), "");
614  }
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
+ Here is the call graph for this function:

◆ getParentGUI()

ilSkillTreeNodeGUI::getParentGUI ( )

Definition at line 125 of file class.ilSkillTreeNodeGUI.php.

References $parentgui.

Referenced by confirmedDelete(), deleteNodes(), ilSkillRootGUI\listSkills(), ilSkillRootGUI\listTemplates(), and saveAllTitles().

125  : object
126  {
127  return $this->parentgui;
128  }
+ Here is the caller graph for this function:

◆ getPropertyValues()

ilSkillTreeNodeGUI::getPropertyValues ( )

Get property values for edit form.

Definition at line 315 of file class.ilSkillTreeNodeGUI.php.

References ILIAS\Repository\form().

Referenced by editProperties().

315  : void
316  {
317  $values = [];
318 
319  $values["title"] = $this->node_object->getTitle();
320  $values["description"] = $this->node_object->getDescription();
321  $values["order_nr"] = $this->node_object->getOrderNr();
322  $values["self_eval"] = $this->node_object->getSelfEvaluation();
323  $values["status"] = (string) $this->node_object->getStatus();
324 
325  $this->form->setValuesByArray($values);
326  }
form( $class_path, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

ilSkillTreeNodeGUI::initForm ( string  $a_mode = "edit")

Definition at line 396 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, $lng, ILIAS\Repository\form(), ilTextAreaInputGUI\setRows(), and ilLanguage\txt().

Referenced by create(), editProperties(), save(), and update().

396  : void
397  {
398  $lng = $this->lng;
399  $ilCtrl = $this->ctrl;
400 
401  $this->form = new ilPropertyFormGUI();
402 
403  // title
404  $ti = new ilTextInputGUI($lng->txt("title"), "title");
405  $ti->setMaxLength(200);
406  $ti->setSize(50);
407  $ti->setRequired(true);
408  $this->form->addItem($ti);
409 
410  // description
411  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
412  $ta->setRows(5);
413  $this->form->addItem($ta);
414 
415  // save and cancel commands
416  if ($a_mode == "create") {
417  $this->form->addCommandButton("save", $lng->txt("save"));
418  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
419  $this->form->setTitle($lng->txt("skmg_create_" . $this->getType()));
420  } else {
421  $this->form->addCommandButton("update", $lng->txt("save"));
422  $this->form->setTitle($lng->txt("skmg_edit_" . $this->getType()));
423  }
424 
425  $ilCtrl->setParameter($this, "node_id", $this->requested_node_id);
426  $this->form->setFormAction($ilCtrl->getFormAction($this));
427  }
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...
form( $class_path, string $cmd)
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertBasicSkillClip()

ilSkillTreeNodeGUI::insertBasicSkillClip ( )

Definition at line 486 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

486  : void
487  {
488  $this->skill_tree_node_manager->insertItemsFromClip("skll", $this->requested_node_id);
489  $this->redirectToParent();
490  }
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
+ Here is the call graph for this function:

◆ insertSkillCategoryClip()

ilSkillTreeNodeGUI::insertSkillCategoryClip ( )

Definition at line 492 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

492  : void
493  {
494  $this->skill_tree_node_manager->insertItemsFromClip("scat", $this->requested_node_id);
495  $this->redirectToParent();
496  }
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
+ Here is the call graph for this function:

◆ insertSkillTemplateClip()

ilSkillTreeNodeGUI::insertSkillTemplateClip ( )

Definition at line 504 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

504  : void
505  {
506  $this->skill_tree_node_manager->insertItemsFromClip("sktp", $this->requested_node_id);
507  $this->redirectToParent();
508  }
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
+ Here is the call graph for this function:

◆ insertTemplateCategoryClip()

ilSkillTreeNodeGUI::insertTemplateCategoryClip ( )

Definition at line 510 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

510  : void
511  {
512  $this->skill_tree_node_manager->insertItemsFromClip("sctp", $this->requested_node_id);
513  $this->redirectToParent();
514  }
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
+ Here is the call graph for this function:

◆ insertTemplateReferenceClip()

ilSkillTreeNodeGUI::insertTemplateReferenceClip ( )

Definition at line 498 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

498  : void
499  {
500  $this->skill_tree_node_manager->insertItemsFromClip("sktr", $this->requested_node_id);
501  $this->redirectToParent();
502  }
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
+ Here is the call graph for this function:

◆ isInUse()

ilSkillTreeNodeGUI::isInUse ( )

Definition at line 101 of file class.ilSkillTreeNodeGUI.php.

References $in_use, and ilSkillTreeNode\getAllCSkillIdsForNodeIds().

Referenced by ilBasicSkillGUI\edit(), ilBasicSkillTemplateGUI\edit(), ilBasicSkillGUI\editLevel(), editProperties(), ilSkillTemplateCategoryGUI\listItems(), ilSkillCategoryGUI\listItems(), and ilSkillTemplateReferenceGUI\listItems().

101  : bool
102  {
103  if (!is_object($this->node_object)) {
104  return false;
105  }
106  if ($this->use_checked) {
107  return $this->in_use;
108  }
109  $cskill_ids = ilSkillTreeNode::getAllCSkillIdsForNodeIds(array($this->node_object->getId()));
110  $u = new ilSkillUsage();
111  $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
112  if (count($usages) > 0) {
113  $this->in_use = true;
114  } else {
115  $this->in_use = false;
116  }
117  return $this->in_use;
118  }
static getAllCSkillIdsForNodeIds(array $a_node_ids)
Get all possible common skill IDs for node IDs.
Skill usage.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readNodeObject()

ilSkillTreeNodeGUI::readNodeObject ( int  $a_node_id)

Get node object instance.

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

References ilSkillTreeNodeFactory\getInstance().

Referenced by __construct().

133  : void
134  {
135  $this->node_object = ilSkillTreeNodeFactory::getInstance($a_node_id);
136  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectToParent()

ilSkillTreeNodeGUI::redirectToParent ( bool  $a_tmp_mode = false)

Redirect to parent (identified by current node_id)

Definition at line 437 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, and ilSkillTreeNode\_lookupType().

Referenced by afterSave(), cancelDelete(), cancelSave(), confirmedDelete(), copyItems(), cutItems(), exportSelectedNodes(), insertBasicSkillClip(), insertSkillCategoryClip(), insertSkillTemplateClip(), insertTemplateCategoryClip(), insertTemplateReferenceClip(), and saveOrder().

437  : void
438  {
439  $ilCtrl = $this->ctrl;
440 
441  if ($this->requested_tmpmode) {
442  $a_tmp_mode = true;
443  }
444 
445  $t = ilSkillTreeNode::_lookupType($this->requested_node_id);
446 
447  switch ($t) {
448  case "skrt":
449  $ilCtrl->setParameterByClass("ilskillrootgui", "node_id", $this->requested_node_id);
450  if ($a_tmp_mode) {
451  $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
452  } else {
453  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
454  }
455  break;
456 
457  case "sctp":
458  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "node_id", $this->requested_node_id);
459  $ilCtrl->redirectByClass("ilskilltemplatecategorygui", "listItems");
460  break;
461 
462  case "scat":
463  $ilCtrl->setParameterByClass("ilskillcategorygui", "node_id", $this->requested_node_id);
464  $ilCtrl->redirectByClass("ilskillcategorygui", "listItems");
465  break;
466  }
467  }
static _lookupType(int $a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilSkillTreeNodeGUI::save ( )

Save skill tree node.

Definition at line 332 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, $lng, $tpl, afterSave(), ILIAS\Repository\form(), initForm(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

332  : void
333  {
334  $tpl = $this->tpl;
335  $lng = $this->lng;
336  $ilCtrl = $this->ctrl;
337 
338  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
339  return;
340  }
341 
342  $this->initForm("create");
343  if ($this->form->checkInput()) {
344  $this->saveItem();
345  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
346  $this->skill_tree_node_manager->saveChildsOrder(
347  $this->requested_node_id,
348  [],
349  in_array($this->getType(), array("sktp", "sctp"))
350  );
351  $this->afterSave();
352  } else {
353  $this->form->setValuesByPost();
354  $tpl->setContent($this->form->getHTML());
355  }
356  }
initForm(string $a_mode="edit")
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...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd)
+ Here is the call graph for this function:

◆ saveAllTitles()

ilSkillTreeNodeGUI::saveAllTitles ( )

Definition at line 138 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, and getParentGUI().

138  : void
139  {
140  $ilCtrl = $this->ctrl;
141 
142  $this->getParentGUI()->saveAllTitles(false);
143  $ilCtrl->redirect($this, "showOrganization");
144  }
+ Here is the call graph for this function:

◆ saveOrder()

ilSkillTreeNodeGUI::saveOrder ( )

Definition at line 469 of file class.ilSkillTreeNodeGUI.php.

References $lng, redirectToParent(), and ilLanguage\txt().

469  : void
470  {
471  $lng = $this->lng;
472 
473  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
474  return;
475  }
476 
477  $this->skill_tree_node_manager->saveChildsOrder(
478  $this->requested_node_id,
479  $this->requested_node_order,
480  $this->requested_tmpmode
481  );
482  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
483  $this->redirectToParent($this->requested_tmpmode);
484  }
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...
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
+ Here is the call graph for this function:

◆ setParentGUI()

ilSkillTreeNodeGUI::setParentGUI ( object  $a_parentgui)

Definition at line 120 of file class.ilSkillTreeNodeGUI.php.

120  : void
121  {
122  $this->parentgui = $a_parentgui;
123  }

◆ setSkillNodeDescription()

ilSkillTreeNodeGUI::setSkillNodeDescription ( )

Definition at line 258 of file class.ilSkillTreeNodeGUI.php.

References $tpl, $tref_id, and ilGlobalTemplateInterface\setDescription().

Referenced by ilSkillCategoryGUI\setTabs(), ilSkillTemplateReferenceGUI\setTabs(), ilSkillTemplateCategoryGUI\setTabs(), ilBasicSkillTemplateGUI\setTabs(), and ilBasicSkillGUI\setTabs().

258  : void
259  {
260  $tpl = $this->tpl;
261 
262  $tpl->setDescription($this->skill_tree_node_manager->getWrittenPath($this->node_object->getId(), $this->tref_id));
263  }
ilGlobalTemplateInterface $tpl
setDescription(string $a_descr)
Sets description below title in standard template.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTitleIcon()

ilSkillTreeNodeGUI::setTitleIcon ( )

Definition at line 516 of file class.ilSkillTreeNodeGUI.php.

References $tpl, ilSkillTreeNode\_lookupStatus(), ilSkillTreeNode\getIconPath(), ilGlobalTemplateInterface\setTitleIcon(), and ilSkillTreeNode\STATUS_DRAFT.

516  : void
517  {
518  $tpl = $this->tpl;
519 
520  $obj_id = (is_object($this->node_object))
521  ? $this->node_object->getId()
522  : 0;
525  $obj_id,
526  $this->getType(),
527  "",
529  )
530  );
531  }
static _lookupStatus(int $a_obj_id)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
ilGlobalTemplateInterface $tpl
static getIconPath(int $a_obj_id, string $a_type, string $a_size="", int $a_status=0)
+ Here is the call graph for this function:

◆ showObjects()

ilSkillTreeNodeGUI::showObjects ( )

Definition at line 582 of file class.ilSkillTreeNodeGUI.php.

References $tpl, and ilGlobalTemplateInterface\setContent().

582  : void
583  {
584  $tpl = $this->tpl;
585 
586  $this->setTabs("objects");
587 
588  $base_skill_id = ($this->base_skill_id > 0)
589  ? $this->base_skill_id
590  : $this->node_object->getId();
591  $usage_info = new ilSkillUsage();
592  $objects = $usage_info->getAssignedObjectsForSkill($base_skill_id, $this->tref_id);
593 
594  $tab = new ilSkillAssignedObjectsTableGUI($this, "showObjects", $objects);
595 
596  $tpl->setContent($tab->getHTML());
597  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
Skill usage.
+ Here is the call graph for this function:

◆ showUsage()

ilSkillTreeNodeGUI::showUsage ( )

Definition at line 549 of file class.ilSkillTreeNodeGUI.php.

References $tpl, and ilGlobalTemplateInterface\setContent().

549  : void
550  {
551  $tpl = $this->tpl;
552 
553  $this->setTabs("usage");
554 
555  $usage_info = new ilSkillUsage();
556  $base_skill_id = ($this->base_skill_id > 0)
557  ? $this->base_skill_id
558  : $this->node_object->getId();
559  $usages = $usage_info->getAllUsagesInfoOfSubtree($base_skill_id, $this->tref_id);
560 
561  $html = "";
562  foreach ($usages as $k => $usage) {
563  $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
564  $html .= $tab->getHTML() . "<br/><br/>";
565  }
566 
567  $tpl->setContent($html);
568  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
TableGUI class for skill usages.
Skill usage.
+ Here is the call graph for this function:

◆ update()

ilSkillTreeNodeGUI::update ( )

Update skill tree node.

Definition at line 368 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, $lng, $tpl, afterUpdate(), ILIAS\Repository\form(), initForm(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

368  : void
369  {
370  $tpl = $this->tpl;
371  $lng = $this->lng;
372  $ilCtrl = $this->ctrl;
373 
374  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
375  return;
376  }
377 
378  $this->initForm("edit");
379  if ($this->form->checkInput()) {
380  $this->updateItem();
381  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
382  $this->afterUpdate();
383  } else {
384  $this->form->setValuesByPost();
385  $tpl->setContent($this->form->getHTML());
386  }
387  }
initForm(string $a_mode="edit")
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...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd)
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilSkillTreeNodeGUI::$access

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

◆ $admin_gui_request

SkillAdminGUIRequest ilSkillTreeNodeGUI::$admin_gui_request
protected

◆ $base_skill_id

int ilSkillTreeNodeGUI::$base_skill_id = 0
protected

Definition at line 54 of file class.ilSkillTreeNodeGUI.php.

◆ $ctrl

◆ $form

◆ $in_use

bool ilSkillTreeNodeGUI::$in_use = false

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

Referenced by isInUse().

◆ $lng

◆ $locator

ilLocatorGUI ilSkillTreeNodeGUI::$locator
protected

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

◆ $node_object

object ilSkillTreeNodeGUI::$node_object = null

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

◆ $parentgui

object ilSkillTreeNodeGUI::$parentgui
protected

Definition at line 38 of file class.ilSkillTreeNodeGUI.php.

Referenced by getParentGUI().

◆ $requested_backcmd

string ilSkillTreeNodeGUI::$requested_backcmd = ""
protected

Definition at line 52 of file class.ilSkillTreeNodeGUI.php.

◆ $requested_node_id

int ilSkillTreeNodeGUI::$requested_node_id = 0
protected

◆ $requested_node_ids

array ilSkillTreeNodeGUI::$requested_node_ids = []
protected

Definition at line 59 of file class.ilSkillTreeNodeGUI.php.

Referenced by copyItems(), and cutItems().

◆ $requested_node_order

array ilSkillTreeNodeGUI::$requested_node_order = []
protected

Definition at line 64 of file class.ilSkillTreeNodeGUI.php.

◆ $requested_ref_id

int ilSkillTreeNodeGUI::$requested_ref_id = 0
protected

Definition at line 50 of file class.ilSkillTreeNodeGUI.php.

◆ $requested_tmpmode

int ilSkillTreeNodeGUI::$requested_tmpmode = 0
protected

Definition at line 53 of file class.ilSkillTreeNodeGUI.php.

◆ $skill_tree_id

int ilSkillTreeNodeGUI::$skill_tree_id = 0
protected

Definition at line 47 of file class.ilSkillTreeNodeGUI.php.

◆ $skill_tree_node_manager

Tree SkillTreeNodeManager ilSkillTreeNodeGUI::$skill_tree_node_manager
protected

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

◆ $tabs

ilTabsGUI ilSkillTreeNodeGUI::$tabs
protected

Definition at line 48 of file class.ilSkillTreeNodeGUI.php.

Referenced by create().

◆ $tpl

◆ $tree

ilTree ilSkillTreeNodeGUI::$tree
protected

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

◆ $tree_access_manager

SkillTreeAccess ilSkillTreeNodeGUI::$tree_access_manager
protected

Definition at line 45 of file class.ilSkillTreeNodeGUI.php.

◆ $tree_repo

ilSkillTreeRepository ilSkillTreeNodeGUI::$tree_repo
protected

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

◆ $tref_id

int ilSkillTreeNodeGUI::$tref_id = 0
protected

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

Referenced by setSkillNodeDescription().

◆ $use_checked

bool ilSkillTreeNodeGUI::$use_checked = false

Definition at line 42 of file class.ilSkillTreeNodeGUI.php.

◆ $user

ilObjUser ilSkillTreeNodeGUI::$user
protected

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


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