ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
21 public function __construct($a_title = '', $a_postvar = '', ilTermsOfServiceAcceptanceEntity $entity)
22 {
23 parent::__construct($a_title, $a_postvar);
24 $this->entity = $entity;
25 }
26
30 public function checkInput()
31 {
32 return true;
33 }
34
38 public function insert(ilTemplate $tpl)
39 {
43 global $lng;
44
45 $local_tpl = new ilTemplate('tpl.prop_tos_signed_document.html', true, true, 'Services/TermsOfService');
46
47 require_once 'Services/UIComponent/Modal/classes/class.ilModalGUI.php';
48 $modal = ilModalGUI::getInstance();
49 $modal->setType(ilModalGUI::TYPE_LARGE);
50 $modal->setHeading($lng->txt('tos_agreement_document'));
51 $modal->setId('accepted_tos_' . $this->entity->getUserId());
52 $modal->setBody($this->entity->getText());
53
54 require_once 'Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php';
55 $local_tpl->setVariable('MODAL_TRIGGER_HTML', ilGlyphGUI::get(ilGlyphGUI::SEARCH));
56 $local_tpl->setVariable('MODAL', $modal->getHTML());
57 $local_tpl->setVariable('MODAL_ID', 'accepted_tos_' . $this->entity->getUserId());
58
59 $tpl->setCurrentBlock('prop_generic');
60 $tpl->setVariable('PROP_GENERIC', $local_tpl->get());
61 $tpl->parseCurrentBlock();
62 }
63}
global $tpl
Definition: ilias.php:8
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 $lng
Definition: privfeed.php:40