ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilObjMailGUI Class Reference

ilObjMailGUI: ilPermissionGUI More...

+ 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 $active_sub_tab)
 
 showGeneralSettingsForm (?ilPropertyFormGUI $form=null)
 
 getGeneralSettingsForm ()
 
 populateGeneralSettingsForm (ilPropertyFormGUI $form)
 
 showExternalSettingsFormObject (?ilPropertyFormGUI $form=null)
 
 sendTestUserMailObject ()
 
 sendTestSystemMailObject ()
 
 sendTestMail (bool $is_manual_mail=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 string SETTINGS_SUB_TAB_ID_GENERAL = 'settings_general'
 
const string SETTINGS_SUB_TAB_ID_EXTERNAL = 'settings_external'
 
const string 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
 
GlobalHttpState $http
 
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
 
CustomIconFactory $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 40 of file class.ilObjMailGUI.php.

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

41  {
42  global $DIC;
43  $this->type = 'mail';
44  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
45 
46  $this->tabs = $DIC->tabs();
47  $this->mustache_factory = $DIC->mail()->mustacheFactory();
48  $this->mail_signature_service = $DIC->mail()->signature();
49 
50  $this->lng->loadLanguageModule('mail');
51  }
global $DIC
Definition: shib_login.php:26
__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 740 of file class.ilObjMailGUI.php.

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

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

◆ buildSettingsSubTabs()

ilObjMailGUI::buildSettingsSubTabs ( string  $active_sub_tab)
protected

Definition at line 143 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().

143  : void
144  {
145  if ($this->isViewAllowed()) {
146  $this->tabs->addSubTab(
147  self::SETTINGS_SUB_TAB_ID_GENERAL,
148  $this->lng->txt('mail_settings_general_tab'),
149  $this->ctrl->getLinkTarget($this, 'view')
150  );
151 
152  if ($this->settings->get('mail_allow_external', '0')) {
153  $this->tabs->addSubTab(
154  self::SETTINGS_SUB_TAB_ID_EXTERNAL,
155  $this->lng->txt('mail_settings_external_tab'),
156  $this->ctrl->getLinkTarget($this, 'showExternalSettingsForm')
157  );
158  }
159 
160  $this->tabs->activateSubTab($active_sub_tab);
161  }
162  }
+ 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 577 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().

577  : array
578  {
579  $signature_input = new ilTextAreaInputGUI(
580  $this->lng->txt($signature->getPersistenceIdentifier()),
581  $signature->getPersistenceIdentifier()
582  );
583  $signature_input->setRows(8);
584  $signature_input->setDisabled(!$this->isEditingAllowed());
585 
586  $placeholder_input = new ilManualPlaceholderInputGUI(
587  $this->lng->txt('mail_form_placeholders_label'),
588  'm_placeholders',
589  $signature->getPersistenceIdentifier(),
590  );
591  $placeholder_input->setDisabled(!$this->isEditingAllowed());
592 
593  $placeholder = $this->mail_signature_service->getPlaceholder();
594  do {
595  if ($signature->supports($placeholder)) {
596  $placeholder_input->addPlaceholder($placeholder->getId(), $placeholder->getLabel());
597  }
598  } while ($placeholder = $placeholder->getNext());
599 
600  return [$signature_input, $placeholder_input];
601  }
supports(Placeholder $placeholder)
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 53 of file class.ilObjMailGUI.php.

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

53  : void
54  {
55  $next_class = $this->ctrl->getNextClass($this) ?? '';
56  $cmd = $this->ctrl->getCmd();
57  $this->prepareOutput();
58 
59  switch (strtolower($next_class)) {
60  case strtolower(ilPermissionGUI::class):
61  $perm_gui = new ilPermissionGUI($this);
62  $this->ctrl->forwardCommand($perm_gui);
63  break;
64 
65  case strtolower(ilMailTemplateGUI::class):
66  if (!$this->isViewAllowed()) {
67  $this->ilias->raiseError(
68  $this->lng->txt('msg_no_perm_write'),
69  $this->ilias->error_obj->WARNING
70  );
71  }
72 
73  $this->ctrl->forwardCommand(new ilMailTemplateGUI($this->object));
74  break;
75 
76  default:
77  if (!$cmd) {
78  $cmd = 'view';
79  }
80  $cmd .= 'Object';
81  $this->$cmd();
82  break;
83  }
84  }
ilMailTemplateGUI: ilObjMailGUI
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 101 of file class.ilObjMailGUI.php.

References getTabs().

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

◆ getAvailableSignatures()

ilObjMailGUI::getAvailableSignatures ( )
private
Returns
Signature[]

Definition at line 766 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 401 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().

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

186  {
187  $form = new ilPropertyFormGUI();
188 
189  $form->setFormAction($this->ctrl->getFormAction($this, 'save'));
190  $form->setTitle($this->lng->txt('general_settings'));
191 
192  $cb = new ilCheckboxInputGUI($this->lng->txt('mail_allow_external'), 'mail_allow_external');
193  $cb->setInfo($this->lng->txt('mail_allow_external_info'));
194  $cb->setValue('1');
195  $cb->setDisabled(!$this->isEditingAllowed());
196  $form->addItem($cb);
197 
198  $incoming_mail_gui = new ilIncomingMailInputGUI(
199  $this->lng->txt('mail_incoming'),
200  'incoming_type'
201  );
202  $incoming_mail_gui->setDisabled(!$this->isEditingAllowed());
203  $this->ctrl->setParameterByClass(ilObjUserFolderGUI::class, 'ref_id', USER_FOLDER_ID);
204  $incoming_mail_gui->setInfo(sprintf(
205  $this->lng->txt('mail_settings_incoming_type_see_also'),
206  $this->ctrl->getLinkTargetByClass(ilObjUserFolderGUI::class, 'settings')
207  ));
208  $this->ctrl->clearParametersByClass(ilObjUserFolderGUI::class);
209  $form->addItem($incoming_mail_gui);
210 
211  $show_mail_settings_gui = new ilCheckboxInputGUI(
212  $this->lng->txt('show_mail_settings'),
213  'show_mail_settings'
214  );
215  $show_mail_settings_gui->setInfo($this->lng->txt('show_mail_settings_info'));
216  $show_mail_settings_gui->setValue('1');
217  $form->addItem($show_mail_settings_gui);
218 
219  $ti = new ilNumberInputGUI($this->lng->txt('mail_maxsize_attach'), 'mail_maxsize_attach');
220  $ti->setSuffix($this->lng->txt('kb'));
221  $ti->setInfo($this->lng->txt('mail_max_size_attachments_total'));
222  $ti->setMaxLength(10);
223  $ti->setSize(10);
224  $ti->setDisabled(!$this->isEditingAllowed());
225  $form->addItem($ti);
226 
227  $mn = new ilFormSectionHeaderGUI();
228  $mn->setTitle($this->lng->txt('mail_member_notification'));
229  $form->addItem($mn);
230 
231  $cron_mail = new ilSelectInputGUI(
232  $this->lng->txt('cron_mail_notification'),
233  'mail_notification'
234  );
235  $cron_options = [
236  0 => $this->lng->txt('cron_mail_notification_never'),
237  1 => $this->lng->txt('cron_mail_notification_cron'),
238  ];
239  $cron_mail->setOptions($cron_options);
240  $cron_mail->setInfo(sprintf(
241  $this->lng->txt('cron_mail_notification_desc'),
242  $this->lng->txt('mail_allow_external')
243  ));
244  $cron_mail->setDisabled(!$this->isEditingAllowed());
245  $form->addItem($cron_mail);
246 
249  $form,
250  $this
251  );
252 
253  $mn = new ilFormSectionHeaderGUI();
254  $mn->setTitle($this->lng->txt('mail_auto_responder'));
255  $form->addItem($mn);
256 
257  $input = new ilNumberInputGUI($this->lng->txt('mail_auto_responder_idle_time'), 'mail_auto_responder_idle_time');
258  $input->setMinValue(1);
259  $input->allowDecimals(false);
260  $input->setInfo($this->lng->txt('mail_auto_responder_idle_time_info'));
261  $input->setSuffix($this->lng->txt('days'));
262  $input->setDisabled(!$this->isEditingAllowed());
263  $input->setSize(5);
264  $form->addItem($input);
265 
266  if ($this->isEditingAllowed()) {
267  $form->addCommandButton('save', $this->lng->txt('save'));
268  }
269 
270  return $form;
271  }
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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjMailGUI::getTabs ( )
protected

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

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

