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

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

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

Public Member Functions

 __construct (Node\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
 
UI Factory $ui_fac
 
UI Renderer $ui_ren
 
object $parentgui
 
int $tref_id = 0
 
Node SkillTreeNodeManager $skill_tree_node_manager
 
SkillTreeAccess $tree_access_manager
 
Table TableManager $table_manager
 
Usage SkillUsageManager $usage_manager
 
ilSkillTreeRepository $tree_repo
 
int $skill_tree_id = 0
 
ilTabsGUI $tabs
 
SkillAdminGUIRequest $admin_gui_request
 
SkillUIService $skill_ui_service
 
int $requested_ref_id = 0
 
int $requested_node_id = 0
 
string $requested_backcmd = ""
 
bool $requested_tmpmode = false
 
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 35 of file class.ilSkillTreeNodeGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 77 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().

78  {
79  global $DIC;
80 
81  $this->ctrl = $DIC->ctrl();
82  $this->lng = $DIC->language();
83  $this->locator = $DIC["ilLocator"];
84  $this->tpl = $DIC["tpl"];
85  $this->user = $DIC->user();
86  $this->ui_fac = $DIC->ui()->factory();
87  $this->ui_ren = $DIC->ui()->renderer();
88  $ilAccess = $DIC->access();
89  $this->tree = $DIC->repositoryTree();
90  $this->tabs = $DIC->tabs();
91  $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
92  $this->skill_ui_service = $DIC->skills()->ui();
93 
94  $this->node_object = null;
95  $this->access = $ilAccess;
96 
97  $this->requested_ref_id = $this->admin_gui_request->getRefId();
98  $this->requested_node_id = $this->admin_gui_request->getNodeId();
99  $this->requested_backcmd = $this->admin_gui_request->getBackCommand();
100  $this->requested_tmpmode = $this->admin_gui_request->getTemplateMode();
101  $this->requested_node_ids = $this->admin_gui_request->getNodeIds();
102  $this->requested_node_order = $this->admin_gui_request->getOrder();
103 
104  $this->skill_tree_node_manager = $node_manager;
105  $this->tree_access_manager = $DIC->skills()->internal()->manager()->getTreeAccessManager($this->requested_ref_id);
106  $this->table_manager = $DIC->skills()->internal()->manager()->getTableManager();
107  $this->usage_manager = $DIC->skills()->internal()->manager()->getUsageManager();
108  $this->tree_repo = $DIC->skills()->internal()->repo()->getTreeRepo();
109  $this->skill_tree_id = $this->tree_repo->getTreeIdForNodeId($this->requested_node_id);
110 
111  if ($a_node_id > 0 &&
112  $this->getType() == ilSkillTreeNode::_lookupType($a_node_id)) {
113  $this->readNodeObject($a_node_id);
114  }
115  }
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 584 of file class.ilSkillTreeNodeGUI.php.

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

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

584  : void
585  {
586  $lng = $this->lng;
587  $ilCtrl = $this->ctrl;
588 
589  $a_tabs->addTab(
590  "objects",
591  $lng->txt("skmg_assigned_objects"),
592  $ilCtrl->getLinkTarget($this, "showObjects")
593  );
594  }
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 299 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().

299  : void
300  {
301  $lng = $this->lng;
302 
303  // status
304  $radg = new ilRadioGroupInputGUI($lng->txt("skmg_status"), "status");
305  foreach (ilSkillTreeNode::getAllStatus() as $k => $op) {
306  $op = new ilRadioOption($op, (string) $k, ilSkillTreeNode::getStatusInfo($k));
307  $radg->addOption($op);
308  }
309  $radg->setValue((string) ilSkillTreeNode::STATUS_PUBLISH);
310  $a_form->addItem($radg);
311  }
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 552 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().

552  : void
553  {
554  $lng = $this->lng;
555  $ilCtrl = $this->ctrl;
556 
557  $a_tabs->addTab(
558  "usage",
559  $lng->txt("skmg_usage"),
560  $ilCtrl->getLinkTarget($this, "showUsage")
561  );
562  }
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 373 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

Referenced by save().

373  : void
374  {
375  $this->redirectToParent();
376  }
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 404 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, and ilCtrl\redirect().

Referenced by update().

404  : void
405  {
406  $ilCtrl = $this->ctrl;
407 
408  $ilCtrl->redirect($this, "editProperties");
409  }
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 245 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, and redirectToParent().

245  : void
246  {
247  $ilCtrl = $this->ctrl;
248 
249  $this->redirectToParent();
250  }
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 444 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

444  : void
445  {
446  $this->redirectToParent();
447  }
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 255 of file class.ilSkillTreeNodeGUI.php.

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

255  : void
256  {
257  $ilCtrl = $this->ctrl;
258 
259  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
260  return;
261  }
262 
263  $this->getParentGUI()->confirmedDelete(false);
264  $this->skill_tree_node_manager->saveChildsOrder(
265  $this->requested_node_id,
266  [],
267  $this->requested_tmpmode
268  );
269 
270  $this->redirectToParent();
271  }
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 215 of file class.ilSkillTreeNodeGUI.php.

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

