ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilQuestionPoolSkillAdministrationGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentsGUI.php';
5require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillUsagesTableGUI.php';
6
7use ILIAS\Refinery\Factory as Refinery;
8
19{
23 private $ilias;
24
28 private $ctrl;
29
33 protected $refinery;
34
38 private $access;
39
43 private $tabs;
44
48 private $tpl;
49
53 private $lng;
54
58 private $db;
59
63 private $pluginAdmin;
64
68 private $poolOBJ;
69
70
72 {
73 $this->ilias = $ilias;
74 $this->ctrl = $ctrl;
75 $this->refinery = $refinery;
76 $this->access = $access;
77 $this->tabs = $tabs;
78 $this->tpl = $tpl;
79 $this->lng = $lng;
80 $this->db = $db;
81 $this->pluginAdmin = $pluginAdmin;
82 $this->poolOBJ = $poolOBJ;
83 $this->refId = $refId;
84 }
85
86 private function isAccessDenied()
87 {
88 if (!$this->poolOBJ->isSkillServiceEnabled()) {
89 return true;
90 }
91
93 return true;
94 }
95
96 if (!$this->access->checkAccess('write', '', $this->refId)) {
97 return true;
98 }
99
100 return false;
101 }
102
103 public function manageTabs($activeSubTabId)
104 {
105 $link = $this->ctrl->getLinkTargetByClass(
106 'ilAssQuestionSkillAssignmentsGUI',
108 );
109 $this->tabs->addSubTab(
110 'ilassquestionskillassignmentsgui',
111 $this->lng->txt('qpl_skl_sub_tab_quest_assign'),
112 $link
113 );
114
115 $link = $this->ctrl->getLinkTargetByClass(
116 'ilAssQuestionSkillUsagesTableGUI',
118 );
119 $this->tabs->addSubTab(
120 'ilassquestionskillusagestablegui',
121 $this->lng->txt('qpl_skl_sub_tab_usages'),
122 $link
123 );
124
125 $this->tabs->activateTab('qpl_tab_competences');
126 $this->tabs->activateSubTab($activeSubTabId);
127 }
128
129 public function executeCommand()
130 {
131 if ($this->isAccessDenied()) {
132 $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
133 }
134
135 $nextClass = $this->ctrl->getNextClass();
136
137 $this->manageTabs($nextClass);
138
139 switch ($nextClass) {
140 case 'ilassquestionskillassignmentsgui':
141 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
142 $questionList = new ilAssQuestionList($this->db, $this->lng, $this->refinery, $this->pluginAdmin);
143 $questionList->setParentObjId($this->poolOBJ->getId());
144 $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_ORIGINALS);
145 $questionList->load();
146
147 $gui = new ilAssQuestionSkillAssignmentsGUI($this->ctrl, $this->access, $this->tpl, $this->lng, $this->db);
148 $gui->setAssignmentEditingEnabled(true);
149 $gui->setQuestionContainerId($this->poolOBJ->getId());
150 $gui->setQuestionList($questionList);
151
152 $this->ctrl->forwardCommand($gui);
153
154 break;
155
156 case 'ilassquestionskillusagestablegui':
157
159 $this->ctrl,
160 $this->tpl,
161 $this->lng,
162 $this->db,
163 $this->poolOBJ->getId()
164 );
165
166 $this->ctrl->forwardCommand($gui);
167
168 break;
169 }
170 }
171}
An exception for terminatinating execution or to throw for unit testing.
Builds data types.
Definition: Factory.php:20
This class provides processing control methods.
language handling
Administration class for plugins.
__construct(ILIAS $ilias, ilCtrl $ctrl, ILIAS\Refinery\Factory $refinery, ilAccessHandler $access, ilTabsGUI $tabs, ilGlobalTemplateInterface $tpl, ilLanguage $lng, ilDBInterface $db, ilPluginAdmin $pluginAdmin, ilObjQuestionPool $poolOBJ, $refId)
Tabs GUI.
Interface ilAccessHandler.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.
redirection script todo: (a better solution should control the processing via a xml file)
$refId
Definition: xapitoken.php:40