Referenced by getAdminTabs().

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

◆ isEditingAllowed()

ilObjMailGUI::isEditingAllowed ( )
private

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

References ILIAS\Repository\object().

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

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

◆ isPermissionChangeAllowed()

ilObjMailGUI::isPermissionChangeAllowed ( )
private

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

References ILIAS\Repository\object().

Referenced by getTabs().

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

◆ isViewAllowed()

ilObjMailGUI::isViewAllowed ( )
private

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

References ILIAS\Repository\object().

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

91  : bool
92  {
93  return $this->rbac_system->checkAccess('read', $this->object->getRefId());
94  }
+ 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 603 of file class.ilObjMailGUI.php.

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

Referenced by showExternalSettingsFormObject().

603  : void
604  {
605  $subject_prefix = $this->settings->get('mail_subject_prefix');
606  if ($subject_prefix === null) {
607  $subject_prefix = ilMimeMail::MAIL_SUBJECT_PREFIX;
608  }
609 
610  [$user_signature, $installation_signature] = $this->getAvailableSignatures();
611 
612  $form->setValuesByArray([
613  'mail_smtp_status' => (bool) $this->settings->get('mail_smtp_status', '0'),
614  'mail_smtp_host' => $this->settings->get('mail_smtp_host', ''),
615  'mail_smtp_port' => $this->settings->get('mail_smtp_port', ''),
616  'mail_smtp_user' => $this->settings->get('mail_smtp_user', ''),
617  'mail_smtp_password' => $this->settings->get('mail_smtp_password') !== '' ?
618  self::PASSWORD_PLACE_HOLDER :
619  '',
620  'mail_smtp_encryption' => $this->settings->get('mail_smtp_encryption', ''),
621  'mail_subject_prefix' => $subject_prefix,
622  'mail_send_html' => (bool) $this->settings->get('mail_send_html', '0'),
623  'mail_system_usr_from_addr' => $this->settings->get('mail_system_usr_from_addr', ''),
624  'mail_system_usr_from_name' => $this->settings->get('mail_system_usr_from_name', ''),
625  'mail_system_usr_env_from_addr' => $this->settings->get('mail_system_usr_env_from_addr', ''),
626  'mail_system_sys_from_addr' => $this->settings->get('mail_system_sys_from_addr', ''),
627  'mail_system_sys_from_name' => $this->settings->get('mail_system_sys_from_name', ''),
628  $user_signature->getPersistenceIdentifier() => $this->settings->get($user_signature->getPersistenceIdentifier(), ''),
629  'mail_system_sys_reply_to_addr' => $this->settings->get('mail_system_sys_reply_to_addr', ''),
630  'mail_system_sys_env_from_addr' => $this->settings->get('mail_system_sys_env_from_addr', ''),
631  $installation_signature->getPersistenceIdentifier() => $this->settings->get($installation_signature->getPersistenceIdentifier(), ''),
632  'use_global_reply_to_addr' => (bool) $this->settings->get('use_global_reply_to_addr', '0'),
633  'global_reply_to_addr' => $this->settings->get('global_reply_to_addr', ''),
634  ]);
635  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
final const string MAIL_SUBJECT_PREFIX
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)
+ 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 273 of file class.ilObjMailGUI.php.

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

