ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSkillTemplateReferenceGUI Class Reference

Skill template reference GUI class. More...

+ Inheritance diagram for ilSkillTemplateReferenceGUI:
+ Collaboration diagram for ilSkillTemplateReferenceGUI:

Public Member Functions

 __construct ($a_tref_id=0)
 Constructor. More...
 
 getType ()
 Get Node Type. More...
 
executeCommand ()
 Execute command. More...
 
 setTabs ($a_tab)
 output tabs More...
 
 insert ()
 Insert. More...
 
 editProperties ()
 Edit properties. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 getValues ()
 Get current values for from. More...
 
 saveItem ()
 Save item. More...
 
 afterSave ()
 After saving. More...
 
 updateSkillTemplateReference ()
 Update form. More...
 
 cancel ()
 Cancel. More...
 
 listItems ()
 List items. More...
 
- Public Member Functions inherited from ilBasicSkillTemplateGUI
 __construct ($a_node_id=0, $a_tref_id=0)
 Constructor. More...
 
 getType ()
 Get Node Type. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 setLevelHead ()
 Set header for level. More...
 
 setTabs ($a_tab)
 Set header for skill. More...
 
 saveItem ()
 Save item. More...
 
 afterSave ()
 After saving. More...
 
 edit ()
 Edit skill. More...
 
- Public Member Functions inherited from ilBasicSkillGUI
 __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...
 

Additional Inherited Members

- Data Fields inherited from ilSkillTreeNodeGUI
 $node_object
 
- Protected Attributes inherited from ilBasicSkillGUI
 $tref_id = 0
 
 $base_skill_id
 

Detailed Description

Skill template reference GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilSkillTemplateReferenceGUI: ilObjSkillManagementGUI

Definition at line 16 of file class.ilSkillTemplateReferenceGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSkillTemplateReferenceGUI::__construct (   $a_tref_id = 0)

Constructor.

Definition at line 22 of file class.ilSkillTemplateReferenceGUI.php.

References $ilCtrl.

23  {
24  global $ilCtrl;
25 
26  $ilCtrl->saveParameter($this, "obj_id");
27  $ilCtrl->saveParameter($this, "tref_id");
28 
29  parent::__construct($a_tref_id);
30 
31  $this->tref_id = $a_tref_id;
32  if (is_object($this->node_object))
33  {
34  $this->base_skill_id = $this->node_object->getSkillTemplateId();
35  }
36  }
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ afterSave()

ilSkillTemplateReferenceGUI::afterSave ( )

After saving.

Definition at line 258 of file class.ilSkillTemplateReferenceGUI.php.

References $ilCtrl.

259  {
260  global $ilCtrl;
261 
262  $ilCtrl->setParameterByClass("ilskilltemplatereferencegui", "tref_id",
263  $this->node_object->getId());
264  $ilCtrl->setParameterByClass("ilskilltemplatereferencegui", "obj_id",
265  $this->node_object->getSkillTemplateId());
266  $ilCtrl->redirectByClass("ilskilltemplatereferencegui", "listItems");
267  }
global $ilCtrl
Definition: ilias.php:18

◆ cancel()

ilSkillTemplateReferenceGUI::cancel ( )

Cancel.

Parameters

Definition at line 301 of file class.ilSkillTemplateReferenceGUI.php.

References $ilCtrl.

302  {
303  global $ilCtrl;
304 
305  $ilCtrl->redirectByClass("ilobjskillmanagementgui", "editSkills");
306  }
global $ilCtrl
Definition: ilias.php:18

◆ editProperties()

ilSkillTemplateReferenceGUI::editProperties ( )

Edit properties.

Definition at line 142 of file class.ilSkillTemplateReferenceGUI.php.

References $tpl, getValues(), initForm(), and setTabs().

143  {
144  global $tpl;
145 
146  $this->setTabs("properties");
147 
148  $this->initForm();
149  $this->getValues();
150  $tpl->setContent($this->form->getHTML());
151  }
getValues()
Get current values for from.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ Here is the call graph for this function:

◆ executeCommand()

& ilSkillTemplateReferenceGUI::executeCommand ( )

Execute command.

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

References $cmd, $ilCtrl, $ret, and $tpl.

