ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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, ILIAS\GlobalScreen\Provider\__construct(), and help().

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 $ilCtrl
Definition: ilias.php:18
help()
Definition: help.php:2
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ afterSave()

ilBasicSkillTemplateGUI::afterSave ( )

After saving.

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

References $ctrl, and $ilCtrl.

297  {
299 
300  $ilCtrl->setParameterByClass(
301  "ilbasicskilltemplategui",
302  "obj_id",
303  $this->node_object->getId()
304  );
305  $ilCtrl->redirectByClass("ilbasicskilltemplategui", "edit");
306  }
global $ilCtrl
Definition: ilias.php:18

◆ edit()

ilBasicSkillTemplateGUI::edit ( )

Edit skill.

Parameters

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

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

315  {
316  $tpl = $this->tpl;
317  $ilToolbar = $this->toolbar;
318  $lng = $this->lng;
320 
321  $this->setTabs("levels");
322 
323  if ($this->isInUse()) {
324  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
325  } else {
326  if ($this->checkPermissionBool("write")) {
327  if ($this->tref_id == 0) {
328  $ilToolbar->addButton(
329  $lng->txt("skmg_add_level"),
330  $ilCtrl->getLinkTarget($this, "addLevel")
331  );
332  }
333  }
334  }
335 
336  include_once("./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
337  $table = new ilSkillLevelTableGUI((int) $_GET["obj_id"], $this, "edit", $this->tref_id, $this->isInUse());
338  $tpl->setContent($table->getHTML());
339  }
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.
+ 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 ilTextAreaInputGUI\setRows().

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  // description
101  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
102  $ta->setRows(5);
103  $this->form->addItem($ta);
104 
105  // order nr
106  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
107  $ni->setInfo($lng->txt("skmg_order_nr_info"));
108  $ni->setMaxLength(6);
109  $ni->setSize(6);
110  $ni->setRequired(true);
111  if ($a_mode == "create") {
112  include_once("./Services/Skill/classes/class.ilSkillTree.php");
113  $tree = new ilSkillTree();
114  $max = $tree->getMaxOrderNr((int) $_GET["obj_id"], true);
115  $ni->setValue($max + 10);
116  }
117  $this->form->addItem($ni);
118 
119  // save and cancel commands
120  if ($this->checkPermissionBool("write")) {
121  if ($a_mode == "create") {
122  $this->form->addCommandButton("save", $lng->txt("save"));
123  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
124  $this->form->setTitle($lng->txt("skmg_create_skll"));
125  } else {
126  $this->form->addCommandButton("update", $lng->txt("save"));
127  $this->form->setTitle($lng->txt("skmg_edit_skll"));
128  }
129  }
130 
131  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
132  $this->form->setFormAction($ilCtrl->getFormAction($this));
133  }
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 area property in a property form.
+ Here is the call graph for this function:

◆ saveItem()

ilBasicSkillTemplateGUI::saveItem ( )

Save item.

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

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

279  {
280  if (!$this->checkPermissionBool("write")) {
281  return;
282  }
283 
284  $it = new ilBasicSkillTemplate();
285  $it->setTitle($this->form->getInput("title"));
286  $it->setDescription($this->form->getInput("description"));
287  $it->setOrderNr($this->form->getInput("order_nr"));
288  $it->create();
289  ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
290  $this->node_object = $it;
291  }
$_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 138 of file class.ilBasicSkillTemplateGUI.php.

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

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

◆ setTabs()

ilBasicSkillTemplateGUI::setTabs (   $a_tab = "")

Set header for skill.

Parameters

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

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

Referenced by edit(), and showUsage().

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

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

345  {
346  $tpl = $this->tpl;
347 
348 
349  // (a) referenced skill template in main tree
350  if ($this->tref_id > 0) {
351  return parent::showUsage();
352  }
353 
354  // (b) skill template in templates view
355 
356  $this->setTabs("usage");
357 
358  include_once("./Services/Skill/classes/class.ilSkillUsage.php");
359  $usage_info = new ilSkillUsage();
360  $usages = $usage_info->getAllUsagesOfTemplate($this->base_skill_id);
361 
362  $html = "";
363  include_once("./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
364  foreach ($usages as $k => $usage) {
365  $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
366  $html .= $tab->getHTML() . "<br/><br/>";
367  }
368 
369  $tpl->setContent($html);
370  }
setTabs($a_tab="")
Set header for skill.
TableGUI class for skill usages.
Skill usage.
+ 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: