ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
23  public function __construct($buttonLabel)
24  {
25  global $lng;
26 
27  $this->buttonLabel = $buttonLabel;
28  parent::__construct($lng->txt('attachments'));
29  }
30 
36  public function addItem($label)
37  {
38  $this->items[] = $label;
39  }
40 
41  public function insert($a_tpl)
42  {
43  $tpl = new ilTemplate('tpl.mail_new_attachments.html', true, true, 'Services/Mail');
44 
45  foreach($this->items as $item)
46  {
47  $tpl->setCurrentBlock('attachment_list_item');
48  $tpl->setVariable('ATTACHMENT_LABEL', $item);
49  $tpl->parseCurrentBlock();
50  }
51  $tpl->setVariable('ATTACHMENT_BUTTON_LABEL', $this->buttonLabel);
52 
53  $a_tpl->setCurrentBlock("prop_generic");
54  $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
55  $a_tpl->parseCurrentBlock();
56  }
57 }
58 
59 ?>