ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSkillTreeNodeGUI Class Reference

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

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

Public Member Functions

 __construct ($a_node_id=0)
 constructor More...
 
 isInUse ()
 Is in use? 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...
 
 exportSelectedNodes ()
 Export seleced nodes. More...
 

Data Fields

 $node_object
 
 $in_use = false
 
 $use_checked = false
 
 $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.

Constructor & Destructor Documentation

◆ __construct()

ilSkillTreeNodeGUI::__construct (   $a_node_id = 0)

constructor

Parameters
object$a_content_objnode object

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

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

35  {
36  global $ilAccess;
37 
38  $this->node_object = null;
39  $this->access = $ilAccess;
40  $this->ref_id = (int) $_GET["ref_id"];
41 
42  if ($a_node_id > 0 &&
43  $this->getType() == ilSkillTreeNode::_lookupType($a_node_id))
44  {
45  $this->readNodeObject((int) $a_node_id);
46  }
47  }
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:

Member Function Documentation

◆ addStatusInput()

ilSkillTreeNodeGUI::addStatusInput ( ilPropertyFormGUI  $a_form)

Add status input.

Parameters
ilPropertyFormGUI$a_formform

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

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

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

348  {
349  global $lng;
350 
351  // status
352  $radg = new ilRadioGroupInputGUI($lng->txt("skmg_status"), "status");
353  foreach (ilSkillTreeNode::getAllStatus() as $k => $op)
354  {
355  $op = new ilRadioOption($op, $k, ilSkillTreeNode::getStatusInfo($k));
356  $radg->addOption($op);
357  }
358  $a_form->addItem($radg);
359  }
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:17
+ 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 673 of file class.ilSkillTreeNodeGUI.php.

References $ilCtrl, and $lng.

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

674  {
675  global $lng, $ilCtrl;
676 
677  $a_tabs->addTab("usage",
678  $lng->txt("skmg_usage"),
679  $ilCtrl->getLinkTarget($this, "showUsage"));
680  }
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ afterSave()

ilSkillTreeNodeGUI::afterSave ( )

After saving.

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

References redirectToParent().

Referenced by save().

426  {
427  $this->redirectToParent();
428  }
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 461 of file class.ilSkillTreeNodeGUI.php.

References $ilCtrl.

Referenced by update().

462  {
463  global $ilCtrl;
464 
465  $ilCtrl->redirect($this, "editProperties");
466  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ cancelDelete()

ilSkillTreeNodeGUI::cancelDelete ( )

cancel delete

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

References $ilCtrl, and redirectToParent().

235  {
236  global $ilCtrl;
237 
238  $this->redirectToParent();
239  }
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 520 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

521  {
522  $this->redirectToParent();
523  }
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 244 of file class.ilSkillTreeNodeGUI.php.

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

245  {
246  global $ilCtrl;
247 
248  if (!$this->checkPermissionBool("write"))
249  {
250  return;
251  }
252 
253  $this->getParentGUI()->confirmedDelete(false);
254  ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], array(),
255  $_GET["tmpmode"]);
256 
257  $this->redirectToParent();
258  }
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
Create styles array
The data for the language used.
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 192 of file class.ilSkillTreeNodeGUI.php.

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

