ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMailOptionsGUI Class Reference
+ Collaboration diagram for ilMailOptionsGUI:

Public Member Functions

 __construct (?ilGlobalTemplateInterface $tpl=null, ?ilCtrlInterface $ctrl=null, ?ilLanguage $lng=null, ?ilObjUser $user=null, ?GlobalHttpState $http=null, ?Refinery $refinery=null, ?ilMailOptions $mail_options=null)
 
 executeCommand ()
 
 setForm (ilMailOptionsFormGUI $form)
 

Protected Member Functions

 getForm ()
 
 saveOptions ()
 
 showOptions (?ilMailOptionsFormGUI $form=null)
 

Protected Attributes

GlobalHttpState $http
 
Refinery $refinery
 
ilMailOptionsFormGUI $form
 
ilMailOptions $mail_options
 

Private Attributes

readonly ilGlobalTemplateInterface $tpl
 
readonly ilCtrlInterface $ctrl
 
readonly ilLanguage $lng
 
readonly ilSetting $settings
 
readonly ilObjUser $user
 

Detailed Description

Definition at line 25 of file class.ilMailOptionsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailOptionsGUI::__construct ( ?ilGlobalTemplateInterface  $tpl = null,
?ilCtrlInterface  $ctrl = null,
?ilLanguage  $lng = null,
?ilObjUser  $user = null,
?GlobalHttpState  $http = null,
?Refinery  $refinery = null,
?ilMailOptions  $mail_options = null 
)

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

45 {
46 global $DIC;
47 $this->tpl = $tpl ?? $DIC->ui()->mainTemplate();
48 $this->ctrl = $ctrl ?? $DIC->ctrl();
49 $this->lng = $lng ?? $DIC->language();
50 $this->user = $user ?? $DIC->user();
51 $this->http = $http ?? $DIC->http();
52 $this->refinery = $refinery ?? $DIC->refinery();
53 $this->mail_options = $mail_options ?? new ilMailOptions($this->user->getId());
54
55 $this->lng->loadLanguageModule('mail');
56 $this->ctrl->saveParameter($this, 'mobj_id');
57 }
readonly ilLanguage $lng
readonly ilGlobalTemplateInterface $tpl
readonly ilCtrlInterface $ctrl
readonly ilObjUser $user
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

References $DIC, $mail_options, $tpl, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilMailOptionsGUI::executeCommand ( )

Definition at line 59 of file class.ilMailOptionsGUI.php.

59 : void
60 {
61 if (!$this->mail_options->mayManageInvididualSettings()) {
62 $referrer = '';
63 if ($this->http->wrapper()->query()->has('referrer')) {
64 $referrer = $this->http->wrapper()->query()->retrieve(
65 'referrer',
66 $this->refinery->kindlyTo()->string()
67 );
68 }
69 if (strtolower(ilPersonalSettingsGUI::class) === strtolower($referrer)) {
70 $this->ctrl->redirectByClass(PersonalSettingsGUI::class);
71 }
72 $this->ctrl->redirectByClass(ilMailGUI::class);
73 }
74
75 if (!($cmd = $this->ctrl->getCmd())) {
76 $cmd = 'showOptions';
77 }
78 $this->$cmd();
79 }

References ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ getForm()

ilMailOptionsGUI::getForm ( )
protected

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

87 {
88 return $this->form ?? new ilMailOptionsFormGUI(
89 $this->mail_options,
90 $this,
91 'saveOptions'
92 );
93 }
form( $class_path, string $cmd, string $submit_caption="")

References ILIAS\Repository\form().

Referenced by saveOptions(), and showOptions().

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

◆ saveOptions()

ilMailOptionsGUI::saveOptions ( )
protected

Definition at line 95 of file class.ilMailOptionsGUI.php.

95 : void
96 {
97 $this->tpl->setTitle($this->lng->txt('mail'));
98
99 $form = $this->getForm();
100 if ($form->save()) {
101 $this->tpl->setOnScreenMessage('success', $this->lng->txt('mail_options_saved'), true);
102 $this->ctrl->redirect($this, 'showOptions');
103 }
104
105 $this->showOptions($form);
106 }
showOptions(?ilMailOptionsFormGUI $form=null)
ilMailOptionsFormGUI $form

References ILIAS\Repository\ctrl(), getForm(), ILIAS\Repository\lng(), ilMailOptionsFormGUI\save(), and showOptions().

+ Here is the call graph for this function:

◆ setForm()

ilMailOptionsGUI::setForm ( ilMailOptionsFormGUI  $form)

Definition at line 81 of file class.ilMailOptionsGUI.php.

81 : void
82 {
83 $this->form = $form;
84 }

References $form, and ILIAS\Repository\form().

+ Here is the call graph for this function:

◆ showOptions()

ilMailOptionsGUI::showOptions ( ?ilMailOptionsFormGUI  $form = null)
protected

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

108 : void
109 {
110 if (null === $form) {
111 $form = $this->getForm();
112 $form->populate();
113 } else {
115 }
116
117 $this->tpl->setContent($form->getHTML());
118 $this->tpl->printToStdout();
119 }

References $form, getForm(), ilPropertyFormGUI\getHTML(), ilMailOptionsFormGUI\populate(), and ilPropertyFormGUI\setValuesByPost().

Referenced by saveOptions().

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

Field Documentation

◆ $ctrl

readonly ilCtrlInterface ilMailOptionsGUI::$ctrl
private

Definition at line 28 of file class.ilMailOptionsGUI.php.

◆ $form

ilMailOptionsFormGUI ilMailOptionsGUI::$form
protected

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

Referenced by setForm(), and showOptions().

◆ $http

GlobalHttpState ilMailOptionsGUI::$http
protected

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

◆ $lng

readonly ilLanguage ilMailOptionsGUI::$lng
private

Definition at line 29 of file class.ilMailOptionsGUI.php.

◆ $mail_options

ilMailOptions ilMailOptionsGUI::$mail_options
protected

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

Referenced by __construct().

◆ $refinery

Refinery ilMailOptionsGUI::$refinery
protected

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

◆ $settings

readonly ilSetting ilMailOptionsGUI::$settings
private

Definition at line 30 of file class.ilMailOptionsGUI.php.

◆ $tpl

readonly ilGlobalTemplateInterface ilMailOptionsGUI::$tpl
private

Definition at line 27 of file class.ilMailOptionsGUI.php.

Referenced by __construct().

◆ $user

readonly ilObjUser ilMailOptionsGUI::$user
private

Definition at line 31 of file class.ilMailOptionsGUI.php.


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