ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 ()
 

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
 
DataFactory $data_factory
 
ExportFactoryInterface $export_factory
 
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 37 of file class.ilSkillTreeNodeGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

82  {
83  global $DIC;
84 
85  $this->data_factory = new DataFactory();
86  $this->export_factory = new ExportFactory();
87 
88  $this->ctrl = $DIC->ctrl();
89  $this->lng = $DIC->language();
90  $this->locator = $DIC["ilLocator"];
91  $this->tpl = $DIC["tpl"];
92  $this->user = $DIC->user();
93  $this->ui_fac = $DIC->ui()->factory();
94  $this->ui_ren = $DIC->ui()->renderer();
95  $ilAccess = $DIC->access();
96  $this->tree = $DIC->repositoryTree();
97  $this->tabs = $DIC->tabs();
98  $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
99  $this->skill_ui_service = $DIC->skills()->ui();
100 
101  $this->node_object = null;
102  $this->access = $ilAccess;
103 
104  $this->requested_ref_id = $this->admin_gui_request->getRefId();
105  $this->requested_node_id = $this->admin_gui_request->getNodeId();
106  $this->requested_backcmd = $this->admin_gui_request->getBackCommand();
107  $this->requested_tmpmode = $this->admin_gui_request->getTemplateMode();
108  $this->requested_node_ids = $this->admin_gui_request->getNodeIds();
109  $this->requested_node_order = $this->admin_gui_request->getOrder();
110 
111  $this->skill_tree_node_manager = $node_manager;
112  $this->tree_access_manager = $DIC->skills()->internal()->manager()->getTreeAccessManager($this->requested_ref_id);
113  $this->table_manager = $DIC->skills()->internal()->manager()->getTableManager();
114  $this->usage_manager = $DIC->skills()->internal()->manager()->getUsageManager();
115  $this->tree_repo = $DIC->skills()->internal()->repo()->getTreeRepo();
116  $this->skill_tree_id = $this->tree_repo->getTreeIdForNodeId($this->requested_node_id);
117 
118  if ($a_node_id > 0 &&
119  $this->getType() == ilSkillTreeNode::_lookupType($a_node_id)) {
120  $this->readNodeObject($a_node_id);
121  }
122  }
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ addObjectsTab()

ilSkillTreeNodeGUI::addObjectsTab ( ilTabsGUI  $a_tabs)

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

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

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

591  : void
592  {
593  $lng = $this->lng;
594  $ilCtrl = $this->ctrl;
595 
596  $a_tabs->addTab(
597  "objects",
598  $lng->txt("skmg_assigned_objects"),
599  $ilCtrl->getLinkTarget($this, "showObjects")
600  );
601  }
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 306 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().

306  : void
307  {
308  $lng = $this->lng;
309 
310  // status
311  $radg = new ilRadioGroupInputGUI($lng->txt("skmg_status"), "status");
312  foreach (ilSkillTreeNode::getAllStatus() as $k => $op) {
313  $op = new ilRadioOption($op, (string) $k, ilSkillTreeNode::getStatusInfo($k));
314  $radg->addOption($op);
315  }
316  $radg->setValue((string) ilSkillTreeNode::STATUS_PUBLISH);
317  $a_form->addItem($radg);
318  }
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 559 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().

559  : void
560  {
561  $lng = $this->lng;
562  $ilCtrl = $this->ctrl;
563 
564  $a_tabs->addTab(
565  "usage",
566  $lng->txt("skmg_usage"),
567  $ilCtrl->getLinkTarget($this, "showUsage")
568  );
569  }
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 380 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

Referenced by save().

380  : void
381  {
382  $this->redirectToParent();
383  }
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 411 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, and ilCtrl\redirect().

Referenced by update().

411  : void
412  {
413  $ilCtrl = $this->ctrl;
414 
415  $ilCtrl->redirect($this, "editProperties");
416  }
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 252 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, and redirectToParent().

252  : void
253  {
254  $ilCtrl = $this->ctrl;
255 
256  $this->redirectToParent();
257  }
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 451 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

451  : void
452  {
453  $this->redirectToParent();
454  }
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 262 of file class.ilSkillTreeNodeGUI.php.

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

262  : void
263  {
264  $ilCtrl = $this->ctrl;
265 
266  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
267  return;
268  }
269 
270  $this->getParentGUI()->confirmedDelete(false);
271  $this->skill_tree_node_manager->saveChildsOrder(
272  $this->requested_node_id,
273  [],
274  $this->requested_tmpmode
275  );
276 
277  $this->redirectToParent();
278  }
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 222 of file class.ilSkillTreeNodeGUI.php.

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

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

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

290  : void
291  {
292  $lng = $this->lng;
293  $tpl = $this->tpl;
294  $tabs = $this->tabs;
295  $ilCtrl = $this->ctrl;
296 
298  $lng->txt("back"),
299  $ilCtrl->getLinkTarget($this, "redirectToParent")
300  );
301 
302  $this->initForm("create");
303  $tpl->setContent($this->form->getHTML());
304  }
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 182 of file class.ilSkillTreeNodeGUI.php.

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

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

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

