• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

classes/class.ilMailOptions.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 
00035 class ilMailOptions
00036 {
00037         var $ilias;
00038 
00039         // SOME QUASI STATIC CONSTANTS (possible values of incoming type)
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 } // END class.ilFormatMail
00161 ?>

Generated on Fri Dec 13 2013 13:52:07 for ILIAS Release_3_7_x_branch .rev 46817 by  doxygen 1.7.1