ILIAS  release_8 Revision v8.19
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 (Tree\SkillTreeNodeManager $node_manager, int $a_node_id=0, int $a_tref_id=0)
 
 getType ()
 
 executeCommand ()
 
 setTabs (string $a_tab)
 
 initForm (string $a_mode="edit")
 
 listItems ()
 
 editProperties ()
 
 saveItem ()
 
 updateItem ()
 
 afterSave ()
 
 showUsage ()
 
 redirectToParent (bool $a_tmp_mode=false)
 
- Public Member Functions inherited from ilSkillTreeNodeGUI
 __construct (Tree\SkillTreeNodeManager $node_manager, int $a_node_id=0)
 
 isInUse ()
 
 setParentGUI (object $a_parentgui)
 
 getParentGUI ()
 
 readNodeObject (int $a_node_id)
 Get node object instance. More...
 
 saveAllTitles ()
 
 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 ()
 
 confirmedDelete ()
 confirmed delete More...
 
 setSkillNodeDescription ()
 
 create ()
 Create skill tree node. More...
 
 addStatusInput (ilPropertyFormGUI $a_form)
 
 editProperties ()
 
 getPropertyValues ()
 Get property values for edit form. More...
 
 save ()
 Save skill tree node. More...
 
 afterSave ()
 
 update ()
 Update skill tree node. More...
 
 afterUpdate ()
 
 initForm (string $a_mode="edit")
 
 cancelSave ()
 
 redirectToParent (bool $a_tmp_mode=false)
 Redirect to parent (identified by current node_id) More...
 
 saveOrder ()
 
 insertBasicSkillClip ()
 
 insertSkillCategoryClip ()
 
 insertTemplateReferenceClip ()
 
 insertSkillTemplateClip ()
 
 insertTemplateCategoryClip ()
 
 setTitleIcon ()
 
 addUsageTab (ilTabsGUI $a_tabs)
 
 showUsage ()
 
 addObjectsTab (ilTabsGUI $a_tabs)
 
 showObjects ()
 
 exportSelectedNodes ()
 

Static Public Member Functions

static addCreationButtons ()
 

Protected Attributes

ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs
 
ilLanguage $lng
 
ilHelpGUI $help
 
int $tref_id = 0
 
- Protected Attributes inherited from ilSkillTreeNodeGUI
ilCtrl $ctrl
 
ilLanguage $lng
 
ilLocatorGUI $locator
 
ilGlobalTemplateInterface $tpl
 
ilObjUser $user
 
ilTree $tree
 
ilPropertyFormGUI $form
 
object $parentgui
 
int $tref_id = 0
 
Tree SkillTreeNodeManager $skill_tree_node_manager
 
SkillTreeAccess $tree_access_manager
 
ilSkillTreeRepository $tree_repo
 
int $skill_tree_id = 0
 
ilTabsGUI $tabs
 
SkillAdminGUIRequest $admin_gui_request
 
int $requested_ref_id = 0
 
int $requested_node_id = 0
 
string $requested_backcmd = ""
 
int $requested_tmpmode = 0
 
int $base_skill_id = 0
 
array $requested_node_ids = []
 
array $requested_node_order = []
 

Additional Inherited Members

- Data Fields inherited from ilSkillTreeNodeGUI
object $node_object = null
 
bool $in_use = false
 
bool $use_checked = false
 
ilAccessHandler $access
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSkillTemplateCategoryGUI::__construct ( Tree\SkillTreeNodeManager  $node_manager,
int  $a_node_id = 0,
int  $a_tref_id = 0 
)

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

