ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
ilBasicSkillGUI Class Reference

Basic skill GUI class. More...

+ Inheritance diagram for ilBasicSkillGUI:
+ Collaboration diagram for ilBasicSkillGUI:

Public Member Functions

 __construct ($a_node_id=0)
 Constructor. More...
 
 getType ()
 Get Node Type. More...
 
 executeCommand ()
 Execute command. More...
 
 showProperties ()
 Show properties. More...
 
 proceedDragDrop ()
 Perform drag and drop action. More...
 
 saveItem ()
 Save item. More...
 
 afterSave ()
 After saving. More...
 
 updateItem ()
 Update item. More...
 
 edit ()
 Edit skill. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 editProperties ()
 Edit properties. More...
 
 addLevel ()
 Add new level. More...
 
 editLevel ()
 Edit level. More...
 
 saveLevel ()
 Save level form. More...
 
 updateLevel ()
 Update level form. More...
 
 initLevelForm ($a_mode="edit")
 Init level form. More...
 
 getLevelValues ()
 Get current values for level from. More...
 
 updateLevelOrder ()
 Update level order. More...
 
 confirmLevelDeletion ()
 Confirm level deletion. More...
 
 deleteLevel ()
 Delete levels. More...
 
 setLevelHead ()
 Set header for level. More...
 
 setTabs ($a_tab="levels")
 Set header for skill. More...
 
 editLevelTrigger ()
 Edit level trigger. More...
 
 selectLevelTrigger ()
 Select skill level trigger. More...
 
 saveLevelTrigger ()
 Save level trigger. More...
 
 removeLevelTrigger ()
 Remove trigger. More...
 
 redirectToParent ()
 Redirect to parent (identified by current obj_id) More...
 
 showLevelResources ()
 Show level resources. More...
 
 addLevelResource ()
 Add level resource. More...
 
 saveLevelResource ()
 Save level resource. More...
 
 confirmLevelResourcesRemoval ()
 Confirm level resources removal. More...
 
 removeLevelResources ()
 Remove level resource. More...
 
- Public Member Functions inherited from ilSkillTreeNodeGUI
 ilSkillTreeNodeGUI ($a_node_id=0)
 constructor 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...
 

Protected Attributes

 $tref_id = 0
 
 $base_skill_id
 

Additional Inherited Members

- Data Fields inherited from ilSkillTreeNodeGUI
 $node_object
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBasicSkillGUI::__construct (   $a_node_id = 0)

Constructor.

Definition at line 26 of file class.ilBasicSkillGUI.php.

References $ilCtrl.

27  {
28  global $ilCtrl;
29 
30  $ilCtrl->saveParameter($this, array("obj_id", "level_id"));
31  $this->base_skill_id = $a_node_id;
32 
33  parent::ilSkillTreeNodeGUI($a_node_id);
34  }
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ addLevel()

ilBasicSkillGUI::addLevel ( )

Add new level.

Definition at line 225 of file class.ilBasicSkillGUI.php.

References $tpl, and initLevelForm().

226  {
227  global $tpl;
228 
229  $this->initLevelForm("create");
230  $tpl->setContent($this->form->getHTML());
231  }
global $tpl
Definition: ilias.php:8
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ addLevelResource()

ilBasicSkillGUI::addLevelResource ( )

Add level resource.

Definition at line 665 of file class.ilBasicSkillGUI.php.

References $ilCtrl, $lng, $tpl, and setLevelHead().