Referenced by showGeneralSettingsForm().

273  : void
274  {
275  $form->setValuesByArray([
276  'mail_allow_external' => (bool) $this->settings->get('mail_allow_external', '0'),
277  'incoming_type' => (string) $this->settings->get('mail_incoming_mail', '0'),
278  'mail_address_option' => $this->settings->get('mail_address_option', '') !== '' ?
279  $this->settings->get('mail_address_option') :
281  'mail_address_option_both' => $this->settings->get('mail_address_option', '') !== '' ?
282  $this->settings->get('mail_address_option') :
284  'show_mail_settings' => (bool) $this->settings->get('show_mail_settings', '1'),
285  'mail_maxsize_attach' => $this->settings->get('mail_maxsize_attach', ''),
286  'mail_notification' => $this->settings->get('mail_notification', ''),
287  'mail_auto_responder_idle_time' => is_numeric($this->settings->get('mail_auto_responder_idle_time', (string) AutoresponderService::AUTO_RESPONDER_DEFAULT_IDLE_TIME)) ?
288  (string) $this->settings->get('mail_auto_responder_idle_time', '3') :
289  '',
290  ]);
291  }
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)
final const int 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 637 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().

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

◆ saveObject()

ilObjMailGUI::saveObject ( )

Definition at line 293 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().

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

◆ sendTestMail()

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

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

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

Referenced by sendTestSystemMailObject(), and sendTestUserMailObject().

363  : void
364  {
365  if (!$this->isViewAllowed()) {
366  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
367  }
368 
369  if ($this->user->getEmail() === '') {
371  return;
372  }
373 
374  if ($is_manual_mail) {
375  $mail = new ilMail($this->user->getId());
376  } else {
377  $mail = new ilMail(ANONYMOUS_USER_ID);
378  }
379 
380  $mail->setSaveInSentbox(false);
381  $mail->appendInstallationSignature(!$is_manual_mail);
382 
383  $lng_variable_prefix = 'sys';
384  if ($is_manual_mail) {
385  $lng_variable_prefix = 'usr';
386  }
387 
388  $mail->enqueue(
389  $this->user->getEmail(),
390  '',
391  '',
392  $this->lng->txt('mail_email_' . $lng_variable_prefix . '_subject'),
393  $this->lng->txt('mail_email_' . $lng_variable_prefix . '_body'),
394  []
395  );
396 
397  $this->tpl->setOnScreenMessage('success', $this->lng->txt('mail_external_test_sent'));
399  }
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 358 of file class.ilObjMailGUI.php.

References sendTestMail().

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

◆ sendTestUserMailObject()

ilObjMailGUI::sendTestUserMailObject ( )
protected

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

References sendTestMail().

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

◆ showExternalSettingsFormObject()

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

Definition at line 326 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().

326  : void
327  {
328  if (!$this->isViewAllowed()) {
329  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
330  }
331 
332  $this->buildSettingsSubTabs(self::SETTINGS_SUB_TAB_ID_EXTERNAL);
333 
334  if ($form === null) {
335  $form = $this->getExternalSettingsForm();
336  $this->populateExternalSettingsForm($form);
337  }
338 
339  if ($this->user->getEmail() !== '') {
340  $this->toolbar->addComponent($this->ui_factory->button()->standard(
341  $this->lng->txt('mail_external_send_test_usr'),
342  $this->ctrl->getLinkTarget($this, 'sendTestUserMail')
343  ));
344  $this->toolbar->addComponent($this->ui_factory->button()->standard(
345  $this->lng->txt('mail_external_send_test_sys'),
346  $this->ctrl->getLinkTarget($this, 'sendTestSystemMail')
347  ));
348  }
349 
350  $this->tpl->setContent($form->getHTML());
351  }
buildSettingsSubTabs(string $active_sub_tab)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilObjForumAdministration.
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 169 of file class.ilObjMailGUI.php.

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

Referenced by saveObject(), and viewObject().

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

◆ viewObject()

ilObjMailGUI::viewObject ( )

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

References showGeneralSettingsForm().

164  : void
165  {
166  $this->showGeneralSettingsForm();
167  }
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 38 of file class.ilObjMailGUI.php.

◆ $mustache_factory

readonly ilMustacheFactory ilObjMailGUI::$mustache_factory
private

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

◆ $tabs

readonly ilTabsGUI ilObjMailGUI::$tabs
private

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

◆ PASSWORD_PLACE_HOLDER

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

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

◆ SETTINGS_SUB_TAB_ID_EXTERNAL

const string ilObjMailGUI::SETTINGS_SUB_TAB_ID_EXTERNAL = 'settings_external'
private

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

◆ SETTINGS_SUB_TAB_ID_GENERAL

const string ilObjMailGUI::SETTINGS_SUB_TAB_ID_GENERAL = 'settings_general'
private

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


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