ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 addObjectsTab ($a_tabs)
 
 showObjects ()
 Show assigned objects. 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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and help().

43  {
44  global $DIC;
45 
46  $this->ctrl = $DIC->ctrl();
47  $this->tpl = $DIC["tpl"];
48  $this->tabs = $DIC->tabs();
49  $this->lng = $DIC->language();
50  $this->help = $DIC["ilHelp"];
51  $ilCtrl = $DIC->ctrl();
52 
53  $ilCtrl->saveParameter($this, "obj_id");
54  $this->tref_id = $a_tref_id;
55 
56  parent::__construct($a_node_id);
57  }
help()
Definition: help.php:2
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addCreationButtons()

static ilSkillTemplateCategoryGUI::addCreationButtons ( )
static

Add creation buttons.

Parameters

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

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

Referenced by ilSkillRootGUI\listTemplates().

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

◆ afterSave()

ilSkillTemplateCategoryGUI::afterSave ( )

After saving.

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

References ilSkillTreeNodeGUI\redirectToParent().

307  {
308  $this->redirectToParent(true);
309  }
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 263 of file class.ilSkillTemplateCategoryGUI.php.

References setTabs().

264  {
265  $this->setTabs("properties");
266  parent::editProperties();
267  }
+ Here is the call graph for this function:

◆ executeCommand()

ilSkillTemplateCategoryGUI::executeCommand ( )

Execute command.

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

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

71  {
72  $ilCtrl = $this->ctrl;
73  $tpl = $this->tpl;
74  $ilTabs = $this->tabs;
75 
76  //$tpl->getStandardTemplate();
77 
78  $next_class = $ilCtrl->getNextClass($this);
79  $cmd = $ilCtrl->getCmd();
80 
81  switch ($next_class) {
82  default:
83  $ret = $this->$cmd();
84  break;
85  }
86  }
$ret
Definition: parser.php:6

◆ getType()

ilSkillTemplateCategoryGUI::getType ( )

Get Node Type.

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

63  {
64  return "sctp";
65  }

◆ initForm()

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

Init form.

Parameters
string$a_modeedit mode

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

References $_GET.

155  {
156  $r = parent::initForm($a_mode);
157  if ($a_mode == "create") {
158  $ni = $this->form->getItemByPostVar("order_nr");
159  $tree = new ilSkillTree();
160  $max = $tree->getMaxOrderNr((int) $_GET["obj_id"], true);
161  $ni->setValue($max + 10);
162  }
163  return $r;
164  }
Skill tree.
$_GET["client_id"]

◆ listItems()

ilSkillTemplateCategoryGUI::listItems ( )

List items.

Parameters

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

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

173  {
174  $tpl = $this->tpl;
175  $lng = $this->lng;
176 
177  if ($this->isInUse()) {
178  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
179  }
180 
181  if ($this->checkPermissionBool("write")) {
182  if ($this->tref_id == 0) {
183  self::addCreationButtons();
184  }
185  }
186 
187  $this->setTabs("content");
188 
189  $table = new ilSkillCatTableGUI(
190  $this,
191  "listItems",
192  (int) $_GET["obj_id"],
194  $this->tref_id
195  );
196 
197  $tpl->setContent($table->getHTML());
198  }
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ saveItem()

ilSkillTemplateCategoryGUI::saveItem ( )

Save item.

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

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

274  {
275  if (!$this->checkPermissionBool("write")) {
276  return;
277  }
278 
279  $it = new ilSkillTemplateCategory();
280  $it->setTitle($this->form->getInput("title"));
281  $it->setDescription($this->form->getInput("description"));
282  $it->setOrderNr($this->form->getInput("order_nr"));
283  $it->create();
284  ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
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:

◆ setTabs()

ilSkillTemplateCategoryGUI::setTabs (   $a_tab)

output tabs

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

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

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

92  {
93  $ilTabs = $this->tabs;
94  $ilCtrl = $this->ctrl;
95  $tpl = $this->tpl;
96  $lng = $this->lng;
97  $ilHelp = $this->help;
98 
99  $ilTabs->clearTargets();
100  $ilHelp->setScreenIdComponent("skmg_sctp");
101 
102  // content
103  $ilTabs->addTab(
104  "content",
105  $lng->txt("content"),
106  $ilCtrl->getLinkTarget($this, 'listItems')
107  );
108 
109 
110  // properties
111  if ($this->tref_id == 0) {
112  $ilTabs->addTab(
113  "properties",
114  $lng->txt("settings"),
115  $ilCtrl->getLinkTarget($this, 'editProperties')
116  );
117  }
118 
119  // usage
120  $this->addUsageTab($ilTabs);
121 
122  // back link
123  if ($this->tref_id == 0) {
124  $ilCtrl->setParameterByClass(
125  "ilskillrootgui",
126  "obj_id",
127  $this->node_object->skill_tree->getRootId()
128  );
129  $ilTabs->setBackTarget(
130  $lng->txt("skmg_skill_templates"),
131  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listTemplates")
132  );
133  $ilCtrl->setParameterByClass(
134  "ilskillrootgui",
135  "obj_id",
136  $_GET["obj_id"]
137  );
138  }
139 
140  parent::setTitleIcon();
141  $tpl->setTitle(
142  $lng->txt("skmg_sctp") . ": " . $this->node_object->getTitle()
143  );
144  $this->setSkillNodeDescription();
145 
146  $ilTabs->activateTab($a_tab);
147  }
addUsageTab($a_tabs)
Add usage tab.
setSkillNodeDescription()
Set skill node description.
$_GET["client_id"]
+ 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 314 of file class.ilSkillTemplateCategoryGUI.php.

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

315  {
316  $tpl = $this->tpl;
317 
318  // (a) referenced skill template category in main tree
319  if ($this->tref_id > 0) {
320  return parent::showUsage();
321  }
322 
323  // (b) skill template category in templates view
324 
325  $this->setTabs("usage");
326 
327  $usage_info = new ilSkillUsage();
328  $usages = $usage_info->getAllUsagesOfTemplate((int) $_GET["obj_id"]);
329 
330  $html = "";
331  foreach ($usages as $k => $usage) {
332  $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
333  $html .= $tab->getHTML() . "<br/><br/>";
334  }
335 
336  $tpl->setContent($html);
337  }
$_GET["client_id"]
TableGUI class for skill usages.
Skill usage.
+ Here is the call graph for this function:

◆ updateItem()

ilSkillTemplateCategoryGUI::updateItem ( )

Update item.

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

References $_POST, and ilSkillTreeNodeGUI\checkPermissionBool().

291  {
292  if (!$this->checkPermissionBool("write")) {
293  return;
294  }
295 
296  $this->node_object->setTitle($this->form->getInput("title"));
297  $this->node_object->setDescription($this->form->getInput("description"));
298  $this->node_object->setOrderNr($this->form->getInput("order_nr"));
299  $this->node_object->setSelfEvaluation($_POST["self_eval"]);
300  $this->node_object->update();
301  }
checkPermissionBool($a_perm)
Check permission pool.
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilSkillTemplateCategoryGUI::$ctrl
protected

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

Referenced by executeCommand(), and setTabs().

◆ $help

ilSkillTemplateCategoryGUI::$help
protected

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

Referenced by setTabs().

◆ $lng

ilSkillTemplateCategoryGUI::$lng
protected

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

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

◆ $tabs

ilSkillTemplateCategoryGUI::$tabs
protected

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

Referenced by executeCommand(), and setTabs().

◆ $tpl

ilSkillTemplateCategoryGUI::$tpl
protected

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

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


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