ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
4 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentsGUI.php';
5 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillUsagesTableGUI.php';
6 
17 {
21  private $ilias;
22 
26  private $ctrl;
27 
31  private $access;
32 
36  private $tabs;
37 
41  private $tpl;
42 
46  private $lng;
47 
51  private $db;
52 
56  private $pluginAdmin;
57 
61  private $poolOBJ;
62 
63 
65  {
66  $this->ilias = $ilias;
67  $this->ctrl = $ctrl;
68  $this->access = $access;
69  $this->tabs = $tabs;
70  $this->tpl = $tpl;
71  $this->lng = $lng;
72  $this->db = $db;
73  $this->pluginAdmin = $pluginAdmin;
74  $this->poolOBJ = $poolOBJ;
75  $this->refId = $refId;
76  }
77 
78  private function isAccessDenied()
79  {
80  if (!$this->poolOBJ->isSkillServiceEnabled()) {
81  return true;
82  }
83 
85  return true;
86  }
87 
88  if (!$this->access->checkAccess('write', '', $this->refId)) {
89  return true;
90  }
91 
92  return false;
93  }
94 
95  public function manageTabs($activeSubTabId)
96  {
97  $link = $this->ctrl->getLinkTargetByClass(
98  'ilAssQuestionSkillAssignmentsGUI',
100  );
101  $this->tabs->addSubTab(
102  'ilassquestionskillassignmentsgui',
103  $this->lng->txt('qpl_skl_sub_tab_quest_assign'),
104  $link
105  );
106 
107  $link = $this->ctrl->getLinkTargetByClass(
108  'ilAssQuestionSkillUsagesTableGUI',
110  );
111  $this->tabs->addSubTab(
112  'ilassquestionskillusagestablegui',
113  $this->lng->txt('qpl_skl_sub_tab_usages'),
114  $link
115  );
116 
117  $this->tabs->activateTab('qpl_tab_competences');
118  $this->tabs->activateSubTab($activeSubTabId);
119  }
120 
121  public function executeCommand()
122  {
123  if ($this->isAccessDenied()) {
124  $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
125  }
126 
127  $nextClass = $this->ctrl->getNextClass();
128 
129  $this->manageTabs($nextClass);
130 
131  switch ($nextClass) {
132  case 'ilassquestionskillassignmentsgui':
133 
134  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
135  $questionList = new ilAssQuestionList($this->db, $this->lng, $this->pluginAdmin);
136  $questionList->setParentObjId($this->poolOBJ->getId());
137  $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_ORIGINALS);
138  $questionList->load();
139 
140  $gui = new ilAssQuestionSkillAssignmentsGUI($this->ctrl, $this->access, $this->tpl, $this->lng, $this->db);
141  $gui->setAssignmentEditingEnabled(true);
142  $gui->setQuestionContainerId($this->poolOBJ->getId());
143  $gui->setQuestionList($questionList);
144 
145  $this->ctrl->forwardCommand($gui);
146 
147  break;
148 
149  case 'ilassquestionskillusagestablegui':
150 
152  $this->ctrl,
153  $this->tpl,
154  $this->lng,
155  $this->db,
156  $this->poolOBJ->getId()
157  );
158 
159  $this->ctrl->forwardCommand($gui);
160 
161  break;
162  }
163  }
164 }
This class provides processing control methods.
Tabs GUI.
Class BaseForm.
Interface ilAccessHandler.
Administration class for plugins.
Interface ilDBInterface.
__construct(ILIAS $ilias, ilCtrl $ctrl, ilAccessHandler $access, ilTabsGUI $tabs, ilTemplate $tpl, ilLanguage $lng, ilDBInterface $db, ilPluginAdmin $pluginAdmin, ilObjQuestionPool $poolOBJ, $refId)
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file) ...
language handling