ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTestSkillAdministrationGUI.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 include_once 'Modules/Test/classes/class.ilTestSkillQuestionAssignmentsGUI.php';
5 include_once 'Modules/Test/classes/class.ilTestSkillLevelThresholdsGUI.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 $testOBJ;
57 
59  {
60  $this->ilias = $ilias;
61  $this->ctrl = $ctrl;
62  $this->access = $access;
63  $this->tabs = $tabs;
64  $this->tpl = $tpl;
65  $this->lng = $lng;
66  $this->db = $db;
67  $this->testOBJ = $testOBJ;
68  $this->refId = $refId;
69  }
70 
71  public function executeCommand()
72  {
73  if( $this->isAccessDenied() )
74  {
75  $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
76  }
77 
78  $nextClass = $this->ctrl->getNextClass();
79 
80  $this->manageTabs($nextClass);
81 
82  switch($nextClass)
83  {
84  case 'iltestskillquestionassignmentsgui':
85 
86  $gui = new ilTestSkillQuestionAssignmentsGUI($this->ctrl, $this->tpl, $this->lng, $this->db, $this->testOBJ);
87  $this->ctrl->forwardCommand($gui);
88  break;
89 
90  case 'iltestskilllevelthresholdsgui':
91 
92  $gui = new ilTestSkillLevelThresholdsGUI($this->ctrl, $this->tpl, $this->lng, $this->db, $this->testOBJ);
93  $this->ctrl->forwardCommand($gui);
94  break;
95  }
96  }
97 
98  public function manageTabs($activeSubTabId)
99  {
100  $link = $this->ctrl->getLinkTargetByClass(
101  'iltestskillquestionassignmentsgui', ilTestSkillQuestionAssignmentsGUI::CMD_SHOW_SKILL_QUEST_ASSIGNS
102  );
103  $this->tabs->addSubTab(
104  'iltestskillquestionassignmentsgui', $this->lng->txt('tst_skl_sub_tab_quest_assign'), $link
105 
106  );
107 
108  $link = $this->ctrl->getLinkTargetByClass(
109  'iltestskilllevelthresholdsgui', ilTestSkillLevelThresholdsGUI::CMD_SHOW_SKILL_THRESHOLDS
110  );
111  $this->tabs->addSubTab(
112  'iltestskilllevelthresholdsgui', $this->lng->txt('tst_skl_sub_tab_thresholds'), $link
113  );
114 
115  $this->tabs->activateTab('tst_tab_competences');
116  $this->tabs->activateSubTab($activeSubTabId);
117  }
118 
119  private function isAccessDenied()
120  {
121  if( !$this->testOBJ->isSkillServiceEnabled() )
122  {
123  return true;
124  }
125 
127  {
128  return true;
129  }
130 
131  if( ! $this->access->checkAccess('write', '', $this->refId) )
132  {
133  return true;
134  }
135 
136  return false;
137  }
138 }