171  : void
172  {
173  $ilCtrl = $this->ctrl;
174 
175  $ilCtrl->setParameter($this, "backcmd", $this->requested_backcmd);
176  $this->getParentGUI()->deleteNodes($this);
177  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ editProperties()

ilSkillTreeNodeGUI::editProperties ( )

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

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

320  : void
321  {
322  $tpl = $this->tpl;
323  $lng = $this->lng;
324 
325  if ($this->isInUse()) {
326  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
327  }
328 
329  $this->initForm("edit");
330  $this->getPropertyValues();
331  $tpl->setContent($this->form->getHTML());
332  }
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:

◆ getParentGUI()

ilSkillTreeNodeGUI::getParentGUI ( )

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

References $parentgui.

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

147  : object
148  {
149  return $this->parentgui;
150  }
+ Here is the caller graph for this function:

◆ getPropertyValues()

ilSkillTreeNodeGUI::getPropertyValues ( )

Get property values for edit form.

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

References ILIAS\Repository\form().

Referenced by editProperties().

337  : void
338  {
339  $values = [];
340 
341  $values["title"] = $this->node_object->getTitle();
342  $values["description"] = $this->node_object->getDescription();
343  $values["order_nr"] = $this->node_object->getOrderNr();
344  $values["self_eval"] = $this->node_object->getSelfEvaluation();
345  $values["status"] = (string) $this->node_object->getStatus();
346 
347  $this->form->setValuesByArray($values);
348  }
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 418 of file class.ilSkillTreeNodeGUI.php.

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

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

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

References redirectToParent().

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

References redirectToParent().

514  : void
515  {
516  $this->skill_tree_node_manager->insertItemsFromClip("scat", $this->requested_node_id);
517  $this->redirectToParent();
518  }
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 526 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

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

References redirectToParent().

532  : void
533  {
534  $this->skill_tree_node_manager->insertItemsFromClip("sctp", $this->requested_node_id);
535  $this->redirectToParent();
536  }
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 520 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

520  : void
521  {
522  $this->skill_tree_node_manager->insertItemsFromClip("sktr", $this->requested_node_id);
523  $this->redirectToParent();
524  }
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 124 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().

124  : bool
125  {
126  if (!is_object($this->node_object)) {
127  return false;
128  }
129  if ($this->use_checked) {
130  return $this->in_use;
131  }
132  $cskill_ids = ilSkillTreeNode::getAllCSkillIdsForNodeIds(array($this->node_object->getId()));
133  $usages = $this->usage_manager->getAllUsagesInfoOfSubtrees($cskill_ids);
134  if (count($usages) > 0) {
135  $this->in_use = true;
136  } else {
137  $this->in_use = false;
138  }
139  return $this->in_use;
140  }
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 155 of file class.ilSkillTreeNodeGUI.php.

References ilSkillTreeNodeFactory\getInstance().

Referenced by __construct().

155  : void
156  {
157  $this->node_object = ilSkillTreeNodeFactory::getInstance($a_node_id);
158  }
+ 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 459 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, and ilSkillTreeNode\_lookupType().

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

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

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

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

References $ctrl, and getParentGUI().

160  : void
161  {
162  $ilCtrl = $this->ctrl;
163 
164  $this->getParentGUI()->saveAllTitles(false);
165  $ilCtrl->redirect($this, "showOrganization");
166  }
+ Here is the call graph for this function:

◆ saveOrder()

ilSkillTreeNodeGUI::saveOrder ( )

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

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

491  : void
492  {
493  $lng = $this->lng;
494 
495  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
496  return;
497  }
498 
499  $this->skill_tree_node_manager->saveChildsOrder(
500  $this->requested_node_id,
501  $this->requested_node_order,
502  $this->requested_tmpmode
503  );
504  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
505  $this->redirectToParent($this->requested_tmpmode);
506  }
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 142 of file class.ilSkillTreeNodeGUI.php.

142  : void
143  {
144  $this->parentgui = $a_parentgui;
145  }

◆ setSkillNodeDescription()

ilSkillTreeNodeGUI::setSkillNodeDescription ( )

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

280  : void
281  {
282  $tpl = $this->tpl;
283 
284  $tpl->setDescription($this->skill_tree_node_manager->getWrittenPath($this->node_object->getId(), $this->tref_id));
285  }
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 538 of file class.ilSkillTreeNodeGUI.php.

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

538  : void
539  {
540  $tpl = $this->tpl;
541 
542  $obj_id = (is_object($this->node_object))
543  ? $this->node_object->getId()
544  : 0;
547  $obj_id,
548  $this->getType(),
549  "",
551  )
552  );
553  }
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 603 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, $tpl, redirectToParent(), ILIAS\UICore\GlobalTemplate\setContent(), and ILIAS\Repository\user().

603  : void
604  {
605  $tpl = $this->tpl;
606 
607  $this->setTabs("objects");
608 
609  $base_skill_id = ($this->base_skill_id > 0)
610  ? $this->base_skill_id
611  : $this->node_object->getId();
612  $objects = $this->usage_manager->getAssignedObjectsForSkill($base_skill_id, $this->tref_id);
613 
614  $table = $this->table_manager->getAssignedObjectsTable(
615  $this,
616  $objects,
618  $this->tref_id
619  )->getComponent();
620 
621  $tpl->setContent($this->ui_ren->render($table));
622  }
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 571 of file class.ilSkillTreeNodeGUI.php.

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

571  : void
572  {
573  $tpl = $this->tpl;
574 
575  $this->setTabs("usage");
576 
577  $base_skill_id = ($this->base_skill_id > 0)
578  ? $this->base_skill_id
579  : $this->node_object->getId();
580  $usages = $this->usage_manager->getAllUsagesInfoOfSubtree($base_skill_id, $this->tref_id);
581 
582  $html = "";
583  foreach ($usages as $k => $usage) {
584  $usages_ui = $this->skill_ui_service->getUsagesUI($k, $usage);
585  $html .= $usages_ui->render() . "<br/><br/>";
586  }
587 
588  $tpl->setContent($html);
589  }
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 390 of file class.ilSkillTreeNodeGUI.php.

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

390  : void
391  {
392  $tpl = $this->tpl;
393  $lng = $this->lng;
394  $ilCtrl = $this->ctrl;
395 
396  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
397  return;
398  }
399 
400  $this->initForm("edit");
401  if ($this->form->checkInput()) {
402  $this->updateItem();
403  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
404  $this->afterUpdate();
405  } else {
406  $this->form->setValuesByPost();
407  $tpl->setContent($this->form->getHTML());
408  }
409  }
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 53 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 69 of file class.ilSkillTreeNodeGUI.php.

◆ $ctrl

◆ $data_factory

DataFactory ilSkillTreeNodeGUI::$data_factory
protected

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

◆ $export_factory

ExportFactoryInterface ilSkillTreeNodeGUI::$export_factory
protected

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

◆ $form

◆ $in_use

bool ilSkillTreeNodeGUI::$in_use = false

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

Referenced by isInUse().

◆ $lng

◆ $locator

ilLocatorGUI ilSkillTreeNodeGUI::$locator
protected

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

◆ $node_object

object ilSkillTreeNodeGUI::$node_object = null

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

◆ $parentgui

object ilSkillTreeNodeGUI::$parentgui
protected

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

Referenced by getParentGUI().

◆ $requested_backcmd

string ilSkillTreeNodeGUI::$requested_backcmd = ""
protected

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

Referenced by copyItems(), and cutItems().

◆ $requested_node_order

array ilSkillTreeNodeGUI::$requested_node_order = []
protected

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

◆ $requested_ref_id

int ilSkillTreeNodeGUI::$requested_ref_id = 0
protected

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

◆ $requested_tmpmode

bool ilSkillTreeNodeGUI::$requested_tmpmode = false
protected

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

◆ $skill_tree_id

int ilSkillTreeNodeGUI::$skill_tree_id = 0
protected

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

◆ $skill_tree_node_manager

Node SkillTreeNodeManager ilSkillTreeNodeGUI::$skill_tree_node_manager
protected

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

◆ $skill_ui_service

SkillUIService ilSkillTreeNodeGUI::$skill_ui_service
protected

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

◆ $table_manager

Table TableManager ilSkillTreeNodeGUI::$table_manager
protected

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

◆ $tabs

ilTabsGUI ilSkillTreeNodeGUI::$tabs
protected

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

Referenced by create().

◆ $tpl

◆ $tree

ilTree ilSkillTreeNodeGUI::$tree
protected

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

◆ $tree_access_manager

SkillTreeAccess ilSkillTreeNodeGUI::$tree_access_manager
protected

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

◆ $tree_repo

ilSkillTreeRepository ilSkillTreeNodeGUI::$tree_repo
protected

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

◆ $tref_id

int ilSkillTreeNodeGUI::$tref_id = 0
protected

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

Referenced by setSkillNodeDescription().

◆ $ui_fac

UI Factory ilSkillTreeNodeGUI::$ui_fac
protected

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

◆ $ui_ren

UI Renderer ilSkillTreeNodeGUI::$ui_ren
protected

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

◆ $usage_manager

Usage SkillUsageManager ilSkillTreeNodeGUI::$usage_manager
protected

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

◆ $use_checked

bool ilSkillTreeNodeGUI::$use_checked = false

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

◆ $user

ilObjUser ilSkillTreeNodeGUI::$user
protected

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


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