215  : void
216  {
217  $ilCtrl = $this->ctrl;
218  $lng = $this->lng;
219 
220  if (empty($this->requested_node_ids)) {
221  $this->redirectToParent();
222  }
223 
224  $items = $this->requested_node_ids;
225  $todel = []; // delete IDs < 0 (needed for non-js editing)
226  foreach ($items as $k => $item) {
227  if ($item < 0) {
228  $todel[] = $k;
229  }
230  }
231  foreach ($todel as $k) {
232  unset($items[$k]);
233  }
234  if (!ilSkillTreeNode::uniqueTypesCheck($items)) {
235  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_insert_please_choose_one_type_only"), true);
236  $this->redirectToParent();
237  }
238  $this->skill_tree_node_manager->clipboardCopy($items);
239 
240  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_selected_items_have_been_copied"), true);
241 
242  $this->redirectToParent();
243  }
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 283 of file class.ilSkillTreeNodeGUI.php.

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

283  : void
284  {
285  $lng = $this->lng;
286  $tpl = $this->tpl;
287  $tabs = $this->tabs;
288  $ilCtrl = $this->ctrl;
289 
291  $lng->txt("back"),
292  $ilCtrl->getLinkTarget($this, "redirectToParent")
293  );
294 
295  $this->initForm("create");
296  $tpl->setContent($this->form->getHTML());
297  }
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, string $submit_caption="")
+ 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 175 of file class.ilSkillTreeNodeGUI.php.

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

175  : void
176  {
177  $lng = $this->lng;
178 
179  if (empty($this->requested_node_ids)) {
180  $this->redirectToParent();
181  }
182 
183  $items = $this->requested_node_ids;
184  $todel = []; // delete IDs < 0 (needed for non-js editing)
185  foreach ($items as $k => $item) {
186  if ($item < 0) {
187  $todel[] = $k;
188  }
189  }
190  foreach ($todel as $k) {
191  unset($items[$k]);
192  }
193 
194  if (!ilSkillTreeNode::uniqueTypesCheck($items)) {
195  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_insert_please_choose_one_type_only"), true);
196  $this->redirectToParent();
197  }
198 
199  $this->skill_tree_node_manager->clipboardCut($items);
200 
201  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_selected_items_have_been_cut"), true);
202 
203  $this->skill_tree_node_manager->saveChildsOrder(
204  $this->requested_node_id,
205  [],
206  $this->requested_tmpmode
207  );
208 
209  $this->redirectToParent();
210  }
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 164 of file class.ilSkillTreeNodeGUI.php.

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

164  : void
165  {
166  $ilCtrl = $this->ctrl;
167 
168  $ilCtrl->setParameter($this, "backcmd", $this->requested_backcmd);
169  $this->getParentGUI()->deleteNodes($this);
170  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ editProperties()

ilSkillTreeNodeGUI::editProperties ( )

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

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

313  : void
314  {
315  $tpl = $this->tpl;
316  $lng = $this->lng;
317 
318  if ($this->isInUse()) {
319  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
320  }
321 
322  $this->initForm("edit");
323  $this->getPropertyValues();
324  $tpl->setContent($this->form->getHTML());
325  }
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, string $submit_caption="")
+ Here is the call graph for this function:

◆ exportSelectedNodes()

ilSkillTreeNodeGUI::exportSelectedNodes ( )

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

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

