ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilSkillTreeNodeGUI Class Reference

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

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

Public Member Functions

 ilSkillTreeNodeGUI ($a_node_id=0)
 constructor More...
 
 checkPermissionBool ($a_perm)
 Check permission pool. More...
 
 setParentGUI ($a_parentgui)
 Set Parent GUI class. More...
 
 getParentGUI ()
 Get Parent GUI class (ilObjSCORM2004LearningModuleGUI). More...
 
 readNodeObject ($a_node_id)
 Get node object instance. More...
 
 saveAllTitles ()
 Save Titles. More...
 
 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 ()
 cancel delete More...
 
 confirmedDelete ()
 confirmed delete More...
 
 setLocator ()
 Set Locator Items. More...
 
 setSkillNodeDescription ()
 Set skill node description. More...
 
 create ()
 Create skill tree node. More...
 
 addStatusInput (ilPropertyFormGUI $a_form)
 Add status input. More...
 
 editProperties ()
 Edit properties form. More...
 
 getPropertyValues ()
 Get property values for edit form. More...
 
 save ()
 Save skill tree node. More...
 
 afterSave ()
 After saving. More...
 
 update ()
 Update skill tree node. More...
 
 afterUpdate ()
 After update. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 cancelSave ()
 Cancel saving. More...
 
 redirectToParent ($a_tmp_mode=false)
 Redirect to parent (identified by current obj_id) More...
 
 saveOrder ()
 Save order. More...
 
 insertBasicSkillClip ()
 Insert basic skills from clipboard. More...
 
 insertSkillCategoryClip ()
 Insert skill categories from clipboard. More...
 
 insertTemplateReferenceClip ()
 Insert skill template references from clipboard. More...
 
 insertSkillTemplateClip ()
 Insert skill template from clipboard. More...
 
 insertTemplateCategoryClip ()
 Insert skill template category from clipboard. More...
 
 setTitleIcon ()
 Set title icon. More...
 
 addUsageTab ($a_tabs)
 Add usage tab. More...
 
 showUsage ()
 Show skill usage. More...
 

Data Fields

 $node_object
 
 $access
 
 $ref_id
 

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
Version
$Id$

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

Member Function Documentation

◆ addStatusInput()

ilSkillTreeNodeGUI::addStatusInput ( ilPropertyFormGUI  $a_form)

Add status input.

Parameters
ilPropertyFormGUI$a_formform

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

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

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

316  {
317  global $lng;
318 
319  // status
320  $radg = new ilRadioGroupInputGUI($lng->txt("skmg_status"), "status");
321  foreach (ilSkillTreeNode::getAllStatus() as $k => $op)
322  {
323  $op = new ilRadioOption($op, $k, ilSkillTreeNode::getStatusInfo($k));
324  $radg->addOption($op);
325  }
326  $a_form->addItem($radg);
327  }
This class represents an option in a radio group.
static getAllStatus()
Get all status.
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a property in a property form.
static getStatusInfo($a_status)
Get status info.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUsageTab()

ilSkillTreeNodeGUI::addUsageTab (   $a_tabs)

Add usage tab.

Parameters

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

References $ilCtrl, and $lng.

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

637  {
638  global $lng, $ilCtrl;
639 
640  $a_tabs->addTab("usage",
641  $lng->txt("skmg_usage"),
642  $ilCtrl->getLinkTarget($this, "showUsage"));
643  }
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ afterSave()

ilSkillTreeNodeGUI::afterSave ( )

After saving.

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

References redirectToParent().

Referenced by save().

