ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilMStListCompetencesGUI.php
Go to the documentation of this file.
1<?php
2
5
16{
17 const CMD_APPLY_FILTER = 'applyFilter';
18 const CMD_INDEX = 'index';
19 const CMD_GET_ACTIONS = "getActions";
20 const CMD_RESET_FILTER = 'resetFilter';
21 const SUB_TAB_SKILLS = 'skills';
25 protected $table;
29 protected $access;
33 private $dic;
34
35
39 public function __construct(Container $dic = null)
40 {
41 if (is_null($dic)) {
42 global $DIC;
43 $dic = $DIC;
44 }
45 $this->access = ilMyStaffAccess::getInstance();
46 $this->dic = $dic;
47 }
48
49
53 protected function checkAccessOrFail()
54 {
55 if ($this->access->hasCurrentUserAccessToCompetences()) {
56 return;
57 } else {
58 ilUtil::sendFailure($this->dic->language()->txt("permission_denied"), true);
59 $this->dic->ctrl()->redirectByClass(ilDashboardGUI::class, "");
60 }
61 }
62
63
67 public function executeCommand()
68 {
69 $cmd = $this->dic->ctrl()->getCmd();
70 $next_class = $this->dic->ctrl()->getNextClass();
71 switch ($next_class) {
72 case strtolower(ilMStListCompetencesSkillsGUI::class):
73 $this->addSubTabs(self::SUB_TAB_SKILLS);
74 $gui = new ilMStListCompetencesSkillsGUI($this->dic);
75 $this->dic->ctrl()->forwardCommand($gui);
76 break;
77 default:
78 switch ($cmd) {
79 case self::CMD_INDEX:
80 $this->$cmd();
81 break;
82 default:
83 $this->index();
84 break;
85 }
86 break;
87 }
88 }
89
90
94 protected function addSubTabs(string $subtab_active) : void
95 {
96 $this->dic->language()->loadLanguageModule('skmg');
97 $this->dic->tabs()->addSubTab(
98 self::SUB_TAB_SKILLS,
99 $this->dic->language()->txt('skmg_selected_skills'),
100 $this->dic->ctrl()->getLinkTargetByClass([
101 self::class,
102 ilMStListCompetencesSkillsGUI::class
103 ])
104 );
105
106 $this->dic->tabs()->activateSubTab($subtab_active);
107 }
108
109
113 public function index()
114 {
115 $this->dic->ctrl()->redirectByClass(ilMStListCompetencesSkillsGUI::class);
116 }
117}
An exception for terminatinating execution or to throw for unit testing.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:19
Class ilMStListCompetencesGUI.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $DIC
Definition: goto.php:24