617  : void
618  {
619  $ilCtrl = $this->ctrl;
620 
621  if (empty($this->requested_node_ids)) {
622  $this->redirectToParent();
623  }
624 
625  $exp = new ilExport();
626  $conf = $exp->getConfig("Services/Skill");
627  $conf->setSelectedNodes($this->requested_node_ids);
628  $conf->setSkillTreeId($this->skill_tree_id);
629  $exp->exportObject("skmg", ilObject::_lookupObjId($this->requested_ref_id));
630 
631  $ilCtrl->redirectByClass(array("ilobjskilltreegui", "ilexportgui"), "");
632  }
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
Export.
static _lookupObjId(int $ref_id)
+ Here is the call graph for this function:

◆ getParentGUI()

ilSkillTreeNodeGUI::getParentGUI ( )

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

References $parentgui.

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

140  : object
141  {
142  return $this->parentgui;
143  }
+ Here is the caller graph for this function:

◆ getPropertyValues()

ilSkillTreeNodeGUI::getPropertyValues ( )

Get property values for edit form.

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

References ILIAS\Repository\form().

Referenced by editProperties().

330  : void
331  {
332  $values = [];
333 
334  $values["title"] = $this->node_object->getTitle();
335  $values["description"] = $this->node_object->getDescription();
336  $values["order_nr"] = $this->node_object->getOrderNr();
337  $values["self_eval"] = $this->node_object->getSelfEvaluation();
338  $values["status"] = (string) $this->node_object->getStatus();
339 
340  $this->form->setValuesByArray($values);
341  }
form( $class_path, string $cmd, string $submit_caption="")
+ 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 411 of file class.ilSkillTreeNodeGUI.php.

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

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

411  : void
412  {
413  $lng = $this->lng;
414  $ilCtrl = $this->ctrl;
415 
416  $this->form = new ilPropertyFormGUI();
417 
418  // title
419  $ti = new ilTextInputGUI($lng->txt("title"), "title");
420  $ti->setMaxLength(200);
421  $ti->setSize(50);
422  $ti->setRequired(true);
423  $this->form->addItem($ti);
424 
425  // description
426  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
427  $ta->setRows(5);
428  $this->form->addItem($ta);
429 
430  // save and cancel commands
431  if ($a_mode == "create") {
432  $this->form->addCommandButton("save", $lng->txt("save"));
433  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
434  $this->form->setTitle($lng->txt("skmg_create_" . $this->getType()));
435  } else {
436  $this->form->addCommandButton("update", $lng->txt("save"));
437  $this->form->setTitle($lng->txt("skmg_edit_" . $this->getType()));
438  }
439 
440  $ilCtrl->setParameter($this, "node_id", $this->requested_node_id);
441  $this->form->setFormAction($ilCtrl->getFormAction($this));
442  }
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, string $submit_caption="")
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 501 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

501  : void
502  {
503  $this->skill_tree_node_manager->insertItemsFromClip("skll", $this->requested_node_id);
504  $this->redirectToParent();
505  }
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 507 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

507  : void
508  {
509  $this->skill_tree_node_manager->insertItemsFromClip("scat", $this->requested_node_id);
510  $this->redirectToParent();
511  }
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 519 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

519  : void
520  {
521  $this->skill_tree_node_manager->insertItemsFromClip("sktp", $this->requested_node_id);
522  $this->redirectToParent();
523  }
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 525 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

525  : void
526  {
527  $this->skill_tree_node_manager->insertItemsFromClip("sctp", $this->requested_node_id);
528  $this->redirectToParent();
529  }
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 513 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

513  : void
514  {
515  $this->skill_tree_node_manager->insertItemsFromClip("sktr", $this->requested_node_id);
516  $this->redirectToParent();
517  }
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 117 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().

117  : bool
118  {
119  if (!is_object($this->node_object)) {
120  return false;
121  }
122  if ($this->use_checked) {
123  return $this->in_use;
124  }
125  $cskill_ids = ilSkillTreeNode::getAllCSkillIdsForNodeIds(array($this->node_object->getId()));
126  $usages = $this->usage_manager->getAllUsagesInfoOfSubtrees($cskill_ids);
127  if (count($usages) > 0) {
128  $this->in_use = true;
129  } else {
130  $this->in_use = false;
131  }
132  return $this->in_use;
133  }
static getAllCSkillIdsForNodeIds(array $a_node_ids)
Get all possible common skill IDs for node IDs.
+ 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 148 of file class.ilSkillTreeNodeGUI.php.

