ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSkillTemplateCategoryGUI Class Reference

Skill template category GUI class. More...

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

Public Member Functions

 __construct (Node\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 (Node\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
 
UI Factory $ui_fac
 
UI Renderer $ui_ren
 
object $parentgui
 
int $tref_id = 0
 
Node SkillTreeNodeManager $skill_tree_node_manager
 
SkillTreeAccess $tree_access_manager
 
Table TableManager $table_manager
 
Usage SkillUsageManager $usage_manager
 
ilSkillTreeRepository $tree_repo
 
int $skill_tree_id = 0
 
ilTabsGUI $tabs
 
SkillAdminGUIRequest $admin_gui_request
 
SkillUIService $skill_ui_service
 
int $requested_ref_id = 0
 
int $requested_node_id = 0
 
string $requested_backcmd = ""
 
bool $requested_tmpmode = false
 
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 ( Node\SkillTreeNodeManager  $node_manager,
int  $a_node_id = 0,
int  $a_tref_id = 0 
)

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

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

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

Member Function Documentation

◆ addCreationButtons()

static ilSkillTemplateCategoryGUI::addCreationButtons ( )
static

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

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

Referenced by ilSkillRootGUI\listTemplates().

226  : void
227  {
228  global $DIC;
229 
230  $ilCtrl = $DIC->ctrl();
231  $lng = $DIC->language();
232  $ilToolbar = $DIC->toolbar();
233  $ilUser = $DIC->user();
234  $admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
235 
237 
238  $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "tmpmode", 1);
239 
240  $ilCtrl->setParameterByClass(
241  "ilbasicskilltemplategui",
242  "node_id",
244  );
245  $ilToolbar->addButton(
246  $lng->txt("skmg_create_skill_template"),
247  $ilCtrl->getLinkTargetByClass("ilbasicskilltemplategui", "create")
248  );
249  $ilCtrl->setParameterByClass(
250  "ilskilltemplatecategorygui",
251  "node_id",
253  );
254  $ilToolbar->addButton(
255  $lng->txt("skmg_create_skill_template_category"),
256  $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "create")
257  );
258 
259  // skill templates from clipboard
260  $sep = false;
261  if ($ilUser->clipboardHasObjectsOfType("sktp")) {
262  $ilToolbar->addSeparator();
263  $sep = true;
264  $ilToolbar->addButton(
265  $lng->txt("skmg_insert_skill_template_from_clip"),
266  $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "insertSkillTemplateClip")
267  );
268  }
269 
270  // template categories from clipboard
271  if ($ilUser->clipboardHasObjectsOfType("sctp")) {
272  if (!$sep) {
273  $ilToolbar->addSeparator();
274  $sep = true;
275  }
276  $ilToolbar->addButton(
277  $lng->txt("skmg_insert_template_category_from_clip"),
278  $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "insertTemplateCategoryClip")
279  );
280  }
281  }
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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterSave()

ilSkillTemplateCategoryGUI::afterSave ( )

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

References redirectToParent().

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

◆ editProperties()

ilSkillTemplateCategoryGUI::editProperties ( )

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

References setTabs().

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

◆ executeCommand()

ilSkillTemplateCategoryGUI::executeCommand ( )

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

References $ctrl, $tabs, and $tpl.

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

◆ getType()

ilSkillTemplateCategoryGUI::getType ( )

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

57  : string
58  {
59  return "sctp";
60  }

◆ initForm()

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

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

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

159  : void
160  {
161  $lng = $this->lng;
162  $ilCtrl = $this->ctrl;
163 
164  $this->form = new ilPropertyFormGUI();
165 
166  // title
167  $ti = new ilTextInputGUI($lng->txt("title"), "title");
168  $ti->setMaxLength(200);
169  $ti->setSize(50);
170  $ti->setRequired(true);
171  $this->form->addItem($ti);
172 
173  // description
174  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
175  $ta->setRows(5);
176  $this->form->addItem($ta);
177 
178  // save and cancel commands
179  if ($this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
180  if ($a_mode == "create") {
181  $this->form->addCommandButton("save", $lng->txt("save"));
182  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
183  $this->form->setTitle($lng->txt("skmg_create_" . $this->getType()));
184  } else {
185  $this->form->addCommandButton("update", $lng->txt("save"));
186  $this->form->setTitle($lng->txt("skmg_edit_" . $this->getType()));
187  }
188  } else {
189  foreach ($this->form->getItems() as $item) {
190  $item->setDisabled(true);
191  }
192  }
193 
194  $ilCtrl->setParameter($this, "node_id", $this->requested_node_id);
195  $this->form->setFormAction($ilCtrl->getFormAction($this));
196  }
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, string $submit_caption="")
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 198 of file class.ilSkillTemplateCategoryGUI.php.

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

