ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilQuestionPoolSkillAdministrationGUI.php
Go to the documentation of this file.
1<?php
2
19use ILIAS\Refinery\Factory as Refinery;
20
31{
35 private $ilias;
36
40 private $ctrl;
41
42 private Refinery $refinery;
43
47 private $access;
48
52 private $tabs;
53
57 private $tpl;
58
62 private $lng;
63
67 private $db;
68
70
74 private $poolOBJ;
75
77 private $refId;
78
79 public function __construct(
82 Refinery $refinery,
90 $refId
91 ) {
92 $this->ilias = $ilias;
93 $this->ctrl = $ctrl;
94 $this->refinery = $refinery;
95 $this->access = $access;
96 $this->tabs = $tabs;
97 $this->tpl = $tpl;
98 $this->lng = $lng;
99 $this->db = $db;
100 $this->component_repository = $component_repository;
101 $this->poolOBJ = $poolOBJ;
102 $this->refId = $refId;
103 }
104
105 private function isAccessDenied(): bool
106 {
107 if (!$this->poolOBJ->isSkillServiceEnabled()) {
108 return true;
109 }
110
112 return true;
113 }
114
115 if (!$this->access->checkAccess('write', '', $this->refId)) {
116 return true;
117 }
118
119 return false;
120 }
121
122 public function manageTabs($activeSubTabId): void
123 {
124 $link = $this->ctrl->getLinkTargetByClass(
125 'ilAssQuestionSkillAssignmentsGUI',
127 );
128 $this->tabs->addSubTab(
129 'ilassquestionskillassignmentsgui',
130 $this->lng->txt('qpl_skl_sub_tab_quest_assign'),
131 $link
132 );
133
134 $link = $this->ctrl->getLinkTargetByClass(
135 'ilAssQuestionSkillUsagesTableGUI',
137 );
138 $this->tabs->addSubTab(
139 'ilassquestionskillusagestablegui',
140 $this->lng->txt('qpl_skl_sub_tab_usages'),
141 $link
142 );
143
144 $this->tabs->activateTab('qpl_tab_competences');
145 $this->tabs->activateSubTab($activeSubTabId);
146 }
147
148 public function executeCommand(): void
149 {
150 if ($this->isAccessDenied()) {
151 $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
152 }
153
154 $nextClass = $this->ctrl->getNextClass();
155
156 $this->manageTabs($nextClass);
157
158 switch ($nextClass) {
159 case 'ilassquestionskillassignmentsgui':
160 $questionList = new ilAssQuestionList(
161 $this->db,
162 $this->lng,
163 $this->refinery,
164 $this->component_repository
165 );
166 $questionList->setParentObjId($this->poolOBJ->getId());
167 $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_ORIGINALS);
168 $questionList->load();
169
170 $gui = new ilAssQuestionSkillAssignmentsGUI($this->ctrl, $this->access, $this->tpl, $this->lng, $this->db);
171 $gui->setAssignmentEditingEnabled(true);
172 $gui->setQuestionContainerId($this->poolOBJ->getId());
173 $gui->setQuestionList($questionList);
174
175 $this->ctrl->forwardCommand($gui);
176
177 break;
178
179 case 'ilassquestionskillusagestablegui':
180
182 $this->ctrl,
183 $this->tpl,
184 $this->lng,
185 $this->db,
186 $this->poolOBJ->getId()
187 );
188
189 $this->ctrl->forwardCommand($gui);
190
191 break;
192 }
193 }
194}
Builds data types.
Definition: Factory.php:36
Class ilCtrl provides processing control methods.
language handling
__construct(ILIAS $ilias, ilCtrl $ctrl, Refinery $refinery, ilAccessHandler $access, ilTabsGUI $tabs, ilGlobalTemplateInterface $tpl, ilLanguage $lng, ilDBInterface $db, ilComponentRepository $component_repository, ilObjQuestionPool $poolOBJ, $refId)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
Readable part of repository interface to ilComponentDataDB.
Interface ilDBInterface.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
Class ilObjForumAdministration.