19 declare(strict_types=1);
39 public function __construct(
string $label,
string $http_post_param_name,
protected string $dependency_element_id)
43 $this->tpl = $DIC->ui()->mainTemplate();
44 $this->http_state = $DIC->http();
48 $this->tpl->addJavaScript(
'assets/js/ilMailComposeFunctions.js');
63 $this->rerender_trigger_element_name = $element_id;
64 $this->rerender_url =
$url;
89 $this->placeholders[$placeholder][
'placeholder'] = $placeholder;
90 $this->placeholders[$placeholder][
'title'] =
$title;
102 public function render(
bool $ajax =
false): string
105 'tpl.mail_manual_placeholders.html',
108 'components/ILIAS/Mail' 110 $subtpl->setVariable(
'TXT_USE_PLACEHOLDERS', $this->
lng->txt(
'mail_nacc_use_placeholder'));
111 $subtpl->setVariable(
'DEPENDENCY_ELM_ID_OUTER', $this->dependency_element_id);
113 $subtpl->setVariable(
'TXT_PLACEHOLDERS_ADVISE', $this->
getAdviseText());
116 foreach ($this->placeholders as $placeholder) {
117 $subtpl->setCurrentBlock(
'man_placeholder');
118 $subtpl->setVariable(
'DEPENDENCY_ELM_ID', $this->dependency_element_id);
119 $subtpl->setVariable(
'PLACEHOLDER',
'{{' . $placeholder[
'placeholder'] .
'}}');
120 $subtpl->setVariable(
'PLACEHOLDER_INTERACTION_INFO', sprintf(
121 $this->
lng->txt(
'mail_hint_add_placeholder_x'),
122 '{{' . $placeholder[
'placeholder'] .
'}}' 124 $subtpl->setVariable(
'PLACEHOLDER_DESCRIPTION', $placeholder[
'title']);
125 $subtpl->parseCurrentBlock();
130 $subtpl->setVariable(
'RERENDER_DEPENDENCY_ELM_ID_OUTER', $this->dependency_element_id);
135 $this->http_state->saveResponse(
138 ->withBody(Streams::ofString($subtpl->get()))
140 $this->http_state->sendResponse();
141 $this->http_state->close();
144 return $subtpl->get();
154 if (is_array($a_value) && $this->
getMulti()) {
156 $a_value = array_shift($a_value);
158 $this->value = $a_value;
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
__construct(Container $dic, ilPlugin $plugin)