ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTestSignatureGUI.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 'Services/Export/classes/class.ilExportGUI.php';
5 
15 {
17  protected $lng;
18 
20  protected $ilCtrl;
21 
23  protected $tpl;
24 
26  protected $testGUI;
27 
29  protected $ilTestOutputGUI;
30 
32  protected $test;
33 
35  protected $plugin;
36 
37  public function __construct(ilTestOutputGUI $testOutputGUI)
38  {
39  global $lng, $ilCtrl, $tpl, $ilPluginAdmin;
40 
41  $this->lng = $lng;
42  $this->ilCtrl = $ilCtrl;
43  $this->tpl = $tpl;
44 
45  $this->ilTestOutputGUI = $testOutputGUI;
46  $this->test = $this->ilTestOutputGUI->object;
47 
48  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, 'Test', 'tsig');
49  $pl = current($pl_names);
50  $this->plugin = ilPluginAdmin::getPluginObject(IL_COMP_MODULE, 'Test', 'tsig', $pl);
51  $this->plugin->setGUIObject($this);
52  }
53 
54  public function executeCommand()
55  {
56  $next_class = $this->ilCtrl->getNextClass($this);
57 
58  switch($next_class)
59  {
60  default:
61  $ret = $this->dispatchCommand();
62  break;
63  }
64  return $ret;
65  }
66 
67  protected function dispatchCommand()
68  {
70  global $ilUser;
71  $active = $this->test->getActiveIdOfUser($ilUser->getId());
72  $pass = $this->test->_getMaxPass($active);
73  $key = 'signed_'. $active .'_'. $pass;
74  ilSession::set($key, null);
75 
76  $cmd = $this->ilCtrl->getCmd();
77  switch ($cmd)
78  {
79  default:
80  $ret = $this->plugin->invoke($cmd);
81  }
82  return $ret;
83  }
84 
88  public function setTest($test)
89  {
90  $this->test = $test;
91  }
92 
96  public function getTest()
97  {
98  return $this->test;
99  }
100 
104  public function setTestGUI($testGUI)
105  {
106  $this->testGUI = $testGUI;
107  }
108 
112  public function getTestGUI()
113  {
114  return $this->testGUI;
115  }
116 
120  public function setTestOutputGUI($testOutputGUI)
121  {
122  $this->ilTestOutputGUI = $testOutputGUI;
123  }
124 
128  public function getTestOutputGUI()
129  {
130  return $this->ilTestOutputGUI;
131  }
132 
136  public function redirectToTest($success)
137  {
140  global $ilCtrl, $ilUser;
141  $active = $this->test->getActiveIdOfUser($ilUser->getId());
142  $pass = $this->test->_getMaxPass($active);
143  $key = 'signed_'. $active .'_'. $pass;
144  ilSession::set($key, $success);
145  $ilCtrl->redirect($this->ilTestOutputGUI,'afterTestPassFinished');
146  return;
147  }
148 }