666  {
667  global $ilCtrl, $ilTabs, $lng, $tree, $tpl;
668 
669  $this->setLevelHead();
670  $ilTabs->activateTab("level_resources");
671 
672  include_once("./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
673  $exp = new ilRepositorySelectorExplorerGUI($this, "addLevelResource",
674  $this, "saveLevelResource", "root_id");
675  if (!$exp->handleCommand())
676  {
677  $tpl->setContent($exp->getHTML());
678  }
679  }
Explorer for selecting repository items.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
setLevelHead()
Set header for level.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ afterSave()

ilBasicSkillGUI::afterSave ( )

After saving.

Definition at line 117 of file class.ilBasicSkillGUI.php.

References $ilCtrl.

118  {
119  global $ilCtrl;
120 
121  $ilCtrl->setParameterByClass("ilbasicskillgui", "obj_id",
122  $this->node_object->getId());
123  $ilCtrl->redirectByClass("ilbasicskillgui", "edit");
124  }
global $ilCtrl
Definition: ilias.php:18

◆ confirmLevelDeletion()

ilBasicSkillGUI::confirmLevelDeletion ( )

Confirm level deletion.

Definition at line 367 of file class.ilBasicSkillGUI.php.

References $_POST, $ilCtrl, $lng, $tpl, ilBasicSkill\lookupLevelTitle(), ilUtil\sendInfo(), and setTabs().

368  {
369  global $ilCtrl, $tpl, $lng;
370 
371  $this->setTabs("levels");
372 
373  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
374  {
375  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
376  $ilCtrl->redirect($this, "edit");
377  }
378  else
379  {
380  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
381  $cgui = new ilConfirmationGUI();
382  $cgui->setFormAction($ilCtrl->getFormAction($this));
383  $cgui->setHeaderText($lng->txt("skmg_really_delete_levels"));
384  $cgui->setCancel($lng->txt("cancel"), "edit");
385  $cgui->setConfirm($lng->txt("delete"), "deleteLevel");
386 
387  foreach ($_POST["id"] as $i)
388  {
389  $cgui->addItem("id[]", $i, ilBasicSkill::lookupLevelTitle($i));
390  }
391 
392  $tpl->setContent($cgui->getHTML());
393  }
394  }
$_POST['username']
Definition: cron.php:12
static lookupLevelTitle($a_id)
Lookup level title.
setTabs($a_tab="levels")
Set header for skill.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $lng
Definition: privfeed.php:40
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmLevelResourcesRemoval()

ilBasicSkillGUI::confirmLevelResourcesRemoval ( )

Confirm level resources removal.

Definition at line 706 of file class.ilBasicSkillGUI.php.

References $_POST, $ilCtrl, $lng, $tpl, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilUtil\sendInfo(), and setLevelHead().

707  {
708  global $ilCtrl, $tpl, $lng, $ilTabs;
709 
710  $this->setLevelHead();
711  $ilTabs->activateTab("level_resources");
712 
713  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
714  {
715  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
716  $ilCtrl->redirect($this, "showLevelResources");
717  }
718  else
719  {
720  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
721  $cgui = new ilConfirmationGUI();
722  $cgui->setFormAction($ilCtrl->getFormAction($this));
723  $cgui->setHeaderText($lng->txt("skmg_confirm_level_resources_removal"));
724  $cgui->setCancel($lng->txt("cancel"), "showLevelResources");
725  $cgui->setConfirm($lng->txt("remove"), "removeLevelResources");
726 
727  foreach ($_POST["id"] as $i)
728  {
730  $cgui->addItem("id[]", $i, $title);
731  }
732 
733  $tpl->setContent($cgui->getHTML());
734  }
735  }
$_POST['username']
Definition: cron.php:12
static _lookupTitle($a_id)
lookup object title
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupObjId($a_id)
setLevelHead()
Set header for level.
global $lng
Definition: privfeed.php:40
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteLevel()

ilBasicSkillGUI::deleteLevel ( )

Delete levels.

Definition at line 399 of file class.ilBasicSkillGUI.php.

References $_POST, $ilCtrl, $lng, and ilUtil\sendSuccess().

400  {
401  global $lng, $ilCtrl;
402 
403  if (is_array($_POST["id"]))
404  {
405  foreach ($_POST["id"] as $id)
406  {
407  $this->node_object->deleteLevel((int) $id);
408  }
409  $this->node_object->fixLevelNumbering();
410  }
411  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
412  $ilCtrl->redirect($this, "edit");
413  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ edit()

ilBasicSkillGUI::edit ( )

Edit skill.

Definition at line 141 of file class.ilBasicSkillGUI.php.

References $ilCtrl, $lng, $tpl, and setTabs().

142  {
143  global $tpl, $ilToolbar, $lng, $ilCtrl;
144 
145  $this->setTabs("levels");
146 
147  $ilToolbar->addButton($lng->txt("skmg_add_level"),
148  $ilCtrl->getLinkTarget($this, "addLevel"));
149 
150  include_once("./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
151  $table = new ilSkillLevelTableGUI($this->base_skill_id, $this, "edit");
152  $tpl->setContent($table->getHTML());
153  }
setTabs($a_tab="levels")
Set header for skill.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ editLevel()

ilBasicSkillGUI::editLevel ( )

Edit level.

Definition at line 236 of file class.ilBasicSkillGUI.php.

References $tpl, getLevelValues(), and initLevelForm().

237  {
238  global $tpl;
239 
240  $this->initLevelForm();
241  $this->getLevelValues();
242  $tpl->setContent($this->form->getHTML());
243  }
global $tpl
Definition: ilias.php:8
getLevelValues()
Get current values for level from.
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ editLevelTrigger()

ilBasicSkillGUI::editLevelTrigger ( )

Edit level trigger.

Definition at line 528 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, ilObject\_isInTrash(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilBasicSkill\lookupLevelTrigger(), setLevelHead(), and ilNonEditableValueGUI\setValue().

529  {
530  global $lng, $ilCtrl, $tpl, $ilTabs;
531 
532  $this->setLevelHead();
533  $ilTabs->activateTab("level_trigger");
534 
535  $trigger = ilBasicSkill::lookupLevelTrigger((int) $_GET["level_id"]);
536  if (ilObject::_lookupType($trigger["obj_id"]) != "crs" ||
537  ilObject::_isInTrash($trigger["ref_id"]))
538  {
539  $trigger = array();
540  }
541 
542  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
543  $this->form = new ilPropertyFormGUI();
544 
545  // trigger
546  $ne = new ilNonEditableValueGUI($lng->txt("skmg_trigger"), "trigger");
547  if ($trigger["obj_id"] > 0)
548  {
549  $ne->setValue(ilObject::_lookupTitle($trigger["obj_id"]));
550  }
551  else
552  {
553  $ne->setValue($lng->txt("skmg_no_trigger"));
554  }
555  $this->form->addItem($ne);
556 
557  if ($trigger["obj_id"] > 0)
558  {
559  $this->form->addCommandButton("removeLevelTrigger", $lng->txt("skmg_remove_trigger"));
560  }
561  $this->form->addCommandButton("selectLevelTrigger", $lng->txt("skmg_select_trigger"));
562 
563  $this->form->setTitle($lng->txt("skmg_skill_level_trigger"));
564  $this->form->setFormAction($ilCtrl->getFormAction($this));
565 
566  $tpl->setContent($this->form->getHTML());
567  }
This class represents a property form user interface.
$_GET["client_id"]
static lookupLevelTrigger($a_id)
Lookup level trigger.
static _lookupTitle($a_id)
lookup object title
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
_isInTrash($a_ref_id)
checks wether object is in trash
static _lookupType($a_id, $a_reference=false)
lookup object type
setLevelHead()
Set header for level.
This class represents a non editable value in a property form.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ editProperties()

ilBasicSkillGUI::editProperties ( )

Edit properties.

Definition at line 209 of file class.ilBasicSkillGUI.php.

References setTabs().

210  {
211  $this->setTabs("properties");
212  parent::editProperties();
213  }
setTabs($a_tab="levels")
Set header for skill.
+ Here is the call graph for this function:

◆ executeCommand()

ilBasicSkillGUI::executeCommand ( )

Execute command.

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

References $_GET, $cmd, $ilCtrl, $ret, $tpl, and setLevelHead().

48  {
49  global $ilCtrl, $tpl, $ilTabs, $ilHelp;
50 
51  $tpl->getStandardTemplate();
52 
53  $next_class = $ilCtrl->getNextClass($this);
54  $cmd = $ilCtrl->getCmd();
55  switch($next_class)
56  {
57  case "ilcertificategui":
58  $this->setLevelHead();
59  $ilTabs->activateTab("level_certificate");
60  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
61  include_once("./Services/Skill/classes/class.ilSkillCertificateAdapter.php");
62  $output_gui = new ilCertificateGUI(
63  new ilSkillCertificateAdapter($this->node_object, (int) $_GET["level_id"]));
64  $ret = $ilCtrl->forwardCommand($output_gui);
65  break;
66 
67  default:
68  $ret = $this->$cmd();
69  break;
70  }
71  }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
GUI class to create PDF certificates.
setLevelHead()
Set header for level.
+ Here is the call graph for this function:

◆ getLevelValues()

ilBasicSkillGUI::getLevelValues ( )

Get current values for level from.

Definition at line 341 of file class.ilBasicSkillGUI.php.

References $_GET, and $data.

Referenced by editLevel().

342  {
343  $values = array();
344 
345  $data = $this->node_object->getLevelData((int) $_GET["level_id"]);
346  $values["title"] = $data["title"];
347  $values["description"] = $data["description"];
348  $this->form->setValuesByArray($values);
349  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getType()

ilBasicSkillGUI::getType ( )

Get Node Type.

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

40  {
41  return "skll";
42  }

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

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

References $_GET, $ilCtrl, $lng, ilSkillTreeNodeGUI\addStatusInput(), ilFormPropertyGUI\setInfo(), ilNumberInputGUI\setMaxLength(), and ilTextInputGUI\setMaxLength().

161  {
162  global $lng, $ilCtrl;
163 
164  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
165  $this->form = new ilPropertyFormGUI();
166 
167  // title
168  $ti = new ilTextInputGUI($lng->txt("title"), "title");
169  $ti->setMaxLength(200);
170  $ti->setSize(50);
171  $ti->setRequired(true);
172  $this->form->addItem($ti);
173 
174  // order nr
175  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
176  $ni->setMaxLength(6);
177  $ni->setSize(6);
178  $ni->setRequired(true);
179  $this->form->addItem($ni);
180 
181  // status
182  $this->addStatusInput($this->form);
183 
184  // selectable
185  $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
186  $cb->setInfo($lng->txt("skmg_selectable_info"));
187  $this->form->addItem($cb);
188 
189  // save and cancel commands
190  if ($a_mode == "create")
191  {
192  $this->form->addCommandButton("save", $lng->txt("save"));
193  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
194  $this->form->setTitle($lng->txt("skmg_create_skll"));
195  }
196  else
197  {
198  $this->form->addCommandButton("update", $lng->txt("save"));
199  $this->form->setTitle($lng->txt("skmg_edit_skll"));
200  }
201 
202  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
203  $this->form->setFormAction($ilCtrl->getFormAction($this));
204  }
This class represents a property form user interface.
$_GET["client_id"]
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
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
addStatusInput(ilPropertyFormGUI $a_form)
Add status input.
+ Here is the call graph for this function:

◆ initLevelForm()

ilBasicSkillGUI::initLevelForm (   $a_mode = "edit")

Init level form.

Parameters
string$a_modeform mode

Definition at line 298 of file class.ilBasicSkillGUI.php.

References $ilCtrl, $lng, ilTextAreaInputGUI\setCols(), setLevelHead(), and ilTextInputGUI\setMaxLength().

Referenced by addLevel(), editLevel(), saveLevel(), and updateLevel().

299  {
300  global $lng, $ilCtrl, $ilTabs;
301 
302  $ilCtrl->saveParameter($this, "level_id");
303  $this->setLevelHead();
304  $ilTabs->activateTab("level_settings");
305 
306  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
307  $this->form = new ilPropertyFormGUI();
308 
309  // title
310  $ti = new ilTextInputGUI($lng->txt("title"), "title");
311  $ti->setMaxLength(200);
312  $ti->setRequired(true);
313  $this->form->addItem($ti);
314 
315  // description
316  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
317  $ta->setCols(50);
318  $ta->setRows(5);
319  $this->form->addItem($ta);
320 
321  // save and cancel commands
322  if ($a_mode == "create")
323  {
324  $this->form->addCommandButton("saveLevel", $lng->txt("save"));
325  $this->form->addCommandButton("edit", $lng->txt("cancel"));
326  $this->form->setTitle($lng->txt("skmg_new_level"));
327  }
328  else
329  {
330  $this->form->addCommandButton("updateLevel", $lng->txt("save"));
331  $this->form->addCommandButton("edit", $lng->txt("cancel"));
332  $this->form->setTitle($lng->txt("skmg_edit_level"));
333  }
334 
335  $this->form->setFormAction($ilCtrl->getFormAction($this));
336  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
setLevelHead()
Set header for level.
global $lng
Definition: privfeed.php:40
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:

◆ proceedDragDrop()

ilBasicSkillGUI::proceedDragDrop ( )

Perform drag and drop action.

Definition at line 90 of file class.ilBasicSkillGUI.php.

References $ilCtrl.

91  {
92  global $ilCtrl;
93 
94 // $this->slm_object->executeDragDrop($_POST["il_hform_source_id"], $_POST["il_hform_target_id"],
95 // $_POST["il_hform_fc"], $_POST["il_hform_as_subitem"]);
96 // $ilCtrl->redirect($this, "showOrganization");
97  }
global $ilCtrl
Definition: ilias.php:18

◆ redirectToParent()

ilBasicSkillGUI::redirectToParent ( )

Redirect to parent (identified by current obj_id)

Definition at line 619 of file class.ilBasicSkillGUI.php.

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

620  {
621  global $ilCtrl;
622 
623  $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
624 
625  switch ($t)
626  {
627  case "skrt":
628  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
629  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
630  break;
631  }
632 
633  parent::redirectToParent();
634  }
$_GET["client_id"]
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ removeLevelResources()

ilBasicSkillGUI::removeLevelResources ( )

Remove level resource.

Definition at line 740 of file class.ilBasicSkillGUI.php.

References $_GET, $_POST, $ilCtrl, $lng, and ilUtil\sendSuccess().

741  {
742  global $ilCtrl, $lng;
743 
744  if (is_array($_POST["id"]))
745  {
746  include_once("./Services/Skill/classes/class.ilSkillResources.php");
747  $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
748  foreach ($_POST["id"] as $i)
749  {
750  $sres->setResourceAsImparting((int) $_GET["level_id"], $i, false);
751  }
752  $sres->save();
753  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
754  }
755 
756  $ilCtrl->redirect($this, "showLevelResources");
757  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Manages resources for skills.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ removeLevelTrigger()

ilBasicSkillGUI::removeLevelTrigger ( )

Remove trigger.

Definition at line 608 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, and ilBasicSkill\writeLevelTrigger().

609  {
610  global $ilCtrl;
611 
612  ilBasicSkill::writeLevelTrigger((int) $_GET["level_id"], 0);
613  $ilCtrl->redirect($this, "editLevelTrigger");
614  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static writeLevelTrigger($a_id, $a_trigger_ref_id)
Write trigger.
+ Here is the call graph for this function:

◆ saveItem()

ilBasicSkillGUI::saveItem ( )

Save item.

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

References $_GET, $_POST, IL_LAST_NODE, and ilSkillTreeNode\putInTree().

103  {
104  $it = new ilBasicSkill();
105  $it->setTitle($this->form->getInput("title"));
106  $it->setOrderNr($this->form->getInput("order_nr"));
107  $it->setStatus($this->form->getInput("status"));
108  $it->setSelfEvaluation($_POST["self_eval"]);
109  $it->create();
110  ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
111  $this->node_object = $it;
112  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.
const IL_LAST_NODE
Definition: class.ilTree.php:4
Basic Skill.
+ Here is the call graph for this function:

◆ saveLevel()

ilBasicSkillGUI::saveLevel ( )

Save level form.

Definition at line 248 of file class.ilBasicSkillGUI.php.

References $ilCtrl, $lng, $tpl, initLevelForm(), and ilUtil\sendSuccess().

249  {
250  global $tpl, $lng, $ilCtrl;
251 
252  $this->initLevelForm("create");
253  if ($this->form->checkInput())
254  {
255  // perform save
256  $this->node_object->addLevel(
257  $this->form->getInput("title"),
258  $this->form->getInput("description"));
259 
260  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
261  $ilCtrl->redirect($this, "edit");
262  }
263 
264  $this->form->setValuesByPost();
265  $tpl->setContent($this->form->getHtml());
266  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ saveLevelResource()

ilBasicSkillGUI::saveLevelResource ( )

Save level resource.

Definition at line 684 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, $ref_id, and ilUtil\sendSuccess().

685  {
686  global $ilCtrl, $lng;
687 
688  $ref_id = (int) $_GET["root_id"];
689 
690  if ($ref_id > 0)
691  {
692  include_once("./Services/Skill/classes/class.ilSkillResources.php");
693  $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
694  $sres->setResourceAsImparting((int) $_GET["level_id"], $ref_id);
695  $sres->save();
696 
697  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
698  }
699 
700  $ilCtrl->redirect($this, "showLevelResources");
701  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Manages resources for skills.
$ref_id
Definition: sahs_server.php:39
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ saveLevelTrigger()

ilBasicSkillGUI::saveLevelTrigger ( )

Save level trigger.

Definition at line 597 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, and ilBasicSkill\writeLevelTrigger().

598  {
599  global $ilCtrl;
600 
601  ilBasicSkill::writeLevelTrigger((int) $_GET["level_id"], (int) $_GET["root_id"]);
602  $ilCtrl->redirect($this, "editLevelTrigger");
603  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static writeLevelTrigger($a_id, $a_trigger_ref_id)
Write trigger.
+ Here is the call graph for this function:

◆ selectLevelTrigger()

ilBasicSkillGUI::selectLevelTrigger ( )

Select skill level trigger.

Definition at line 572 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, ilExplorer\setExpand(), and setLevelHead().

573  {
574  global $ilCtrl, $ilTabs, $lng, $tree, $tpl;
575 
576  $this->setLevelHead();
577  $ilTabs->activateTab("level_trigger");
578 
579  include_once 'Services/Search/classes/class.ilSearchRootSelector.php';
580  $exp = new ilSearchRootSelector(
581  $ilCtrl->getLinkTarget($this,'showRepositorySelection'));
582  $exp->setExpand($_GET["search_root_expand"] ? $_GET["search_root_expand"] : $tree->readRootId());
583  $exp->setExpandTarget($ilCtrl->getLinkTarget($this,'selectLevelTrigger'));
584  $exp->setTargetClass(get_class($this));
585  $exp->setCmd('saveLevelTrigger');
586  $exp->setClickableTypes(array("crs"));
587 
588  // build html-output
589  $exp->setOutput(0);
590  $tpl->setContent($exp->getOutput());
591 
592  }
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
setLevelHead()
Set header for level.
global $lng
Definition: privfeed.php:40
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
+ Here is the call graph for this function:

◆ setLevelHead()

ilBasicSkillGUI::setLevelHead ( )

Set header for level.

Definition at line 418 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, $path, $tpl, and ilBasicSkill\lookupLevelTitle().

Referenced by addLevelResource(), confirmLevelResourcesRemoval(), editLevelTrigger(), executeCommand(), initLevelForm(), selectLevelTrigger(), and showLevelResources().

419  {
420  global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
421 
422  // tabs
423  $ilTabs->clearTargets();
424  $ilHelp->setScreenIdComponent("skmg_lev");
425 
426  $ilTabs->setBackTarget($lng->txt("back"),
427  $ilCtrl->getLinkTarget($this, "edit"));
428 
429  if ($_GET["level_id"] > 0)
430  {
431  $ilTabs->addTab("level_settings",
432  $lng->txt("settings"),
433  $ilCtrl->getLinkTarget($this, "editLevel"));
434 
435 /* $ilTabs->addTab("level_trigger",
436  $lng->txt("skmg_trigger"),
437  $ilCtrl->getLinkTarget($this, "editLevelTrigger"));*/
438 
439  $ilTabs->addTab("level_resources",
440  $lng->txt("skmg_resources"),
441  $ilCtrl->getLinkTarget($this, "showLevelResources"));
442 /*
443  $ilTabs->addTab("level_certificate",
444  $lng->txt("certificate"),
445  $ilCtrl->getLinkTargetByClass("ilcertificategui", "certificateEditor"));*/
446 
447  }
448 
449  // title
450  if ($_GET["level_id"] > 0)
451  {
452  $tpl->setTitle($lng->txt("skmg_skill_level").": ".
453  ilBasicSkill::lookupLevelTitle((int) $_GET["level_id"]));
454  }
455  else
456  {
457  $tpl->setTitle($lng->txt("skmg_skill_level"));
458  }
459 
460  include_once("./Services/Skill/classes/class.ilSkillTree.php");
461  $tree = new ilSkillTree();
462  $path = $tree->getPathFull($this->node_object->getId());
463  $desc = "";
464  foreach ($path as $p)
465  {
466  if (in_array($p["type"], array("scat", "skll")))
467  {
468  $desc.= $sep.$p["title"];
469  $sep = " > ";
470  }
471  }
472  $tpl->setDescription($desc);
473  }
static lookupLevelTitle($a_id)
Lookup level title.
Skill tree.
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilBasicSkillGUI::setTabs (   $a_tab = "levels")

Set header for skill.

Parameters
string$a_tabactive tab

Definition at line 480 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, ilSkillTreeNodeGUI\addUsageTab(), and ilSkillTreeNodeGUI\setSkillNodeDescription().

Referenced by confirmLevelDeletion(), edit(), editProperties(), and showProperties().

481  {
482  global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
483 
484  $ilTabs->clearTargets();
485  $ilHelp->setScreenIdComponent("skmg_skll");
486 // $ilTabs->setBackTarget($lng->txt("skmg_skill_hierarchie"),
487 // $ilCtrl->getLinkTargetByClass("ilobjskillmanagementgui", "editSkills"));
488 
489  if (is_object($this->node_object))
490  {
491 
492  // levels
493  $ilTabs->addTab("levels", $lng->txt("skmg_skill_levels"),
494  $ilCtrl->getLinkTarget($this, 'edit'));
495 
496  // properties
497  $ilTabs->addTab("properties", $lng->txt("settings"),
498  $ilCtrl->getLinkTarget($this, 'editProperties'));
499 
500  // usage
501  $this->addUsageTab($ilTabs);
502 
503  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
504  $this->node_object->skill_tree->getRootId());
505  $ilTabs->setBackTarget($lng->txt("obj_skmg"),
506  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listSkills"));
507  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
508  $_GET["obj_id"]);
509 
510  $ilTabs->activateTab($a_tab);
511 
512  $tpl->setTitle($lng->txt("skmg_skill").": ".
513  $this->node_object->getTitle());
514 
515  $this->setSkillNodeDescription();
516  }
517  else
518  {
519  $tpl->setTitle($lng->txt("skmg_skill"));
520  $tpl->setDescription("");
521  }
522  parent::setTitleIcon();
523  }
addUsageTab($a_tabs)
Add usage tab.
setSkillNodeDescription()
Set skill node description.
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLevelResources()

ilBasicSkillGUI::showLevelResources ( )

Show level resources.

Definition at line 644 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, $tab, $tpl, and setLevelHead().

645  {
646  global $tpl, $ilTabs, $ilToolbar, $lng, $ilCtrl;
647 
648  $ilToolbar->addButton(
649  $lng->txt("skmg_add_resource"),
650  $ilCtrl->getLinkTarget($this, "addLevelResource"));
651 
652  $this->setLevelHead();
653  $ilTabs->activateTab("level_resources");
654 
655  include_once("./Services/Skill/classes/class.ilSkillLevelResourcesTableGUI.php");
656  $tab = new ilSkillLevelResourcesTableGUI($this, "showLevelResources",
657  $this->base_skill_id, $this->tref_id, (int) $_GET["level_id"]);
658 
659  $tpl->setContent($tab->getHTML());
660  }
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
TableGUI class for skill level resources.
setLevelHead()
Set header for level.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ showProperties()

ilBasicSkillGUI::showProperties ( )

Show properties.

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

References $tpl, ilSkillTreeNodeGUI\setLocator(), and setTabs().

77  {
78  global $tpl;
79 
80  $this->setTabs();
81  $this->setLocator();
82 
83  $tpl->setContent("Properties");
84  }
setLocator()
Set Locator Items.
setTabs($a_tab="levels")
Set header for skill.
global $tpl
Definition: ilias.php:8
+ Here is the call graph for this function:

◆ updateItem()

ilBasicSkillGUI::updateItem ( )

Update item.

Definition at line 129 of file class.ilBasicSkillGUI.php.

References $_POST.

130  {
131  $this->node_object->setTitle($this->form->getInput("title"));
132  $this->node_object->setOrderNr($this->form->getInput("order_nr"));
133  $this->node_object->setSelfEvaluation($_POST["self_eval"]);
134  $this->node_object->setStatus($_POST["status"]);
135  $this->node_object->update();
136  }
$_POST['username']
Definition: cron.php:12

◆ updateLevel()

ilBasicSkillGUI::updateLevel ( )

Update level form.

Definition at line 271 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, initLevelForm(), and ilUtil\sendSuccess().

272  {
273  global $lng, $ilCtrl, $tpl;
274 
275  $this->initLevelForm("edit");
276  if ($this->form->checkInput())
277  {
278  $this->node_object->writeLevelTitle(
279  (int) $_GET["level_id"],
280  $this->form->getInput("title"));
281  $this->node_object->writeLevelDescription(
282  (int) $_GET["level_id"],
283  $this->form->getInput("description"));
284 
285  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
286  $ilCtrl->redirect($this, "edit");
287  }
288 
289  $this->form->setValuesByPost();
290  $tpl->setContent($this->form->getHtml());
291  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ updateLevelOrder()

ilBasicSkillGUI::updateLevelOrder ( )

Update level order.

Definition at line 354 of file class.ilBasicSkillGUI.php.

References $_POST, $ilCtrl, $lng, ilUtil\sendSuccess(), and ilUtil\stripSlashesArray().

355  {
356  global $lng, $ilCtrl;
357 
358  $order = ilUtil::stripSlashesArray($_POST["order"]);
359  $this->node_object->updateLevelOrder($order);
360  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
361  $ilCtrl->redirect($this, "edit");
362  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
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:

Field Documentation

◆ $base_skill_id

ilBasicSkillGUI::$base_skill_id
protected

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

◆ $tref_id

ilBasicSkillGUI::$tref_id = 0
protected

Definition at line 20 of file class.ilBasicSkillGUI.php.


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