ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilTestSignaturePlugin.php
Go to the documentation of this file.
1 <?php
2 
28 abstract class ilTestSignaturePlugin extends ilPlugin
29 {
31  protected $GUIObject;
32 
36  public function setGUIObject($GUIObject)
37  {
38  $this->GUIObject = $GUIObject;
39  }
40 
44  public function getGUIObject(): ilTestSignatureGUI
45  {
46  return $this->GUIObject;
47  }
48 
54  protected function getLinkTargetForCmd($cmd): string
55  {
57  global $DIC;
58  $ilCtrl = $DIC['ilCtrl'];
59  return
60  '//' . $_SERVER['HTTP_HOST']
61  . substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - 10)
62  . '/' . $ilCtrl->getLinkTarget($this->getGUIObject(), $cmd, '', false, false);
63  }
64 
71  protected function getLinkTargetForRessource($cmd, $ressource): string
72  {
74  global $DIC;
75  $ilCtrl = $DIC['ilCtrl'];
76  $link = 'http://' . $_SERVER['HTTP_HOST']
77  . substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - 10)
78  . '/'
79  . $ilCtrl->getLinkTarget($this->getGUIObject(), $cmd, '', false, false) . '&ressource=' . $ressource;
80  return $link;
81  }
82 
88  protected function getFormAction($default_cmd): string
89  {
91  global $DIC;
92  $ilCtrl = $DIC['ilCtrl'];
93  return $ilCtrl->getFormAction($this, $default_cmd);
94  }
95 
99  protected function populatePluginCanvas($content)
100  {
102  global $DIC;
103  $tpl = $DIC['tpl'];
104  $tpl->setVariable($this->getGUIObject()->getTestOutputGUI()->getContentBlockName(), $content);
105  return;
106  }
107 
125  protected function handInFileForArchiving($active_fi, $pass, $filename, $filepath)
126  {
127  require_once './Modules/Test/classes/class.ilTestArchiver.php';
128  $archiver = new ilTestArchiver($this->getGUIObject()->getTest()->getId());
129  $archiver->handInParticipantMisc($active_fi, $pass, $filename, $filepath);
130  }
131 
132  protected function redirectToTest($success)
133  {
134  $this->getGUIObject()->redirectToTest($success);
135  }
136 
152  abstract public function invoke($cmd = null);
153 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
invoke($cmd=null)
Method all commands are forwarded to.
global $DIC
Definition: feed.php:28
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$filename
Definition: buildRTE.php:78
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
handInFileForArchiving($active_fi, $pass, $filename, $filepath)
Hands in a file from the signature process associated with a given user and pass for archiving...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41