ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjMailGUI Class Reference
+ Inheritance diagram for ilObjMailGUI:
+ Collaboration diagram for ilObjMailGUI:

Public Member Functions

 __construct ($a_data, int $a_id, bool $a_call_by_reference)
 
 executeCommand ()
 
 getAdminTabs ()
 
 viewObject ()
 
 saveObject ()
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $target)
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Protected Member Functions

 getTabs ()
 
 buildSettingsSubTabs (string $activeSubTab)
 
 showGeneralSettingsForm (?ilPropertyFormGUI $form=null)
 
 getGeneralSettingsForm ()
 
 populateGeneralSettingsForm (ilPropertyFormGUI $form)
 
 showExternalSettingsFormObject (?ilPropertyFormGUI $form=null)
 
 sendTestUserMailObject ()
 
 sendTestSystemMailObject ()
 
 sendTestMail (bool $isManualMail=false)
 
 getExternalSettingsForm ()
 
 populateExternalSettingsForm (ilPropertyFormGUI $form)
 
 saveExternalSettingsFormObject ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Private Member Functions

 isEditingAllowed ()
 
 isViewAllowed ()
 
 isPermissionChangeAllowed ()
 
 buildSignaturePlaceholderInputs (Signature $signature)
 
 getAvailableSignatures ()
 

Private Attributes

const SETTINGS_SUB_TAB_ID_GENERAL = 'settings_general'
 
const SETTINGS_SUB_TAB_ID_EXTERNAL = 'settings_external'
 
const PASSWORD_PLACE_HOLDER = '***********************'
 
readonly ilTabsGUI $tabs
 
readonly ilMustacheFactory $mustache_factory
 
readonly MailSignatureService $mail_signature_service
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjMailGUI::__construct (   $a_data,
int  $a_id,
bool  $a_call_by_reference 
)

Definition at line 42 of file class.ilObjMailGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

43  {
44  global $DIC;
45  $this->type = 'mail';
46  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
47 
48  $this->tabs = $DIC->tabs();
49  $this->mustache_factory = $DIC->mail()->mustacheFactory();
50  $this->mail_signature_service = $DIC->mail()->signature();
51 
52  $this->lng->loadLanguageModule('mail');
53  }
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjMailGUI::_goto ( string  $target)
static

Definition at line 742 of file class.ilObjMailGUI.php.

References $DIC, ilObject\_lookupObjId(), ilObject\_lookupTitle(), and ROOT_FOLDER_ID.

742  : void
743  {
744  global $DIC;
745  $main_tpl = $DIC->ui()->mainTemplate();
746 
747  $mail = new ilMail($DIC->user()->getId());
748 
749  if ($DIC->rbac()->system()->checkAccess('internal_mail', $mail->getMailObjectReferenceId())) {
750  $DIC->ctrl()->redirectToURL('ilias.php?baseClass=ilMailGUI');
751  } elseif ($DIC->access()->checkAccess('read', '', ROOT_FOLDER_ID)) {
752  $main_tpl->setOnScreenMessage('failure', sprintf(
753  $DIC->language()->txt('msg_no_perm_read_item'),
755  ), true);
756 
757  $DIC->ctrl()->setTargetScript('ilias.php');
758  $DIC->ctrl()->setParameterByClass(ilRepositoryGUI::class, 'ref_id', ROOT_FOLDER_ID);
759  $DIC->ctrl()->redirectByClass(ilRepositoryGUI::class);
760  }
761 
762  $DIC['ilErr']->raiseError($DIC->language()->txt('msg_no_perm_read'), $DIC['ilErr']->FATAL);
763  }
const ROOT_FOLDER_ID
Definition: constants.php:32
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ buildSettingsSubTabs()

ilObjMailGUI::buildSettingsSubTabs ( string  $activeSubTab)
protected

Definition at line 145 of file class.ilObjMailGUI.php.

References ILIAS\Repository\ctrl(), isViewAllowed(), ILIAS\Repository\lng(), ILIAS\Repository\settings(), and ILIAS\Repository\tabs().

Referenced by showExternalSettingsFormObject(), and showGeneralSettingsForm().

