ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTestSignaturePlugin.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/Component/classes/class.ilPlugin.php';
5 
15 abstract class ilTestSignaturePlugin extends ilPlugin
16 {
18  protected $GUIObject;
19 
23  public function setGUIObject($GUIObject)
24  {
25  $this->GUIObject = $GUIObject;
26  }
27 
31  public function getGUIObject()
32  {
33  return $this->GUIObject;
34  }
35 
40  final public function getComponentType()
41  {
42  return IL_COMP_MODULE;
43  }
44 
49  final public function getComponentName()
50  {
51  return "Test";
52  }
53 
58  final public function getSlot()
59  {
60  return "Signature";
61  }
62 
67  final public function getSlotId()
68  {
69  return "tsig";
70  }
71 
75  final protected function slotInit()
76  {
77  }
78 
84  protected function getLinkTargetForCmd($cmd)
85  {
87  global $ilCtrl;
88  return
89  'http://'. $_SERVER['HTTP_HOST']
90  . substr($_SERVER['PHP_SELF'],0, strlen($_SERVER['PHP_SELF']) - 10)
91  . '/' . $ilCtrl->getLinkTarget($this->getGUIObject(), $cmd, '', false, false);
92  }
93 
100  protected function getLinkTargetForRessource($cmd, $ressource)
101  {
103  global $ilCtrl;
104  $link = 'http://'. $_SERVER['HTTP_HOST']
105  . substr($_SERVER['PHP_SELF'],0, strlen($_SERVER['PHP_SELF']) - 10)
106  . '/'
107  . $ilCtrl->getLinkTarget($this->getGUIObject(), $cmd, '', false, false) . '&ressource=' . $ressource;
108  return $link;
109  }
110 
116  protected function getFormAction($default_cmd)
117  {
119  global $ilCtrl;
120  return $ilCtrl->getFormAction($this, $default_cmd);
121  }
122 
126  protected function populatePluginCanvas($content)
127  {
129  global $tpl;
130  $tpl->setVariable($this->getGUIObject()->getTestOutputGUI()->getContentBlockName(), $content );
131  return;
132  }
133 
151  protected function handInFileForArchiving($active_fi, $pass, $filename, $filepath)
152  {
153  if ( $this->getGUIObject()->getTest()->getEnableArchiving() )
154  {
155  require_once './Modules/Test/classes/class.ilTestArchiver.php';
156  $archiver = new ilTestArchiver($this->getGUIObject()->getTest()->getId());
157  $archiver->handInParticipantMisc($active_fi, $pass, $filename, $filepath);
158  }
159  }
160 
161  protected function redirectToTest($success)
162  {
163  $this->getGUIObject()->redirectToTest($success);
164  }
165 
181  abstract function invoke($cmd = null);
182 
183 }