ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSkillTemplateCategoryGUI Class Reference

Skill template category GUI class. More...

+ Inheritance diagram for ilSkillTemplateCategoryGUI:
+ Collaboration diagram for ilSkillTemplateCategoryGUI:

Public Member Functions

 __construct ($a_node_id=0, $a_tref_id)
 Constructor. More...
 
 getType ()
 Get Node Type. More...
 
 executeCommand ()
 Execute command. More...
 
 setTabs ($a_tab)
 output tabs More...
 
 listItems ()
 List items. More...
 
 editProperties ()
 Edit properties. More...
 
 saveItem ()
 Save item. More...
 
 updateItem ()
 Update item. More...
 
 afterSave ()
 After saving. More...
 
 showUsage ()
 Show skill usage. 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...
 

Static Public Member Functions

static addCreationButtons ()
 Add creation buttons. More...
 

Additional Inherited Members

- Data Fields inherited from ilSkillTreeNodeGUI
 $node_object
 
 $in_use = false
 
 $use_checked = false
 
 $access
 
 $ref_id
 

Detailed Description

Skill template category GUI class.

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

ilSkillTemplateCategoryGUI: ilObjSkillManagementGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

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

References $ilCtrl.

24  {
25  global $ilCtrl;
26 
27  $ilCtrl->saveParameter($this, "obj_id");
28  $this->tref_id = $a_tref_id;
29 
30  parent::__construct($a_node_id);
31  }
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ addCreationButtons()

static ilSkillTemplateCategoryGUI::addCreationButtons ( )
static

Add creation buttons.

Parameters

Definition at line 144 of file class.ilSkillTemplateCategoryGUI.php.

References $_GET, $ilCtrl, $ilUser, and $lng.

Referenced by ilSkillRootGUI\listTemplates().

145  {
146  global $ilCtrl, $lng, $ilToolbar, $ilUser;
147 
148  $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "tmpmode", 1);
149 
150  $ilCtrl->setParameterByClass("ilbasicskilltemplategui",
151  "obj_id", (int) $_GET["obj_id"]);
152  $ilToolbar->addButton($lng->txt("skmg_create_skill_template"),
153  $ilCtrl->getLinkTargetByClass("ilbasicskilltemplategui", "create"));
154  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui",
155  "obj_id", (int) $_GET["obj_id"]);
156  $ilToolbar->addButton($lng->txt("skmg_create_skill_template_category"),
157  $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "create"));
158 
159  // skill templates from clipboard
160  $sep = false;
161  if ($ilUser->clipboardHasObjectsOfType("sktp"))
162  {
163  $ilToolbar->addSeparator();
164  $sep = true;
165  $ilToolbar->addButton($lng->txt("skmg_insert_skill_template_from_clip"),
166  $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "insertSkillTemplateClip"));
167  }
168 
169  // template categories from clipboard
170  if ($ilUser->clipboardHasObjectsOfType("sctp"))
171  {
172  if (!$sep)
173  {
174  $ilToolbar->addSeparator();
175  $sep = true;
176  }
177  $ilToolbar->addButton($lng->txt("skmg_insert_template_category_from_clip"),
178  $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "insertTemplateCategoryClip"));
179  }
180 
181  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ afterSave()

ilSkillTemplateCategoryGUI::afterSave ( )

After saving.

Definition at line 229 of file class.ilSkillTemplateCategoryGUI.php.

References ilSkillTreeNodeGUI\redirectToParent().

230  {
231  $this->redirectToParent(true);
232  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
+ Here is the call graph for this function:

◆ editProperties()

ilSkillTemplateCategoryGUI::editProperties ( )

Edit properties.

Definition at line 186 of file class.ilSkillTemplateCategoryGUI.php.

References setTabs().

187  {
188  $this->setTabs("properties");
189  parent::editProperties();
190  }
+ Here is the call graph for this function:

◆ executeCommand()

ilSkillTemplateCategoryGUI::executeCommand ( )

Execute command.

Definition at line 44 of file class.ilSkillTemplateCategoryGUI.php.

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

45  {
46  global $ilCtrl, $tpl, $ilTabs;
47 
48  //$tpl->getStandardTemplate();
49 
50  $next_class = $ilCtrl->getNextClass($this);
51  $cmd = $ilCtrl->getCmd();
52 
53  switch($next_class)
54  {
55  default:
56  $ret = $this->$cmd();
57  break;
58  }
59  }
$cmd
Definition: sahs_server.php:35
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6

◆ getType()

ilSkillTemplateCategoryGUI::getType ( )

Get Node Type.

Definition at line 36 of file class.ilSkillTemplateCategoryGUI.php.

37  {
38  return "sctp";
39  }

◆ listItems()

ilSkillTemplateCategoryGUI::listItems ( )

List items.

Parameters

Definition at line 112 of file class.ilSkillTemplateCategoryGUI.php.

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

113  {
114  global $tpl, $lng;
115 
116  if ($this->isInUse())
117  {
118  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
119  }
120 
121  if ($this->checkPermissionBool("write"))
122  {
123  if ($this->tref_id == 0)
124  {
125  self::addCreationButtons();
126  }
127  }
128 
129  $this->setTabs("content");
130 
131  include_once("./Services/Skill/classes/class.ilSkillCatTableGUI.php");
132  $table = new ilSkillCatTableGUI($this, "listItems", (int) $_GET["obj_id"],
133  ilSkillCatTableGUI::MODE_SCTP, $this->tref_id);
134 
135  $tpl->setContent($table->getHTML());
136  }
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
checkPermissionBool($a_perm)
Check permission pool.
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:

◆ saveItem()

ilSkillTemplateCategoryGUI::saveItem ( )

Save item.

Definition at line 196 of file class.ilSkillTemplateCategoryGUI.php.

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

197  {
198  if (!$this->checkPermissionBool("write"))
199  {
200  return;
201  }
202 
203  $it = new ilSkillTemplateCategory();
204  $it->setTitle($this->form->getInput("title"));
205  $it->setOrderNr($this->form->getInput("order_nr"));
206  $it->create();
207  ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
208  }
$_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:

◆ setTabs()

ilSkillTemplateCategoryGUI::setTabs (   $a_tab)

output tabs

Definition at line 64 of file class.ilSkillTemplateCategoryGUI.php.

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

Referenced by editProperties(), listItems(), and showUsage().

65  {
66  global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
67 
68  $ilTabs->clearTargets();
69  $ilHelp->setScreenIdComponent("skmg_sctp");
70 
71  // content
72  $ilTabs->addTab("content", $lng->txt("content"),
73  $ilCtrl->getLinkTarget($this, 'listItems'));
74 
75 
76  // properties
77  if ($this->tref_id == 0)
78  {
79  $ilTabs->addTab("properties", $lng->txt("settings"),
80  $ilCtrl->getLinkTarget($this, 'editProperties'));
81  }
82 
83  // usage
84  $this->addUsageTab($ilTabs);
85 
86  // back link
87  if ($this->tref_id == 0)
88  {
89  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
90  $this->node_object->skill_tree->getRootId());
91  $ilTabs->setBackTarget($lng->txt("skmg_skill_templates"),
92  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listTemplates"));
93  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
94  $_GET["obj_id"]);
95  }
96 
97  parent::setTitleIcon();
98  $tpl->setTitle(
99  $lng->txt("skmg_sctp").": ".$this->node_object->getTitle());
100  $this->setSkillNodeDescription();
101 
102  $ilTabs->activateTab($a_tab);
103 
104  }
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:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUsage()

ilSkillTemplateCategoryGUI::showUsage ( )

Show skill usage.

Definition at line 237 of file class.ilSkillTemplateCategoryGUI.php.

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

238  {
239  global $tpl;
240 
241  // (a) referenced skill template category in main tree
242  if ($this->tref_id > 0)
243  {
244  return parent::showUsage();
245  }
246 
247  // (b) skill template category in templates view
248 
249  $this->setTabs("usage");
250 
251  include_once("./Services/Skill/classes/class.ilSkillUsage.php");
252  $usage_info = new ilSkillUsage();
253  $usages = $usage_info->getAllUsagesOfTemplate((int) $_GET["obj_id"]);
254 
255  $html = "";
256  include_once("./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
257  foreach ($usages as $k => $usage)
258  {
259  $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
260  $html.= $tab->getHTML()."<br/><br/>";
261  }
262 
263  $tpl->setContent($html);
264  }
$_GET["client_id"]
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:

◆ updateItem()

ilSkillTemplateCategoryGUI::updateItem ( )

Update item.

Definition at line 213 of file class.ilSkillTemplateCategoryGUI.php.

References $_POST, and ilSkillTreeNodeGUI\checkPermissionBool().

214  {
215  if (!$this->checkPermissionBool("write"))
216  {
217  return;
218  }
219 
220  $this->node_object->setTitle($this->form->getInput("title"));
221  $this->node_object->setOrderNr($this->form->getInput("order_nr"));
222  $this->node_object->setSelfEvaluation($_POST["self_eval"]);
223  $this->node_object->update();
224  }
checkPermissionBool($a_perm)
Check permission pool.
$_POST["username"]
+ Here is the call graph for this function:

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