References ilSkillTreeNodeFactory\getInstance().

Referenced by __construct().

148  : void
149  {
150  $this->node_object = ilSkillTreeNodeFactory::getInstance($a_node_id);
151  }
+ 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 452 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().

452  : void
453  {
454  $ilCtrl = $this->ctrl;
455 
456  if ($this->requested_tmpmode) {
457  $a_tmp_mode = true;
458  }
459 
460  $t = ilSkillTreeNode::_lookupType($this->requested_node_id);
461 
462  switch ($t) {
463  case "skrt":
464  $ilCtrl->setParameterByClass("ilskillrootgui", "node_id", $this->requested_node_id);
465  if ($a_tmp_mode) {
466  $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
467  } else {
468  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
469  }
470  break;
471 
472  case "sctp":
473  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "node_id", $this->requested_node_id);
474  $ilCtrl->redirectByClass("ilskilltemplatecategorygui", "listItems");
475  break;
476 
477  case "scat":
478  $ilCtrl->setParameterByClass("ilskillcategorygui", "node_id", $this->requested_node_id);
479  $ilCtrl->redirectByClass("ilskillcategorygui", "listItems");
480  break;
481  }
482  }
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 347 of file class.ilSkillTreeNodeGUI.php.

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

347  : void
348  {
349  $tpl = $this->tpl;
350  $lng = $this->lng;
351  $ilCtrl = $this->ctrl;
352 
353  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
354  return;
355  }
356 
357  $this->initForm("create");
358  if ($this->form->checkInput()) {
359  $this->saveItem();
360  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
361  $this->skill_tree_node_manager->saveChildsOrder(
362  $this->requested_node_id,
363  [],
364  in_array($this->getType(), array("sktp", "sctp"))
365  );
366  $this->afterSave();
367  } else {
368  $this->form->setValuesByPost();
369  $tpl->setContent($this->form->getHTML());
370  }
371  }
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, string $submit_caption="")
+ Here is the call graph for this function:

◆ saveAllTitles()

ilSkillTreeNodeGUI::saveAllTitles ( )

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

References $ctrl, and getParentGUI().

153  : void
154  {
155  $ilCtrl = $this->ctrl;
156 
157  $this->getParentGUI()->saveAllTitles(false);
158  $ilCtrl->redirect($this, "showOrganization");
159  }
+ Here is the call graph for this function:

◆ saveOrder()

ilSkillTreeNodeGUI::saveOrder ( )

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

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

484  : void
485  {
486  $lng = $this->lng;
487 
488  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
489  return;
490  }
491 
492  $this->skill_tree_node_manager->saveChildsOrder(
493  $this->requested_node_id,
494  $this->requested_node_order,
495  $this->requested_tmpmode
496  );
497  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
498  $this->redirectToParent($this->requested_tmpmode);
499  }
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 135 of file class.ilSkillTreeNodeGUI.php.

135  : void
136  {
137  $this->parentgui = $a_parentgui;
138  }

◆ setSkillNodeDescription()

ilSkillTreeNodeGUI::setSkillNodeDescription ( )

Definition at line 273 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().

273  : void
274  {
275  $tpl = $this->tpl;
276 
277  $tpl->setDescription($this->skill_tree_node_manager->getWrittenPath($this->node_object->getId(), $this->tref_id));
278  }
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 531 of file class.ilSkillTreeNodeGUI.php.

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

531  : void
532  {
533  $tpl = $this->tpl;
534 
535  $obj_id = (is_object($this->node_object))
536  ? $this->node_object->getId()
537  : 0;
540  $obj_id,
541  $this->getType(),
542  "",
544  )
545  );
546  }
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 596 of file class.ilSkillTreeNodeGUI.php.

References $tpl, and ilGlobalTemplateInterface\setContent().

