19 declare(strict_types=1);
44 public function __construct(
string $label,
string $dependencyElementId)
48 $this->tpl = $DIC->ui()->mainTemplate();
49 $this->httpState = $DIC->http();
55 $this->tpl->addJavaScript(
'Services/Mail/js/ilMailComposeFunctions.js');
70 $this->rerenderTriggerElementName = $elementId;
71 $this->rerenderUrl =
$url;
96 $this->placeholders[$placeholder][
'placeholder'] = $placeholder;
97 $this->placeholders[$placeholder][
'title'] =
$title;
109 public function render(
bool $ajax =
false): string
112 'tpl.mail_manual_placeholders.html',
117 $subtpl->setVariable(
'TXT_USE_PLACEHOLDERS', $this->
lng->txt(
'mail_nacc_use_placeholder'));
118 $subtpl->setVariable(
'DEPENDENCY_ELM_ID_OUTER', $this->dependencyElementId);
120 $subtpl->setVariable(
'TXT_PLACEHOLDERS_ADVISE', $this->
getAdviseText());
123 if (count($this->placeholders) > 0) {
124 foreach ($this->placeholders as $placeholder) {
125 $subtpl->setCurrentBlock(
'man_placeholder');
126 $subtpl->setVariable(
'DEPENDENCY_ELM_ID', $this->dependencyElementId);
127 $subtpl->setVariable(
'PLACEHOLDER',
'[' . $placeholder[
'placeholder'] .
']');
128 $subtpl->setVariable(
'PLACEHOLDER_INTERACTION_INFO', sprintf(
129 $this->
lng->txt(
'mail_hint_add_placeholder_x'),
130 '[' . $placeholder[
'placeholder'] .
']' 132 $subtpl->setVariable(
'PLACEHOLDER_DESCRIPTION', $placeholder[
'title']);
133 $subtpl->parseCurrentBlock();
143 $this->httpState->saveResponse(
146 ->withBody(Streams::ofString($subtpl->get()))
148 $this->httpState->sendResponse();
149 $this->httpState->close();
152 return $subtpl->get();
162 if (is_array($a_value) && $this->
getMulti()) {
164 $a_value = array_shift($a_value);
166 $this->value = $a_value;
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
Interface GlobalHttpState.
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
__construct(Container $dic, ilPlugin $plugin)