39  {
40  global $DIC;
41 
42  $this->ctrl = $DIC->ctrl();
43  $this->tpl = $DIC["tpl"];
44  $this->tabs = $DIC->tabs();
45  $this->lng = $DIC->language();
46  $this->help = $DIC["ilHelp"];
47  $ilCtrl = $DIC->ctrl();
48 
49  $ilCtrl->saveParameter($this, "node_id");
50  $this->tref_id = $a_tref_id;
51 
52  parent::__construct($node_manager, $a_node_id);
53  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addCreationButtons()

static ilSkillTemplateCategoryGUI::addCreationButtons ( )
static

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

References ilSkillTreeNodeGUI\$admin_gui_request, $DIC, $ilUser, ilSkillTreeNodeGUI\$requested_node_id, ILIAS\Skill\Service\SkillAdminGUIRequest\getNodeId(), and ilLanguage\txt().

Referenced by ilSkillRootGUI\listTemplates().

224  : void
225  {
226  global $DIC;
227 
228  $ilCtrl = $DIC->ctrl();
229  $lng = $DIC->language();
230  $ilToolbar = $DIC->toolbar();
231  $ilUser = $DIC->user();
232  $admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
233 
235 
236  $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "tmpmode", 1);
237 
238  $ilCtrl->setParameterByClass(
239  "ilbasicskilltemplategui",
240  "node_id",
242  );
243  $ilToolbar->addButton(
244  $lng->txt("skmg_create_skill_template"),
245  $ilCtrl->getLinkTargetByClass("ilbasicskilltemplategui", "create")
246  );
247  $ilCtrl->setParameterByClass(
248  "ilskilltemplatecategorygui",
249  "node_id",
251  );
252  $ilToolbar->addButton(
253  $lng->txt("skmg_create_skill_template_category"),
254  $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "create")
255  );
256 
257  // skill templates from clipboard
258  $sep = false;
259  if ($ilUser->clipboardHasObjectsOfType("sktp")) {
260  $ilToolbar->addSeparator();
261  $sep = true;
262  $ilToolbar->addButton(
263  $lng->txt("skmg_insert_skill_template_from_clip"),
264  $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "insertSkillTemplateClip")
265  );
266  }
267 
268  // template categories from clipboard
269  if ($ilUser->clipboardHasObjectsOfType("sctp")) {
270  if (!$sep) {
271  $ilToolbar->addSeparator();
272  $sep = true;
273  }
274  $ilToolbar->addButton(
275  $lng->txt("skmg_insert_template_category_from_clip"),
276  $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "insertTemplateCategoryClip")
277  );
278  }
279  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
global $DIC
Definition: feed.php:28
SkillAdminGUIRequest $admin_gui_request
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterSave()

ilSkillTemplateCategoryGUI::afterSave ( )

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

References redirectToParent().

313  : void
314  {
315  $this->redirectToParent(true);
316  }
+ Here is the call graph for this function:

◆ editProperties()

ilSkillTemplateCategoryGUI::editProperties ( )

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

References setTabs().

281  : void
282  {
283  $this->setTabs("properties");
284  parent::editProperties();
285  }
+ Here is the call graph for this function:

◆ executeCommand()

ilSkillTemplateCategoryGUI::executeCommand ( )

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

References $ctrl, $tabs, and $tpl.

60  : void
61  {
62  $ilCtrl = $this->ctrl;
63  $tpl = $this->tpl;
64  $ilTabs = $this->tabs;
65 
66  //$tpl->getStandardTemplate();
67 
68  $next_class = $ilCtrl->getNextClass($this);
69  $cmd = $ilCtrl->getCmd();
70 
71  switch ($next_class) {
72  default:
73  $ret = $this->$cmd();
74  break;
75  }
76  }

◆ getType()

ilSkillTemplateCategoryGUI::getType ( )

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

55  : string
56  {
57  return "sctp";
58  }

◆ initForm()

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

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

References $ctrl, $lng, ILIAS\Repository\form(), ilTextAreaInputGUI\setRows(), and ilLanguage\txt().