596  : void
597  {
598  $tpl = $this->tpl;
599 
600  $this->setTabs("objects");
601 
602  $base_skill_id = ($this->base_skill_id > 0)
603  ? $this->base_skill_id
604  : $this->node_object->getId();
605  $objects = $this->usage_manager->getAssignedObjectsForSkill($base_skill_id, $this->tref_id);
606 
607  $table = $this->table_manager->getAssignedObjectsTable(
608  $this,
609  $objects,
611  $this->tref_id
612  )->getComponent();
613 
614  $tpl->setContent($this->ui_ren->render($table));
615  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ showUsage()

ilSkillTreeNodeGUI::showUsage ( )

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

References $tpl, and ilGlobalTemplateInterface\setContent().

564  : void
565  {
566  $tpl = $this->tpl;
567 
568  $this->setTabs("usage");
569 
570  $base_skill_id = ($this->base_skill_id > 0)
571  ? $this->base_skill_id
572  : $this->node_object->getId();
573  $usages = $this->usage_manager->getAllUsagesInfoOfSubtree($base_skill_id, $this->tref_id);
574 
575  $html = "";
576  foreach ($usages as $k => $usage) {
577  $usages_ui = $this->skill_ui_service->getUsagesUI($k, $usage);
578  $html .= $usages_ui->render() . "<br/><br/>";
579  }
580 
581  $tpl->setContent($html);
582  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ update()

ilSkillTreeNodeGUI::update ( )

Update skill tree node.

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

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

383  : void
384  {
385  $tpl = $this->tpl;
386  $lng = $this->lng;
387  $ilCtrl = $this->ctrl;
388 
389  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
390  return;
391  }
392 
393  $this->initForm("edit");
394  if ($this->form->checkInput()) {
395  $this->updateItem();
396  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
397  $this->afterUpdate();
398  } else {
399  $this->form->setValuesByPost();
400  $tpl->setContent($this->form->getHTML());
401  }
402  }
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, string $submit_caption="")
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilSkillTreeNodeGUI::$access

Definition at line 51 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 65 of file class.ilSkillTreeNodeGUI.php.

◆ $ctrl

◆ $form

◆ $in_use

bool ilSkillTreeNodeGUI::$in_use = false

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

Referenced by isInUse().

◆ $lng

◆ $locator

ilLocatorGUI ilSkillTreeNodeGUI::$locator
protected

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

◆ $node_object

object ilSkillTreeNodeGUI::$node_object = null

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

◆ $parentgui

object ilSkillTreeNodeGUI::$parentgui
protected

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

Referenced by getParentGUI().

◆ $requested_backcmd

string ilSkillTreeNodeGUI::$requested_backcmd = ""
protected

Definition at line 63 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 70 of file class.ilSkillTreeNodeGUI.php.

Referenced by copyItems(), and cutItems().

◆ $requested_node_order

array ilSkillTreeNodeGUI::$requested_node_order = []
protected

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

◆ $requested_ref_id

int ilSkillTreeNodeGUI::$requested_ref_id = 0
protected

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

◆ $requested_tmpmode

bool ilSkillTreeNodeGUI::$requested_tmpmode = false
protected

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

◆ $skill_tree_id

int ilSkillTreeNodeGUI::$skill_tree_id = 0
protected

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

◆ $skill_tree_node_manager

Node SkillTreeNodeManager ilSkillTreeNodeGUI::$skill_tree_node_manager
protected

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

◆ $skill_ui_service

SkillUIService ilSkillTreeNodeGUI::$skill_ui_service
protected

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

◆ $table_manager

Table TableManager ilSkillTreeNodeGUI::$table_manager
protected

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

◆ $tabs

ilTabsGUI ilSkillTreeNodeGUI::$tabs
protected

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

Referenced by create().

◆ $tpl

◆ $tree

ilTree ilSkillTreeNodeGUI::$tree
protected

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

◆ $tree_access_manager

SkillTreeAccess ilSkillTreeNodeGUI::$tree_access_manager
protected

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

◆ $tree_repo

ilSkillTreeRepository ilSkillTreeNodeGUI::$tree_repo
protected

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

◆ $tref_id

int ilSkillTreeNodeGUI::$tref_id = 0
protected

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

Referenced by setSkillNodeDescription().

◆ $ui_fac

UI Factory ilSkillTreeNodeGUI::$ui_fac
protected

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

◆ $ui_ren

UI Renderer ilSkillTreeNodeGUI::$ui_ren
protected

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

◆ $usage_manager

Usage SkillUsageManager ilSkillTreeNodeGUI::$usage_manager
protected

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

◆ $use_checked

bool ilSkillTreeNodeGUI::$use_checked = false

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

◆ $user

ilObjUser ilSkillTreeNodeGUI::$user
protected

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


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