Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00035 class ilMailOptions
00036 {
00037 var $ilias;
00038
00039
00040 var $LOCAL = 0;
00041 var $EMAIL = 1;
00042 var $BOTH = 2;
00043
00049 var $linebreak;
00050
00056 var $signature;
00057 var $incoming_type;
00058
00065 function ilMailOptions($a_user_id)
00066 {
00067 global $ilias;
00068
00069 define("DEFAULT_LINEBREAK",60);
00070
00071 $this->ilias =& $ilias;
00072 $this->table_mail_options = 'mail_options';
00073
00074 $this->user_id = $a_user_id;
00075 $this->getOptions();
00076 }
00077
00084 function createMailOptionsEntry()
00085 {
00086 $query = "INSERT INTO $this->table_mail_options " .
00087 "VALUES('" . $this->user_id . "','" . DEFAULT_LINEBREAK . "','',2)";
00088
00089 $res = $this->ilias->db->query($query);
00090 return true;
00091 }
00092
00100 function getOptions()
00101 {
00102 $query = "SELECT * FROM $this->table_mail_options ".
00103 "WHERE user_id = '".$this->user_id."'";
00104
00105 $row = $this->ilias->db->getRow($query,DB_FETCHMODE_OBJECT);
00106
00107 $this->signature = stripslashes($row->signature);
00108 $this->linebreak = stripslashes($row->linebreak);
00109 $this->incoming_type = $row->incoming_type;
00110
00111 return true;
00112 }
00113
00120 function updateOptions($a_signature, $a_linebreak,$a_incoming_type)
00121 {
00122 $query = "UPDATE $this->table_mail_options ".
00123 "SET signature = '".addslashes($a_signature)."',".
00124 "linebreak = '".addslashes($a_linebreak)."', ".
00125 "incoming_type = '".$a_incoming_type."' ".
00126 "WHERE user_id = '".$this->user_id."'";
00127
00128 $res = $this->ilias->db->query($query);
00129
00130 $this->signature = $a_signature;
00131 $this->linebreak = $a_linebreak;
00132
00133 return true;
00134 }
00140 function getLinebreak()
00141 {
00142 return $this->linebreak;
00143 }
00144
00150 function getSignature()
00151 {
00152 return $this->signature;
00153 }
00154
00155 function getIncomingType()
00156 {
00157 return $this->incoming_type;
00158 }
00159
00160 }
00161 ?>