ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilBasicSkillGUI Class Reference

Basic skill GUI class. More...

+ Inheritance diagram for ilBasicSkillGUI:
+ Collaboration diagram for ilBasicSkillGUI:

Public Member Functions

 __construct (Node\SkillTreeNodeManager $node_manager, int $a_node_id=0)
 
 getType ()
 
 executeCommand ()
 
 showProperties ()
 
 saveItem ()
 
 afterSave ()
 
 updateItem ()
 
 edit ()
 
 initForm (string $a_mode="edit")
 
 editProperties ()
 
 addLevel ()
 
 editLevel ()
 
 saveLevel ()
 
 updateLevel ()
 
 initLevelForm (string $a_mode="edit")
 
 updateLevelOrder ()
 
 confirmLevelDeletion ()
 
 deleteLevel ()
 
 setLevelHead ()
 
 setTabs (string $a_tab="levels")
 
 redirectToParent (bool $a_tmp_mode=false)
 Redirect to parent (identified by current node_id) More...
 
 showLevelResources ()
 
 addLevelResource ()
 
 saveLevelResource ()
 
 removeLevelResources ()
 
 saveResourcesAsSuggested ()
 
 saveResourcesAsNotSuggested ()
 
 saveResourcesAsTrigger ()
 
 saveResourcesAsNoTrigger ()
 
- 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 ()
 

Protected Attributes

ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs
 
ilHelpGUI $help
 
ilToolbarGUI $toolbar
 
ilLanguage $lng
 
Data Factory $df
 
ServerRequestInterface $request
 
ArrayBasedRequestWrapper $query
 
Resource SkillResourcesManager $resource_manager
 
int $tref_id = 0
 
int $requested_level_id = 0
 
int $requested_root_id = 0
 
array $requested_level_order = []
 
array $requested_level_ids = []
 
array $requested_resource_ids = []
 
array $requested_suggested = []
 
array $requested_trigger = []
 
string $requested_table_action = ""
 
array $requested_table_rep_ref_ids = []
 
- 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
 
DataFactory $data_factory
 
ExportFactoryInterface $export_factory
 
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

Basic skill GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e @ilCtrl_isCalledBy ilBasicSkillGUI: ilObjSkillManagementGUI, ilObjSkillTreeGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilBasicSkillGUI::__construct ( Node\SkillTreeNodeManager  $node_manager,
int  $a_node_id = 0 
)

Reimplemented from ilSkillTreeNodeGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

Definition at line 84 of file class.ilBasicSkillGUI.php.