389  {
390  $this->redirectToParent();
391  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterUpdate()

ilSkillTreeNodeGUI::afterUpdate ( )

After update.

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

References $ilCtrl.

Referenced by update().

425  {
426  global $ilCtrl;
427 
428  $ilCtrl->redirect($this, "editProperties");
429  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ cancelDelete()

ilSkillTreeNodeGUI::cancelDelete ( )

cancel delete

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

References $ilCtrl, and redirectToParent().

203  {
204  global $ilCtrl;
205 
206  $this->redirectToParent();
207  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ cancelSave()

ilSkillTreeNodeGUI::cancelSave ( )

Cancel saving.

Parameters

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

References redirectToParent().

484  {
485  $this->redirectToParent();
486  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
+ Here is the call graph for this function:

◆ checkPermissionBool()

◆ confirmedDelete()

ilSkillTreeNodeGUI::confirmedDelete ( )

confirmed delete

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

References $_GET, $ilCtrl, checkPermissionBool(), getParentGUI(), redirectToParent(), and ilSkillTreeNode\saveChildsOrder().

213  {
214  global $ilCtrl;
215 
216  if (!$this->checkPermissionBool("write"))
217  {
218  return;
219  }
220 
221  $this->getParentGUI()->confirmedDelete(false);
222  ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], array(),
223  $_GET["tmpmode"]);
224 
225  $this->redirectToParent();
226  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
getParentGUI()
Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
static saveChildsOrder($a_par_id, $a_childs_order, $a_templates=false)
Save childs order.
+ Here is the call graph for this function:

◆ copyItems()

ilSkillTreeNodeGUI::copyItems ( )

Copy items to clipboard.

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

References $_POST, $ilCtrl, $lng, ilSkillTreeNode\clipboardCopy(), redirectToParent(), ilUtil\sendInfo(), ilEditClipboard\setAction(), ilUtil\stripSlashesArray(), and ilSkillTreeNode\uniqueTypesCheck().

161  {
162  global $ilCtrl, $lng;
163 
164  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
165  {
166  $this->redirectToParent();
167  }
168 
169  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
170 
171  $items = ilUtil::stripSlashesArray($_POST["id"]);
172  $todel = array(); // delete IDs < 0 (needed for non-js editing)
173  foreach($items as $k => $item)
174  {
175  if ($item < 0)
176  {
177  $todel[] = $k;
178  }
179  }
180  foreach($todel as $k)
181  {
182  unset($items[$k]);
183  }
185  {
186  ilUtil::sendInfo($lng->txt("skmg_insert_please_choose_one_type_only"), true);
187  $this->redirectToParent();
188  }
190 
191  // @todo: move this to a service since it can be used here, too
192  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
194  ilUtil::sendInfo($lng->txt("skmg_selected_items_have_been_copied"), true);
195 
196  $this->redirectToParent();
197  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static uniqueTypesCheck($a_items)
Check for unique types.
static clipboardCopy($a_tree_id, $a_ids)
Copy a set of skills/skill categories into the clipboard.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ create()

ilSkillTreeNodeGUI::create ( )

Create skill tree node.

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

References $tpl, and initForm().

303  {
304  global $tpl;
305 
306  $this->initForm("create");
307  $tpl->setContent($this->form->getHTML());
308  }
global $tpl
Definition: ilias.php:8
initForm($a_mode="edit")
Init form.
+ 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 113 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $_POST, $ilCtrl, $lng, ilSkillTreeNode\clipboardCut(), redirectToParent(), ilSkillTreeNode\saveChildsOrder(), ilUtil\sendInfo(), ilEditClipboard\setAction(), ilUtil\stripSlashesArray(), and ilSkillTreeNode\uniqueTypesCheck().

114  {
115  global $ilCtrl, $lng;
116 
117  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
118 
119  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
120  {
121  $this->redirectToParent();
122  }
123 
124  $items = ilUtil::stripSlashesArray($_POST["id"]);
125  $todel = array(); // delete IDs < 0 (needed for non-js editing)
126  foreach($items as $k => $item)
127  {
128  if ($item < 0)
129  {
130  $todel[] = $k;
131  }
132  }
133  foreach($todel as $k)
134  {
135  unset($items[$k]);
136  }
137 
139  {
140  ilUtil::sendInfo($lng->txt("skmg_insert_please_choose_one_type_only"), true);
141  $this->redirectToParent();
142  }
143 
145 
146  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
148 
149  ilUtil::sendInfo($lng->txt("skmg_selected_items_have_been_cut"), true);
150 
151  ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], array(),
152  $_GET["tmpmode"]);
153 
154  $this->redirectToParent();
155  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static uniqueTypesCheck($a_items)
Check for unique types.
static saveChildsOrder($a_par_id, $a_childs_order, $a_templates=false)
Save childs order.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
clipboardCut($a_tree_id, $a_ids)
Cut and copy a set of skills/skill categories into the clipboard.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ deleteNodes()

ilSkillTreeNodeGUI::deleteNodes ( )

Delete nodes in the hierarchy.

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

References $_GET, $ilCtrl, and getParentGUI().

103  {
104  global $ilCtrl;
105 
106  $ilCtrl->setParameter($this, "backcmd", $_GET["backcmd"]);
107  $this->getParentGUI()->deleteNodes($this);
108  }
$_GET["client_id"]
getParentGUI()
Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ editProperties()

ilSkillTreeNodeGUI::editProperties ( )

Edit properties form.

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

References $tpl, getPropertyValues(), and initForm().

333  {
334  global $tpl;
335 
336  $this->initForm("edit");
337  $this->getPropertyValues();
338  $tpl->setContent($this->form->getHTML());
339  }
getPropertyValues()
Get property values for edit form.
global $tpl
Definition: ilias.php:8
initForm($a_mode="edit")
Init form.
+ Here is the call graph for this function:

◆ getParentGUI()

ilSkillTreeNodeGUI::getParentGUI ( )

Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).

Returns
object Parent GUI class

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

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

75  {
76  return $this->parentgui;
77  }
+ Here is the caller graph for this function:

◆ getPropertyValues()

ilSkillTreeNodeGUI::getPropertyValues ( )

Get property values for edit form.

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

Referenced by editProperties().

345  {
346  $values = array();
347 
348  $values["title"] = $this->node_object->getTitle();
349  $values["order_nr"] = $this->node_object->getOrderNr();
350  $values["self_eval"] = $this->node_object->getSelfEvaluation();
351  $values["status"] = $this->node_object->getStatus();
352 
353  $this->form->setValuesByArray($values);
354  }
+ Here is the caller graph for this function:

◆ ilSkillTreeNodeGUI()

ilSkillTreeNodeGUI::ilSkillTreeNodeGUI (   $a_node_id = 0)

constructor

Parameters
object$a_content_objnode object

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

References $_GET, ilSkillTreeNode\_lookupType(), and readNodeObject().

33  {
34  global $ilAccess;
35 
36  $this->node_object = null;
37  $this->access = $ilAccess;
38  $this->ref_id = (int) $_GET["ref_id"];
39 
40  if ($a_node_id > 0 &&
41  $this->getType() == ilSkillTreeNode::_lookupType($a_node_id))
42  {
43  $this->readNodeObject((int) $a_node_id);
44  }
45  }
readNodeObject($a_node_id)
Get node object instance.
$_GET["client_id"]
static _lookupType($a_obj_id)
Lookup Type.
+ Here is the call graph for this function:

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

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

References $_GET, $ilCtrl, $lng, checkPermissionBool(), ilNumberInputGUI\setMaxLength(), and ilTextInputGUI\setMaxLength().

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

437  {
438  global $lng, $ilCtrl;
439 
440  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
441  $this->form = new ilPropertyFormGUI();
442 
443  // title
444  $ti = new ilTextInputGUI($lng->txt("title"), "title");
445  $ti->setMaxLength(200);
446  $ti->setSize(50);
447  $ti->setRequired(true);
448  $this->form->addItem($ti);
449 
450  // order nr
451  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
452  $ni->setMaxLength(6);
453  $ni->setSize(6);
454  $ni->setRequired(true);
455  $this->form->addItem($ni);
456 
457  // save and cancel commands
458  if ($this->checkPermissionBool("write"))
459  {
460  if ($a_mode == "create")
461  {
462  $this->form->addCommandButton("save", $lng->txt("save"));
463  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
464  $this->form->setTitle($lng->txt("skmg_create_" . $this->getType()));
465  } else
466  {
467  $this->form->addCommandButton("update", $lng->txt("save"));
468  $this->form->setTitle($lng->txt("skmg_edit_" . $this->getType()));
469  }
470  }
471 
472  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
473  $this->form->setFormAction($ilCtrl->getFormAction($this));
474 
475  }
This class represents a property form user interface.
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
This class represents a number property in a property form.
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
setMaxLength($a_maxlength)
Set Max Length.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertBasicSkillClip()

ilSkillTreeNodeGUI::insertBasicSkillClip ( )

Insert basic skills from clipboard.

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

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

554  {
555  global $ilCtrl, $ilUser;
556 
557  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
558  $nodes = ilSkillTreeNode::insertItemsFromClip("skll", (int) $_GET["obj_id"]);
559  $this->redirectToParent();
560  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
static insertItemsFromClip($a_type, $a_obj_id)
Insert basic skills from clipboard.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ insertSkillCategoryClip()

ilSkillTreeNodeGUI::insertSkillCategoryClip ( )

Insert skill categories from clipboard.

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

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

566  {
567  global $ilCtrl, $ilUser;
568 
569  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
570  $nodes = ilSkillTreeNode::insertItemsFromClip("scat", (int) $_GET["obj_id"]);
571  $this->redirectToParent();
572  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
static insertItemsFromClip($a_type, $a_obj_id)
Insert basic skills from clipboard.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ insertSkillTemplateClip()

ilSkillTreeNodeGUI::insertSkillTemplateClip ( )

Insert skill template from clipboard.

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

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

590  {
591  global $ilCtrl, $ilUser;
592 
593  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
594  $nodes = ilSkillTreeNode::insertItemsFromClip("sktp", (int) $_GET["obj_id"]);
595  $this->redirectToParent();
596  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
static insertItemsFromClip($a_type, $a_obj_id)
Insert basic skills from clipboard.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ insertTemplateCategoryClip()

ilSkillTreeNodeGUI::insertTemplateCategoryClip ( )

Insert skill template category from clipboard.

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

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

602  {
603  global $ilCtrl, $ilUser;
604 
605  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
606  $nodes = ilSkillTreeNode::insertItemsFromClip("sctp", (int) $_GET["obj_id"]);
607  $this->redirectToParent();
608  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
static insertItemsFromClip($a_type, $a_obj_id)
Insert basic skills from clipboard.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ insertTemplateReferenceClip()

ilSkillTreeNodeGUI::insertTemplateReferenceClip ( )

Insert skill template references from clipboard.

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

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

578  {
579  global $ilCtrl, $ilUser;
580 
581  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
582  $nodes = ilSkillTreeNode::insertItemsFromClip("sktr", (int) $_GET["obj_id"]);
583  $this->redirectToParent();
584  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
static insertItemsFromClip($a_type, $a_obj_id)
Insert basic skills from clipboard.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ readNodeObject()

ilSkillTreeNodeGUI::readNodeObject (   $a_node_id)

Get node object instance.

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

References ilSkillTreeNodeFactory\getInstance().

Referenced by ilSkillTreeNodeGUI().

83  {
84  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
85  $this->node_object = ilSkillTreeNodeFactory::getInstance($a_node_id);
86  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectToParent()

ilSkillTreeNodeGUI::redirectToParent (   $a_tmp_mode = false)

Redirect to parent (identified by current obj_id)

Parameters

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

References $_GET, $ilCtrl, $t, and ilSkillTreeNode\_lookupType().

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

495  {
496  global $ilCtrl;
497 
498  if ($_GET["tmpmode"])
499  {
500  $a_tmp_mode = true;
501  }
502 
503  $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
504 
505  switch ($t)
506  {
507  case "skrt":
508  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
509  if ($a_tmp_mode)
510  {
511  $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
512  }
513  else
514  {
515  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
516  }
517  break;
518 
519  case "sctp":
520  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", (int) $_GET["obj_id"]);
521  $ilCtrl->redirectByClass("ilskilltemplatecategorygui", "listItems");
522  break;
523 
524  case "scat":
525  $ilCtrl->setParameterByClass("ilskillcategorygui", "obj_id", (int) $_GET["obj_id"]);
526  $ilCtrl->redirectByClass("ilskillcategorygui", "listItems");
527  break;
528  }
529 
530  }
$_GET["client_id"]
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
+ 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 360 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, afterSave(), checkPermissionBool(), initForm(), ilSkillTreeNode\saveChildsOrder(), and ilUtil\sendSuccess().

361  {
362  global $tpl, $lng, $ilCtrl;
363 
364  if (!$this->checkPermissionBool("write"))
365  {
366  return;
367  }
368 
369  $this->initForm("create");
370  if ($this->form->checkInput())
371  {
372  $this->saveItem();
373  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
374  ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], array(),
375  in_array($this->getType(), array("sktp", "sctp")));
376  $this->afterSave();
377  }
378  else
379  {
380  $this->form->setValuesByPost();
381  $tpl->setContent($this->form->getHtml());
382  }
383  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
initForm($a_mode="edit")
Init form.
static saveChildsOrder($a_par_id, $a_childs_order, $a_templates=false)
Save childs order.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ saveAllTitles()

ilSkillTreeNodeGUI::saveAllTitles ( )

Save Titles.

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

References $ilCtrl, and getParentGUI().

92  {
93  global $ilCtrl;
94 
95  $this->getParentGUI()->saveAllTitles(false);
96  $ilCtrl->redirect($this, "showOrganization");
97  }
getParentGUI()
Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ saveOrder()

ilSkillTreeNodeGUI::saveOrder ( )

Save order.

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

References $_GET, $_POST, $ilCtrl, $lng, checkPermissionBool(), redirectToParent(), ilSkillTreeNode\saveChildsOrder(), and ilUtil\sendSuccess().

536  {
537  global $ilCtrl, $lng;
538 
539  if (!$this->checkPermissionBool("write"))
540  {
541  return;
542  }
543 
544  ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], $_POST["order"],
545  (int) $_GET["tmpmode"]);
546  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
547  $this->redirectToParent((int) $_GET["tmpmode"]);
548  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
static saveChildsOrder($a_par_id, $a_childs_order, $a_templates=false)
Save childs order.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ setLocator()

ilSkillTreeNodeGUI::setLocator ( )

Set Locator Items.

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

References $_GET, $ilCtrl, $path, $tpl, ilUtil\getImagePath(), and getParentGUI().

Referenced by ilBasicSkillGUI\showProperties().

232  {
233  global $ilLocator, $tpl, $ilCtrl;
234 
235  $ilLocator->addRepositoryItems($_GET["ref_id"]);
236  $this->getParentGUI()->addLocatorItems();
237 
238  if ($_GET["obj_id"] > 0)
239  {
240  include_once("./Services/Skill/classes/class.ilSkillTree.php");
241  $tree = new ilSkillTree();
242  $path = $tree->getPathFull($_GET["obj_id"]);
243  for( $i = 1; $i < count($path); $i++)
244  {
245  switch($path[$i]["type"])
246  {
247  case "scat":
248  $ilCtrl->setParameterByClass("ilskillcategorygui", "obj_id",
249  $path[$i]["child"]);
250  $ilLocator->addItem($path[$i]["title"],
251  $ilCtrl->getLinkTargetByClass("ilskillmanagementgui",
252  "ilskillcategorygui"), "", 0, $path[$i]["type"],
253  ilUtil::getImagePath("icon_skmg.svg"));
254  break;
255 
256  case "skll":
257  $ilCtrl->setParameterByClass("ilbasicskillgui", "obj_id",
258  $path[$i]["child"]);
259  $ilLocator->addItem($path[$i]["title"],
260  $ilCtrl->getLinkTargetByClass("ilskillmanagementgui",
261  "ilbasicskillgui"), "", 0, $path[$i]["type"],
262  ilUtil::getImagePath("icon_skmg.svg"));
263  break;
264 
265  }
266  }
267  }
268  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
269 
270  $tpl->setLocator();
271  }
Skill tree.
$_GET["client_id"]
getParentGUI()
Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setParentGUI()

ilSkillTreeNodeGUI::setParentGUI (   $a_parentgui)

Set Parent GUI class.

Parameters
object$a_parentguiParent GUI class

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

65  {
66  $this->parentgui = $a_parentgui;
67  }

◆ setSkillNodeDescription()

ilSkillTreeNodeGUI::setSkillNodeDescription ( )

Set skill node description.

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

References $path, and $tpl.

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

277  {
278  global $tpl;
279 
280  if (is_object($this->node_object))
281  {
282  include_once("./Services/Skill/classes/class.ilSkillTree.php");
283  $tree = new ilSkillTree();
284  $path = $this->node_object->skill_tree->getSkillTreePath($this->node_object->getId(),
285  $this->tref_id);
286  $desc = "";
287  foreach ($path as $p)
288  {
289  if (in_array($p["type"], array("scat", "skll", "sktr")))
290  {
291  $desc.= $sep.$p["title"];
292  $sep = " > ";
293  }
294  }
295  }
296  $tpl->setDescription($desc);
297  }
Skill tree.
global $tpl
Definition: ilias.php:8
$path
Definition: index.php:22
+ Here is the caller graph for this function:

◆ setTitleIcon()

ilSkillTreeNodeGUI::setTitleIcon ( )

Set title icon.

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

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

614  {
615  global $tpl;
616 
617  $obj_id = (is_object($this->node_object))
618  ? $this->node_object->getId()
619  :0;
620  $tpl->setTitleIcon(
622  $obj_id, $this->getType(), "",
624  }
static getIconPath($a_obj_id, $a_type, $a_size="", $a_status=0)
Get icon path.
global $tpl
Definition: ilias.php:8
static _lookupStatus($a_obj_id)
Lookup Status.
+ Here is the call graph for this function:

◆ showUsage()

ilSkillTreeNodeGUI::showUsage ( )

Show skill usage.

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

References $html, $tab, and $tpl.

650  {
651  global $tpl;
652 
653  $this->setTabs("usage");
654 
655  include_once("./Services/Skill/classes/class.ilSkillUsage.php");
656  $usage_info = new ilSkillUsage();
657  $base_skill_id = ($this->base_skill_id > 0)
658  ? $this->base_skill_id
659  : $this->node_object->getId();
660  $usages = $usage_info->getAllUsagesInfoOfSubtree($base_skill_id.":".$this->tref_id);
661 
662  $html = "";
663  include_once("./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
664  foreach ($usages as $k => $usage)
665  {
666  $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
667  $html.= $tab->getHTML()."<br/><br/>";
668  }
669 
670  $tpl->setContent($html);
671  }
global $tpl
Definition: ilias.php:8
TableGUI class for skill usages.
Skill usage.
$html
Definition: example_001.php:87

◆ update()

ilSkillTreeNodeGUI::update ( )

Update skill tree node.

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

References $ilCtrl, $lng, $tpl, afterUpdate(), checkPermissionBool(), initForm(), and ilUtil\sendSuccess().

399  {
400  global $tpl, $lng, $ilCtrl;
401 
402  if (!$this->checkPermissionBool("write"))
403  {
404  return;
405  }
406 
407  $this->initForm("edit");
408  if ($this->form->checkInput())
409  {
410  $this->updateItem();
411  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
412  $this->afterUpdate();
413  }
414  else
415  {
416  $this->form->setValuesByPost();
417  $tpl->setContent($this->form->getHtml());
418  }
419  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $tpl
Definition: ilias.php:8
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
initForm($a_mode="edit")
Init form.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilSkillTreeNodeGUI::$access

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

◆ $node_object

ilSkillTreeNodeGUI::$node_object

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

◆ $ref_id

ilSkillTreeNodeGUI::$ref_id

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

Referenced by ilBasicSkillGUI\saveLevelResource().


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