ILIAS  release_8 Revision v8.23
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

ilGlobalTemplateInterface $tpl
 
ilCtrlInterface $ctrl
 
ilLanguage $lng
 
ilSetting $settings
 
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  }
Class ilMailOptions this class handles user mails.
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
+ 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  $nextClass = $this->ctrl->getNextClass($this);
79  switch ($nextClass) {
80  default:
81  if (!($cmd = $this->ctrl->getCmd())) {
82  $cmd = 'showOptions';
83  }
84 
85  $this->$cmd();
86  break;
87  }
88  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ getForm()

ilMailOptionsGUI::getForm ( )
protected

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

References ILIAS\Repository\form().

Referenced by saveOptions(), and showOptions().

96  {
97  return $this->form ?? new ilMailOptionsFormGUI(
98  $this->mail_options,
99  $this,
100  'saveOptions'
101  );
102  }
Class ilMailOptionsFormGUI.
form( $class_path, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveOptions()

ilMailOptionsGUI::saveOptions ( )
protected

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

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

104  : void
105  {
106  $this->tpl->setTitle($this->lng->txt('mail'));
107 
108  $form = $this->getForm();
109  if ($form->save()) {
110  $this->tpl->setOnScreenMessage('success', $this->lng->txt('mail_options_saved'), true);
111  $this->ctrl->redirect($this, 'showOptions');
112  }
113 
114  $this->showOptions($form);
115  }
ilMailOptionsFormGUI $form
showOptions(ilMailOptionsFormGUI $form=null)
+ Here is the call graph for this function:

◆ setForm()

ilMailOptionsGUI::setForm ( ilMailOptionsFormGUI  $form)

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

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

90  : void
91  {
92  $this->form = $form;
93  }
ilMailOptionsFormGUI $form
form( $class_path, string $cmd)
+ Here is the call graph for this function:

◆ showOptions()

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

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

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

Referenced by saveOptions().

117  : void
118  {
119  if (null === $form) {
120  $form = $this->getForm();
121  $form->populate();
122  } else {
123  $form->setValuesByPost();
124  }
125 
126  $this->tpl->setContent($form->getHTML());
127  $this->tpl->printToStdout();
128  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

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

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

ilSetting ilMailOptionsGUI::$settings
private

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

◆ $tpl

ilGlobalTemplateInterface ilMailOptionsGUI::$tpl
private

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

◆ $user

ilObjUser ilMailOptionsGUI::$user
private

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


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