ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilTermsOfServiceSignedDocumentFormElementGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/Form/classes/class.ilFormPropertyGUI.php';
5 
10 {
14  protected $entity;
15 
19  protected $lng;
20 
26  public function __construct($a_title = '', $a_postvar = '', ilTermsOfServiceAcceptanceEntity $entity)
27  {
28  global $DIC;
29 
30  parent::__construct($a_title, $a_postvar);
31 
32  $this->entity = $entity;
33  $this->lng = $DIC['lng'];
34  }
35 
39  public function checkInput()
40  {
41  return true;
42  }
43 
47  public function insert(ilTemplate $tpl)
48  {
49  $local_tpl = new ilTemplate('tpl.prop_tos_signed_document.html', true, true, 'Services/TermsOfService');
50 
51  require_once 'Services/UIComponent/Modal/classes/class.ilModalGUI.php';
52  $modal = ilModalGUI::getInstance();
53  $modal->setType(ilModalGUI::TYPE_LARGE);
54  $modal->setHeading($this->lng->txt('tos_agreement_document'));
55  $modal->setId('accepted_tos_' . $this->entity->getUserId());
56  $modal->setBody($this->entity->getText());
57 
58  require_once 'Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php';
59  $local_tpl->setVariable('MODAL_TRIGGER_HTML', ilGlyphGUI::get(ilGlyphGUI::SEARCH));
60  $local_tpl->setVariable('MODAL', $modal->getHTML());
61  $local_tpl->setVariable('MODAL_ID', 'accepted_tos_' . $this->entity->getUserId());
62 
63  $tpl->setCurrentBlock('prop_generic');
64  $tpl->setVariable('PROP_GENERIC', $local_tpl->get());
65  $tpl->parseCurrentBlock();
66  }
67 }
static get($a_glyph, $a_text="")
Get glyph html.
__construct($a_title='', $a_postvar='', ilTermsOfServiceAcceptanceEntity $entity)
global $tpl
Definition: ilias.php:8
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
special template class to simplify handling of ITX/PEAR
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
static getInstance()
Get instance.
This class represents a property in a property form.
global $DIC
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt public...