ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilMailFormAttachmentFormPropertyGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
12include_once 'Services/Form/classes/class.ilFormPropertyGUI.php';
13
15{
17 public $items = array();
18
22 protected $lng;
23
28 public function __construct($buttonLabel)
29 {
30 global $DIC;
31
32 $this->lng = $DIC->language();
33
34 $this->buttonLabel = $buttonLabel;
35 parent::__construct($this->lng->txt('attachments'));
36 }
37
43 public function addItem($label)
44 {
45 $this->items[] = $label;
46 }
47
48 public function insert($a_tpl)
49 {
50 $tpl = new ilTemplate('tpl.mail_new_attachments.html', true, true, 'Services/Mail');
51
52 foreach ($this->items as $item) {
53 $tpl->setCurrentBlock('attachment_list_item');
54 $tpl->setVariable('ATTACHMENT_LABEL', $item);
55 $tpl->parseCurrentBlock();
56 }
57 $tpl->setVariable('ATTACHMENT_BUTTON_LABEL', $this->buttonLabel);
58
59 $a_tpl->setCurrentBlock("prop_generic");
60 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
61 $a_tpl->parseCurrentBlock();
62 }
63}
$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.
__construct($buttonLabel)
Form Element for showing Mail Attachments.
special template class to simplify handling of ITX/PEAR
global $DIC
Definition: saml.php:7