ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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

Author
Jens Conze

Definition at line 28 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 40 of file class.ilMailOptionsGUI.php.

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

48  {
49  global $DIC;
50  $this->tpl = $tpl ?? $DIC->ui()->mainTemplate();
51  $this->ctrl = $ctrl ?? $DIC->ctrl();
52  $this->lng = $lng ?? $DIC->language();
53  $this->user = $user ?? $DIC->user();
54  $this->http = $http ?? $DIC->http();
55  $this->refinery = $refinery ?? $DIC->refinery();
56  $this->mail_options = $mail_options ?? new ilMailOptions($this->user->getId());
57 
58  $this->lng->loadLanguageModule('mail');
59  $this->ctrl->saveParameter($this, 'mobj_id');
60  }
readonly ilCtrlInterface $ctrl
readonly ilGlobalTemplateInterface $tpl
readonly ilLanguage $lng
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:22
readonly ilObjUser $user
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilMailOptionsGUI::executeCommand ( )

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

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

62  : void
63  {
64  if (!$this->mail_options->mayManageInvididualSettings()) {
65  $referrer = '';
66  if ($this->http->wrapper()->query()->has('referrer')) {
67  $referrer = $this->http->wrapper()->query()->retrieve(
68  'referrer',
69  $this->refinery->kindlyTo()->string()
70  );
71  }
72  if (strtolower(ilPersonalSettingsGUI::class) === strtolower($referrer)) {
73  $this->ctrl->redirectByClass(ilPersonalSettingsGUI::class);
74  }
75  $this->ctrl->redirectByClass(ilMailGUI::class);
76  }
77 
78  if (!($cmd = $this->ctrl->getCmd())) {
79  $cmd = 'showOptions';
80  }
81  $this->$cmd();
82  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ getForm()

ilMailOptionsGUI::getForm ( )
protected

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

References ILIAS\Repository\form().

Referenced by saveOptions(), and showOptions().

90  {
91  return $this->form ?? new ilMailOptionsFormGUI(
92  $this->mail_options,
93  $this,
94  'saveOptions'
95  );
96  }
Class ilMailOptionsFormGUI.
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveOptions()

ilMailOptionsGUI::saveOptions ( )
protected

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

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

98  : void
99  {
100  $this->tpl->setTitle($this->lng->txt('mail'));
101 
102  $form = $this->getForm();
103  if ($form->save()) {
104  $this->tpl->setOnScreenMessage('success', $this->lng->txt('mail_options_saved'), true);
105  $this->ctrl->redirect($this, 'showOptions');
106  }
107 
108  $this->showOptions($form);
109  }
ilMailOptionsFormGUI $form
showOptions(?ilMailOptionsFormGUI $form=null)
+ Here is the call graph for this function:

◆ setForm()

ilMailOptionsGUI::setForm ( ilMailOptionsFormGUI  $form)

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

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

84  : void
85  {
86  $this->form = $form;
87  }
ilMailOptionsFormGUI $form
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:

◆ showOptions()

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

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

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

Referenced by saveOptions().

111  : void
112  {
113  if (null === $form) {
114  $form = $this->getForm();
115  $form->populate();
116  } else {
118  }
119 
120  $this->tpl->setContent($form->getHTML());
121  $this->tpl->printToStdout();
122  }
ilMailOptionsFormGUI $form
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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 31 of file class.ilMailOptionsGUI.php.

◆ $form

ilMailOptionsFormGUI ilMailOptionsGUI::$form
protected

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

Referenced by setForm().

◆ $http

GlobalHttpState ilMailOptionsGUI::$http
protected

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

◆ $lng

readonly ilLanguage ilMailOptionsGUI::$lng
private

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

◆ $mail_options

ilMailOptions ilMailOptionsGUI::$mail_options
protected

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

◆ $refinery

Refinery ilMailOptionsGUI::$refinery
protected

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

◆ $settings

readonly ilSetting ilMailOptionsGUI::$settings
private

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

◆ $tpl

readonly ilGlobalTemplateInterface ilMailOptionsGUI::$tpl
private

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

◆ $user

readonly ilObjUser ilMailOptionsGUI::$user
private

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


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