ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 39 of file class.ilSkillTemplateCategoryGUI.php.

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

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

Member Function Documentation

◆ addCreationButtons()

static ilSkillTemplateCategoryGUI::addCreationButtons ( )
static

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

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

References redirectToParent().

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

◆ editProperties()

ilSkillTemplateCategoryGUI::editProperties ( )

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

References setTabs().

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

◆ executeCommand()

ilSkillTemplateCategoryGUI::executeCommand ( )

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

References $ctrl, $tabs, and $tpl.

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

◆ getType()

ilSkillTemplateCategoryGUI::getType ( )

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

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

◆ initForm()

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

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

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

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

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

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

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

288  : void
289  {
290  if (!$this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
291  return;
292  }
293 
294  $it = new ilSkillTemplateCategory();
295  $it->setTitle($this->form->getInput("title"));
296  $it->setDescription($this->form->getInput("description"));
297  $it->create();
298  $this->skill_tree_node_manager->putIntoTree($it, $this->requested_node_id, ilTree::POS_LAST_NODE);
299  }
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 79 of file class.ilSkillTemplateCategoryGUI.php.

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

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

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

◆ showUsage()

ilSkillTemplateCategoryGUI::showUsage ( )

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

References $tpl, ILIAS\UICore\GlobalTemplate\setContent(), and setTabs().

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

◆ updateItem()

ilSkillTemplateCategoryGUI::updateItem ( )

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

References ILIAS\Repository\form().

301  : void
302  {
303  if (!$this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
304  return;
305  }
306 
307  $this->node_object->setTitle($this->form->getInput("title"));
308  $this->node_object->setDescription($this->form->getInput("description"));
309  $this->node_object->setOrderNr((int) $this->form->getInput("order_nr"));
310  $this->node_object->setSelfEvaluation((bool) $this->form->getInput("self_eval"));
311  $this->node_object->update();
312  }
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 31 of file class.ilSkillTemplateCategoryGUI.php.

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

◆ $help

ilHelpGUI ilSkillTemplateCategoryGUI::$help
protected

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

Referenced by setTabs().

◆ $lng

ilLanguage ilSkillTemplateCategoryGUI::$lng
protected

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

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

◆ $tabs

ilTabsGUI ilSkillTemplateCategoryGUI::$tabs
protected

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

Referenced by executeCommand(), and setTabs().

◆ $tpl

ilGlobalTemplateInterface ilSkillTemplateCategoryGUI::$tpl
protected

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

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

◆ $tref_id

int ilSkillTemplateCategoryGUI::$tref_id = 0
protected

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


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