145  : void
146  {
147  if ($this->isViewAllowed()) {
148  $this->tabs->addSubTab(
149  self::SETTINGS_SUB_TAB_ID_GENERAL,
150  $this->lng->txt('mail_settings_general_tab'),
151  $this->ctrl->getLinkTarget($this, 'view')
152  );
153 
154  if ($this->settings->get('mail_allow_external', '0')) {
155  $this->tabs->addSubTab(
156  self::SETTINGS_SUB_TAB_ID_EXTERNAL,
157  $this->lng->txt('mail_settings_external_tab'),
158  $this->ctrl->getLinkTarget($this, 'showExternalSettingsForm')
159  );
160  }
161 
162  $this->tabs->activateSubTab($activeSubTab);
163  }
164  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildSignaturePlaceholderInputs()

ilObjMailGUI::buildSignaturePlaceholderInputs ( Signature  $signature)
private
Returns
ilFormPropertyGUI[]

Definition at line 579 of file class.ilObjMailGUI.php.

References ILIAS\Mail\Signature\Signature\getPersistenceIdentifier(), isEditingAllowed(), ILIAS\Repository\lng(), ilFormPropertyGUI\setDisabled(), ilTextAreaInputGUI\setRows(), and ILIAS\Mail\Signature\Signature\supports().

Referenced by getExternalSettingsForm().

579  : array
580  {
581  $signature_input = new ilTextAreaInputGUI(
582  $this->lng->txt($signature->getPersistenceIdentifier()),
583  $signature->getPersistenceIdentifier()
584  );
585  $signature_input->setRows(8);
586  $signature_input->setDisabled(!$this->isEditingAllowed());
587 
588  $placeholder_input = new ilManualPlaceholderInputGUI(
589  $this->lng->txt('mail_form_placeholders_label'),
590  'm_placeholders',
591  $signature->getPersistenceIdentifier(),
592  );
593  $placeholder_input->setDisabled(!$this->isEditingAllowed());
594 
595  $placeholder = $this->mail_signature_service->getPlaceholder();
596  do {
597  if ($signature->supports($placeholder)) {
598  $placeholder_input->addPlaceholder($placeholder->getId(), $placeholder->getLabel());
599  }
600  } while ($placeholder = $placeholder->getNext());
601 
602  return [$signature_input, $placeholder_input];
603  }
supports(Placeholder $placeholder)
Class ilManualPlaceholderInputGUI.
This class represents a text area property in a property form.
setDisabled(bool $a_disabled)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjMailGUI::executeCommand ( )

Definition at line 55 of file class.ilObjMailGUI.php.

References ILIAS\Repository\ctrl(), isViewAllowed(), ILIAS\Repository\lng(), and ilObjectGUI\prepareOutput().

55  : void
56  {
57  $next_class = $this->ctrl->getNextClass($this) ?? '';
58  $cmd = $this->ctrl->getCmd();
59  $this->prepareOutput();
60 
61  switch (strtolower($next_class)) {
62  case strtolower(ilPermissionGUI::class):
63  $perm_gui = new ilPermissionGUI($this);
64  $this->ctrl->forwardCommand($perm_gui);
65  break;
66 
67  case strtolower(ilMailTemplateGUI::class):
68  if (!$this->isViewAllowed()) {
69  $this->ilias->raiseError(
70  $this->lng->txt('msg_no_perm_write'),
71  $this->ilias->error_obj->WARNING
72  );
73  }
74 
75  $this->ctrl->forwardCommand(new ilMailTemplateGUI($this->object));
76  break;
77 
78  default:
79  if (!$cmd) {
80  $cmd = 'view';
81  }
82  $cmd .= 'Object';
83  $this->$cmd();
84  break;
85  }
86  }
Class ilMailTemplateGUI.
prepareOutput(bool $show_sub_objects=true)
if(!file_exists('../ilias.ini.php'))
Class ilObjForumAdministration.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjMailGUI::getAdminTabs ( )

Definition at line 103 of file class.ilObjMailGUI.php.

References getTabs().

103  : void
104  {
105  $this->getTabs();
106  }
+ Here is the call graph for this function:

◆ getAvailableSignatures()

ilObjMailGUI::getAvailableSignatures ( )
private
Returns
Signature[]

Definition at line 768 of file class.ilObjMailGUI.php.

References ILIAS\Repository\settings().

Referenced by getExternalSettingsForm(), populateExternalSettingsForm(), and saveExternalSettingsFormObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExternalSettingsForm()

ilObjMailGUI::getExternalSettingsForm ( )
protected

Definition at line 403 of file class.ilObjMailGUI.php.

References ilObjectGUI\$user, buildSignaturePlaceholderInputs(), ILIAS\Repository\ctrl(), getAvailableSignatures(), isEditingAllowed(), ILIAS\Repository\lng(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), and ilPasswordInputGUI\setRetype().

Referenced by saveExternalSettingsFormObject(), and showExternalSettingsFormObject().

404  {
405  $form = new ilPropertyFormGUI();
406 
407  $form->setFormAction($this->ctrl->getFormAction($this, 'saveExternalSettingsForm'));
408  $form->setTitle($this->lng->txt('mail_settings_external_frm_head'));
409 
410  $smtp = new ilCheckboxInputGUI($this->lng->txt('mail_smtp_status'), 'mail_smtp_status');
411  $smtp->setInfo($this->lng->txt('mail_smtp_status_info'));
412  $smtp->setValue('1');
413  $smtp->setDisabled(!$this->isEditingAllowed());
414  $form->addItem($smtp);
415 
416  $host = new ilTextInputGUI($this->lng->txt('mail_smtp_host'), 'mail_smtp_host');
417  $host->setInfo($this->lng->txt('mail_smtp_host_info'));
418  $host->setRequired(true);
419  $host->setDisabled(!$this->isEditingAllowed());
420  $smtp->addSubItem($host);
421 
422  $port = new ilNumberInputGUI($this->lng->txt('mail_smtp_port'), 'mail_smtp_port');
423  $port->setInfo($this->lng->txt('mail_smtp_port_info'));
424  $port->allowDecimals(false);
425  $port->setMinValue(0);
426  $port->setMinValue(0);
427  $port->setRequired(true);
428  $port->setDisabled(!$this->isEditingAllowed());
429  $smtp->addSubItem($port);
430 
431  $encryption = new ilSelectInputGUI(
432  $this->lng->txt('mail_smtp_encryption'),
433  'mail_smtp_encryption'
434  );
435  $encryptionOptions = [
436  '' => $this->lng->txt('please_choose'),
437  'tls' => $this->lng->txt('mail_smtp_encryption_tls'),
438  'ssl' => $this->lng->txt('mail_smtp_encryption_ssl'),
439  ];
440 
441  $encryption->setOptions($encryptionOptions);
442  $encryption->setDisabled(!$this->isEditingAllowed());
443  $smtp->addSubItem($encryption);
444 
445  $user = new ilTextInputGUI($this->lng->txt('mail_smtp_user'), 'mail_smtp_user');
446  $user->setDisabled(!$this->isEditingAllowed());
447  $user->setDisableHtmlAutoComplete(true);
448  $smtp->addSubItem($user);
449 
450  $password = new ilPasswordInputGUI(
451  $this->lng->txt('mail_smtp_password'),
452  'mail_smtp_password'
453  );
454  $password->setRetype(false);
455  $password->setSkipSyntaxCheck(true);
456  $password->setDisabled(!$this->isEditingAllowed());
457  $password->setDisableHtmlAutoComplete(true);
458  $smtp->addSubItem($password);
459 
460  $pre = new ilTextInputGUI($this->lng->txt('mail_subject_prefix'), 'mail_subject_prefix');
461  $pre->setSize(12);
462  $pre->setMaxLength(32);
463  $pre->setInfo($this->lng->txt('mail_subject_prefix_info'));
464  $pre->setDisabled(!$this->isEditingAllowed());
465  $form->addItem($pre);
466 
467  $send_html = new ilCheckboxInputGUI($this->lng->txt('mail_send_html'), 'mail_send_html');
468  $send_html->setInfo($this->lng->txt('mail_send_html_info'));
469  $send_html->setValue('1');
470  $send_html->setDisabled(!$this->isEditingAllowed());
471  $form->addItem($send_html);
472 
473  $sh = new ilFormSectionHeaderGUI();
474  $sh->setTitle($this->lng->txt('mail_settings_user_frm_head'));
475  $form->addItem($sh);
476 
477  $user_from_address = new ilEMailInputGUI(
478  $this->lng->txt('mail_system_usr_from_addr'),
479  'mail_system_usr_from_addr'
480  );
481  $user_from_address->setInfo($this->lng->txt('mail_system_usr_from_addr_info'));
482  $user_from_address->setRequired(true);
483  $user_from_address->setDisabled(!$this->isEditingAllowed());
484  $form->addItem($user_from_address);
485 
486  $useGlobalReplyToAddress = new ilCheckboxInputGUI(
487  $this->lng->txt('mail_use_global_reply_to_addr'),
488  'use_global_reply_to_addr'
489  );
490  $useGlobalReplyToAddress->setInfo($this->lng->txt('mail_use_global_reply_to_addr_info'));
491  $useGlobalReplyToAddress->setValue('1');
492  $useGlobalReplyToAddress->setDisabled(!$this->isEditingAllowed());
493  $form->addItem($useGlobalReplyToAddress);
494  $globalReplyTo = new ilEMailInputGUI(
495  $this->lng->txt('mail_global_reply_to_addr'),
496  'global_reply_to_addr'
497  );
498  $globalReplyTo->setInfo($this->lng->txt('mail_global_reply_to_addr_info'));
499  $globalReplyTo->setRequired(true);
500  $globalReplyTo->setDisabled(!$this->isEditingAllowed());
501  $useGlobalReplyToAddress->addSubItem($globalReplyTo);
502 
503  $user_from_name = new ilTextInputGUI(
504  $this->lng->txt('mail_system_usr_from_name'),
505  'mail_system_usr_from_name'
506  );
507  $user_from_name->setInfo($this->lng->txt('mail_system_usr_from_name_info'));
508  $user_from_name->setRequired(true);
509  $user_from_name->setDisabled(!$this->isEditingAllowed());
510  $form->addItem($user_from_name);
511 
512  $user_envelope_from_addr = new ilEMailInputGUI(
513  $this->lng->txt('mail_system_usr_env_from_addr'),
514  'mail_system_usr_env_from_addr'
515  );
516  $user_envelope_from_addr->setInfo($this->lng->txt('mail_system_usr_env_from_addr_info'));
517  $user_envelope_from_addr->setDisabled(!$this->isEditingAllowed());
518  $form->addItem($user_envelope_from_addr);
519 
520  [$user_signature_inputs, $installation_signature_inputs] = array_map(
521  fn(Signature $signature): array => $this->buildSignaturePlaceholderInputs($signature),
522  $this->getAvailableSignatures()
523  );
524  foreach ($user_signature_inputs as $user_signature_input) {
525  $form->addItem($user_signature_input);
526  }
527 
528  $sh = new ilFormSectionHeaderGUI();
529  $sh->setTitle($this->lng->txt('mail_settings_system_frm_head'));
530  $form->addItem($sh);
531 
532  $system_from_addr = new ilEMailInputGUI(
533  $this->lng->txt('mail_system_sys_from_addr'),
534  'mail_system_sys_from_addr'
535  );
536  $system_from_addr->setInfo($this->lng->txt('mail_system_sys_from_addr_info'));
537  $system_from_addr->setRequired(true);
538  $system_from_addr->setDisabled(!$this->isEditingAllowed());
539  $form->addItem($system_from_addr);
540 
541  $system_from_name = new ilTextInputGUI(
542  $this->lng->txt('mail_system_sys_from_name'),
543  'mail_system_sys_from_name'
544  );
545  $system_from_name->setRequired(true);
546  $system_from_name->setDisabled(!$this->isEditingAllowed());
547  $form->addItem($system_from_name);
548 
549  $system_reply_to_addr = new ilEMailInputGUI(
550  $this->lng->txt('mail_system_sys_reply_to_addr'),
551  'mail_system_sys_reply_to_addr'
552  );
553  $system_reply_to_addr->setRequired(true);
554  $system_reply_to_addr->setDisabled(!$this->isEditingAllowed());
555  $form->addItem($system_reply_to_addr);
556 
557  $system_return_path = new ilEMailInputGUI(
558  $this->lng->txt('mail_system_sys_env_from_addr'),
559  'mail_system_sys_env_from_addr'
560  );
561  $system_return_path->setInfo($this->lng->txt('mail_system_sys_env_from_addr_info'));
562  $system_return_path->setDisabled(!$this->isEditingAllowed());
563  $form->addItem($system_return_path);
564 
565  foreach ($installation_signature_inputs as $installation_signature_input) {
566  $form->addItem($installation_signature_input);
567  }
568 
569  if ($this->isEditingAllowed()) {
570  $form->addCommandButton('saveExternalSettingsForm', $this->lng->txt('save'));
571  }
572 
573  return $form;
574  }
This class represents a selection list property in a property form.
setOptions(array $a_options)
This class represents a email property in a property form.
buildSignaturePlaceholderInputs(Signature $signature)
This class represents a number property in a property form.
This class represents a password property in a property form.
setRequired(bool $a_required)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGeneralSettingsForm()

ilObjMailGUI::getGeneralSettingsForm ( )
protected

Definition at line 187 of file class.ilObjMailGUI.php.

References ilAdministrationSettingsFormHandler\addFieldsToForm(), ILIAS\Repository\ctrl(), ilAdministrationSettingsFormHandler\FORM_MAIL, isEditingAllowed(), ILIAS\Repository\lng(), ilFormPropertyGUI\setDisabled(), ilNumberInputGUI\setMinValue(), ilSelectInputGUI\setOptions(), ilNumberInputGUI\setSuffix(), and USER_FOLDER_ID.

Referenced by saveObject(), and showGeneralSettingsForm().

188  {
189  $form = new ilPropertyFormGUI();
190 
191  $form->setFormAction($this->ctrl->getFormAction($this, 'save'));
192  $form->setTitle($this->lng->txt('general_settings'));
193 
194  $cb = new ilCheckboxInputGUI($this->lng->txt('mail_allow_external'), 'mail_allow_external');
195  $cb->setInfo($this->lng->txt('mail_allow_external_info'));
196  $cb->setValue('1');
197  $cb->setDisabled(!$this->isEditingAllowed());
198  $form->addItem($cb);
199 
200  $incoming_mail_gui = new ilIncomingMailInputGUI(
201  $this->lng->txt('mail_incoming'),
202  'incoming_type'
203  );
204  $incoming_mail_gui->setDisabled(!$this->isEditingAllowed());
205  $this->ctrl->setParameterByClass(ilObjUserFolderGUI::class, 'ref_id', USER_FOLDER_ID);
206  $incoming_mail_gui->setInfo(sprintf(
207  $this->lng->txt('mail_settings_incoming_type_see_also'),
208  $this->ctrl->getLinkTargetByClass(ilObjUserFolderGUI::class, 'settings')
209  ));
210  $this->ctrl->clearParametersByClass(ilObjUserFolderGUI::class);
211  $form->addItem($incoming_mail_gui);
212 
213  $show_mail_settings_gui = new ilCheckboxInputGUI(
214  $this->lng->txt('show_mail_settings'),
215  'show_mail_settings'
216  );
217  $show_mail_settings_gui->setInfo($this->lng->txt('show_mail_settings_info'));
218  $show_mail_settings_gui->setValue('1');
219  $form->addItem($show_mail_settings_gui);
220 
221  $ti = new ilNumberInputGUI($this->lng->txt('mail_maxsize_attach'), 'mail_maxsize_attach');
222  $ti->setSuffix($this->lng->txt('kb'));
223  $ti->setInfo($this->lng->txt('mail_max_size_attachments_total'));
224  $ti->setMaxLength(10);
225  $ti->setSize(10);
226  $ti->setDisabled(!$this->isEditingAllowed());
227  $form->addItem($ti);
228 
229  $mn = new ilFormSectionHeaderGUI();
230  $mn->setTitle($this->lng->txt('mail_member_notification'));
231  $form->addItem($mn);
232 
233  $cron_mail = new ilSelectInputGUI(
234  $this->lng->txt('cron_mail_notification'),
235  'mail_notification'
236  );
237  $cron_options = [
238  0 => $this->lng->txt('cron_mail_notification_never'),
239  1 => $this->lng->txt('cron_mail_notification_cron'),
240  ];
241  $cron_mail->setOptions($cron_options);
242  $cron_mail->setInfo(sprintf(
243  $this->lng->txt('cron_mail_notification_desc'),
244  $this->lng->txt('mail_allow_external')
245  ));
246  $cron_mail->setDisabled(!$this->isEditingAllowed());
247  $form->addItem($cron_mail);
248 
251  $form,
252  $this
253  );
254 
255  $mn = new ilFormSectionHeaderGUI();
256  $mn->setTitle($this->lng->txt('mail_auto_responder'));
257  $form->addItem($mn);
258 
259  $input = new ilNumberInputGUI($this->lng->txt('mail_auto_responder_idle_time'), 'mail_auto_responder_idle_time');
260  $input->setMinValue(1);
261  $input->allowDecimals(false);
262  $input->setInfo($this->lng->txt('mail_auto_responder_idle_time_info'));
263  $input->setSuffix($this->lng->txt('days'));
264  $input->setDisabled(!$this->isEditingAllowed());
265  $input->setSize(5);
266  $form->addItem($input);
267 
268  if ($this->isEditingAllowed()) {
269  $form->addCommandButton('save', $this->lng->txt('save'));
270  }
271 
272  return $form;
273  }
setSuffix(string $a_value)
const USER_FOLDER_ID
Definition: constants.php:33
This class represents a selection list property in a property form.
setOptions(array $a_options)
This class represents a number property in a property form.
setMinValue(float $a_minvalue, bool $a_display_always=false)
static addFieldsToForm(int $a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
setDisabled(bool $a_disabled)
Class ilIncomingMailInputGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjMailGUI::getTabs ( )
protected

Definition at line 108 of file class.ilObjMailGUI.php.

References ILIAS\Repository\ctrl(), isPermissionChangeAllowed(), isViewAllowed(), and ILIAS\Repository\tabs().

Referenced by getAdminTabs().

108  : void
109  {
110  if ($this->isViewAllowed()) {
111  $this->tabs->addTarget(
112  'settings',
113  $this->ctrl->getLinkTarget($this, 'view'),
114  [
115  'view',
116  'save',
117  '',
118  'showExternalSettingsForm',
119  'saveExternalSettingsForm',
120  'sendTestUserMail',
121  'sendTestSystemMail',
122  ]
123  );
124  }
125 
126  if ($this->isViewAllowed()) {
127  $this->tabs->addTarget(
128  'mail_templates',
129  $this->ctrl->getLinkTargetByClass(ilMailTemplateGUI::class, 'showTemplates'),
130  '',
131  ilMailTemplateGUI::class
132  );
133  }
134 
135  if ($this->isPermissionChangeAllowed()) {
136  $this->tabs->addTarget(
137  'perm_settings',
138  $this->ctrl->getLinkTargetByClass([static::class, ilPermissionGUI::class], 'perm'),
139  ['perm', 'info', 'owner'],
140  ilPermissionGUI::class
141  );
142  }
143  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isEditingAllowed()

ilObjMailGUI::isEditingAllowed ( )
private

Definition at line 88 of file class.ilObjMailGUI.php.

References ILIAS\Repository\object().

Referenced by buildSignaturePlaceholderInputs(), getExternalSettingsForm(), getGeneralSettingsForm(), saveExternalSettingsFormObject(), and saveObject().

88  : bool
89  {
90  return $this->rbac_system->checkAccess('write', $this->object->getRefId());
91  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isPermissionChangeAllowed()

ilObjMailGUI::isPermissionChangeAllowed ( )
private

Definition at line 98 of file class.ilObjMailGUI.php.

References ILIAS\Repository\object().

Referenced by getTabs().

98  : bool
99  {
100  return $this->rbac_system->checkAccess('edit_permission', $this->object->getRefId());
101  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isViewAllowed()

ilObjMailGUI::isViewAllowed ( )
private

Definition at line 93 of file class.ilObjMailGUI.php.

References ILIAS\Repository\object().

Referenced by buildSettingsSubTabs(), executeCommand(), getTabs(), sendTestMail(), showExternalSettingsFormObject(), and showGeneralSettingsForm().

93  : bool
94  {
95  return $this->rbac_system->checkAccess('read', $this->object->getRefId());
96  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateExternalSettingsForm()

ilObjMailGUI::populateExternalSettingsForm ( ilPropertyFormGUI  $form)
protected

Definition at line 605 of file class.ilObjMailGUI.php.

References getAvailableSignatures(), ilMimeMail\MAIL_SUBJECT_PREFIX, null, ILIAS\Repository\settings(), and ilPropertyFormGUI\setValuesByArray().

Referenced by showExternalSettingsFormObject().

605  : void
606  {
607  $subjectPrefix = $this->settings->get('mail_subject_prefix');
608  if (null === $subjectPrefix) {
609  $subjectPrefix = ilMimeMail::MAIL_SUBJECT_PREFIX;
610  }
611 
612  [$user_signature, $installation_signature] = $this->getAvailableSignatures();
613 
614  $form->setValuesByArray([
615  'mail_smtp_status' => (bool) $this->settings->get('mail_smtp_status', '0'),
616  'mail_smtp_host' => $this->settings->get('mail_smtp_host', ''),
617  'mail_smtp_port' => $this->settings->get('mail_smtp_port', ''),
618  'mail_smtp_user' => $this->settings->get('mail_smtp_user', ''),
619  'mail_smtp_password' => $this->settings->get('mail_smtp_password') !== '' ?
620  self::PASSWORD_PLACE_HOLDER :
621  '',
622  'mail_smtp_encryption' => $this->settings->get('mail_smtp_encryption', ''),
623  'mail_subject_prefix' => $subjectPrefix,
624  'mail_send_html' => (bool) $this->settings->get('mail_send_html', '0'),
625  'mail_system_usr_from_addr' => $this->settings->get('mail_system_usr_from_addr', ''),
626  'mail_system_usr_from_name' => $this->settings->get('mail_system_usr_from_name', ''),
627  'mail_system_usr_env_from_addr' => $this->settings->get('mail_system_usr_env_from_addr', ''),
628  'mail_system_sys_from_addr' => $this->settings->get('mail_system_sys_from_addr', ''),
629  'mail_system_sys_from_name' => $this->settings->get('mail_system_sys_from_name', ''),
630  $user_signature->getPersistenceIdentifier() => $this->settings->get($user_signature->getPersistenceIdentifier(), ''),
631  'mail_system_sys_reply_to_addr' => $this->settings->get('mail_system_sys_reply_to_addr', ''),
632  'mail_system_sys_env_from_addr' => $this->settings->get('mail_system_sys_env_from_addr', ''),
633  $installation_signature->getPersistenceIdentifier() => $this->settings->get($installation_signature->getPersistenceIdentifier(), ''),
634  'use_global_reply_to_addr' => (bool) $this->settings->get('use_global_reply_to_addr', '0'),
635  'global_reply_to_addr' => $this->settings->get('global_reply_to_addr', ''),
636  ]);
637  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)
final const MAIL_SUBJECT_PREFIX
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateGeneralSettingsForm()

ilObjMailGUI::populateGeneralSettingsForm ( ilPropertyFormGUI  $form)
protected

Definition at line 275 of file class.ilObjMailGUI.php.

References ilMailOptions\FIRST_EMAIL, ILIAS\Repository\settings(), and ilPropertyFormGUI\setValuesByArray().

Referenced by showGeneralSettingsForm().

275  : void
276  {
277  $form->setValuesByArray([
278  'mail_allow_external' => (bool) $this->settings->get('mail_allow_external', '0'),
279  'incoming_type' => (string) $this->settings->get('mail_incoming_mail', '0'),
280  'mail_address_option' => $this->settings->get('mail_address_option', '') !== '' ?
281  $this->settings->get('mail_address_option') :
283  'mail_address_option_both' => $this->settings->get('mail_address_option', '') !== '' ?
284  $this->settings->get('mail_address_option') :
286  'show_mail_settings' => (bool) $this->settings->get('show_mail_settings', '1'),
287  'mail_maxsize_attach' => $this->settings->get('mail_maxsize_attach', ''),
288  'mail_notification' => $this->settings->get('mail_notification', ''),
289  'mail_auto_responder_idle_time' => is_numeric($this->settings->get('mail_auto_responder_idle_time', (string) AutoresponderService::AUTO_RESPONDER_DEFAULT_IDLE_TIME)) ?
290  (string) $this->settings->get('mail_auto_responder_idle_time', '3') :
291  '',
292  ]);
293  }
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)
final const FIRST_EMAIL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveExternalSettingsFormObject()

ilObjMailGUI::saveExternalSettingsFormObject ( )
protected

Definition at line 639 of file class.ilObjMailGUI.php.

References ILIAS\Repository\ctrl(), getAvailableSignatures(), getExternalSettingsForm(), ILIAS\Mail\Signature\Signature\getPersistenceIdentifier(), isEditingAllowed(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ILIAS\Repository\settings(), and showExternalSettingsFormObject().

639  : void
640  {
641  if (!$this->isEditingAllowed()) {
642  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
643  }
644 
645  $form = $this->getExternalSettingsForm();
646  $isFormValid = $form->checkInput();
647 
648  if (!$isFormValid) {
649  $form->setValuesByPost();
650  $this->showExternalSettingsFormObject($form);
651  return;
652  }
653 
654  $isSmtpEnabled = (bool) $form->getInput('mail_smtp_status');
655  if ($isSmtpEnabled && $form->getInput('mail_smtp_user') &&
656  !$form->getInput('mail_smtp_password')
657  ) {
658  $form->getItemByPostVar('mail_smtp_password')->setRequired(true);
659  $form->getItemByPostVar('mail_smtp_password')
660  ->setAlert($this->lng->txt('mail_smtp_password_req'));
661  $form->setValuesByPost();
662  $this->showExternalSettingsFormObject($form);
663  return;
664  }
665 
666  // If all forms in ILIAS use the UI/KS forms (here and in Services/Mail), we should move this to a proper constraint/trafo
667  $is_valid_template_syntax = $this->refinery->custom()->constraint(function ($value): bool {
668  try {
669  $this->mustache_factory->getBasicEngine()->render((string) $value, []);
670  return true;
671  } catch (Exception) {
672  return false;
673  }
674  }, $this->lng->txt('mail_template_invalid_tpl_syntax'));
675 
676  $valid_templates = true;
677  $availabe_signatures = array_map(
678  static fn(Signature $signature): string => $signature->getPersistenceIdentifier(),
679  $this->getAvailableSignatures()
680  );
681  foreach (
682  ['mail_system_usr_from_name', ...$availabe_signatures] as $template
683  ) {
684  try {
685  $is_valid_template_syntax->check((string) $form->getInput($template));
686  } catch (Exception) {
687  $form->getItemByPostVar($template)->setAlert(
688  $is_valid_template_syntax->problemWith((string) $form->getInput($template))
689  );
690  $valid_templates = false;
691  }
692  }
693  if (!$valid_templates) {
694  $form->setValuesByPost();
695  $this->showExternalSettingsFormObject($form);
696  return;
697  }
698 
699  $this->settings->set('mail_smtp_status', (string) ((int) $form->getInput('mail_smtp_status')));
700  $this->settings->set('mail_smtp_host', (string) $form->getInput('mail_smtp_host'));
701  $this->settings->set('mail_smtp_port', (string) ((int) $form->getInput('mail_smtp_port')));
702  $this->settings->set('mail_smtp_user', (string) $form->getInput('mail_smtp_user'));
703  if ($form->getInput('mail_smtp_password') !== self::PASSWORD_PLACE_HOLDER) {
704  $this->settings->set('mail_smtp_password', (string) $form->getInput('mail_smtp_password'));
705  }
706  $this->settings->set('mail_smtp_encryption', (string) $form->getInput('mail_smtp_encryption'));
707  $this->settings->set('mail_send_html', (string) $form->getInput('mail_send_html'));
708  $this->settings->set('mail_subject_prefix', (string) $form->getInput('mail_subject_prefix'));
709  $this->settings->set('mail_system_usr_from_addr', (string) $form->getInput('mail_system_usr_from_addr'));
710  $this->settings->set('mail_system_usr_from_name', (string) $form->getInput('mail_system_usr_from_name'));
711  $this->settings->set(
712  'mail_system_usr_env_from_addr',
713  (string) $form->getInput('mail_system_usr_env_from_addr')
714  );
715  $this->settings->set(
716  'mail_system_sys_from_addr',
717  (string) $form->getInput('mail_system_sys_from_addr')
718  );
719  $this->settings->set('mail_system_sys_from_name', (string) $form->getInput('mail_system_sys_from_name'));
720  $this->settings->set(
721  'mail_system_sys_reply_to_addr',
722  (string) $form->getInput('mail_system_sys_reply_to_addr')
723  );
724  $this->settings->set(
725  'mail_system_sys_env_from_addr',
726  (string) $form->getInput('mail_system_sys_env_from_addr')
727  );
728  $this->settings->set('use_global_reply_to_addr', (string) ((int) $form->getInput('use_global_reply_to_addr')));
729  $this->settings->set('global_reply_to_addr', (string) $form->getInput('global_reply_to_addr'));
730 
731  foreach ($availabe_signatures as $availabe_signature) {
732  $this->settings->set(
733  $availabe_signature,
734  (string) $form->getInput($availabe_signature)
735  );
736  }
737 
738  $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
739  $this->ctrl->redirect($this, 'showExternalSettingsForm');
740  }
showExternalSettingsFormObject(?ilPropertyFormGUI $form=null)
Class ilObjForumAdministration.
+ Here is the call graph for this function:

◆ saveObject()

ilObjMailGUI::saveObject ( )

Definition at line 295 of file class.ilObjMailGUI.php.

References ILIAS\Repository\ctrl(), ilMailOptions\FIRST_EMAIL, getGeneralSettingsForm(), ilMailOptions\INCOMING_BOTH, ilMailOptions\INCOMING_EMAIL, ILIAS\Repository\int(), isEditingAllowed(), ILIAS\Repository\lng(), ILIAS\Repository\settings(), and showGeneralSettingsForm().

295  : void
296  {
297  if (!$this->isEditingAllowed()) {
298  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
299  }
300 
301  $form = $this->getGeneralSettingsForm();
302  if ($form->checkInput()) {
303  $incoming_type = (int) $form->getInput('incoming_type');
304 
305  $mail_address_option = ilMailOptions::FIRST_EMAIL;
306  if ($incoming_type === ilMailOptions::INCOMING_EMAIL) {
307  $mail_address_option = (int) $form->getInput('mail_address_option');
308  } elseif ($incoming_type === ilMailOptions::INCOMING_BOTH) {
309  $mail_address_option = (int) $form->getInput('mail_address_option_both');
310  }
311 
312  $this->settings->set('mail_allow_external', (string) ((int) $form->getInput('mail_allow_external')));
313  $this->settings->set('mail_incoming_mail', (string) $incoming_type);
314  $this->settings->set('show_mail_settings', (string) ((int) $form->getInput('show_mail_settings')));
315  $this->settings->set('mail_address_option', (string) $mail_address_option);
316  $this->settings->set('mail_maxsize_attach', (string) $form->getInput('mail_maxsize_attach'));
317  $this->settings->set('mail_notification', (string) ((int) $form->getInput('mail_notification')));
318  $this->settings->set('mail_auto_responder_idle_time', (string) $form->getInput('mail_auto_responder_idle_time'));
319 
320  $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
321  $this->ctrl->redirect($this);
322  }
323 
324  $form->setValuesByPost();
325  $this->showGeneralSettingsForm($form);
326  }
showGeneralSettingsForm(?ilPropertyFormGUI $form=null)
final const INCOMING_EMAIL
Class ilObjForumAdministration.
final const FIRST_EMAIL
final const INCOMING_BOTH
+ Here is the call graph for this function:

◆ sendTestMail()

ilObjMailGUI::sendTestMail ( bool  $isManualMail = false)
protected

Definition at line 365 of file class.ilObjMailGUI.php.

References ANONYMOUS_USER_ID, isViewAllowed(), ILIAS\Repository\lng(), showExternalSettingsFormObject(), and ILIAS\Repository\user().

Referenced by sendTestSystemMailObject(), and sendTestUserMailObject().

365  : void
366  {
367  if (!$this->isViewAllowed()) {
368  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
369  }
370 
371  if ($this->user->getEmail() === '') {
373  return;
374  }
375 
376  if ($isManualMail) {
377  $mail = new ilMail($this->user->getId());
378  } else {
379  $mail = new ilMail(ANONYMOUS_USER_ID);
380  }
381 
382  $mail->setSaveInSentbox(false);
383  $mail->appendInstallationSignature(!$isManualMail);
384 
385  $lngVariablePrefix = 'sys';
386  if ($isManualMail) {
387  $lngVariablePrefix = 'usr';
388  }
389 
390  $mail->enqueue(
391  $this->user->getEmail(),
392  '',
393  '',
394  $this->lng->txt('mail_email_' . $lngVariablePrefix . '_subject'),
395  $this->lng->txt('mail_email_' . $lngVariablePrefix . '_body'),
396  []
397  );
398 
399  $this->tpl->setOnScreenMessage('success', $this->lng->txt('mail_external_test_sent'));
401  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
showExternalSettingsFormObject(?ilPropertyFormGUI $form=null)
Class ilObjForumAdministration.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendTestSystemMailObject()

ilObjMailGUI::sendTestSystemMailObject ( )
protected

Definition at line 360 of file class.ilObjMailGUI.php.

References sendTestMail().

360  : void
361  {
362  $this->sendTestMail();
363  }
sendTestMail(bool $isManualMail=false)
+ Here is the call graph for this function:

◆ sendTestUserMailObject()

ilObjMailGUI::sendTestUserMailObject ( )
protected

Definition at line 355 of file class.ilObjMailGUI.php.

References sendTestMail().

355  : void
356  {
357  $this->sendTestMail(true);
358  }
sendTestMail(bool $isManualMail=false)
+ Here is the call graph for this function:

◆ showExternalSettingsFormObject()

ilObjMailGUI::showExternalSettingsFormObject ( ?ilPropertyFormGUI  $form = null)
protected

Definition at line 328 of file class.ilObjMailGUI.php.

References buildSettingsSubTabs(), ILIAS\Repository\ctrl(), getExternalSettingsForm(), isViewAllowed(), ILIAS\Repository\lng(), null, populateExternalSettingsForm(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

Referenced by saveExternalSettingsFormObject(), and sendTestMail().

328  : void
329  {
330  if (!$this->isViewAllowed()) {
331  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
332  }
333 
334  $this->buildSettingsSubTabs(self::SETTINGS_SUB_TAB_ID_EXTERNAL);
335 
336  if ($form === null) {
337  $form = $this->getExternalSettingsForm();
338  $this->populateExternalSettingsForm($form);
339  }
340 
341  if ($this->user->getEmail() !== '') {
342  $this->toolbar->addComponent($this->ui_factory->button()->standard(
343  $this->lng->txt('mail_external_send_test_usr'),
344  $this->ctrl->getLinkTarget($this, 'sendTestUserMail')
345  ));
346  $this->toolbar->addComponent($this->ui_factory->button()->standard(
347  $this->lng->txt('mail_external_send_test_sys'),
348  $this->ctrl->getLinkTarget($this, 'sendTestSystemMail')
349  ));
350  }
351 
352  $this->tpl->setContent($form->getHTML());
353  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilObjForumAdministration.
buildSettingsSubTabs(string $activeSubTab)
populateExternalSettingsForm(ilPropertyFormGUI $form)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showGeneralSettingsForm()

ilObjMailGUI::showGeneralSettingsForm ( ?ilPropertyFormGUI  $form = null)
protected

Definition at line 171 of file class.ilObjMailGUI.php.

References buildSettingsSubTabs(), getGeneralSettingsForm(), isViewAllowed(), ILIAS\Repository\lng(), null, and populateGeneralSettingsForm().

Referenced by saveObject(), and viewObject().

171  : void
172  {
173  if (!$this->isViewAllowed()) {
174  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
175  }
176 
177  $this->buildSettingsSubTabs(self::SETTINGS_SUB_TAB_ID_GENERAL);
178 
179  if ($form === null) {
180  $form = $this->getGeneralSettingsForm();
181  $this->populateGeneralSettingsForm($form);
182  }
183 
184  $this->tpl->setContent($form->getHTML());
185  }
populateGeneralSettingsForm(ilPropertyFormGUI $form)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilObjForumAdministration.
buildSettingsSubTabs(string $activeSubTab)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ viewObject()

ilObjMailGUI::viewObject ( )

Definition at line 166 of file class.ilObjMailGUI.php.

References showGeneralSettingsForm().

166  : void
167  {
168  $this->showGeneralSettingsForm();
169  }
showGeneralSettingsForm(?ilPropertyFormGUI $form=null)
+ Here is the call graph for this function:

Field Documentation

◆ $mail_signature_service

readonly MailSignatureService ilObjMailGUI::$mail_signature_service
private

Definition at line 40 of file class.ilObjMailGUI.php.

◆ $mustache_factory

readonly ilMustacheFactory ilObjMailGUI::$mustache_factory
private

Definition at line 39 of file class.ilObjMailGUI.php.

◆ $tabs

readonly ilTabsGUI ilObjMailGUI::$tabs
private

Definition at line 38 of file class.ilObjMailGUI.php.

◆ PASSWORD_PLACE_HOLDER

const ilObjMailGUI::PASSWORD_PLACE_HOLDER = '***********************'
private

Definition at line 36 of file class.ilObjMailGUI.php.

◆ SETTINGS_SUB_TAB_ID_EXTERNAL

const ilObjMailGUI::SETTINGS_SUB_TAB_ID_EXTERNAL = 'settings_external'
private

Definition at line 35 of file class.ilObjMailGUI.php.

◆ SETTINGS_SUB_TAB_ID_GENERAL

const ilObjMailGUI::SETTINGS_SUB_TAB_ID_GENERAL = 'settings_general'
private

Definition at line 34 of file class.ilObjMailGUI.php.


The documentation for this class was generated from the following file: