ILIAS  trunk Revision v11.0_alpha-1862-g4e205cb56d4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 (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 34 of file class.ilSkillTreeNodeGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

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

77  {
78  global $DIC;
79 
80  $this->ctrl = $DIC->ctrl();
81  $this->lng = $DIC->language();
82  $this->locator = $DIC["ilLocator"];
83  $this->tpl = $DIC["tpl"];
84  $this->user = $DIC->user();
85  $this->ui_fac = $DIC->ui()->factory();
86  $this->ui_ren = $DIC->ui()->renderer();
87  $ilAccess = $DIC->access();
88  $this->tree = $DIC->repositoryTree();
89  $this->tabs = $DIC->tabs();
90  $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
91  $this->skill_ui_service = $DIC->skills()->ui();
92 
93  $this->node_object = null;
94  $this->access = $ilAccess;
95 
96  $this->requested_ref_id = $this->admin_gui_request->getRefId();
97  $this->requested_node_id = $this->admin_gui_request->getNodeId();
98  $this->requested_backcmd = $this->admin_gui_request->getBackCommand();
99  $this->requested_tmpmode = $this->admin_gui_request->getTemplateMode();
100  $this->requested_node_ids = $this->admin_gui_request->getNodeIds();
101  $this->requested_node_order = $this->admin_gui_request->getOrder();
102 
103  $this->skill_tree_node_manager = $node_manager;
104  $this->tree_access_manager = $DIC->skills()->internal()->manager()->getTreeAccessManager($this->requested_ref_id);
105  $this->table_manager = $DIC->skills()->internal()->manager()->getTableManager();
106  $this->usage_manager = $DIC->skills()->internal()->manager()->getUsageManager();
107  $this->tree_repo = $DIC->skills()->internal()->repo()->getTreeRepo();
108  $this->skill_tree_id = $this->tree_repo->getTreeIdForNodeId($this->requested_node_id);
109 
110  if ($a_node_id > 0 &&
111  $this->getType() == ilSkillTreeNode::_lookupType($a_node_id)) {
112  $this->readNodeObject($a_node_id);
113  }
114  }
readNodeObject(int $a_node_id)
Get node object instance.
static _lookupType(int $a_obj_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ addObjectsTab()

ilSkillTreeNodeGUI::addObjectsTab ( ilTabsGUI  $a_tabs)

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

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

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

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

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

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

References redirectToParent().

Referenced by save().

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

References $ctrl, and ilCtrl\redirect().

Referenced by update().

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

References $ctrl, and redirectToParent().

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

References redirectToParent().

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

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

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

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

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

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

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

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

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

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

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

◆ editProperties()

ilSkillTreeNodeGUI::editProperties ( )

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

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

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

◆ exportSelectedNodes()

ilSkillTreeNodeGUI::exportSelectedNodes ( )

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

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

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

◆ getParentGUI()

ilSkillTreeNodeGUI::getParentGUI ( )

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

References $parentgui.

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

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

◆ getPropertyValues()

ilSkillTreeNodeGUI::getPropertyValues ( )

Get property values for edit form.

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

References ILIAS\Repository\form().

Referenced by editProperties().

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

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

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

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

References redirectToParent().

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

References redirectToParent().

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

References redirectToParent().

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

References redirectToParent().

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

References redirectToParent().

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

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

References ilSkillTreeNodeFactory\getInstance().

Referenced by __construct().

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

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

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

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

References $ctrl, and getParentGUI().

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

◆ saveOrder()

ilSkillTreeNodeGUI::saveOrder ( )

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

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

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

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

◆ setSkillNodeDescription()

ilSkillTreeNodeGUI::setSkillNodeDescription ( )

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

References $tpl, $tref_id, and ILIAS\UICore\GlobalTemplate\setDescription().

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

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

References $tpl, ilSkillTreeNode\_lookupStatus(), ilSkillTreeNode\getIconPath(), and ILIAS\UICore\GlobalTemplate\setTitleIcon().

530  : void
531  {
532  $tpl = $this->tpl;
533 
534  $obj_id = (is_object($this->node_object))
535  ? $this->node_object->getId()
536  : 0;
539  $obj_id,
540  $this->getType(),
541  "",
543  )
544  );
545  }
static _lookupStatus(int $a_obj_id)
ilGlobalTemplateInterface $tpl
static getIconPath(int $a_obj_id, string $a_type, string $a_size="", int $a_status=0)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
+ Here is the call graph for this function:

◆ showObjects()

ilSkillTreeNodeGUI::showObjects ( )

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

References $tpl, and ILIAS\UICore\GlobalTemplate\setContent().

