ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 initForm ($a_mode="edit")
 Init form. 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...
 

Protected Attributes

 $ctrl
 
 $tpl
 
 $tabs
 
 $lng
 
 $help
 
- 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

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$

@ilCtrl_isCalledBy 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 48 of file class.ilSkillTemplateCategoryGUI.php.

49 {
50 global $DIC;
51
52 $this->ctrl = $DIC->ctrl();
53 $this->tpl = $DIC["tpl"];
54 $this->tabs = $DIC->tabs();
55 $this->lng = $DIC->language();
56 $this->help = $DIC["ilHelp"];
57 $ilCtrl = $DIC->ctrl();
58
59 $ilCtrl->saveParameter($this, "obj_id");
60 $this->tref_id = $a_tref_id;
61
62 parent::__construct($a_node_id);
63 }
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7

References $DIC, and $ilCtrl.

Member Function Documentation

◆ addCreationButtons()

static ilSkillTemplateCategoryGUI::addCreationButtons ( )
static

Add creation buttons.

Parameters

return

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

215 {
216 global $DIC;
217
218 $ilCtrl = $DIC->ctrl();
219 $lng = $DIC->language();
220 $ilToolbar = $DIC->toolbar();
221 $ilUser = $DIC->user();
222
223 $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "tmpmode", 1);
224
225 $ilCtrl->setParameterByClass(
226 "ilbasicskilltemplategui",
227 "obj_id",
228 (int) $_GET["obj_id"]
229 );
230 $ilToolbar->addButton(
231 $lng->txt("skmg_create_skill_template"),
232 $ilCtrl->getLinkTargetByClass("ilbasicskilltemplategui", "create")
233 );
234 $ilCtrl->setParameterByClass(
235 "ilskilltemplatecategorygui",
236 "obj_id",
237 (int) $_GET["obj_id"]
238 );
239 $ilToolbar->addButton(
240 $lng->txt("skmg_create_skill_template_category"),
241 $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "create")
242 );
243
244 // skill templates from clipboard
245 $sep = false;
246 if ($ilUser->clipboardHasObjectsOfType("sktp")) {
247 $ilToolbar->addSeparator();
248 $sep = true;
249 $ilToolbar->addButton(
250 $lng->txt("skmg_insert_skill_template_from_clip"),
251 $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "insertSkillTemplateClip")
252 );
253 }
254
255 // template categories from clipboard
256 if ($ilUser->clipboardHasObjectsOfType("sctp")) {
257 if (!$sep) {
258 $ilToolbar->addSeparator();
259 $sep = true;
260 }
261 $ilToolbar->addButton(
262 $lng->txt("skmg_insert_template_category_from_clip"),
263 $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "insertTemplateCategoryClip")
264 );
265 }
266 }
$_GET["client_id"]
$ilUser
Definition: imgupload.php:18

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

Referenced by listItems(), and ilSkillRootGUI\listTemplates().

+ Here is the caller graph for this function:

◆ afterSave()

ilSkillTemplateCategoryGUI::afterSave ( )

After saving.

Reimplemented from ilSkillTreeNodeGUI.

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

313 {
314 $this->redirectToParent(true);
315 }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)

References ilSkillTreeNodeGUI\redirectToParent().

+ Here is the call graph for this function:

◆ editProperties()

ilSkillTemplateCategoryGUI::editProperties ( )

Edit properties.

Reimplemented from ilSkillTreeNodeGUI.

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

272 {
273 $this->setTabs("properties");
274 parent::editProperties();
275 }

References setTabs().

+ Here is the call graph for this function:

◆ executeCommand()

ilSkillTemplateCategoryGUI::executeCommand ( )

Execute command.

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

77 {
80 $ilTabs = $this->tabs;
81
82 //$tpl->getStandardTemplate();
83
84 $next_class = $ilCtrl->getNextClass($this);
85 $cmd = $ilCtrl->getCmd();
86
87 switch ($next_class) {
88 default:
89 $ret = $this->$cmd();
90 break;
91 }
92 }
$ret
Definition: parser.php:6

References $ctrl, $ilCtrl, $ret, $tabs, and $tpl.

◆ getType()

ilSkillTemplateCategoryGUI::getType ( )

Get Node Type.

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

69 {
70 return "sctp";
71 }

◆ initForm()

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

Init form.

Parameters
string$a_modeedit mode

Reimplemented from ilSkillTreeNodeGUI.

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

161 {
162 $r = parent::initForm($a_mode);
163 if ($a_mode == "create") {
164 $ni = $this->form->getItemByPostVar("order_nr");
165 include_once("./Services/Skill/classes/class.ilSkillTree.php");
166 $tree = new ilSkillTree();
167 $max = $tree->getMaxOrderNr((int) $_GET["obj_id"], true);
168 $ni->setValue($max + 10);
169 }
170 return $r;
171 }
$r
Definition: example_031.php:79

References $_GET, $r, and $tree.

◆ listItems()

ilSkillTemplateCategoryGUI::listItems ( )

List items.

Parameters

return

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

