ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
ilMailOptionsGUI Class Reference
+ Collaboration diagram for ilMailOptionsGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 saveOptions ()
 Called if the user pushes the submit button of the mail options form. More...
 
 showOptions ()
 Called to display the mail options form. More...
 

Private Member Functions

 setMailOptionsValuesByDB ()
 Fetches data from model and loads this data into form. More...
 
 initMailOptionsForm ()
 Initialises the mail options form. More...
 

Private Attributes

 $tpl = null
 
 $ctrl = null
 
 $lng = null
 
 $umail = null
 
 $mbox = null
 
 $errorDelete = false
 

Detailed Description

Author
Jens Conze
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilMailOptionsGUI::__construct ( )

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

References $ilCtrl, $ilUser, $lng, and $tpl.

26  {
27  global $tpl, $ilCtrl, $lng, $ilUser;
28 
29  $this->tpl = $tpl;
30  $this->ctrl = $ilCtrl;
31  $this->lng = $lng;
32 
33  $this->ctrl->saveParameter($this, "mobj_id");
34 
35  $this->umail = new ilFormatMail($ilUser->getId());
36  $this->mbox = new ilMailBox($ilUser->getId());
37  }
global $ilCtrl
Definition: ilias.php:18
Class UserMail this class handles user mails.
global $ilUser
Definition: imgupload.php:15

Member Function Documentation

◆ executeCommand()

ilMailOptionsGUI::executeCommand ( )

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

References $cmd.

40  {
41  $forward_class = $this->ctrl->getNextClass($this);
42  switch($forward_class)
43  {
44  default:
45  if (!($cmd = $this->ctrl->getCmd()))
46  {
47  $cmd = "showOptions";
48  }
49 
50  $this->$cmd();
51  break;
52  }
53  return true;
54  }
$cmd
Definition: sahs_server.php:35

◆ initMailOptionsForm()

ilMailOptionsGUI::initMailOptionsForm ( )
private

Initialises the mail options form.

private

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

References $ilCtrl, $ilSetting, $ilUser, $lng, $options, $si, ilObjUser\_lookupEmail(), IL_MAIL_BOTH, IL_MAIL_EMAIL, IL_MAIL_LOCAL, ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), and ilTextAreaInputGUI\setRows().

Referenced by saveOptions(), and showOptions().

