ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
ilBasicSkillTemplateGUI Class Reference

Basic skill template GUI class. More...

+ Inheritance diagram for ilBasicSkillTemplateGUI:
+ Collaboration diagram for ilBasicSkillTemplateGUI:

Public Member Functions

 __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...
 
 showUsage ()
 Show skill usage. 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 ($a_tmp_mode=false)
 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
 __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...
 

Additional Inherited Members

- Data Fields inherited from ilSkillTreeNodeGUI
 $node_object
 
 $in_use = false
 
 $use_checked = false
 
 $access
 
 $ref_id
 
- Protected Attributes inherited from ilBasicSkillGUI
 $tref_id = 0
 
 $base_skill_id
 

Detailed Description

Basic skill template GUI class.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilBasicSkillTemplateGUI::__construct (   $a_node_id = 0,
  $a_tref_id = 0 
)

Constructor.

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

References $ilCtrl, and array.

24  {
25  global $ilCtrl;
26 
27  $this->tref_id = $a_tref_id;
28 
29  $ilCtrl->saveParameter($this, array("obj_id", "level_id"));
30 
31  parent::__construct($a_node_id);
32  }
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.

Member Function Documentation

◆ afterSave()

ilBasicSkillTemplateGUI::afterSave ( )

After saving.

Definition at line 238 of file class.ilBasicSkillTemplateGUI.php.

References $ilCtrl.

239  {
240  global $ilCtrl;
241 
242  $ilCtrl->setParameterByClass("ilbasicskilltemplategui", "obj_id",
243  $this->node_object->getId());
244  $ilCtrl->redirectByClass("ilbasicskilltemplategui", "edit");
245  }
global $ilCtrl
Definition: ilias.php:18

◆ edit()

ilBasicSkillTemplateGUI::edit ( )

Edit skill.

Parameters

Definition at line 253 of file class.ilBasicSkillTemplateGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, ilSkillTreeNodeGUI\checkPermissionBool(), ilSkillTreeNodeGUI\isInUse(), ilUtil\sendInfo(), and setTabs().

254  {
255  global $tpl, $ilToolbar, $lng, $ilCtrl;
256 
257  $this->setTabs("levels");
258 
259  if ($this->isInUse())
260  {
261  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
262  }
263  else
264  {
265 
266  if ($this->checkPermissionBool("write"))
267  {
268  if ($this->tref_id == 0)
269  {
270  $ilToolbar->addButton($lng->txt("skmg_add_level"),
271  $ilCtrl->getLinkTarget($this, "addLevel"));
272  }
273  }
274  }
275 
276  include_once("./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
277  $table = new ilSkillLevelTableGUI((int) $_GET["obj_id"], $this, "edit", $this->tref_id, $this->isInUse());
278  $tpl->setContent($table->getHTML());
279  }
setTabs($a_tab="")
Set header for skill.
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ getType()

ilBasicSkillTemplateGUI::getType ( )

Get Node Type.

Definition at line 37 of file class.ilBasicSkillTemplateGUI.php.

38  {
39  return "sktp";
40  }

◆ initForm()

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

Init form.

Parameters
string$a_modeedit mode

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

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

48  {
49  global $lng, $ilCtrl;
50 
51  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
52  $this->form = new ilPropertyFormGUI();
53 
54  // title
55  $ti = new ilTextInputGUI($lng->txt("title"), "title");
56  $ti->setMaxLength(200);
57  $ti->setSize(50);
58  $ti->setRequired(true);
59  $this->form->addItem($ti);
60 
61  // order nr
62  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
63  $ni->setMaxLength(6);
64  $ni->setSize(6);
65  $ni->setRequired(true);
66  $this->form->addItem($ni);
67 
68  // save and cancel commands
69  if ($this->checkPermissionBool("write"))
70  {
71  if ($a_mode == "create")
72  {
73  $this->form->addCommandButton("save", $lng->txt("save"));
74  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
75  $this->form->setTitle($lng->txt("skmg_create_skll"));
76  } else
77  {
78  $this->form->addCommandButton("update", $lng->txt("save"));
79  $this->form->setTitle($lng->txt("skmg_edit_skll"));
80  }
81  }
82 
83  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
84  $this->form->setFormAction($ilCtrl->getFormAction($this));
85  }
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:

◆ saveItem()

ilBasicSkillTemplateGUI::saveItem ( )

Save item.

Definition at line 220 of file class.ilBasicSkillTemplateGUI.php.

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

221  {
222  if (!$this->checkPermissionBool("write"))
223  {
224  return;
225  }
226 
227  $it = new ilBasicSkillTemplate();
228  $it->setTitle($this->form->getInput("title"));
229  $it->setOrderNr($this->form->getInput("order_nr"));
230  $it->create();
231  ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
232  $this->node_object = $it;
233  }
$_GET["client_id"]
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.
checkPermissionBool($a_perm)
Check permission pool.
const IL_LAST_NODE
Definition: class.ilTree.php:4
+ Here is the call graph for this function:

◆ setLevelHead()

ilBasicSkillTemplateGUI::setLevelHead ( )

Set header for level.

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

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

91  {
92  global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
93 
94  // tabs
95  $ilTabs->clearTargets();
96  $ilHelp->setScreenIdComponent("skmg_lev");
97  $ilTabs->setBackTarget($lng->txt("skmg_skill_levels"),
98  $ilCtrl->getLinkTarget($this, "edit"));
99 
100  if ($_GET["level_id"] > 0)
101  {
102  if ($this->tref_id == 0)
103  {
104  $ilTabs->addTab("level_settings",
105  $lng->txt("settings"),
106  $ilCtrl->getLinkTarget($this, "editLevel"));
107  }
108  else
109  {
110  $ilTabs->addTab("level_resources",
111  $lng->txt("skmg_resources"),
112  $ilCtrl->getLinkTarget($this, "showLevelResources"));
113  }
114 
115 /* $ilTabs->addTab("level_trigger",
116  $lng->txt("skmg_trigger"),
117  $ilCtrl->getLinkTarget($this, "editLevelTrigger"));
118 
119  $ilTabs->addTab("level_certificate",
120  $lng->txt("certificate"),
121  $ilCtrl->getLinkTargetByClass("ilcertificategui", "certificateEditor"));*/
122  }
123 
124  // title
125  if ($_GET["level_id"] > 0)
126  {
127  $tpl->setTitle($lng->txt("skmg_skill_level").": ".
128  ilBasicSkill::lookupLevelTitle((int) $_GET["level_id"]));
129  }
130  else
131  {
132  $tpl->setTitle($lng->txt("skmg_skill_level"));
133  }
134 
135  include_once("./Services/Skill/classes/class.ilSkillTree.php");
136  $tree = new ilSkillTree();
137  $path = $tree->getPathFull($this->node_object->getId());
138  $desc = "";
139  foreach ($path as $p)
140  {
141  if (in_array($p["type"], array("scat", "skll")))
142  {
143  $desc.= $sep.$p["title"];
144  $sep = " > ";
145  }
146  }
147  $tpl->setDescription($desc);
148 
149  $tpl->setTitleIcon(
151  0, "sktp", "", false));
152 
153  }
$path
Definition: aliased.php:25
static lookupLevelTitle($a_id)
Lookup level title.
Skill tree.
$_GET["client_id"]
static getIconPath($a_obj_id, $a_type, $a_size="", $a_status=0)
Get icon path.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ setTabs()