198  : void
199  {
200  $tpl = $this->tpl;
201  $lng = $this->lng;
202 
203  if ($this->isInUse()) {
204  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
205  }
206 
207  if ($this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
208  if ($this->tref_id == 0) {
209  self::addCreationButtons();
210  }
211  }
212 
213  $this->setTabs("content");
214 
215  $table = new ilSkillCatTableGUI(
216  $this,
217  "listItems",
218  $this->requested_node_id,
220  $this->tref_id
221  );
222 
223  $tpl->setContent($table->getHTML());
224  }
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 345 of file class.ilSkillTemplateCategoryGUI.php.

Referenced by afterSave().

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

◆ saveItem()

ilSkillTemplateCategoryGUI::saveItem ( )

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

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

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

◆ setTabs()

ilSkillTemplateCategoryGUI::setTabs ( string  $a_tab)

Definition at line 80 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().

80  : void
81  {
82  $ilTabs = $this->tabs;
83  $ilCtrl = $this->ctrl;
84  $tpl = $this->tpl;
85  $lng = $this->lng;
86  $ilHelp = $this->help;
87 
88  $ilTabs->clearTargets();
89  $ilHelp->setScreenIdComponent("skmg_sctp");
90 
91  // content
92  $ilTabs->addTab(
93  "content",
94  $lng->txt("content"),
95  $ilCtrl->getLinkTarget($this, 'listItems')
96  );
97 
98 
99  // properties
100  if ($this->tref_id == 0) {
101  $ilTabs->addTab(
102  "properties",
103  $lng->txt("settings"),
104  $ilCtrl->getLinkTarget($this, 'editProperties')
105  );
106  }
107 
108  // usage
109  $this->addUsageTab($ilTabs);
110 
111  $parent_node_id = $this->tree_repo->getParentNodeIdForNodeId($this->requested_node_id);
112  $parent_title = ilSkillTreeNode::_lookupTitle($parent_node_id);
113  $parent_type = ilSkillTreeNode::_lookupType($parent_node_id);
114 
115  // back link
116  if ($this->tref_id == 0) {
117  if ($parent_type === "sctp") {
118  $ilCtrl->setParameter(
119  $this,
120  "node_id",
121  $parent_node_id
122  );
123  $ilTabs->setBackTarget(
124  $parent_title,
125  $ilCtrl->getLinkTarget($this, "listItems")
126  );
127  $ilCtrl->setParameter(
128  $this,
129  "node_id",
130  $this->requested_node_id
131  );
132  } else {
133  $ilCtrl->setParameterByClass(
134  "ilskillrootgui",
135  "node_id",
136  $this->skill_tree_node_manager->getRootId()
137  );
138  $ilTabs->setBackTarget(
139  $lng->txt("skmg_skill_templates"),
140  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listTemplates")
141  );
142  $ilCtrl->setParameterByClass(
143  "ilskillrootgui",
144  "node_id",
145  $this->requested_node_id
146  );
147  }
148  }
149 
150  parent::setTitleIcon();
151  $tpl->setTitle(
152  $lng->txt("skmg_sctp") . ": " . $this->node_object->getTitle()
153  );
154  $this->setSkillNodeDescription();
155 
156  $ilTabs->activateTab($a_tab);
157  }
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 320 of file class.ilSkillTemplateCategoryGUI.php.

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

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

◆ updateItem()

ilSkillTemplateCategoryGUI::updateItem ( )

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

References ILIAS\Repository\form().

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

Field Documentation

◆ $ctrl

ilCtrl ilSkillTemplateCategoryGUI::$ctrl
protected

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

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

◆ $help

ilHelpGUI ilSkillTemplateCategoryGUI::$help
protected

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

Referenced by setTabs().

◆ $lng

ilLanguage ilSkillTemplateCategoryGUI::$lng
protected

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

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

◆ $tabs

ilTabsGUI ilSkillTemplateCategoryGUI::$tabs
protected

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

Referenced by executeCommand(), and setTabs().

◆ $tpl

ilGlobalTemplateInterface ilSkillTemplateCategoryGUI::$tpl
protected

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

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

◆ $tref_id

int ilSkillTemplateCategoryGUI::$tref_id = 0
protected

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


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