ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC;
88  $ilCtrl = $DIC['ilCtrl'];
89  return
90  '//' . $_SERVER['HTTP_HOST']
91  . substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - 10)
92  . '/' . $ilCtrl->getLinkTarget($this->getGUIObject(), $cmd, '', false, false);
93  }
94 
101  protected function getLinkTargetForRessource($cmd, $ressource)
102  {
104  global $DIC;
105  $ilCtrl = $DIC['ilCtrl'];
106  $link = 'http://' . $_SERVER['HTTP_HOST']
107  . substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - 10)
108  . '/'
109  . $ilCtrl->getLinkTarget($this->getGUIObject(), $cmd, '', false, false) . '&ressource=' . $ressource;
110  return $link;
111  }
112 
118  protected function getFormAction($default_cmd)
119  {
121  global $DIC;
122  $ilCtrl = $DIC['ilCtrl'];
123  return $ilCtrl->getFormAction($this, $default_cmd);
124  }
125 
129  protected function populatePluginCanvas($content)
130  {
132  global $DIC;
133  $tpl = $DIC['tpl'];
134  $tpl->setVariable($this->getGUIObject()->getTestOutputGUI()->getContentBlockName(), $content);
135  return;
136  }
137 
155  protected function handInFileForArchiving($active_fi, $pass, $filename, $filepath)
156  {
157  require_once './Modules/Test/classes/class.ilTestArchiver.php';
158  $archiver = new ilTestArchiver($this->getGUIObject()->getTest()->getId());
159  $archiver->handInParticipantMisc($active_fi, $pass, $filename, $filepath);
160  }
161 
162  protected function redirectToTest($success)
163  {
164  $this->getGUIObject()->redirectToTest($success);
165  }
166 
182  abstract public function invoke($cmd = null);
183 }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
invoke($cmd=null)
Method all commands are forwarded to.
global $ilCtrl
Definition: ilias.php:18
$success
Definition: Utf8Test.php:86
const IL_COMP_MODULE
getComponentType()
Get Component Type.
$filename
Definition: buildRTE.php:89
Class ilTestArchiver.
Abstract parent class for all signature plugin classes.
handInFileForArchiving($active_fi, $pass, $filename, $filepath)
Hands in a file from the signature process associated with a given user and pass for archiving...
slotInit()
Object initialization done by slot.
getComponentName()
Get Component Name.