ILIAS  Release_4_4_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 
83  return $ret;
84  }
85 
89  public function setTest($test)
90  {
91  $this->test = $test;
92  }
93 
97  public function getTest()
98  {
99  return $this->test;
100  }
101 
105  public function setTestGUI($testGUI)
106  {
107  $this->testGUI = $testGUI;
108  }
109 
113  public function getTestGUI()
114  {
115  return $this->testGUI;
116  }
117 
121  public function setTestOutputGUI($testOutputGUI)
122  {
123  $this->ilTestOutputGUI = $testOutputGUI;
124  }
125 
129  public function getTestOutputGUI()
130  {
131  return $this->ilTestOutputGUI;
132  }
133 
137  public function redirectToTest($success)
138  {
141  global $ilCtrl, $ilUser;
142  $active = $this->test->getActiveIdOfUser($ilUser->getId());
143  $pass = $this->test->_getMaxPass($active);
144  $key = 'signed_'. $active .'_'. $pass;
145  ilSession::set($key, $success);
146  $ilCtrl->redirect($this->ilTestOutputGUI,'afterTestPassFinished');
147  return;
148  }
149 }