193  {
194  global $ilCtrl, $lng;
195 
196  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
197  {
198  $this->redirectToParent();
199  }
200 
201  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
202 
203  $items = ilUtil::stripSlashesArray($_POST["id"]);
204  $todel = array(); // delete IDs < 0 (needed for non-js editing)
205  foreach($items as $k => $item)
206  {
207  if ($item < 0)
208  {
209  $todel[] = $k;
210  }
211  }
212  foreach($todel as $k)
213  {
214  unset($items[$k]);
215  }
217  {
218  ilUtil::sendInfo($lng->txt("skmg_insert_please_choose_one_type_only"), true);
219  $this->redirectToParent();
220  }
222 
223  // @todo: move this to a service since it can be used here, too
224  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
226  ilUtil::sendInfo($lng->txt("skmg_selected_items_have_been_copied"), true);
227 
228  $this->redirectToParent();
229  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_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 clipboardCopy($a_tree_id, $a_ids)
Copy a set of skills/skill categories into the clipboard.
Create styles array
The data for the language used.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
global $lng
Definition: privfeed.php:17
static setAction($a_action)
$_POST["username"]
+ Here is the call graph for this function:

◆ create()

ilSkillTreeNodeGUI::create ( )

Create skill tree node.

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

References $tpl, and initForm().

335  {
336  global $tpl;
337 
338  $this->initForm("create");
339  $tpl->setContent($this->form->getHTML());
340  }
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 145 of file class.ilSkillTreeNodeGUI.php.

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

146  {
147  global $ilCtrl, $lng;
148 
149  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
150 
151  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
152  {
153  $this->redirectToParent();
154  }
155 
156  $items = ilUtil::stripSlashesArray($_POST["id"]);
157  $todel = array(); // delete IDs < 0 (needed for non-js editing)
158  foreach($items as $k => $item)
159  {
160  if ($item < 0)
161  {
162  $todel[] = $k;
163  }
164  }
165  foreach($todel as $k)
166  {
167  unset($items[$k]);
168  }
169 
171  {
172  ilUtil::sendInfo($lng->txt("skmg_insert_please_choose_one_type_only"), true);
173  $this->redirectToParent();
174  }
175 
177 
178  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
180 
181  ilUtil::sendInfo($lng->txt("skmg_selected_items_have_been_cut"), true);
182 
183  ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], array(),
184  $_GET["tmpmode"]);
185 
186  $this->redirectToParent();
187  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
static clipboardCut($a_tree_id, $a_ids)
Cut and copy a set of skills/skill categories into the clipboard.
$_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.
Create styles array
The data for the language used.
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.
global $lng
Definition: privfeed.php:17
static setAction($a_action)
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteNodes()

ilSkillTreeNodeGUI::deleteNodes ( )

Delete nodes in the hierarchy.

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

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

135  {
136  global $ilCtrl;
137 
138  $ilCtrl->setParameter($this, "backcmd", $_GET["backcmd"]);
139  $this->getParentGUI()->deleteNodes($this);
140  }
$_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 364 of file class.ilSkillTreeNodeGUI.php.

References $lng, $tpl, getPropertyValues(), initForm(), isInUse(), and ilUtil\sendInfo().

365  {
366  global $tpl, $lng;
367 
368  if ($this->isInUse())
369  {
370  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
371  }
372 
373  $this->initForm("edit");
374  $this->getPropertyValues();
375  $tpl->setContent($this->form->getHTML());
376  }
getPropertyValues()
Get property values for edit form.
global $tpl
Definition: ilias.php:8
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initForm($a_mode="edit")
Init form.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ exportSelectedNodes()

ilSkillTreeNodeGUI::exportSelectedNodes ( )

Export seleced nodes.

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

References $_GET, $_POST, $ilCtrl, ilObject\_lookupObjId(), array, and redirectToParent().

714  {
715  global $ilCtrl;
716 
717  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
718  {
719  $this->redirectToParent();
720  }
721 
722  include_once("./Services/Export/classes/class.ilExport.php");
723  $exp = new ilExport();
724  $conf = $exp->getConfig("Services/Skill");
725  $conf->setSelectedNodes($_POST["id"]);
726  $exp->exportObject("skmg", ilObject::_lookupObjId((int) $_GET["ref_id"]));
727 
728  $ilCtrl->redirectByClass(array("iladministrationgui", "ilobjskillmanagementgui", "ilexportgui"), "");
729  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:

◆ getParentGUI()

ilSkillTreeNodeGUI::getParentGUI ( )

Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).

Returns
object Parent GUI class

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

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

107  {
108  return $this->parentgui;
109  }
+ Here is the caller graph for this function:

◆ getPropertyValues()

ilSkillTreeNodeGUI::getPropertyValues ( )

Get property values for edit form.

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

References array.

Referenced by editProperties().

