ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
4require_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}
$tpl
Definition: ilias.php:10
An exception for terminatinating execution or to throw for unit testing.
This class represents a property in a property form.
static get($a_glyph, $a_text="")
Get glyph html.
static getInstance()
Get instance.
special template class to simplify handling of ITX/PEAR
__construct($a_title='', $a_postvar='', ilTermsOfServiceAcceptanceEntity $entity)
global $DIC
Definition: saml.php:7