157  : void
158  {
159  $lng = $this->lng;
160  $ilCtrl = $this->ctrl;
161 
162  $this->form = new ilPropertyFormGUI();
163 
164  // title
165  $ti = new ilTextInputGUI($lng->txt("title"), "title");
166  $ti->setMaxLength(200);
167  $ti->setSize(50);
168  $ti->setRequired(true);
169  $this->form->addItem($ti);
170 
171  // description
172  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
173  $ta->setRows(5);
174  $this->form->addItem($ta);
175 
176  // save and cancel commands
177  if ($this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
178  if ($a_mode == "create") {
179  $this->form->addCommandButton("save", $lng->txt("save"));
180  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
181  $this->form->setTitle($lng->txt("skmg_create_" . $this->getType()));
182  } else {
183  $this->form->addCommandButton("update", $lng->txt("save"));
184  $this->form->setTitle($lng->txt("skmg_edit_" . $this->getType()));
185  }
186  } else {
187  foreach ($this->form->getItems() as $item) {
188  $item->setDisabled(true);
189  }
190  }
191 
192  $ilCtrl->setParameter($this, "node_id", $this->requested_node_id);
193  $this->form->setFormAction($ilCtrl->getFormAction($this));
194  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
form( $class_path, string $cmd)
This class represents a text area property in a property form.
+ Here is the call graph for this function:

◆ listItems()

ilSkillTemplateCategoryGUI::listItems ( )

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

References $lng, $tpl, ilSkillTreeNodeGUI\isInUse(), ilSkillCatTableGUI\MODE_SCTP, ilGlobalTemplateInterface\setContent(), setTabs(), and ilLanguage\txt().

196  : void
197  {
198  $tpl = $this->tpl;
199  $lng = $this->lng;
200 
201  if ($this->isInUse()) {
202  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
203  }
204 
205  if ($this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
206  if ($this->tref_id == 0) {
207  self::addCreationButtons();
208  }
209  }
210 
211  $this->setTabs("content");
212 
213  $table = new ilSkillCatTableGUI(
214  $this,
215  "listItems",
216  $this->requested_node_id,
218  $this->tref_id
219  );
220 
221  $tpl->setContent($table->getHTML());
222  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ redirectToParent()

ilSkillTemplateCategoryGUI::redirectToParent ( bool  $a_tmp_mode = false)

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

Referenced by afterSave().

344  : void
345  {
346  parent::redirectToParent(true);
347  }
+ Here is the caller graph for this function:

◆ saveItem()

ilSkillTemplateCategoryGUI::saveItem ( )

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

References ILIAS\Repository\form(), and ilTree\POS_LAST_NODE.

287  : void
288  {
289  if (!$this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
290  return;
291  }
292 
293  $it = new ilSkillTemplateCategory();
294  $it->setTitle($this->form->getInput("title"));
295  $it->setDescription($this->form->getInput("description"));
296  $it->create();
297  $this->skill_tree_node_manager->putIntoTree($it, $this->requested_node_id, ilTree::POS_LAST_NODE);
298  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
form( $class_path, string $cmd)
const POS_LAST_NODE
+ Here is the call graph for this function:

◆ setTabs()

ilSkillTemplateCategoryGUI::setTabs ( string  $a_tab)

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

References $ctrl, $help, $lng, $tabs, $tpl, ilSkillTreeNode\_lookupTitle(), ilSkillTreeNode\_lookupType(), ilSkillTreeNodeGUI\addUsageTab(), ilHelpGUI\setScreenIdComponent(), ilSkillTreeNodeGUI\setSkillNodeDescription(), ilGlobalTemplateInterface\setTitle(), and ilLanguage\txt().

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

78  : void
79  {
80  $ilTabs = $this->tabs;
81  $ilCtrl = $this->ctrl;
82  $tpl = $this->tpl;
83  $lng = $this->lng;
84  $ilHelp = $this->help;
85 
86  $ilTabs->clearTargets();
87  $ilHelp->setScreenIdComponent("skmg_sctp");
88 
89  // content
90  $ilTabs->addTab(
91  "content",
92  $lng->txt("content"),
93  $ilCtrl->getLinkTarget($this, 'listItems')
94  );
95 
96 
97  // properties
98  if ($this->tref_id == 0) {
99  $ilTabs->addTab(
100  "properties",
101  $lng->txt("settings"),
102  $ilCtrl->getLinkTarget($this, 'editProperties')
103  );
104  }
105 
106  // usage
107  $this->addUsageTab($ilTabs);
108 
109  $parent_node_id = $this->tree_repo->getParentNodeIdForNodeId($this->requested_node_id);
110  $parent_title = ilSkillTreeNode::_lookupTitle($parent_node_id);
111  $parent_type = ilSkillTreeNode::_lookupType($parent_node_id);
112 
113  // back link
114  if ($this->tref_id == 0) {
115  if ($parent_type === "sctp") {
116  $ilCtrl->setParameter(
117  $this,
118  "node_id",
119  $parent_node_id
120  );
121  $ilTabs->setBackTarget(
122  $parent_title,
123  $ilCtrl->getLinkTarget($this, "listItems")
124  );
125  $ilCtrl->setParameter(
126  $this,
127  "node_id",
128  $this->requested_node_id
129  );
130  } else {
131  $ilCtrl->setParameterByClass(
132  "ilskillrootgui",
133  "node_id",
134  $this->skill_tree_node_manager->getRootId()
135  );
136  $ilTabs->setBackTarget(
137  $lng->txt("skmg_skill_templates"),
138  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listTemplates")
139  );
140  $ilCtrl->setParameterByClass(
141  "ilskillrootgui",
142  "node_id",
143  $this->requested_node_id
144  );
145  }
146  }
147 
148  parent::setTitleIcon();
149  $tpl->setTitle(
150  $lng->txt("skmg_sctp") . ": " . $this->node_object->getTitle()
151  );
152  $this->setSkillNodeDescription();
153 
154  $ilTabs->activateTab($a_tab);
155  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
addUsageTab(ilTabsGUI $a_tabs)
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
static _lookupType(int $a_obj_id)
setScreenIdComponent(string $a_comp)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUsage()

ilSkillTemplateCategoryGUI::showUsage ( )

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

References $tpl, ilGlobalTemplateInterface\setContent(), and setTabs().

318  : void
319  {
320  $tpl = $this->tpl;
321 
322  // (a) referenced skill template category in main tree
323  if ($this->tref_id > 0) {
324  parent::showUsage();
325  return;
326  }
327 
328  // (b) skill template category in templates view
329 
330  $this->setTabs("usage");
331 
332  $usage_info = new ilSkillUsage();
333  $usages = $usage_info->getAllUsagesOfTemplate($this->requested_node_id);
334 
335  $html = "";
336  foreach ($usages as $k => $usage) {
337  $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
338  $html .= $tab->getHTML() . "<br/><br/>";
339  }
340 
341  $tpl->setContent($html);
342  }
setContent(string $a_html)
Sets content for standard template.
TableGUI class for skill usages.
Skill usage.
+ Here is the call graph for this function:

◆ updateItem()

ilSkillTemplateCategoryGUI::updateItem ( )

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

References ILIAS\Repository\form().

300  : void
301  {
302  if (!$this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
303  return;
304  }
305 
306  $this->node_object->setTitle($this->form->getInput("title"));
307  $this->node_object->setDescription($this->form->getInput("description"));
308  $this->node_object->setOrderNr((int) $this->form->getInput("order_nr"));
309  $this->node_object->setSelfEvaluation((bool) $this->form->getInput("self_eval"));
310  $this->node_object->update();
311  }
form( $class_path, string $cmd)
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilSkillTemplateCategoryGUI::$ctrl
protected

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

Referenced by executeCommand(), initForm(), and setTabs().

◆ $help

ilHelpGUI ilSkillTemplateCategoryGUI::$help
protected

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

Referenced by setTabs().

◆ $lng

ilLanguage ilSkillTemplateCategoryGUI::$lng
protected

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

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

◆ $tabs

ilTabsGUI ilSkillTemplateCategoryGUI::$tabs
protected

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

Referenced by executeCommand(), and setTabs().

◆ $tpl

ilGlobalTemplateInterface ilSkillTemplateCategoryGUI::$tpl
protected

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

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

◆ $tref_id

int ilSkillTemplateCategoryGUI::$tref_id = 0
protected

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


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