50  {
51  global $ilCtrl, $tpl, $ilTabs;
52 
53  $tpl->getStandardTemplate();
54 
55  $next_class = $ilCtrl->getNextClass($this);
56  $cmd = $ilCtrl->getCmd();
57 
58  switch($next_class)
59  {
60  default:
61  $ret = $this->$cmd();
62  break;
63  }
64  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl

◆ getType()

ilSkillTemplateReferenceGUI::getType ( )

Get Node Type.

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

42  {
43  return "sktr";
44  }

◆ getValues()

ilSkillTemplateReferenceGUI::getValues ( )

Get current values for from.

Definition at line 228 of file class.ilSkillTemplateReferenceGUI.php.

Referenced by editProperties().

229  {
230  $values = array();
231  $values["skill_template_id"] = $this->node_object->getSkillTemplateId();
232  $values["title"] = $this->node_object->getTitle();
233  $values["selectable"] = $this->node_object->getSelfEvaluation();
234  $values["status"] = $this->node_object->getStatus();
235  $values["order_nr"] = $this->node_object->getOrderNr();
236  $this->form->setValuesByArray($values);
237  }
+ Here is the caller graph for this function:

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

Definition at line 158 of file class.ilSkillTemplateReferenceGUI.php.

References $ilCtrl, $lng, $options, $si, ilSkillTreeNodeGUI\addStatusInput(), ilSkillTreeNode\getTopTemplates(), ilFormPropertyGUI\setInfo(), ilNumberInputGUI\setMaxLength(), and ilNonEditableValueGUI\setValue().

Referenced by editProperties(), insert(), and updateSkillTemplateReference().

159  {
160  global $lng, $ilCtrl;
161 
162  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
163  $this->form = new ilPropertyFormGUI();
164 
165  // select skill template
166  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
168 
169  // title
170  $ti = new ilTextInputGUI($lng->txt("title"), "title");
171  $this->form->addItem($ti);
172 
173  // order nr
174  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
175  $ni->setMaxLength(6);
176  $ni->setSize(6);
177  $ni->setRequired(true);
178  $this->form->addItem($ni);
179 
180  // template
181  $options = array(
182  "" => $lng->txt("please_select"),
183  );
184  foreach ($tmplts as $tmplt)
185  {
186  $options[$tmplt["child"]] = $tmplt["title"];
187  }
188  if ($a_mode != "edit")
189  {
190  $si = new ilSelectInputGUI($lng->txt("skmg_skill_template"), "skill_template_id");
191  $si->setOptions($options);
192  $si->setRequired(true);
193  $this->form->addItem($si);
194  }
195  else
196  {
197  $ne = new ilNonEditableValueGUI($lng->txt("skmg_skill_template"), "");
198  $ne->setValue($options[$this->node_object->getSkillTemplateId()]);
199  $this->form->addItem($ne);
200  }
201 
202  // status
203  $this->addStatusInput($this->form);
204 
205  // selectable
206  $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "selectable");
207  $cb->setInfo($lng->txt("skmg_selectable_info"));
208  $this->form->addItem($cb);
209 
210  if ($a_mode == "create")
211  {
212  $this->form->addCommandButton("save", $lng->txt("save"));
213  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
214  $this->form->setTitle($lng->txt("skmg_new_sktr"));
215  }
216  else
217  {
218  $this->form->addCommandButton("updateSkillTemplateReference", $lng->txt("save"));
219  $this->form->setTitle($lng->txt("skmg_edit_sktr"));
220  }
221 
222  $this->form->setFormAction($ilCtrl->getFormAction($this));
223  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
if(!is_array($argv)) $options
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.
This class represents a non editable value in a property form.
global $lng
Definition: privfeed.php:40
addStatusInput(ilPropertyFormGUI $a_form)
Add status input.
static getTopTemplates()
Get top skill templates and template categories.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilSkillTemplateReferenceGUI::insert ( )

Insert.

Parameters

Definition at line 128 of file class.ilSkillTemplateReferenceGUI.php.

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

129  {
130  global $ilCtrl, $tpl;
131 
132  $ilCtrl->saveParameter($this, "parent_id");
133  $ilCtrl->saveParameter($this, "target");
134  $this->initForm("create");
135  $tpl->setContent($this->form->getHTML());
136  }
global $ilCtrl
Definition: ilias.php:18
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ Here is the call graph for this function:

◆ listItems()

ilSkillTemplateReferenceGUI::listItems ( )

List items.

Definition at line 311 of file class.ilSkillTemplateReferenceGUI.php.

References $tpl, ilSkillTreeNode\_lookupType(), ilSkillCatTableGUI\MODE_SCTP, and setTabs().

312  {
313  global $tpl;
314 
315  $this->setTabs("content");
316 
317  $sk_id = $this->node_object->getSkillTemplateId();
318  $obj_type = ilSkillTreeNode::_lookupType($sk_id);
319 
320  if ($obj_type == "sctp")
321  {
322  include_once("./Services/Skill/classes/class.ilSkillCatTableGUI.php");
323  $table = new ilSkillCatTableGUI($this, "listItems", (int) $sk_id,
324  ilSkillCatTableGUI::MODE_SCTP, $this->node_object->getId());
325  $tpl->setContent($table->getHTML());
326  }
327  else if ($obj_type == "sktp")
328  {
329  include_once("./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
330  $table = new ilSkillLevelTableGUI((int) $sk_id, $this, "edit", $this->node_object->getId());
331  $tpl->setContent($table->getHTML());
332  }
333  }
static _lookupType($a_obj_id)
Lookup Type.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ Here is the call graph for this function:

◆ saveItem()

ilSkillTemplateReferenceGUI::saveItem ( )

Save item.

Definition at line 242 of file class.ilSkillTemplateReferenceGUI.php.

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

243  {
244  $sktr = new ilSkillTemplateReference();
245  $sktr->setTitle($_POST["title"]);
246  $sktr->setSkillTemplateId($_POST["skill_template_id"]);
247  $sktr->setSelfEvaluation($_POST["selectable"]);
248  $sktr->setOrderNr($_POST["order_nr"]);
249  $sktr->setStatus($_POST["status"]);
250  $sktr->create();
251  ilSkillTreeNode::putInTree($sktr, (int) $_GET["obj_id"], IL_LAST_NODE);
252  $this->node_object = $sktr;
253  }
$_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
+ Here is the call graph for this function:

◆ setTabs()

ilSkillTemplateReferenceGUI::setTabs (   $a_tab)

output tabs

Definition at line 69 of file class.ilSkillTemplateReferenceGUI.php.

References $ilCtrl, $lng, $tpl, ilSkillTemplateReference\_lookupTemplateId(), ilSkillTreeNode\_lookupType(), ilSkillTreeNodeGUI\addUsageTab(), and ilSkillTreeNodeGUI\setSkillNodeDescription().

Referenced by editProperties(), and listItems().

70  {
71  global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
72 
73  $ilTabs->clearTargets();
74  $ilHelp->setScreenIdComponent("skmg_sktr");
75 
76  if (is_object($this->node_object))
77  {
78  $sk_id = $this->node_object->getSkillTemplateId();
79  $obj_type = ilSkillTreeNode::_lookupType($sk_id);
80 
81  if ($obj_type == "sctp")
82  {
83  // content
84  $ilTabs->addTab("content", $lng->txt("content"),
85  $ilCtrl->getLinkTarget($this, 'listItems'));
86  }
87  else
88  {
89  // content
90  $ilTabs->addTab("content", $lng->txt("skmg_skill_levels"),
91  $ilCtrl->getLinkTarget($this, 'listItems'));
92  }
93 
94  // properties
95  $ilTabs->addTab("properties", $lng->txt("settings"),
96  $ilCtrl->getLinkTarget($this, 'editProperties'));
97 
98  // usage
99  $this->addUsageTab($ilTabs);
100 
101  // back link
102 /*
103  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
104  $this->node_object->skill_tree->getRootId());
105  $ilTabs->setBackTarget($lng->txt("obj_skmg"),
106  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listSkills"));
107  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
108  $_GET["obj_id"]);*/
109 
110  $tid = ilSkillTemplateReference::_lookupTemplateId($this->node_object->getId());
111  $add = " (".ilSkillTreeNode::_lookupTitle($tid).")";
112 
113  parent::setTitleIcon();
114  $tpl->setTitle(
115  $lng->txt("skmg_sktr").": ".$this->node_object->getTitle().$add);
116  $this->setSkillNodeDescription();
117 
118  $ilTabs->activateTab($a_tab);
119  }
120  }
addUsageTab($a_tabs)
Add usage tab.
setSkillNodeDescription()
Set skill node description.
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
static _lookupTemplateId($a_obj_id)
Lookup template ID.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSkillTemplateReference()

ilSkillTemplateReferenceGUI::updateSkillTemplateReference ( )

Update form.

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

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

273  {
274  global $lng, $ilCtrl, $tpl;
275 
276  $this->initForm("edit");
277  if ($this->form->checkInput())
278  {
279  // perform update
280 // $this->node_object->setSkillTemplateId($_POST["skill_template_id"]);
281  $this->node_object->setTitle($_POST["title"]);
282  $this->node_object->setSelfEvaluation($_POST["selectable"]);
283  $this->node_object->setOrderNr($_POST["order_nr"]);
284  $this->node_object->setStatus($_POST["status"]);
285  $this->node_object->update();
286 
287  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
288  $ilCtrl->redirect($this, "editProperties");
289  }
290 
291  $this->form->setValuesByPost();
292  $tpl->setContent($this->form->getHtml());
293  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

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