85 {
86 global $DIC;
87
88 $this->ctrl = $DIC->ctrl();
89 $this->tpl = $DIC["tpl"];
90 $this->tabs = $DIC->tabs();
91 $this->help = $DIC["ilHelp"];
92 $this->toolbar = $DIC->toolbar();
93 $this->lng = $DIC->language();
94 $this->df = new \ILIAS\Data\Factory();
95 $this->request = $DIC->http()->request();
96 $this->query = $DIC->http()->wrapper()->query();
97 $ilCtrl = $DIC->ctrl();
98 $this->resource_manager = $DIC->skills()->internal()->manager()->getResourceManager();
99
100 $ilCtrl->saveParameter($this, array("node_id", "level_id"));
101 $this->base_skill_id = $a_node_id;
102
103 parent::__construct($node_manager, $a_node_id);
104
105 $this->requested_level_id = $this->admin_gui_request->getLevelId();
106 $this->requested_root_id = $this->admin_gui_request->getRootId();
107 $this->requested_level_order = $this->admin_gui_request->getOrder();
108 $this->requested_level_ids = $this->admin_gui_request->getLevelIds();
109 $this->requested_resource_ids = $this->admin_gui_request->getResourceIds();
110 $this->requested_suggested = $this->admin_gui_request->getSuggested();
111 $this->requested_trigger = $this->admin_gui_request->getTrigger();
112 $this->requested_table_action = $this->admin_gui_request->getTableLevelResourcesAction();
113 $this->requested_table_rep_ref_ids = $this->admin_gui_request->getTableRepoRefIds();
114 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ addLevel()

ilBasicSkillGUI::addLevel ( )

Definition at line 278 of file class.ilBasicSkillGUI.php.

278 : void
279 {
281
282 $form = $this->initLevelForm("create");
283 $tpl->setContent($this->ui_ren->render([$form]));
284 }
ilGlobalTemplateInterface $tpl
initLevelForm(string $a_mode="edit")
setContent(string $a_html)
Sets content for standard template.

References ilSkillTreeNodeGUI\$form, $tpl, initLevelForm(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ addLevelResource()

ilBasicSkillGUI::addLevelResource ( )

Definition at line 674 of file class.ilBasicSkillGUI.php.

674 : void
675 {
676 $ilTabs = $this->tabs;
678
679 $this->setLevelHead();
680 $ilTabs->activateTab("level_resources");
681
683 $this,
684 "addLevelResource",
685 $this,
686 "saveLevelResource",
687 "root_id",
688 "",
689 "rep_node_id"
690 );
691 if (!$exp->handleCommand()) {
692 $tpl->setContent($exp->getHTML());
693 }
694 }
Explorer for selecting repository items.

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

+ Here is the call graph for this function:

◆ afterSave()

ilBasicSkillGUI::afterSave ( )

Reimplemented from ilSkillTreeNodeGUI.

Reimplemented in ilBasicSkillTemplateGUI, and ilSkillTemplateReferenceGUI.

Definition at line 163 of file class.ilBasicSkillGUI.php.

163 : void
164 {
165 $ilCtrl = $this->ctrl;
166
167 $ilCtrl->setParameterByClass(
168 "ilbasicskillgui",
169 "node_id",
170 $this->node_object->getId()
171 );
172 $ilCtrl->redirectByClass("ilbasicskillgui", "edit");
173 }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc

References $ctrl, and ilCtrl\setParameterByClass().

+ Here is the call graph for this function:

◆ confirmLevelDeletion()

ilBasicSkillGUI::confirmLevelDeletion ( )

Definition at line 442 of file class.ilBasicSkillGUI.php.

442 : void
443 {
444 $ilCtrl = $this->ctrl;
447
448 if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
449 || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
450 return;
451 }
452
453 $this->setTabs("levels");
454
455 if (empty($this->requested_level_ids)) {
456 $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
457 $ilCtrl->redirect($this, "edit");
458 } else {
459 $cgui = new ilConfirmationGUI();
460 $cgui->setFormAction($ilCtrl->getFormAction($this));
461 $cgui->setHeaderText($lng->txt("skmg_really_delete_levels"));
462 $cgui->setCancel($lng->txt("cancel"), "edit");
463 $cgui->setConfirm($lng->txt("delete"), "deleteLevel");
464
465 foreach ($this->requested_level_ids as $i) {
466 $cgui->addItem("id[]", (string) $i, ilBasicSkill::lookupLevelTitle($i));
467 }
468
469 $tpl->setContent($cgui->getHTML());
470 }
471 }
setTabs(string $a_tab="levels")
static lookupLevelTitle(int $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...

References $ctrl, $lng, $tpl, ilBasicSkill\lookupLevelTitle(), ILIAS\UICore\GlobalTemplate\setContent(), setTabs(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ deleteLevel()

ilBasicSkillGUI::deleteLevel ( )

Definition at line 473 of file class.ilBasicSkillGUI.php.

473 : void
474 {
476 $ilCtrl = $this->ctrl;
477
478 if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
479 || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
480 return;
481 }
482
483 if (!empty($this->requested_level_ids)) {
484 foreach ($this->requested_level_ids as $id) {
485 $this->node_object->deleteLevel($id);
486 }
487 $this->node_object->fixLevelNumbering();
488 }
489 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
490 $ilCtrl->redirect($this, "edit");
491 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc

References $ctrl, $id, $lng, ilCtrl\redirect(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ edit()

ilBasicSkillGUI::edit ( )

Reimplemented in ilBasicSkillTemplateGUI.

Definition at line 189 of file class.ilBasicSkillGUI.php.

189 : void
190 {
192 $ilToolbar = $this->toolbar;
194 $ilCtrl = $this->ctrl;
195
196 $this->setTabs("levels");
197
198 if ($this->isInUse()) {
199 $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
200 } elseif ($this->tree_access_manager->hasManageCompetencesPermission()) {
201 $ilToolbar->addButton(
202 $lng->txt("skmg_add_level"),
203 $ilCtrl->getLinkTarget($this, "addLevel")
204 );
205 }
206
207 $table = new ilSkillLevelTableGUI(
208 $this->base_skill_id,
209 $this,
210 "edit",
211 0,
212 $this->isInUse(),
213 $this->tree_access_manager->hasManageCompetencesPermission()
214 );
215 $tpl->setContent($table->getHTML());
216 }

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

+ Here is the call graph for this function:

◆ editLevel()

ilBasicSkillGUI::editLevel ( )

Definition at line 286 of file class.ilBasicSkillGUI.php.

286 : void
287 {
290
291 if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
292 || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
293 return;
294 }
295
296 if ($this->isInUse()) {
297 $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
298 }
299
300 $form = $this->initLevelForm();
301 $tpl->setContent($this->ui_ren->render([$form]));
302 }

References ilSkillTreeNodeGUI\$form, $lng, $tpl, initLevelForm(), ilSkillTreeNodeGUI\isInUse(), ILIAS\UICore\GlobalTemplate\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ editProperties()

ilBasicSkillGUI::editProperties ( )

Reimplemented from ilSkillTreeNodeGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

Definition at line 265 of file class.ilBasicSkillGUI.php.

265 : void
266 {
267 $this->setTabs("properties");
268 parent::editProperties();
269 }

References setTabs().

+ Here is the call graph for this function:

◆ executeCommand()

ilBasicSkillGUI::executeCommand ( )

Reimplemented in ilSkillTemplateReferenceGUI.

Definition at line 121 of file class.ilBasicSkillGUI.php.

121 : void
122 {
123 $ilCtrl = $this->ctrl;
124 $ilTabs = $this->tabs;
126
127 //$tpl->getStandardTemplate();
128
129 $next_class = $ilCtrl->getNextClass($this);
130 $cmd = $ilCtrl->getCmd();
131 switch ($next_class) {
132 default:
133 $ret = $this->$cmd();
134 break;
135 }
136 }

References $ctrl, $lng, and $tabs.

◆ getType()

ilBasicSkillGUI::getType ( )

Reimplemented in ilBasicSkillTemplateGUI, and ilSkillTemplateReferenceGUI.

Definition at line 116 of file class.ilBasicSkillGUI.php.

116 : string
117 {
118 return "skll";
119 }

◆ initForm()

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

Reimplemented from ilSkillTreeNodeGUI.

Reimplemented in ilBasicSkillTemplateGUI, and ilSkillTemplateReferenceGUI.

Definition at line 218 of file class.ilBasicSkillGUI.php.

218 : void
219 {
221 $ilCtrl = $this->ctrl;
222
223 $this->form = new ilPropertyFormGUI();
224
225 // title
226 $ti = new ilTextInputGUI($lng->txt("title"), "title");
227 $ti->setMaxLength(200);
228 $ti->setSize(50);
229 $ti->setRequired(true);
230 $this->form->addItem($ti);
231
232 // description
233 $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
234 $ta->setRows(5);
235 $this->form->addItem($ta);
236
237 // status
238 $this->addStatusInput($this->form);
239
240 // selectable
241 $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
242 $cb->setInfo($lng->txt("skmg_selectable_info"));
243 $this->form->addItem($cb);
244
245 // save and cancel commands
246 if ($this->tree_access_manager->hasManageCompetencesPermission()) {
247 if ($a_mode == "create") {
248 $this->form->addCommandButton("save", $lng->txt("save"));
249 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
250 $this->form->setTitle($lng->txt("skmg_create_skll"));
251 } else {
252 $this->form->addCommandButton("update", $lng->txt("save"));
253 $this->form->setTitle($lng->txt("skmg_edit_skll"));
254 }
255 } else {
256 foreach ($this->form->getItems() as $item) {
257 $item->setDisabled(true);
258 }
259 }
260
261 $ilCtrl->setParameter($this, "node_id", $this->requested_node_id);
262 $this->form->setFormAction($ilCtrl->getFormAction($this));
263 }
This class represents a checkbox property in a property form.
This class represents a property form user interface.
addStatusInput(ilPropertyFormGUI $a_form)
This class represents a text area property in a property form.
This class represents a text property in a property form.
form( $class_path, string $cmd, string $submit_caption="")

References $ctrl, $lng, ilSkillTreeNodeGUI\addStatusInput(), ILIAS\Repository\form(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ initLevelForm()

ilBasicSkillGUI::initLevelForm ( string  $a_mode = "edit")

Definition at line 377 of file class.ilBasicSkillGUI.php.

377 : Form
378 {
380 $ilCtrl = $this->ctrl;
381 $ilTabs = $this->tabs;
382
383 $ilCtrl->saveParameter($this, "level_id");
384 $this->setLevelHead();
385 $ilTabs->activateTab("level_settings");
386
387 $input_ti = $this->ui_fac->input()->field()->text($lng->txt("title"))
388 ->withRequired(true);
389
390 $input_desc = $this->ui_fac->input()->field()->textarea($lng->txt("description"));
391
392 $ilCtrl->setParameter(
393 $this,
394 'level_settings',
395 'level_settings_config'
396 );
397
398 if ($a_mode == "create") {
399 $section_level = $this->ui_fac->input()->field()->section(
400 ["input_ti" => $input_ti,
401 "input_desc" => $input_desc],
402 $lng->txt("skmg_new_level")
403 );
404 $form_action = $ilCtrl->getFormAction($this, "saveLevel");
405 } else {
406 $data = $this->node_object->getLevelData($this->requested_level_id);
407 $input_ti = $input_ti->withValue($data["title"]);
408 $input_desc = $input_desc->withValue($data["description"]);
409
410 $section_level = $this->ui_fac->input()->field()->section(
411 ["input_ti" => $input_ti,
412 "input_desc" => $input_desc],
413 $lng->txt("skmg_edit_level")
414 );
415 $form_action = $ilCtrl->getFormAction($this, "updateLevel");
416 }
417
418 $form = $this->ui_fac->input()->container()->form()->standard(
419 $form_action,
420 ["section_level" => $section_level]
421 );
422
423 return $form;
424 }
This describes commonalities between all forms.
Definition: Form.php:33

References $ctrl, $data, ilSkillTreeNodeGUI\$form, $lng, $tabs, setLevelHead(), and ilLanguage\txt().

Referenced by addLevel(), editLevel(), saveLevel(), and updateLevel().

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

◆ redirectToParent()

ilBasicSkillGUI::redirectToParent ( bool  $a_tmp_mode = false)

Redirect to parent (identified by current node_id)

Reimplemented from ilSkillTreeNodeGUI.

Reimplemented in ilBasicSkillTemplateGUI, and ilSkillTemplateReferenceGUI.

Definition at line 622 of file class.ilBasicSkillGUI.php.

622 : void
623 {
624 $ilCtrl = $this->ctrl;
625
626 $t = ilSkillTreeNode::_lookupType($this->requested_node_id);
627
628 switch ($t) {
629 case "skrt":
630 $ilCtrl->setParameterByClass("ilskillrootgui", "node_id", $this->requested_node_id);
631 $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
632 break;
633 }
634
635 parent::redirectToParent();
636 }
static _lookupType(int $a_obj_id)

References $ctrl, and ilSkillTreeNode\_lookupType().

+ Here is the call graph for this function:

◆ removeLevelResources()

ilBasicSkillGUI::removeLevelResources ( )

Definition at line 723 of file class.ilBasicSkillGUI.php.

723 : void
724 {
725 $ilCtrl = $this->ctrl;
727
728 if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
729 || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
730 return;
731 }
732
733 if (!empty($this->requested_resource_ids)) {
734 foreach ($this->requested_resource_ids as $i) {
735 $this->resource_manager->removeResource(
736 $this->base_skill_id,
737 $this->tref_id,
738 $this->requested_level_id,
739 $i
740 );
741 }
742 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
743 }
744
745 $ilCtrl->redirect($this, "showLevelResources");
746 }

References $ctrl, $lng, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveItem()

ilBasicSkillGUI::saveItem ( )

Reimplemented in ilBasicSkillTemplateGUI, and ilSkillTemplateReferenceGUI.

Definition at line 147 of file class.ilBasicSkillGUI.php.

147 : void
148 {
149 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
150 return;
151 }
152
153 $it = new ilBasicSkill();
154 $it->setTitle($this->form->getInput("title"));
155 $it->setDescription($this->form->getInput("description"));
156 $it->setStatus((int) $this->form->getInput("status"));
157 $it->setSelfEvaluation((bool) $this->form->getInput("self_eval"));
158 $it->create();
159 $this->skill_tree_node_manager->putIntoTree($it, $this->requested_node_id, ilTree::POS_LAST_NODE);
160 $this->node_object = $it;
161 }
const POS_LAST_NODE

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

+ Here is the call graph for this function:

◆ saveLevel()

ilBasicSkillGUI::saveLevel ( )

Definition at line 304 of file class.ilBasicSkillGUI.php.

304 : void
305 {
308 $ilCtrl = $this->ctrl;
309
310 if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
311 || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
312 return;
313 }
314
315 $form = $this->initLevelForm("create");
316 if ($this->request->getMethod() == "POST"
317 && $this->request->getQueryParams()["level_settings"] == "level_settings_config") {
318 $form = $form->withRequest($this->request);
319 $result = $form->getData();
320
321 if (is_null($result)) {
322 $tpl->setContent($this->ui_ren->render($form));
323 return;
324 }
325
326 $this->node_object->addLevel(
327 $result["section_level"]["input_ti"],
328 $result["section_level"]["input_desc"]
329 );
330
331 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
332 $ilCtrl->redirect($this, "edit");
333 }
334
335 $tpl->setContent($this->ui_ren->render([$form]));
336 }