180 {
183
184 if ($this->isInUse()) {
185 ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
186 }
187
188 if ($this->checkPermissionBool("write")) {
189 if ($this->tref_id == 0) {
191 }
192 }
193
194 $this->setTabs("content");
195
196 include_once("./Services/Skill/classes/class.ilSkillCatTableGUI.php");
198 $this,
199 "listItems",
200 (int) $_GET["obj_id"],
202 $this->tref_id
203 );
204
205 $tpl->setContent($table->getHTML());
206 }
static addCreationButtons()
Add creation buttons.
checkPermissionBool($a_perm)
Check permission pool.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(empty($password)) $table
Definition: pwgen.php:24

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

+ Here is the call graph for this function:

◆ saveItem()

ilSkillTemplateCategoryGUI::saveItem ( )

Save item.

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

282 {
283 if (!$this->checkPermissionBool("write")) {
284 return;
285 }
286
287 $it = new ilSkillTemplateCategory();
288 $it->setTitle($this->form->getInput("title"));
289 $it->setOrderNr($this->form->getInput("order_nr"));
290 $it->create();
291 ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
292 }
const IL_LAST_NODE
Definition: class.ilTree.php:4
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.

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

+ Here is the call graph for this function:

◆ setTabs()

ilSkillTemplateCategoryGUI::setTabs (   $a_tab)

output tabs

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

98 {
99 $ilTabs = $this->tabs;
103 $ilHelp = $this->help;
104
105 $ilTabs->clearTargets();
106 $ilHelp->setScreenIdComponent("skmg_sctp");
107
108 // content
109 $ilTabs->addTab(
110 "content",
111 $lng->txt("content"),
112 $ilCtrl->getLinkTarget($this, 'listItems')
113 );
114
115
116 // properties
117 if ($this->tref_id == 0) {
118 $ilTabs->addTab(
119 "properties",
120 $lng->txt("settings"),
121 $ilCtrl->getLinkTarget($this, 'editProperties')
122 );
123 }
124
125 // usage
126 $this->addUsageTab($ilTabs);
127
128 // back link
129 if ($this->tref_id == 0) {
130 $ilCtrl->setParameterByClass(
131 "ilskillrootgui",
132 "obj_id",
133 $this->node_object->skill_tree->getRootId()
134 );
135 $ilTabs->setBackTarget(
136 $lng->txt("skmg_skill_templates"),
137 $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listTemplates")
138 );
139 $ilCtrl->setParameterByClass(
140 "ilskillrootgui",
141 "obj_id",
142 $_GET["obj_id"]
143 );
144 }
145
146 parent::setTitleIcon();
147 $tpl->setTitle(
148 $lng->txt("skmg_sctp") . ": " . $this->node_object->getTitle()
149 );
151
152 $ilTabs->activateTab($a_tab);
153 }
setSkillNodeDescription()
Set skill node description.
addUsageTab($a_tabs)
Add usage tab.

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUsage()

ilSkillTemplateCategoryGUI::showUsage ( )

Show skill usage.

Reimplemented from ilSkillTreeNodeGUI.

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

321 {
323
324 // (a) referenced skill template category in main tree
325 if ($this->tref_id > 0) {
326 return parent::showUsage();
327 }
328
329 // (b) skill template category in templates view
330
331 $this->setTabs("usage");
332
333 include_once("./Services/Skill/classes/class.ilSkillUsage.php");
334 $usage_info = new ilSkillUsage();
335 $usages = $usage_info->getAllUsagesOfTemplate((int) $_GET["obj_id"]);
336
337 $html = "";
338 include_once("./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
339 foreach ($usages as $k => $usage) {
340 $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
341 $html .= $tab->getHTML() . "<br/><br/>";
342 }
343
344 $tpl->setContent($html);
345 }
TableGUI class for skill usages.
$html
Definition: example_001.php:87

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

+ Here is the call graph for this function:

◆ updateItem()

ilSkillTemplateCategoryGUI::updateItem ( )

Update item.

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

298 {
299 if (!$this->checkPermissionBool("write")) {
300 return;
301 }
302
303 $this->node_object->setTitle($this->form->getInput("title"));
304 $this->node_object->setOrderNr($this->form->getInput("order_nr"));
305 $this->node_object->setSelfEvaluation($_POST["self_eval"]);
306 $this->node_object->update();
307 }
$_POST["username"]

References $_POST, and ilSkillTreeNodeGUI\checkPermissionBool().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilSkillTemplateCategoryGUI::$ctrl
protected

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

Referenced by executeCommand(), and setTabs().

◆ $help

ilSkillTemplateCategoryGUI::$help
protected

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

Referenced by setTabs().

◆ $lng

ilSkillTemplateCategoryGUI::$lng
protected

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

Referenced by addCreationButtons(), listItems(), and setTabs().

◆ $tabs

ilSkillTemplateCategoryGUI::$tabs
protected

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

Referenced by executeCommand(), and setTabs().

◆ $tpl

ilSkillTemplateCategoryGUI::$tpl
protected

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

Referenced by executeCommand(), listItems(), setTabs(), and showUsage().


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