382  {
383  $values = array();
384 
385  $values["title"] = $this->node_object->getTitle();
386  $values["order_nr"] = $this->node_object->getOrderNr();
387  $values["self_eval"] = $this->node_object->getSelfEvaluation();
388  $values["status"] = $this->node_object->getStatus();
389 
390  $this->form->setValuesByArray($values);
391  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

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

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

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

474  {
475  global $lng, $ilCtrl;
476 
477  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
478  $this->form = new ilPropertyFormGUI();
479 
480  // title
481  $ti = new ilTextInputGUI($lng->txt("title"), "title");
482  $ti->setMaxLength(200);
483  $ti->setSize(50);
484  $ti->setRequired(true);
485  $this->form->addItem($ti);
486 
487  // order nr
488  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
489  $ni->setMaxLength(6);
490  $ni->setSize(6);
491  $ni->setRequired(true);
492  $this->form->addItem($ni);
493 
494  // save and cancel commands
495  if ($this->checkPermissionBool("write"))
496  {
497  if ($a_mode == "create")
498  {
499  $this->form->addCommandButton("save", $lng->txt("save"));
500  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
501  $this->form->setTitle($lng->txt("skmg_create_" . $this->getType()));
502  } else
503  {
504  $this->form->addCommandButton("update", $lng->txt("save"));
505  $this->form->setTitle($lng->txt("skmg_edit_" . $this->getType()));
506  }
507  }
508 
509  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
510  $this->form->setFormAction($ilCtrl->getFormAction($this));
511 
512  }
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:17
+ 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 590 of file class.ilSkillTreeNodeGUI.php.

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

591  {
592  global $ilCtrl, $ilUser;
593 
594  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
595  $nodes = ilSkillTreeNode::insertItemsFromClip("skll", (int) $_GET["obj_id"]);
596  $this->redirectToParent();
597  }
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
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ insertSkillCategoryClip()

ilSkillTreeNodeGUI::insertSkillCategoryClip ( )

Insert skill categories from clipboard.

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

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

603  {
604  global $ilCtrl, $ilUser;
605 
606  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
607  $nodes = ilSkillTreeNode::insertItemsFromClip("scat", (int) $_GET["obj_id"]);
608  $this->redirectToParent();
609  }
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
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ insertSkillTemplateClip()

ilSkillTreeNodeGUI::insertSkillTemplateClip ( )

Insert skill template from clipboard.

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

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

627  {
628  global $ilCtrl, $ilUser;
629 
630  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
631  $nodes = ilSkillTreeNode::insertItemsFromClip("sktp", (int) $_GET["obj_id"]);
632  $this->redirectToParent();
633  }
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
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ insertTemplateCategoryClip()

ilSkillTreeNodeGUI::insertTemplateCategoryClip ( )

Insert skill template category from clipboard.

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

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

639  {
640  global $ilCtrl, $ilUser;
641 
642  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
643  $nodes = ilSkillTreeNode::insertItemsFromClip("sctp", (int) $_GET["obj_id"]);
644  $this->redirectToParent();
645  }
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
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ insertTemplateReferenceClip()

ilSkillTreeNodeGUI::insertTemplateReferenceClip ( )

Insert skill template references from clipboard.

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

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

615  {
616  global $ilCtrl, $ilUser;
617 
618  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
619  $nodes = ilSkillTreeNode::insertItemsFromClip("sktr", (int) $_GET["obj_id"]);
620  $this->redirectToParent();
621  }
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
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ isInUse()

ilSkillTreeNodeGUI::isInUse ( )

Is in use?

Parameters

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

References $in_use, array, and ilSkillTreeNode\getAllCSkillIdsForNodeIds().

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

56  {
57  if (!is_object($this->node_object))
58  {
59  return false;
60  }
61  if ($this->use_checked)
62  {
63  return $this->in_use;
64  }
65  $cskill_ids = ilSkillTreeNode::getAllCSkillIdsForNodeIds(array($this->node_object->getId()));
66  include_once("./Services/Skill/classes/class.ilSkillUsage.php");
67  $u = new ilSkillUsage();
68  $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
69  if (count($usages) > 0)
70  {
71  $this->in_use = true;
72  } else
73  {
74  $this->in_use = false;
75  }
76  return $this->in_use;
77  }
static getAllCSkillIdsForNodeIds(array $a_node_ids)
Get all possible common skill IDs for node IDs.
Create styles array
The data for the language used.
Skill usage.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readNodeObject()

ilSkillTreeNodeGUI::readNodeObject (   $a_node_id)

Get node object instance.

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

References ilSkillTreeNodeFactory\getInstance().

Referenced by __construct().

115  {
116  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
117  $this->node_object = ilSkillTreeNodeFactory::getInstance($a_node_id);
118  }
+ 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 531 of file class.ilSkillTreeNodeGUI.php.

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

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

532  {
533  global $ilCtrl;
534 
535  if ($_GET["tmpmode"])
536  {
537  $a_tmp_mode = true;
538  }
539 
540  $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
541 
542  switch ($t)
543  {
544  case "skrt":
545  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
546  if ($a_tmp_mode)
547  {
548  $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
549  }
550  else
551  {
552  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
553  }
554  break;
555 
556  case "sctp":
557  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", (int) $_GET["obj_id"]);
558  $ilCtrl->redirectByClass("ilskilltemplatecategorygui", "listItems");
559  break;
560 
561  case "scat":
562  $ilCtrl->setParameterByClass("ilskillcategorygui", "obj_id", (int) $_GET["obj_id"]);
563  $ilCtrl->redirectByClass("ilskillcategorygui", "listItems");
564  break;
565  }
566 
567  }
$_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 397 of file class.ilSkillTreeNodeGUI.php.

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

398  {
399  global $tpl, $lng, $ilCtrl;
400 
401  if (!$this->checkPermissionBool("write"))
402  {
403  return;
404  }
405 
406  $this->initForm("create");
407  if ($this->form->checkInput())
408  {
409  $this->saveItem();
410  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
411  ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], array(),
412  in_array($this->getType(), array("sktp", "sctp")));
413  $this->afterSave();
414  }
415  else
416  {
417  $this->form->setValuesByPost();
418  $tpl->setContent($this->form->getHtml());
419  }
420  }
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.
Create styles array
The data for the language used.
static saveChildsOrder($a_par_id, $a_childs_order, $a_templates=false)
Save childs order.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ saveAllTitles()