References $ctrl, ilSkillTreeNodeGUI\$form, $lng, $tpl, initLevelForm(), ILIAS\UICore\GlobalTemplate\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveLevelResource()

ilBasicSkillGUI::saveLevelResource ( )

Definition at line 696 of file class.ilBasicSkillGUI.php.

696 : void
697 {
698 $ilCtrl = $this->ctrl;
700
702 if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
703 || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
704 return;
705 }
706
707 if ($ref_id > 0) {
708 $this->resource_manager->setResource(
709 $this->base_skill_id,
710 $this->tref_id,
711 $this->requested_level_id,
712 $ref_id,
713 true,
714 false
715 );
716
717 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
718 }
719
720 $ilCtrl->redirect($this, "showLevelResources");
721 }
$ref_id
Definition: ltiauth.php:66

References $ctrl, $lng, $ref_id, $requested_root_id, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveResourcesAsNoTrigger()

ilBasicSkillGUI::saveResourcesAsNoTrigger ( )

Definition at line 877 of file class.ilBasicSkillGUI.php.

877 : void
878 {
879 $ilCtrl = $this->ctrl;
882
883 if ($this->requested_table_action == "unsetTrigger"
884 && !empty($this->requested_table_rep_ref_ids)
885 && $this->requested_table_rep_ref_ids[0] === "ALL_OBJECTS"
886 ) {
887 $resources = $this->resource_manager->getResourcesOfLevel(
888 $this->base_skill_id,
889 $this->tref_id,
890 $this->requested_level_id
891 );
892 foreach ($resources as $resource) {
893 $this->resource_manager->setResourceAsNoTrigger(
894 $resource->getBaseSkillId(),
895 $resource->getTrefId(),
896 $resource->getLevelId(),
897 $resource->getRepoRefId()
898 );
899 }
900 } elseif ($this->requested_table_action == "unsetTrigger") {
901 if (empty($this->requested_table_rep_ref_ids)) {
902 $tpl->setOnScreenMessage("info", $lng->txt("no_checkbox"), true);
903 $ilCtrl->redirect($this, "showLevelResources");
904 } else {
905 foreach ($this->requested_table_rep_ref_ids as $i) {
906 $this->resource_manager->setResourceAsNoTrigger(
907 $this->base_skill_id,
908 $this->tref_id,
909 $this->requested_level_id,
910 (int) $i
911 );
912 }
913 }
914 }
915
916 $tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
917 $ilCtrl->redirect($this, "showLevelResources");
918 }
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
$resources
Definition: ltiservices.php:68

References $ctrl, $lng, $resources, $tpl, ILIAS\UICore\GlobalTemplate\setOnScreenMessage(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveResourcesAsNotSuggested()

ilBasicSkillGUI::saveResourcesAsNotSuggested ( )

Definition at line 791 of file class.ilBasicSkillGUI.php.

791 : void
792 {
793 $ilCtrl = $this->ctrl;
796
797 if ($this->requested_table_action == "unsetSuggested"
798 && !empty($this->requested_table_rep_ref_ids)
799 && $this->requested_table_rep_ref_ids[0] === "ALL_OBJECTS"
800 ) {
801 $resources = $this->resource_manager->getResourcesOfLevel(
802 $this->base_skill_id,
803 $this->tref_id,
804 $this->requested_level_id
805 );
806 foreach ($resources as $resource) {
807 $this->resource_manager->setResourceAsNotSuggested(
808 $resource->getBaseSkillId(),
809 $resource->getTrefId(),
810 $resource->getLevelId(),
811 $resource->getRepoRefId()
812 );
813 }
814 } elseif ($this->requested_table_action == "unsetSuggested") {
815 if (empty($this->requested_table_rep_ref_ids)) {
816 $tpl->setOnScreenMessage("info", $lng->txt("no_checkbox"), true);
817 $ilCtrl->redirect($this, "showLevelResources");
818 } else {
819 foreach ($this->requested_table_rep_ref_ids as $i) {
820 $this->resource_manager->setResourceAsNotSuggested(
821 $this->base_skill_id,
822 $this->tref_id,
823 $this->requested_level_id,
824 (int) $i
825 );
826 }
827 }
828 }
829
830 $tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
831 $ilCtrl->redirect($this, "showLevelResources");
832 }

References $ctrl, $lng, $resources, $tpl, ILIAS\UICore\GlobalTemplate\setOnScreenMessage(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveResourcesAsSuggested()

ilBasicSkillGUI::saveResourcesAsSuggested ( )

Definition at line 748 of file class.ilBasicSkillGUI.php.

748 : void
749 {
750 $ilCtrl = $this->ctrl;
753
754 if ($this->requested_table_action == "setSuggested"
755 && !empty($this->requested_table_rep_ref_ids)
756 && $this->requested_table_rep_ref_ids[0] === "ALL_OBJECTS"
757 ) {
758 $resources = $this->resource_manager->getResourcesOfLevel(
759 $this->base_skill_id,
760 $this->tref_id,
761 $this->requested_level_id
762 );
763 foreach ($resources as $resource) {
764 $this->resource_manager->setResourceAsSuggested(
765 $resource->getBaseSkillId(),
766 $resource->getTrefId(),
767 $resource->getLevelId(),
768 $resource->getRepoRefId()
769 );
770 }
771 } elseif ($this->requested_table_action == "setSuggested") {
772 if (empty($this->requested_table_rep_ref_ids)) {
773 $tpl->setOnScreenMessage("info", $lng->txt("no_checkbox"), true);
774 $ilCtrl->redirect($this, "showLevelResources");
775 } else {
776 foreach ($this->requested_table_rep_ref_ids as $i) {
777 $this->resource_manager->setResourceAsSuggested(
778 $this->base_skill_id,
779 $this->tref_id,
780 $this->requested_level_id,
781 (int) $i
782 );
783 }
784 }
785 }
786
787 $tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
788 $ilCtrl->redirect($this, "showLevelResources");
789 }

References $ctrl, $lng, $resources, $tpl, ILIAS\UICore\GlobalTemplate\setOnScreenMessage(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveResourcesAsTrigger()

ilBasicSkillGUI::saveResourcesAsTrigger ( )

Definition at line 834 of file class.ilBasicSkillGUI.php.

834 : void
835 {
836 $ilCtrl = $this->ctrl;
839
840 if ($this->requested_table_action == "setTrigger"
841 && !empty($this->requested_table_rep_ref_ids)
842 && $this->requested_table_rep_ref_ids[0] === "ALL_OBJECTS"
843 ) {
844 $resources = $this->resource_manager->getResourcesOfLevel(
845 $this->base_skill_id,
846 $this->tref_id,
847 $this->requested_level_id
848 );
849 foreach ($resources as $resource) {
850 $this->resource_manager->setResourceAsTrigger(
851 $resource->getBaseSkillId(),
852 $resource->getTrefId(),
853 $resource->getLevelId(),
854 $resource->getRepoRefId()
855 );
856 }
857 } elseif ($this->requested_table_action == "setTrigger") {
858 if (empty($this->requested_table_rep_ref_ids)) {
859 $tpl->setOnScreenMessage("info", $lng->txt("no_checkbox"), true);
860 $ilCtrl->redirect($this, "showLevelResources");
861 } else {
862 foreach ($this->requested_table_rep_ref_ids as $i) {
863 $this->resource_manager->setResourceAsTrigger(
864 $this->base_skill_id,
865 $this->tref_id,
866 $this->requested_level_id,
867 (int) $i
868 );
869 }
870 }
871 }
872
873 $tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
874 $ilCtrl->redirect($this, "showLevelResources");
875 }

References $ctrl, $lng, $resources, $tpl, ILIAS\UICore\GlobalTemplate\setOnScreenMessage(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ setLevelHead()

ilBasicSkillGUI::setLevelHead ( )

Reimplemented in ilBasicSkillTemplateGUI.

Definition at line 493 of file class.ilBasicSkillGUI.php.

493 : void
494 {
495 $ilTabs = $this->tabs;
496 $ilCtrl = $this->ctrl;
499 $ilHelp = $this->help;
500
501 // tabs
502 $ilTabs->clearTargets();
503 $ilHelp->setScreenIdComponent("skmg_lev");
504
505 $ilTabs->setBackTarget(
506 $lng->txt("back"),
507 $ilCtrl->getLinkTarget($this, "edit")
508 );
509
510 if ($this->requested_level_id > 0) {
511 $ilTabs->addTab(
512 "level_settings",
513 $lng->txt("settings"),
514 $ilCtrl->getLinkTarget($this, "editLevel")
515 );
516
517 $ilTabs->addTab(
518 "level_resources",
519 $lng->txt("skmg_resources"),
520 $ilCtrl->getLinkTarget($this, "showLevelResources")
521 );
522 }
523
524 // title
525 if ($this->requested_level_id > 0) {
526 $tpl->setTitle($lng->txt("skmg_skill_level") . ": " .
527 ilBasicSkill::lookupLevelTitle($this->requested_level_id));
528 } else {
529 $tpl->setTitle($lng->txt("skmg_skill_level"));
530 }
531
532 $desc = $this->skill_tree_node_manager->getWrittenPath($this->node_object->getId());
533 $tpl->setDescription($desc);
534 }
setScreenIdComponent(string $a_comp)
setDescription(string $a_descr)
Sets description below title in standard template.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.

References $ctrl, $help, $lng, $tabs, $tpl, ilBasicSkill\lookupLevelTitle(), ILIAS\UICore\GlobalTemplate\setDescription(), ilHelpGUI\setScreenIdComponent(), ILIAS\UICore\GlobalTemplate\setTitle(), and ilLanguage\txt().

Referenced by addLevelResource(), initLevelForm(), and showLevelResources().

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

◆ setTabs()

ilBasicSkillGUI::setTabs ( string  $a_tab = "levels")

Reimplemented in ilBasicSkillTemplateGUI.

Definition at line 536 of file class.ilBasicSkillGUI.php.

536 : void
537 {
538 $ilTabs = $this->tabs;
539 $ilCtrl = $this->ctrl;
542 $ilHelp = $this->help;
543
544 $ilTabs->clearTargets();
545 $ilHelp->setScreenIdComponent("skmg_skll");
546 // $ilTabs->setBackTarget($lng->txt("skmg_skill_hierarchie"),
547 // $ilCtrl->getLinkTargetByClass("ilobjskillmanagementgui", "editSkills"));
548
549 if (is_object($this->node_object)) {
550 // levels
551 $ilTabs->addTab(
552 "levels",
553 $lng->txt("skmg_skill_levels"),
554 $ilCtrl->getLinkTarget($this, 'edit')
555 );
556
557 // properties
558 $ilTabs->addTab(
559 "properties",
560 $lng->txt("settings"),
561 $ilCtrl->getLinkTarget($this, 'editProperties')
562 );
563
564 // usage
565 $this->addUsageTab($ilTabs);
566
567 // assigned objects
568 $this->addObjectsTab($ilTabs);
569
570 $parent_node_id = $this->tree_repo->getParentNodeIdForNodeId($this->requested_node_id);
571 $parent_title = ilSkillTreeNode::_lookupTitle($parent_node_id);
572 $parent_type = ilSkillTreeNode::_lookupType($parent_node_id);
573
574 if ($parent_type === "scat") {
575 $ilCtrl->setParameterByClass(
576 "ilskillcategorygui",
577 "node_id",
578 $parent_node_id
579 );
580 $ilTabs->setBackTarget(
581 $parent_title,
582 $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "listItems")
583 );
584 $ilCtrl->setParameterByClass(
585 "ilskillcategorygui",
586 "node_id",
587 ""
588 );
589 } else {
590 $ilCtrl->setParameterByClass(
591 "ilskillrootgui",
592 "node_id",
593 $this->skill_tree_node_manager->getRootId()
594 );
595 $ilTabs->setBackTarget(
596 $lng->txt("skmg_skills"),
597 $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listSkills")
598 );
599 $ilCtrl->setParameterByClass(
600 "ilskillrootgui",
601 "node_id",
602 $this->requested_node_id
603 );
604 }
605
606 $ilTabs->activateTab($a_tab);
607
608 $tpl->setTitle($lng->txt("skmg_skill") . ": " .
609 $this->node_object->getTitle());
610
612 } else {
613 $tpl->setTitle($lng->txt("skmg_skill"));
614 $tpl->setDescription("");
615 }
616 parent::setTitleIcon();
617 }
addUsageTab(ilTabsGUI $a_tabs)
addObjectsTab(ilTabsGUI $a_tabs)
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)

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

Referenced by confirmLevelDeletion(), edit(), editProperties(), and showProperties().

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

◆ showLevelResources()

ilBasicSkillGUI::showLevelResources ( )

Definition at line 643 of file class.ilBasicSkillGUI.php.

643 : void
644 {
646 $ilTabs = $this->tabs;
647 $ilToolbar = $this->toolbar;
649 $ilCtrl = $this->ctrl;
650
651 if ($this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
652 || $this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
653 $ilToolbar->addButton(
654 $lng->txt("skmg_add_resource"),
655 $ilCtrl->getLinkTarget($this, "addLevelResource")
656 );
657 } else {
658 return;
659 }
660
661 $this->setLevelHead();
662 $ilTabs->activateTab("level_resources");
663
664 $table = $this->table_manager->getLevelResourcesTable(
665 $this->requested_ref_id,
666 $this->base_skill_id,
667 $this->tref_id,
668 $this->requested_level_id
669 )->getComponent();
670
671 $tpl->setContent($this->ui_ren->render($table));
672 }

References $ctrl, $lng, $tabs, $toolbar, $tpl, ILIAS\UICore\GlobalTemplate\setContent(), setLevelHead(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ showProperties()

ilBasicSkillGUI::showProperties ( )

Definition at line 138 of file class.ilBasicSkillGUI.php.

138 : void
139 {
141
142 $this->setTabs();
143
144 $tpl->setContent("Properties");
145 }

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

+ Here is the call graph for this function:

◆ updateItem()

ilBasicSkillGUI::updateItem ( )

Definition at line 175 of file class.ilBasicSkillGUI.php.

175 : void
176 {
177 if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
178 || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
179 return;
180 }
181
182 $this->node_object->setTitle($this->form->getInput("title"));
183 $this->node_object->setDescription($this->form->getInput("description"));
184 $this->node_object->setSelfEvaluation((bool) $this->form->getInput("self_eval"));
185 $this->node_object->setStatus((int) $this->form->getInput("status"));
186 $this->node_object->update();
187 }

References ILIAS\Repository\form().

+ Here is the call graph for this function:

◆ updateLevel()

ilBasicSkillGUI::updateLevel ( )

Definition at line 338 of file class.ilBasicSkillGUI.php.

338 : void
339 {
341 $ilCtrl = $this->ctrl;
343
344 if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
345 || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
346 return;
347 }
348
349 $form = $this->initLevelForm("edit");
350 if ($this->request->getMethod() == "POST"
351 && $this->request->getQueryParams()["level_settings"] == "level_settings_config") {
352 $form = $form->withRequest($this->request);
353 $result = $form->getData();
354
355 if (is_null($result)) {
356 $tpl->setContent($this->ui_ren->render($form));
357 return;
358 }
359
360 $this->node_object->writeLevelTitle(
361 $this->requested_level_id,
362 $result["section_level"]["input_ti"]
363 );
364
365 $this->node_object->writeLevelDescription(
366 $this->requested_level_id,
367 $result["section_level"]["input_desc"]
368 );
369
370 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
371 $ilCtrl->redirect($this, "edit");
372 }
373
374 $tpl->setContent($this->ui_ren->render([$form]));
375 }

References $ctrl, ilSkillTreeNodeGUI\$form, $lng, $tpl, initLevelForm(), ILIAS\UICore\GlobalTemplate\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ updateLevelOrder()

ilBasicSkillGUI::updateLevelOrder ( )

Definition at line 426 of file class.ilBasicSkillGUI.php.

426 : void
427 {
429 $ilCtrl = $this->ctrl;
430
431 if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
432 || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
433 return;
434 }
435
436 $order = ilArrayUtil::stripSlashesArray($this->requested_level_order);
437 $this->node_object->updateLevelOrder($order);
438 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
439 $ilCtrl->redirect($this, "edit");
440 }
static stripSlashesArray(array $a_arr, bool $a_strip_html=true, string $a_allow="")