595  : void
596  {
597  $tpl = $this->tpl;
598 
599  $this->setTabs("objects");
600 
601  $base_skill_id = ($this->base_skill_id > 0)
602  ? $this->base_skill_id
603  : $this->node_object->getId();
604  $objects = $this->usage_manager->getAssignedObjectsForSkill($base_skill_id, $this->tref_id);
605 
606  $table = $this->table_manager->getAssignedObjectsTable(
607  $this,
608  $objects,
610  $this->tref_id
611  )->getComponent();
612 
613  $tpl->setContent($this->ui_ren->render($table));
614  }
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 563 of file class.ilSkillTreeNodeGUI.php.

References $tpl, and ILIAS\UICore\GlobalTemplate\setContent().

563  : void
564  {
565  $tpl = $this->tpl;
566 
567  $this->setTabs("usage");
568 
569  $base_skill_id = ($this->base_skill_id > 0)
570  ? $this->base_skill_id
571  : $this->node_object->getId();
572  $usages = $this->usage_manager->getAllUsagesInfoOfSubtree($base_skill_id, $this->tref_id);
573 
574  $html = "";
575  foreach ($usages as $k => $usage) {
576  $usages_ui = $this->skill_ui_service->getUsagesUI($k, $usage);
577  $html .= $usages_ui->render() . "<br/><br/>";
578  }
579 
580  $tpl->setContent($html);
581  }
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 382 of file class.ilSkillTreeNodeGUI.php.

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

382  : void
383  {
384  $tpl = $this->tpl;
385  $lng = $this->lng;
386  $ilCtrl = $this->ctrl;
387 
388  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
389  return;
390  }
391 
392  $this->initForm("edit");
393  if ($this->form->checkInput()) {
394  $this->updateItem();
395  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
396  $this->afterUpdate();
397  } else {
398  $this->form->setValuesByPost();
399  $tpl->setContent($this->form->getHTML());
400  }
401  }
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 50 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 64 of file class.ilSkillTreeNodeGUI.php.

◆ $ctrl

◆ $form

◆ $in_use

bool ilSkillTreeNodeGUI::$in_use = false

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

Referenced by isInUse().

◆ $lng

◆ $locator

ilLocatorGUI ilSkillTreeNodeGUI::$locator
protected

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

◆ $node_object

object ilSkillTreeNodeGUI::$node_object = null

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

◆ $parentgui

object ilSkillTreeNodeGUI::$parentgui
protected

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

Referenced by getParentGUI().

◆ $requested_backcmd

string ilSkillTreeNodeGUI::$requested_backcmd = ""
protected

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

Referenced by copyItems(), and cutItems().

◆ $requested_node_order

array ilSkillTreeNodeGUI::$requested_node_order = []
protected

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

◆ $requested_ref_id

int ilSkillTreeNodeGUI::$requested_ref_id = 0
protected

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

◆ $requested_tmpmode

bool ilSkillTreeNodeGUI::$requested_tmpmode = false
protected

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

◆ $skill_tree_id

int ilSkillTreeNodeGUI::$skill_tree_id = 0
protected

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

◆ $skill_tree_node_manager

Node SkillTreeNodeManager ilSkillTreeNodeGUI::$skill_tree_node_manager
protected

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

◆ $skill_ui_service

SkillUIService ilSkillTreeNodeGUI::$skill_ui_service
protected

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

◆ $table_manager

Table TableManager ilSkillTreeNodeGUI::$table_manager
protected

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

◆ $tabs

ilTabsGUI ilSkillTreeNodeGUI::$tabs
protected

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

Referenced by create().

◆ $tpl

◆ $tree

ilTree ilSkillTreeNodeGUI::$tree
protected

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

◆ $tree_access_manager

SkillTreeAccess ilSkillTreeNodeGUI::$tree_access_manager
protected

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

◆ $tree_repo

ilSkillTreeRepository ilSkillTreeNodeGUI::$tree_repo
protected

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

◆ $tref_id

int ilSkillTreeNodeGUI::$tref_id = 0
protected

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

Referenced by setSkillNodeDescription().

◆ $ui_fac

UI Factory ilSkillTreeNodeGUI::$ui_fac
protected

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

◆ $ui_ren

UI Renderer ilSkillTreeNodeGUI::$ui_ren
protected

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

◆ $usage_manager

Usage SkillUsageManager ilSkillTreeNodeGUI::$usage_manager
protected

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

◆ $use_checked

bool ilSkillTreeNodeGUI::$use_checked = false

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

◆ $user

ilObjUser ilSkillTreeNodeGUI::$user
protected

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


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