ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 24 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 36 of file class.ilMailOptionsGUI.php.

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

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

Member Function Documentation

◆ executeCommand()

ilMailOptionsGUI::executeCommand ( )

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

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

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

◆ getForm()

ilMailOptionsGUI::getForm ( )
protected

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

References ILIAS\Repository\form().

Referenced by saveOptions(), and showOptions().

86  {
87  return $this->form ?? new ilMailOptionsFormGUI(
88  $this->mail_options,
89  $this,
90  'saveOptions'
91  );
92  }
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 94 of file class.ilMailOptionsGUI.php.

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

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

◆ setForm()

ilMailOptionsGUI::setForm ( ilMailOptionsFormGUI  $form)

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

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

80  : void
81  {
82  $this->form = $form;
83  }
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 107 of file class.ilMailOptionsGUI.php.

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

Referenced by saveOptions().

107  : void
108  {
109  if (null === $form) {
110  $form = $this->getForm();
111  $form->populate();
112  } else {
114  }
115 
116  $this->tpl->setContent($form->getHTML());
117  $this->tpl->printToStdout();
118  }
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 27 of file class.ilMailOptionsGUI.php.

◆ $form

ilMailOptionsFormGUI ilMailOptionsGUI::$form
protected

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

Referenced by setForm().

◆ $http

GlobalHttpState ilMailOptionsGUI::$http
protected

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

◆ $lng

readonly ilLanguage ilMailOptionsGUI::$lng
private

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

◆ $mail_options

ilMailOptions ilMailOptionsGUI::$mail_options
protected

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

◆ $refinery

Refinery ilMailOptionsGUI::$refinery
protected

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

◆ $settings

readonly ilSetting ilMailOptionsGUI::$settings
private

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

◆ $tpl

readonly ilGlobalTemplateInterface ilMailOptionsGUI::$tpl
private

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

◆ $user

readonly ilObjUser ilMailOptionsGUI::$user
private

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


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