ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 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...
 
 saveResourceSettings ()
 Save resource settings. 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...
 

Protected Attributes

 $ctrl
 
 $lng
 
 $tabs
 
 $tpl
 
 $help
 
 $toolbar
 
- Protected Attributes inherited from ilBasicSkillGUI
 $ctrl
 
 $tpl
 
 $tabs
 
 $help
 
 $toolbar
 
 $lng
 
 $tree
 
 $tref_id = 0
 
 $base_skill_id
 
- Protected Attributes inherited from ilSkillTreeNodeGUI
 $ctrl
 
 $lng
 
 $locator
 
 $tpl
 
 $user
 

Additional Inherited Members

- Data Fields inherited from ilSkillTreeNodeGUI
 $node_object
 
 $in_use = false
 
 $use_checked = false
 
 $access
 
 $ref_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 53 of file class.ilBasicSkillTemplateGUI.php.

References $DIC, $ilCtrl, and array.

54  {
55  global $DIC;
56 
57  $this->ctrl = $DIC->ctrl();
58  $this->lng = $DIC->language();
59  $this->tabs = $DIC->tabs();
60  $this->tpl = $DIC["tpl"];
61  $this->help = $DIC["ilHelp"];
62  $this->toolbar = $DIC->toolbar();
63  $ilCtrl = $DIC->ctrl();
64 
65  $this->tref_id = $a_tref_id;
66 
67  $ilCtrl->saveParameter($this, array("obj_id", "level_id"));
68 
69  parent::__construct($a_node_id);
70  }
global $DIC
Definition: saml.php:7
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 290 of file class.ilBasicSkillTemplateGUI.php.

References $ctrl, and $ilCtrl.

291  {
293 
294  $ilCtrl->setParameterByClass(
295  "ilbasicskilltemplategui",
296  "obj_id",
297  $this->node_object->getId()
298  );
299  $ilCtrl->redirectByClass("ilbasicskilltemplategui", "edit");
300  }
global $ilCtrl
Definition: ilias.php:18

◆ edit()

ilBasicSkillTemplateGUI::edit ( )

Edit skill.

Parameters

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

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

309  {
310  $tpl = $this->tpl;
311  $ilToolbar = $this->toolbar;
312  $lng = $this->lng;
314 
315  $this->setTabs("levels");
316 
317  if ($this->isInUse()) {
318  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
319  } else {
320  if ($this->checkPermissionBool("write")) {
321  if ($this->tref_id == 0) {
322  $ilToolbar->addButton(
323  $lng->txt("skmg_add_level"),
324  $ilCtrl->getLinkTarget($this, "addLevel")
325  );
326  }
327  }
328  }
329 
330  include_once("./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
331  $table = new ilSkillLevelTableGUI((int) $_GET["obj_id"], $this, "edit", $this->tref_id, $this->isInUse());
332  $tpl->setContent($table->getHTML());
333  }
setTabs($a_tab="")
Set header for skill.
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:

◆ getType()

ilBasicSkillTemplateGUI::getType ( )

Get Node Type.

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

76  {
77  return "sktp";
78  }

◆ initForm()

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

Init form.

Parameters
string$a_modeedit mode

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

References $_GET, $ctrl, $ilCtrl, $lng, ilBasicSkillGUI\$tree, ilSkillTreeNodeGUI\checkPermissionBool(), ilFormPropertyGUI\setInfo(), and ilTextInputGUI\setMaxLength().

86  {
87  $lng = $this->lng;
89 
90  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
91  $this->form = new ilPropertyFormGUI();
92 
93  // title
94  $ti = new ilTextInputGUI($lng->txt("title"), "title");
95  $ti->setMaxLength(200);
96  $ti->setSize(50);
97  $ti->setRequired(true);
98  $this->form->addItem($ti);
99 
100  // order nr
101  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
102  $ni->setInfo($lng->txt("skmg_order_nr_info"));
103  $ni->setMaxLength(6);
104  $ni->setSize(6);
105  $ni->setRequired(true);
106  if ($a_mode == "create") {
107  include_once("./Services/Skill/classes/class.ilSkillTree.php");
108  $tree = new ilSkillTree();
109  $max = $tree->getMaxOrderNr((int) $_GET["obj_id"], true);
110  $ni->setValue($max + 10);
111  }
112  $this->form->addItem($ni);
113 
114  // save and cancel commands
115  if ($this->checkPermissionBool("write")) {
116  if ($a_mode == "create") {
117  $this->form->addCommandButton("save", $lng->txt("save"));
118  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
119  $this->form->setTitle($lng->txt("skmg_create_skll"));
120  } else {
121  $this->form->addCommandButton("update", $lng->txt("save"));
122  $this->form->setTitle($lng->txt("skmg_edit_skll"));
123  }
124  }
125 
126  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
127  $this->form->setFormAction($ilCtrl->getFormAction($this));
128  }
This class represents a property form user interface.
Skill tree.
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
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.
+ Here is the call graph for this function:

◆ saveItem()

ilBasicSkillTemplateGUI::saveItem ( )

Save item.

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

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

274  {
275  if (!$this->checkPermissionBool("write")) {
276  return;
277  }
278 
279  $it = new ilBasicSkillTemplate();
280  $it->setTitle($this->form->getInput("title"));
281  $it->setOrderNr($this->form->getInput("order_nr"));
282  $it->create();
283  ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
284  $this->node_object = $it;
285  }
$_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 133 of file class.ilBasicSkillTemplateGUI.php.

References $_GET, $ctrl, $help, $ilCtrl, $lng, $path, $tabs, $tpl, ilBasicSkillGUI\$tree, array, ilSkillTreeNode\getIconPath(), and ilBasicSkill\lookupLevelTitle().

134  {
135  $ilTabs = $this->tabs;
137  $tpl = $this->tpl;
138  $lng = $this->lng;
139  $ilHelp = $this->help;
140 
141  // tabs
142  $ilTabs->clearTargets();
143  $ilHelp->setScreenIdComponent("skmg_lev");
144  $ilTabs->setBackTarget(
145  $lng->txt("skmg_skill_levels"),
146  $ilCtrl->getLinkTarget($this, "edit")
147  );
148 
149  if ($_GET["level_id"] > 0) {
150  if ($this->tref_id == 0) {
151  $ilTabs->addTab(
152  "level_settings",
153  $lng->txt("settings"),
154  $ilCtrl->getLinkTarget($this, "editLevel")
155  );
156  } else {
157  $ilTabs->addTab(
158  "level_resources",
159  $lng->txt("skmg_resources"),
160  $ilCtrl->getLinkTarget($this, "showLevelResources")
161  );
162  }
163 
164  /* $ilTabs->addTab("level_trigger",
165  $lng->txt("skmg_trigger"),
166  $ilCtrl->getLinkTarget($this, "editLevelTrigger"));
167 
168  $ilTabs->addTab("level_certificate",
169  $lng->txt("certificate"),
170  $ilCtrl->getLinkTargetByClass("ilcertificategui", "certificateEditor"));*/
171  }
172 
173  // title
174  if ($_GET["level_id"] > 0) {
175  $tpl->setTitle($lng->txt("skmg_skill_level") . ": " .
176  ilBasicSkill::lookupLevelTitle((int) $_GET["level_id"]));
177  } else {
178  $tpl->setTitle($lng->txt("skmg_skill_level"));
179  }
180 
181  include_once("./Services/Skill/classes/class.ilSkillTree.php");
182  $tree = new ilSkillTree();
183  $path = $tree->getPathFull($this->node_object->getId());
184  $desc = "";
185  foreach ($path as $p) {
186  if (in_array($p["type"], array("scat", "skll"))) {
187  $desc.= $sep . $p["title"];
188  $sep = " > ";
189  }
190  }
191  $tpl->setDescription($desc);
192 
193  $tpl->setTitleIcon(
195  0,
196  "sktp",
197  "",
198  false
199  )
200  );
201  }
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 $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ setTabs()

