376 $title->setRequired(
true);
382 if(count($contexts) <= 1)
385 $this->ctrl->redirect($this,
'showTemplates');
388 $context_sort =
array();
389 $context_options =
array();
391 foreach($contexts as $ctx)
393 if($ctx->getId() != $generic_context->getId())
395 $context_options[$ctx->getId()] = $ctx;
396 $context_sort[$ctx->getId()] = $ctx->getTitle();
399 asort($context_sort);
401 foreach($context_sort as $id =>
$title)
403 $ctx = $context_options[$id];
404 $option =
new ilRadioOption($ctx->getTitle(), $ctx->getId());
405 $option->
setInfo($ctx->getDescription());
406 $context->addOption($option);
413 $context->setValue($first);
414 $context->setRequired(
true);
415 $form->addItem($context);
428 $hidde_language->setValue($this->lng->getLangKey());
429 $form->addItem($hidde_language);
431 $subject =
new ilTextInputGUI($this->lng->txt(
'subject'),
'm_subject');
433 $subject->setSize(50);
434 $form->addItem($subject);
438 $message->setCols(60);
439 $message->setRows(10);
440 $form->addItem($message);
442 require_once
'Services/Mail/classes/Form/class.ilManualPlaceholderInputGUI.php';
445 if( $template === null )
447 $context_id = $generic_context->getId();
454 foreach( $context->getPlaceholders() as $key => $value)
456 $placeholders->addPlaceholder($value[
'placeholder'], $value[
'label'] );
458 $form->addItem($placeholders);
464 $form->setTitle($this->lng->txt(
'mail_edit_tpl'));
465 $form->setFormAction($this->ctrl->getFormaction($this,
'updateTemplate'));
466 $form->addCommandButton(
'updateTemplate', $this->lng->txt(
'save'));
470 $form->setTitle($this->lng->txt(
'mail_create_tpl'));
471 $form->setFormAction($this->ctrl->getFormaction($this,
'insertTemplate'));
472 $form->addCommandButton(
'insertTemplate', $this->lng->txt(
'save'));
475 $form->addCommandButton(
'showTemplates', $this->lng->txt(
'cancel'));
This class represents an option in a radio group.
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. ...
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)