ilSkillTreeNodeGUI::saveAllTitles ( )

Save Titles.

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

References $ilCtrl, and getParentGUI().

124  {
125  global $ilCtrl;
126 
127  $this->getParentGUI()->saveAllTitles(false);
128  $ilCtrl->redirect($this, "showOrganization");
129  }
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 572 of file class.ilSkillTreeNodeGUI.php.

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

573  {
574  global $ilCtrl, $lng;
575 
576  if (!$this->checkPermissionBool("write"))
577  {
578  return;
579  }
580 
581  ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], $_POST["order"],
582  (int) $_GET["tmpmode"]);
583  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
584  $this->redirectToParent((int) $_GET["tmpmode"]);
585  }
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)
$_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:17
$_POST["username"]
+ Here is the call graph for this function:

◆ setLocator()

ilSkillTreeNodeGUI::setLocator ( )

Set Locator Items.

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

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

Referenced by ilBasicSkillGUI\showProperties().

264  {
265  global $ilLocator, $tpl, $ilCtrl;
266 
267  $ilLocator->addRepositoryItems($_GET["ref_id"]);
268  $this->getParentGUI()->addLocatorItems();
269 
270  if ($_GET["obj_id"] > 0)
271  {
272  include_once("./Services/Skill/classes/class.ilSkillTree.php");
273  $tree = new ilSkillTree();
274  $path = $tree->getPathFull($_GET["obj_id"]);
275  for( $i = 1; $i < count($path); $i++)
276  {
277  switch($path[$i]["type"])
278  {
279  case "scat":
280  $ilCtrl->setParameterByClass("ilskillcategorygui", "obj_id",
281  $path[$i]["child"]);
282  $ilLocator->addItem($path[$i]["title"],
283  $ilCtrl->getLinkTargetByClass("ilskillmanagementgui",
284  "ilskillcategorygui"), "", 0, $path[$i]["type"],
285  ilUtil::getImagePath("icon_skmg.svg"));
286  break;
287 
288  case "skll":
289  $ilCtrl->setParameterByClass("ilbasicskillgui", "obj_id",
290  $path[$i]["child"]);
291  $ilLocator->addItem($path[$i]["title"],
292  $ilCtrl->getLinkTargetByClass("ilskillmanagementgui",
293  "ilbasicskillgui"), "", 0, $path[$i]["type"],
294  ilUtil::getImagePath("icon_skmg.svg"));
295  break;
296 
297  }
298  }
299  }
300  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
301 
302  $tpl->setLocator();
303  }
$path
Definition: aliased.php:25
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)
+ 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 96 of file class.ilSkillTreeNodeGUI.php.

97  {
98  $this->parentgui = $a_parentgui;
99  }

◆ setSkillNodeDescription()

ilSkillTreeNodeGUI::setSkillNodeDescription ( )

Set skill node description.

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

References $path, $tpl, and array.

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

309  {
310  global $tpl;
311 
312  if (is_object($this->node_object))
313  {
314  include_once("./Services/Skill/classes/class.ilSkillTree.php");
315  $tree = new ilSkillTree();
316  $path = $this->node_object->skill_tree->getSkillTreePath($this->node_object->getId(),
317  $this->tref_id);
318  $desc = "";
319  foreach ($path as $p)
320  {
321  if (in_array($p["type"], array("scat", "skll", "sktr")))
322  {
323  $desc.= $sep.$p["title"];
324  $sep = " > ";
325  }
326  }
327  }
328  $tpl->setDescription($desc);
329  }
$path
Definition: aliased.php:25
Skill tree.
global $tpl
Definition: ilias.php:8
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ setTitleIcon()

ilSkillTreeNodeGUI::setTitleIcon ( )

Set title icon.

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

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

651  {
652  global $tpl;
653 
654  $obj_id = (is_object($this->node_object))
655  ? $this->node_object->getId()
656  :0;
657  $tpl->setTitleIcon(
659  $obj_id, $this->getType(), "",
661  }
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 686 of file class.ilSkillTreeNodeGUI.php.

References $html, $tab, and $tpl.

687  {
688  global $tpl;
689 
690  $this->setTabs("usage");
691 
692  include_once("./Services/Skill/classes/class.ilSkillUsage.php");
693  $usage_info = new ilSkillUsage();
694  $base_skill_id = ($this->base_skill_id > 0)
695  ? $this->base_skill_id
696  : $this->node_object->getId();
697  $usages = $usage_info->getAllUsagesInfoOfSubtree($base_skill_id.":".$this->tref_id);
698 
699  $html = "";
700  include_once("./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
701  foreach ($usages as $k => $usage)
702  {
703  $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
704  $html.= $tab->getHTML()."<br/><br/>";
705  }
706 
707  $tpl->setContent($html);
708  }
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 435 of file class.ilSkillTreeNodeGUI.php.

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

436  {
437  global $tpl, $lng, $ilCtrl;
438 
439  if (!$this->checkPermissionBool("write"))
440  {
441  return;
442  }
443 
444  $this->initForm("edit");
445  if ($this->form->checkInput())
446  {
447  $this->updateItem();
448  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
449  $this->afterUpdate();
450  }
451  else
452  {
453  $this->form->setValuesByPost();
454  $tpl->setContent($this->form->getHtml());
455  }
456  }
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:17
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilSkillTreeNodeGUI::$access

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

◆ $in_use

ilSkillTreeNodeGUI::$in_use = false

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

Referenced by isInUse().

◆ $node_object

ilSkillTreeNodeGUI::$node_object

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

◆ $ref_id

ilSkillTreeNodeGUI::$ref_id

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

Referenced by ilBasicSkillGUI\saveLevelResource().

◆ $use_checked

ilSkillTreeNodeGUI::$use_checked = false

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


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