382 $title->setRequired(
true);
390 if (count($contexts) <= 1) {
392 $this->ctrl->redirect($this,
'showTemplates');
395 $context_sort =
array();
396 $context_options =
array();
398 foreach ($contexts as $ctx) {
399 if ($ctx->getId() != $generic_context->getId()) {
400 $context_options[$ctx->getId()] = $ctx;
401 $context_sort[$ctx->getId()] = $ctx->getTitle();
404 asort($context_sort);
406 foreach ($context_sort as
$id =>
$title) {
407 $ctx = $context_options[
$id];
408 $option =
new ilRadioOption($ctx->getTitle(), $ctx->getId());
409 $option->
setInfo($ctx->getDescription());
410 $context->addOption($option);
416 $context->setValue($first);
417 $context->setRequired(
true);
418 $form->addItem($context);
421 $hidde_language->setValue($this->lng->getLangKey());
422 $form->addItem($hidde_language);
424 $subject =
new ilTextInputGUI($this->lng->txt(
'subject'),
'm_subject');
426 $subject->setRequired(
true);
427 $subject->setSize(50);
428 $form->addItem($subject);
437 require_once
'Services/Mail/classes/Form/class.ilManualPlaceholderInputGUI.php';
440 $placeholders->setInstructionText($this->lng->txt(
'mail_nacc_use_placeholder'));
441 $placeholders->setAdviseText(sprintf($this->lng->txt(
'placeholders_advise'),
'<br />'));
442 $placeholders->supportsRerenderSignal(
444 $this->ctrl->getLinkTarget($this,
'getAjaxPlaceholdersById',
'',
true,
false)
446 if ($template === null) {
447 $context_id = $generic_context->getId();
452 foreach ($context->getPlaceholders() as
$key => $value) {
453 $placeholders->addPlaceholder($value[
'placeholder'], $value[
'label']);
455 $form->addItem($placeholders);
460 $form->setTitle($this->lng->txt(
'mail_edit_tpl'));
461 $form->setFormAction($this->ctrl->getFormaction($this,
'updateTemplate'));
464 $form->addCommandButton(
'updateTemplate', $this->lng->txt(
'save'));
467 $form->setTitle($this->lng->txt(
'mail_create_tpl'));
468 $form->setFormAction($this->ctrl->getFormaction($this,
'insertTemplate'));
471 $form->addCommandButton(
'insertTemplate', $this->lng->txt(
'save'));
476 $form->addCommandButton(
'showTemplates', $this->lng->txt(
'cancel'));
478 $form->addCommandButton(
'showTemplates', $this->lng->txt(
'back'));
This class represents an option in a radio group.
if(!array_key_exists('StateId', $_REQUEST)) $id
setInfo($a_info)
Set Info.
static getTemplateContexts($a_id=null)
Returns an array of mail template contexts, the key of each entry matches its id. ...
catch(Exception $e) $message
This class represents a text property in a property form.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class represents a text area property in a property form.
static getTemplateContextById($a_id)