ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMailOptions Class Reference

Class UserMail this class handles user mails. More...

+ Collaboration diagram for ilMailOptions:

Public Member Functions

 __construct ($a_user_id)
 Constructor setup an mail object.
 createMailOptionsEntry ()
 create entry in table_mail_options for a new user this method should only be called from createUser() public
 getOptions ()
 get options of user and set variables $signature and $linebreak this method shouldn't bew called from outside use getSignature() and getLinebreak() private
 updateOptions ($a_signature, $a_linebreak, $a_incoming_type, $a_cronjob_notification)
 update user options
 getLinebreak ()
 get linebreak of user public
 getSignature ()
 get signature of user public
 getIncomingType ()
 setCronjobNotification ()
 getCronjobNotification ()

Data Fields

 $ilias
 $LOCAL = 0
 $EMAIL = 1
 $BOTH = 2
 $linebreak
 $signature
 $incoming_type
 $cronjob_notification

Detailed Description

Class UserMail this class handles user mails.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilMailOptions.php 61656 2016-03-07 09:10:14Z gitmgr

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

Constructor & Destructor Documentation

ilMailOptions::__construct (   $a_user_id)

Constructor setup an mail object.

Parameters
intuser_id public

Definition at line 48 of file class.ilMailOptions.php.

References $ilias, and getOptions().

{
global $ilias;
define("DEFAULT_LINEBREAK",60);
$this->ilias = $ilias;
$this->table_mail_options = 'mail_options';
$this->user_id = $a_user_id;
$this->getOptions();
}

+ Here is the call graph for this function:

Member Function Documentation

ilMailOptions::createMailOptionsEntry ( )

create entry in table_mail_options for a new user this method should only be called from createUser() public

Returns
boolean

Definition at line 67 of file class.ilMailOptions.php.

References $ilDB, $ilSetting, and IL_MAIL_BOTH.

{
global $ilDB, $ilSetting;
/* Get default setting for incoming mails */
$incomingMail = $ilSetting->get("mail_incoming_mail", IL_MAIL_BOTH);
$statement = $ilDB->manipulateF('
INSERT INTO '.$this->table_mail_options.'
( user_id,
linebreak,
signature,
incoming_type,
cronjob_notification
)
VALUES(%s, %s, %s, %s, %s)',
array('integer', 'integer', 'text', 'integer', 'integer'),
array($this->user_id, DEFAULT_LINEBREAK, NULL, $incomingMail, '0'));
return true;
}
ilMailOptions::getCronjobNotification ( )

Definition at line 191 of file class.ilMailOptions.php.

References $cronjob_notification.

ilMailOptions::getIncomingType ( )

Definition at line 182 of file class.ilMailOptions.php.

References $incoming_type.

Referenced by ilMailOptionsGUI\setMailOptionsValuesByDB(), and ilPersonalSettingsGUI\setMailOptionsValuesByDB().

{
}

+ Here is the caller graph for this function:

ilMailOptions::getLinebreak ( )

get linebreak of user public

Returns
array mails

Definition at line 167 of file class.ilMailOptions.php.

References $linebreak.

{
}
ilMailOptions::getOptions ( )

get options of user and set variables $signature and $linebreak this method shouldn't bew called from outside use getSignature() and getLinebreak() private

Returns
boolean

Definition at line 96 of file class.ilMailOptions.php.

References $ilDB, $LOCAL, $res, $row, ilObjUser\_lookupEmail(), and DB_FETCHMODE_OBJECT.

Referenced by __construct().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM '.$this->table_mail_options.'
WHERE user_id = %s',
array('integer'), array($this->user_id));
$this->cronjob_notification = stripslashes($row->cronjob_notification);
$this->signature = stripslashes($row->signature);
$this->linebreak = stripslashes($row->linebreak);
$this->incoming_type = $row->incoming_type;
if(!strlen(ilObjUser::_lookupEmail($this->user_id)))
{
$this->incoming_type = $this->LOCAL;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMailOptions::getSignature ( )

get signature of user public

Returns
array mails

Definition at line 177 of file class.ilMailOptions.php.

References $signature.

{
}
ilMailOptions::setCronjobNotification ( )

Definition at line 187 of file class.ilMailOptions.php.

References $cronjob_notification.

ilMailOptions::updateOptions (   $a_signature,
  $a_linebreak,
  $a_incoming_type,
  $a_cronjob_notification 
)

update user options

Parameters
stringSignature
intlinebreak
intincoming_type
intcronjob_notification
Returns
boolean

Definition at line 128 of file class.ilMailOptions.php.

References $ilDB, $ilias, and $query.

{
global $ilDB, $ilias;
$data = array();
$data_types = array();
$query = 'UPDATE '.$this->table_mail_options.'
SET signature = %s,
linebreak = %s, ';
array_push($data_types, 'text', 'integer');
array_push($data, $a_signature, $a_linebreak);
if ($ilias->getSetting('mail_notification'))
{
$query .= 'cronjob_notification = %s, ';
array_push($data_types, 'integer');
array_push($data, $a_cronjob_notification);
}
$query .='incoming_type = %s WHERE user_id = %s';
array_push($data, $a_incoming_type, $this->user_id);
array_push($data_types, 'integer', 'integer');
$statement = $ilDB->manipulateF($query, $data_types, $data);
$this->cronjob_notification = $a_cronjob_notification;
$this->signature = $a_signature;
$this->linebreak = $a_linebreak;
$this->incoming_type = $a_incoming_type;
return true;
}

Field Documentation

ilMailOptions::$BOTH = 2

Definition at line 24 of file class.ilMailOptions.php.

ilMailOptions::$cronjob_notification

Definition at line 40 of file class.ilMailOptions.php.

Referenced by getCronjobNotification(), and setCronjobNotification().

ilMailOptions::$EMAIL = 1

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

ilMailOptions::$ilias

Definition at line 19 of file class.ilMailOptions.php.

Referenced by __construct(), and updateOptions().

ilMailOptions::$incoming_type

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

Referenced by getIncomingType().

ilMailOptions::$linebreak

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

Referenced by getLinebreak().

ilMailOptions::$LOCAL = 0

Definition at line 22 of file class.ilMailOptions.php.

Referenced by getOptions().

ilMailOptions::$signature

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

Referenced by getSignature().


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