ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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 $this->ctrl->redirectByClass(ilMailGUI::class);
63 }
64
65 if (!($cmd = $this->ctrl->getCmd())) {
66 $cmd = 'showOptions';
67 }
68 $this->$cmd();
69 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getForm()

ilMailOptionsGUI::getForm ( )
protected

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

77 {
78 return $this->form ?? new ilMailOptionsFormGUI(
79 $this->mail_options,
80 $this,
81 'saveOptions'
82 );
83 }
form(?array $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 85 of file class.ilMailOptionsGUI.php.

85 : void
86 {
87 $this->tpl->setTitle($this->lng->txt('mail'));
88
89 $form = $this->getForm();
90 if ($form->save()) {
91 $this->tpl->setOnScreenMessage('success', $this->lng->txt('mail_options_saved'), true);
92 $this->ctrl->redirect($this, 'showOptions');
93 }
94
95 $this->showOptions($form);
96 }
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 71 of file class.ilMailOptionsGUI.php.

71 : void
72 {
73 $this->form = $form;
74 }

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

+ Here is the call graph for this function:

◆ showOptions()

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

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

98 : void
99 {
100 if (null === $form) {
101 $form = $this->getForm();
102 $form->populate();
103 } else {
105 }
106
107 $this->tpl->setContent($form->getHTML());
108 $this->tpl->printToStdout();
109 }

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: