ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilMStListCompetencesGUI.php
Go to the documentation of this file.
1 <?php
2 
21 
30 {
31  public const string CMD_APPLY_FILTER = 'applyFilter';
32  public const string CMD_INDEX = 'index';
33  public const string CMD_GET_ACTIONS = "getActions";
34  public const string CMD_RESET_FILTER = 'resetFilter';
35  public const string SUB_TAB_SKILLS = 'skills';
36  protected ilTable2GUI $table;
38  private Container $dic;
39  private \ilGlobalTemplateInterface $main_tpl;
40 
41  public function __construct(Container $dic)
42  {
43  $this->main_tpl = $dic->ui()->mainTemplate();
44  $this->access = ilMyStaffAccess::getInstance();
45  $this->dic = $dic;
46  }
47 
48  protected function checkAccessOrFail(): void
49  {
50  if ($this->access->hasCurrentUserAccessToCompetences()) {
51  return;
52  } else {
53  $this->main_tpl->setOnScreenMessage('failure', $this->dic->language()->txt("permission_denied"), true);
54  $this->dic->ctrl()->redirectByClass(ilDashboardGUI::class, "");
55  }
56  }
57 
58  final public function executeCommand(): void
59  {
60  $cmd = $this->dic->ctrl()->getCmd();
61  $next_class = $this->dic->ctrl()->getNextClass();
62  switch ($next_class) {
63  case strtolower(ilMStListCompetencesSkillsGUI::class):
64  $this->addSubTabs(self::SUB_TAB_SKILLS);
65  $gui = new ilMStListCompetencesSkillsGUI($this->dic);
66  $this->dic->ctrl()->forwardCommand($gui);
67  break;
68  default:
69  switch ($cmd) {
70  case self::CMD_INDEX:
71  $this->$cmd();
72  break;
73  default:
74  $this->index();
75  break;
76  }
77  break;
78  }
79  }
80 
81  protected function addSubTabs(string $subtab_active): void
82  {
83  $this->dic->language()->loadLanguageModule('skmg');
84  $this->dic->tabs()->addSubTab(
85  self::SUB_TAB_SKILLS,
86  $this->dic->language()->txt('skmg_selected_skills'),
87  $this->dic->ctrl()->getLinkTargetByClass([
88  self::class,
89  ilMStListCompetencesSkillsGUI::class
90  ])
91  );
92 
93  $this->dic->tabs()->activateSubTab($subtab_active);
94  }
95 
96  final public function index(): void
97  {
98  $this->dic->ctrl()->redirectByClass(ilMStListCompetencesSkillsGUI::class);
99  }
100 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
ui()
Get the interface to get services from UI framework.
Definition: Container.php:127
ilGlobalTemplateInterface $main_tpl