ilBasicSkillTemplateGUI::setTabs (   $a_tab = "")

Set header for skill.

Parameters

Definition at line 161 of file class.ilBasicSkillTemplateGUI.php.

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

Referenced by edit(), and showUsage().

162  {
163  global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
164 
165  $ilTabs->clearTargets();
166  $ilHelp->setScreenIdComponent("skmg_sktp");
167 
168  if ($this->tref_id == 0)
169  {
170  $ilTabs->setBackTarget($lng->txt("skmg_skill_templates"),
171  $ilCtrl->getLinkTargetByClass("ilobjskillmanagementgui", "editSkillTemplates"));
172  }
173 
174  if (is_object($this->node_object))
175  {
176  if ($this->tref_id == 0)
177  {
178  $tpl->setTitle($lng->txt("skmg_skill_template").": ".
179  $this->node_object->getTitle());
180  }
181  else
182  {
183  $tpl->setTitle(
184  $this->node_object->getTitle());
185  }
186 
187  // levels
188  $ilTabs->addTab("levels", $lng->txt("skmg_skill_levels"),
189  $ilCtrl->getLinkTarget($this, 'edit'));
190 
191  // properties
192  if ($this->tref_id == 0)
193  {
194  $ilTabs->addTab("properties", $lng->txt("settings"),
195  $ilCtrl->getLinkTarget($this, 'editProperties'));
196  }
197 
198  // if ($this->tref_id > 0)
199 // {
200  // usage
201  $this->addUsageTab($ilTabs);
202 // }
203 
204  $ilTabs->activateTab($a_tab);
205 
206  parent::setTitleIcon();
207 
208  $this->setSkillNodeDescription();
209  }
210  else
211  {
212  $tpl->setTitle($lng->txt("skmg_skill"));
213  $tpl->setDescription("");
214  }
215  }
addUsageTab($a_tabs)
Add usage tab.
setSkillNodeDescription()
Set skill node description.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUsage()

ilBasicSkillTemplateGUI::showUsage ( )

Show skill usage.

Definition at line 284 of file class.ilBasicSkillTemplateGUI.php.

References $html, $tab, $tpl, and setTabs().

285  {
286  global $tpl;
287 
288 
289  // (a) referenced skill template in main tree
290  if ($this->tref_id > 0)
291  {
292  return parent::showUsage();
293  }
294 
295  // (b) skill template in templates view
296 
297  $this->setTabs("usage");
298 
299  include_once("./Services/Skill/classes/class.ilSkillUsage.php");
300  $usage_info = new ilSkillUsage();
301  $usages = $usage_info->getAllUsagesOfTemplate($this->base_skill_id);
302 
303  $html = "";
304  include_once("./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
305  foreach ($usages as $k => $usage)
306  {
307  $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
308  $html.= $tab->getHTML()."<br/><br/>";
309  }
310 
311  $tpl->setContent($html);
312  }
setTabs($a_tab="")
Set header for skill.
global $tpl
Definition: ilias.php:8
TableGUI class for skill usages.
Skill usage.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

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