151  {
152  global $ilCtrl, $ilSetting, $lng, $ilUser;
153 
154  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
155  $this->form = new ilPropertyFormGUI();
156 
157  $this->form->setFormAction($ilCtrl->getFormAction($this, 'saveOptions'));
158  $this->form->setTitle($lng->txt('mail_settings'));
159 
160  // BEGIN INCOMING
161  if($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')
162  {
163  $options = array(
164  IL_MAIL_LOCAL => $lng->txt('mail_incoming_local'),
165  IL_MAIL_EMAIL => $lng->txt('mail_incoming_smtp'),
166  IL_MAIL_BOTH => $lng->txt('mail_incoming_both')
167  );
168  $si = new ilSelectInputGUI($lng->txt('mail_incoming'), 'incoming_type');
169  $si->setOptions($options);
170  if(!strlen(ilObjUser::_lookupEmail($ilUser->getId())) ||
171  $ilSetting->get('usr_settings_disable_mail_incoming_mail') == '1')
172  {
173  $si->setDisabled(true);
174  }
175  $this->form->addItem($si);
176  }
177 
178  // BEGIN LINEBREAK_OPTIONS
179  $options = array();
180  for($i = 50; $i <= 80; $i++)
181  {
182  $options[$i] = $i;
183  }
184  $si = new ilSelectInputGUI($lng->txt('linebreak'), 'linebreak');
185  $si->setOptions($options);
186  $this->form->addItem($si);
187 
188  // BEGIN SIGNATURE
189  $ta = new ilTextAreaInputGUI($lng->txt('signature'), 'signature');
190  $ta->setRows(10);
191  $ta->setCols(60);
192  $this->form->addItem($ta);
193 
194  // BEGIN CRONJOB NOTIFICATION
195  if($ilSetting->get('mail_notification'))
196  {
197  $cb = new ilCheckboxInputGUI($lng->txt('cron_mail_notification'), 'cronjob_notification');
198  $cb->setInfo($lng->txt('mail_cronjob_notification_info'));
199  $cb->setValue(1);
200  $this->form->addItem($cb);
201  }
202 
203  $this->form->addCommandButton('saveOptions', $lng->txt('save'));
204  }
const IL_MAIL_BOTH
const IL_MAIL_EMAIL
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a checkbox property in a property form.
const IL_MAIL_LOCAL
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
if(!is_array($argv)) $options
_lookupEmail($a_user_id)
Lookup email.
setOptions($a_options)
Set Options.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveOptions()

ilMailOptionsGUI::saveOptions ( )

Called if the user pushes the submit button of the mail options form.

Passes the post data to the mail options model instance to store them.

public

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

References $_POST, $ilSetting, $ilUser, $lng, initMailOptionsForm(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

64  {
65  global $lng, $ilUser, $ilSetting;
66 
67  $this->tpl->setTitle($lng->txt('mail'));
68  $this->initMailOptionsForm();
69 
70  $mailOptions = new ilMailOptions($ilUser->getId());
71  if($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1' &&
72  $ilSetting->get('usr_settings_disable_mail_incoming_mail') != '1')
73  {
74  $incoming_type = (int)$_POST['incoming_type'];
75  }
76  else
77  {
78  $incoming_type = $mailOptions->getIncomingType();
79  }
80 
81  if($this->form->checkInput())
82  {
83  $mailOptions->updateOptions(
84  ilUtil::stripSlashes($_POST['signature']),
85  (int)$_POST['linebreak'],
86  $incoming_type,
87  (int)$_POST['cronjob_notification']
88  );
89 
90  ilUtil::sendSuccess($lng->txt('mail_options_saved'));
91  }
92 
93  $this->form->setValuesByPost();
94 
95  $this->tpl->setContent($this->form->getHTML());
96  $this->tpl->show();
97  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class UserMail this class handles user mails.
$_POST['username']
Definition: cron.php:12
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
initMailOptionsForm()
Initialises the mail options form.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ setMailOptionsValuesByDB()

ilMailOptionsGUI::setMailOptionsValuesByDB ( )
private

Fetches data from model and loads this data into form.

private

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

References $data, $ilSetting, $ilUser, and ilMailOptions\getIncomingType().

Referenced by showOptions().

125  {
126  global $ilUser, $ilSetting;
127 
128  $mailOptions = new ilMailOptions($ilUser->getId());
129 
130  $data= array(
131  'linebreak' => $mailOptions->getLinebreak(),
132  'signature' => $mailOptions->getSignature(),
133  'cronjob_notification' => $mailOptions->getCronjobNotification()
134  );
135 
136  if($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')
137  {
138  $data['incoming_type'] = $mailOptions->getIncomingType();
139  }
140 
141  $this->form->setValuesByArray($data);
142  }
Class UserMail this class handles user mails.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showOptions()

ilMailOptionsGUI::showOptions ( )

Called to display the mail options form.

public

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

References $lng, initMailOptionsForm(), and setMailOptionsValuesByDB().

106  {
107  global $lng;
108 
109  $this->tpl->setTitle($lng->txt('mail'));
110 
111  $this->initMailOptionsForm();
112  $this->setMailOptionsValuesByDB();
113 
114  $this->tpl->setContent($this->form->getHTML());
115  $this->tpl->show();
116  }
setMailOptionsValuesByDB()
Fetches data from model and loads this data into form.
initMailOptionsForm()
Initialises the mail options form.
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilMailOptionsGUI::$ctrl = null
private

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

◆ $errorDelete

ilMailOptionsGUI::$errorDelete = false
private

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

◆ $lng

ilMailOptionsGUI::$lng = null
private

◆ $mbox

ilMailOptionsGUI::$mbox = null
private

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

◆ $tpl

ilMailOptionsGUI::$tpl = null
private

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

Referenced by __construct().

◆ $umail

ilMailOptionsGUI::$umail = null
private

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


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