ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 showOptions ()
 Called to display the mail options form.

Private Member Functions

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

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

ilMailOptionsGUI::__construct ( )

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

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

{
global $tpl, $ilCtrl, $lng, $ilUser;
$this->tpl = $tpl;
$this->ctrl = $ilCtrl;
$this->lng = $lng;
$this->ctrl->saveParameter($this, "mobj_id");
$this->umail = new ilFormatMail($ilUser->getId());
$this->mbox = new ilMailBox($ilUser->getId());
}

Member Function Documentation

ilMailOptionsGUI::executeCommand ( )

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

References $cmd.

{
$forward_class = $this->ctrl->getNextClass($this);
switch($forward_class)
{
default:
if (!($cmd = $this->ctrl->getCmd()))
{
$cmd = "showOptions";
}
$this->$cmd();
break;
}
return true;
}
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().

{
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($ilCtrl->getFormAction($this, 'saveOptions'));
$this->form->setTitle($lng->txt('mail_settings'));
// BEGIN INCOMING
if($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')
{
$options = array(
IL_MAIL_LOCAL => $lng->txt('mail_incoming_local'),
IL_MAIL_EMAIL => $lng->txt('mail_incoming_smtp'),
IL_MAIL_BOTH => $lng->txt('mail_incoming_both')
);
$si = new ilSelectInputGUI($lng->txt('mail_incoming'), 'incoming_type');
if(!strlen(ilObjUser::_lookupEmail($ilUser->getId())) ||
$ilSetting->get('usr_settings_disable_mail_incoming_mail') == '1')
{
$si->setDisabled(true);
}
$this->form->addItem($si);
}
// BEGIN LINEBREAK_OPTIONS
$options = array();
for($i = 50; $i <= 80; $i++)
{
$options[$i] = $i;
}
$si = new ilSelectInputGUI($lng->txt('linebreak'), 'linebreak');
$this->form->addItem($si);
// BEGIN SIGNATURE
$ta = new ilTextAreaInputGUI($lng->txt('signature'), 'signature');
$ta->setRows(10);
$ta->setCols(60);
$this->form->addItem($ta);
// BEGIN CRONJOB NOTIFICATION
if($ilSetting->get('mail_notification'))
{
$cb = new ilCheckboxInputGUI($lng->txt('cron_mail_notification'), 'cronjob_notification');
$cb->setInfo($lng->txt('mail_cronjob_notification_info'));
$cb->setValue(1);
$this->form->addItem($cb);
}
$this->form->addCommandButton('saveOptions', $lng->txt('save'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

{
$this->tpl->setTitle($lng->txt('mail'));
$mailOptions = new ilMailOptions($ilUser->getId());
if($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1' &&
$ilSetting->get('usr_settings_disable_mail_incoming_mail') != '1')
{
$incoming_type = (int)$_POST['incoming_type'];
}
else
{
$incoming_type = $mailOptions->getIncomingType();
}
if($this->form->checkInput())
{
$mailOptions->updateOptions(
(int)$_POST['linebreak'],
$incoming_type,
(int)$_POST['cronjob_notification']
);
ilUtil::sendSuccess($lng->txt('mail_options_saved'));
}
$this->form->setValuesByPost();
$this->tpl->setContent($this->form->getHTML());
$this->tpl->show();
}

+ Here is the call graph for this function:

ilMailOptionsGUI::setMailOptionsValuesByDB ( )
private

Fetches data from model and loads this data into form.

private

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

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

Referenced by showOptions().

{
global $ilUser, $ilSetting;
$mailOptions = new ilMailOptions($ilUser->getId());
$data= array(
'linebreak' => $mailOptions->getLinebreak(),
'signature' => $mailOptions->getSignature(),
'cronjob_notification' => $mailOptions->getCronjobNotification()
);
if($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')
{
$data['incoming_type'] = $mailOptions->getIncomingType();
}
$this->form->setValuesByArray($data);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMailOptionsGUI::showOptions ( )

Called to display the mail options form.

public

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

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

{
global $lng;
$this->tpl->setTitle($lng->txt('mail'));
$this->tpl->setContent($this->form->getHTML());
$this->tpl->show();
}

+ Here is the call graph for this function:

Field Documentation

ilMailOptionsGUI::$ctrl = null
private

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

ilMailOptionsGUI::$errorDelete = false
private

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

ilMailOptionsGUI::$lng = null
private
ilMailOptionsGUI::$mbox = null
private

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

ilMailOptionsGUI::$tpl = null
private

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

Referenced by __construct().

ilMailOptionsGUI::$umail = null
private

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


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