References $ctrl, $lng, ilArrayUtil\stripSlashesArray(), and ilLanguage\txt().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

◆ $df

Data Factory ilBasicSkillGUI::$df
protected

Definition at line 43 of file class.ilBasicSkillGUI.php.

◆ $help

ilHelpGUI ilBasicSkillGUI::$help
protected

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

Referenced by setLevelHead(), and setTabs().

◆ $lng

◆ $query

ArrayBasedRequestWrapper ilBasicSkillGUI::$query
protected

Definition at line 45 of file class.ilBasicSkillGUI.php.

◆ $request

ServerRequestInterface ilBasicSkillGUI::$request
protected

Definition at line 44 of file class.ilBasicSkillGUI.php.

◆ $requested_level_id

int ilBasicSkillGUI::$requested_level_id = 0
protected

Definition at line 49 of file class.ilBasicSkillGUI.php.

◆ $requested_level_ids

array ilBasicSkillGUI::$requested_level_ids = []
protected

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

◆ $requested_level_order

array ilBasicSkillGUI::$requested_level_order = []
protected

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

◆ $requested_resource_ids

array ilBasicSkillGUI::$requested_resource_ids = []
protected

Definition at line 65 of file class.ilBasicSkillGUI.php.

◆ $requested_root_id

int ilBasicSkillGUI::$requested_root_id = 0
protected

