ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
class.ilMailFormAttachmentPropertyGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
27{
28 public string $buttonLabel;
30 public array $items = [];
31
32 public function __construct(string $buttonLabel)
33 {
34 $this->buttonLabel = $buttonLabel;
36 $this->setTitle($this->lng->txt('attachments'));
37 }
38
39 public function addItem(string $label): void
40 {
41 $this->items[] = $label;
42 }
43
44 public function insert(ilTemplate $a_tpl): void
45 {
46 $tpl = new ilTemplate('tpl.mail_new_attachments.html', true, true, 'Services/Mail');
47
48 foreach ($this->items as $item) {
49 $tpl->setCurrentBlock('attachment_list_item');
50 $tpl->setVariable('ATTACHMENT_LABEL', $item);
51 $tpl->parseCurrentBlock();
52 }
53 $tpl->setVariable('ATTACHMENT_BUTTON_LABEL', $this->buttonLabel);
54
55 $a_tpl->setCurrentBlock('prop_generic');
56 $a_tpl->setVariable('PROP_GENERIC', $tpl->get());
57 $a_tpl->parseCurrentBlock();
58 }
59}
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
This class represents a property in a property form.
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc