ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilMStListCompetencesSkillsGUI.php
Go to the documentation of this file.
1<?php
2
22
29{
30 public const string CMD_APPLY_FILTER = 'applyFilter';
31 public const string CMD_INDEX = 'index';
32 public const string CMD_GET_ACTIONS = "getActions";
33 public const string CMD_RESET_FILTER = 'resetFilter';
36 private Container $dic;
37 private \ilGlobalTemplateInterface $main_tpl;
38
39 public function __construct(Container $dic)
40 {
41 global $DIC;
42 $this->main_tpl = $DIC->ui()->mainTemplate();
43 $this->access = ilMyStaffAccess::getInstance();
44 $this->dic = $dic;
45 }
46
47 protected function checkAccessOrFail(): void
48 {
49 if ($this->access->hasCurrentUserAccessToCompetences()) {
50 return;
51 } else {
52 $this->main_tpl->setOnScreenMessage('failure', $this->dic->language()->txt("permission_denied"), true);
53 $this->dic->ctrl()->redirectByClass(ilDashboardGUI::class, "");
54 }
55 }
56
57 final public function executeCommand(): void
58 {
59 $cmd = $this->dic->ctrl()->getCmd();
60 $next_class = $this->dic->ctrl()->getNextClass();
61 switch ($next_class) {
62 default:
63 switch ($cmd) {
66 case self::CMD_INDEX:
68 $this->$cmd();
69 break;
70 default:
71 $this->index();
72 break;
73 }
74 break;
75 }
76 }
77
78 final public function index(): void
79 {
80 $this->listUsers();
81 }
82
83 final public function listUsers(): void
84 {
85 $this->checkAccessOrFail();
86
87 $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_INDEX, $this->dic);
88 $this->dic->ui()->mainTemplate()->setTitle($this->dic->language()->txt('mst_list_competences'));
89 $this->dic->ui()->mainTemplate()->setTitleIcon(ilUtil::getImagePath('standard/icon_skmg.svg'));
90 $this->dic->ui()->mainTemplate()->setContent($this->table->getHTML());
91 }
92
93 final public function applyFilter(): void
94 {
95 $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_APPLY_FILTER, $this->dic);
96 $this->table->writeFilterToSession();
97 $this->table->resetOffset();
98 $this->index();
99 }
100
101 final public function resetFilter(): void
102 {
103 $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_RESET_FILTER, $this->dic);
104 $this->table->resetOffset();
105 $this->table->resetFilter();
106 $this->index();
107 }
108
109 final public function getId(): string
110 {
111 $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_INDEX, $this->dic);
112
113 return $this->table->getId();
114 }
115
116 final public function cancel(): void
117 {
118 $this->dic->ctrl()->redirect($this);
119 }
120}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
global $DIC
Definition: shib_login.php:26