ilBasicSkillTemplateGUI::setTabs (   $a_tab = "")

Set header for skill.

Parameters

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

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

Referenced by edit(), and showUsage().

210  {
211  $ilTabs = $this->tabs;
213  $tpl = $this->tpl;
214  $lng = $this->lng;
215  $ilHelp = $this->help;
216 
217  $ilTabs->clearTargets();
218  $ilHelp->setScreenIdComponent("skmg_sktp");
219 
220  if ($this->tref_id == 0) {
221  $ilTabs->setBackTarget(
222  $lng->txt("skmg_skill_templates"),
223  $ilCtrl->getLinkTargetByClass("ilobjskillmanagementgui", "editSkillTemplates")
224  );
225  }
226 
227  if (is_object($this->node_object)) {
228  if ($this->tref_id == 0) {
229  $tpl->setTitle($lng->txt("skmg_skill_template") . ": " .
230  $this->node_object->getTitle());
231  } else {
232  $tpl->setTitle(
233  $this->node_object->getTitle()
234  );
235  }
236 
237  // levels
238  $ilTabs->addTab(
239  "levels",
240  $lng->txt("skmg_skill_levels"),
241  $ilCtrl->getLinkTarget($this, 'edit')
242  );
243 
244  // properties
245  if ($this->tref_id == 0) {
246  $ilTabs->addTab(
247  "properties",
248  $lng->txt("settings"),
249  $ilCtrl->getLinkTarget($this, 'editProperties')
250  );
251  }
252 
253  // if ($this->tref_id > 0)
254  // {
255  // usage
256  $this->addUsageTab($ilTabs);
257  // }
258 
259  $ilTabs->activateTab($a_tab);
260 
261  parent::setTitleIcon();
262 
263  $this->setSkillNodeDescription();
264  } else {
265  $tpl->setTitle($lng->txt("skmg_skill"));
266  $tpl->setDescription("");
267  }
268  }
addUsageTab($a_tabs)
Add usage tab.
setSkillNodeDescription()
Set skill node description.
global $ilCtrl
Definition: ilias.php:18
+ 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 338 of file class.ilBasicSkillTemplateGUI.php.

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

339  {
340  $tpl = $this->tpl;
341 
342 
343  // (a) referenced skill template in main tree
344  if ($this->tref_id > 0) {
345  return parent::showUsage();
346  }
347 
348  // (b) skill template in templates view
349 
350  $this->setTabs("usage");
351 
352  include_once("./Services/Skill/classes/class.ilSkillUsage.php");
353  $usage_info = new ilSkillUsage();
354  $usages = $usage_info->getAllUsagesOfTemplate($this->base_skill_id);
355 
356  $html = "";
357  include_once("./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
358  foreach ($usages as $k => $usage) {
359  $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
360  $html.= $tab->getHTML() . "<br/><br/>";
361  }
362 
363  $tpl->setContent($html);
364  }
setTabs($a_tab="")
Set header for skill.
TableGUI class for skill usages.
Skill usage.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

◆ $help

ilBasicSkillTemplateGUI::$help
protected

◆ $lng

◆ $tabs

ilBasicSkillTemplateGUI::$tabs
protected

◆ $toolbar

ilBasicSkillTemplateGUI::$toolbar
protected

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

Referenced by edit().

◆ $tpl


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