Definition at line 50 of file class.ilBasicSkillGUI.php.

Referenced by saveLevelResource().

◆ $requested_suggested

array ilBasicSkillGUI::$requested_suggested = []
protected

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

◆ $requested_table_action

string ilBasicSkillGUI::$requested_table_action = ""
protected

Definition at line 77 of file class.ilBasicSkillGUI.php.

◆ $requested_table_rep_ref_ids

array ilBasicSkillGUI::$requested_table_rep_ref_ids = []
protected

Definition at line 82 of file class.ilBasicSkillGUI.php.

◆ $requested_trigger

array ilBasicSkillGUI::$requested_trigger = []
protected

Definition at line 75 of file class.ilBasicSkillGUI.php.

◆ $resource_manager

Resource SkillResourcesManager ilBasicSkillGUI::$resource_manager
protected

Definition at line 46 of file class.ilBasicSkillGUI.php.

◆ $tabs

ilTabsGUI ilBasicSkillGUI::$tabs
protected

◆ $toolbar

ilToolbarGUI ilBasicSkillGUI::$toolbar
protected

Definition at line 41 of file class.ilBasicSkillGUI.php.

Referenced by edit(), and showLevelResources().

◆ $tpl

◆ $tref_id

int ilBasicSkillGUI::$tref_id = 0
protected

Definition at line 48 of file class.ilBasicSkillGUI.php.


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