ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
12 include_once 'Services/Form/classes/class.ilFormPropertyGUI.php';
13 
15 {
16  public $buttonLabel;
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 }
__construct($buttonLabel)
Form Element for showing Mail Attachments.
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
This class represents a property in a property form.