[ Index ] |
|
Code source de Claroline 188 |
1 <?php // $Id: class.iCalAlarm.inc.php,v 1.4 2006/10/16 07:55:02 moosh Exp $ 2 if ( count( get_included_files() ) == 1 ) die( '---' ); 3 //+----------------------------------------------------------------------+ 4 //| WAMP (XP-SP1/1.3.24/4.0.12/4.3.0) | 5 //+----------------------------------------------------------------------+ 6 //| Copyright (c) 1992-2003 Michael Wimmer | 7 //+----------------------------------------------------------------------+ 8 //| I don't have the time to read through all the licences to find out | 9 //| what the exactly say. But it's simple. It's free for non commercial | 10 //| projects, but as soon as you make money with it, i want my share :-) | 11 //| (License : Free for non-commercial use) | 12 //+----------------------------------------------------------------------+ 13 //| Authors: Michael Wimmer <flaimo@gmx.net> | 14 //+----------------------------------------------------------------------+ 15 // 16 // $Id: class.iCalAlarm.inc.php,v 1.4 2006/10/16 07:55:02 moosh Exp $ 17 18 /** 19 * @package iCalendar Everything to generate simple iCal files 20 */ 21 /** 22 * We need the base class 23 */ 24 include_once 'class.iCalBase.inc.php'; 25 /** 26 * Container for an alarm (used in event and todo) 27 * 28 * Tested with WAMP (XP-SP1/1.3.24/4.0.4/4.3.0) 29 * Last Change: 2003-03-29 30 * 31 * @desc Container for an alarm (used in event and todo) 32 * @access private 33 * @author Michael Wimmer <flaimo 'at' gmx 'dot' net> 34 * @copyright Michael Wimmer 35 * @link http://www.flaimo.com/ 36 * @package iCalendar 37 * @version 1.032 38 */ 39 class iCalAlarm extends iCalBase { 40 41 /*-------------------*/ 42 /* V A R I A B L E S */ 43 /*-------------------*/ 44 45 /**#@+ 46 * @access private 47 * @var int 48 */ 49 /** 50 * Kind of alarm (0 = DISPLAY, 1 = EMAIL, (not supported: 2 = AUDIO, 3 = PROCEDURE)) 51 * 52 * @desc Kind of alarm (0 = DISPLAY, 1 = EMAIL, (not supported: 2 = AUDIO, 3 = PROCEDURE)) 53 */ 54 var $action; 55 56 /** 57 * Minutes the alarm goes off before the event/todo 58 * 59 * @desc Minutes the alarm goes off before the event/todo 60 */ 61 var $trigger = 0; 62 63 /** 64 * Headline for the alarm (if action = Display) 65 * 66 * @desc Headline for the alarm (if action = Display) 67 * @var string 68 */ 69 var $summary; 70 71 /** 72 * Duration between the alarms in minutes 73 * 74 * @desc Duration between the alarms in minutes 75 */ 76 var $duration; 77 78 /** 79 * How often should the alarm be repeated 80 * 81 * @desc How often should the alarm be repeated 82 */ 83 var $repeat; 84 /**#@-*/ 85 86 /*-----------------------*/ 87 /* C O N S T R U C T O R */ 88 /*-----------------------*/ 89 90 /**#@+ 91 * @access private 92 * @return void 93 */ 94 /** 95 * Constructor 96 * 97 * Only job is to set all the variablesnames 98 * 99 * @desc Constructor 100 * @param int $action 0 = DISPLAY, 1 = EMAIL, (not supported: 2 = AUDIO, 3 = PROCEDURE) 101 * @param int $trigger Minutes the alarm goes off before the event/todo 102 * @param string $summary Title for the alarm 103 * @param string $description Description 104 * @param (array) $attendees key = attendee name, value = e-mail, second value = role of the attendee 105 * [0 = CHAIR | 1 = REQ | 2 = OPT | 3 =NON] (example: array('Michi' => 'flaimo@gmx.net,1'); ) 106 * @param int $duration Duration between the alarms in minutes 107 * @param int $repeat How often should the alarm be repeated 108 * @param string $lang Language of the strings used in the event (iso code) 109 * @uses setAction() 110 * @uses setTrigger() 111 * @uses setSummary() 112 * @uses iCalBase::setDescription() 113 * @uses setAttendees() 114 * @uses setDuration() 115 * @uses setRepeat() 116 * @uses iCalBase::setLanguage() 117 */ 118 function iCalAlarm($action, $trigger, $summary, $description, $attendees, 119 $duration, $repeat, $lang) { 120 parent::iCalBase(); 121 $this->setAction($action); 122 $this->setTrigger($trigger); 123 parent::setSummary($summary); 124 parent::setDescription($description); 125 parent::setAttendees($attendees); 126 $this->setDuration($duration); 127 $this->setRepeat($repeat); 128 parent::setLanguage($lang); 129 } // end constructor 130 131 /*-------------------*/ 132 /* F U N C T I O N S */ 133 /*-------------------*/ 134 135 /** 136 * Set $action variable 137 * 138 * @desc Set $action variable 139 * @param int $action 0 = DISPLAY, 1 = EMAIL, (not supported: 2 = AUDIO, 3 = PROCEDURE) 140 * @see getAction() 141 * @see $action 142 * @since 1.021 - 2002-12-24 143 */ 144 function setAction($action = 0) { 145 $this->action = (int) $action; 146 } // end function 147 148 /** 149 * Set $trigger variable 150 * 151 * @desc Set $trigger variable 152 * @param int $minutes 153 * @see getTrigger() 154 * @see $minutes 155 * @since 1.021 - 2002-12-24 156 */ 157 function setTrigger($minutes = 0) { 158 $this->trigger = (int) $minutes; 159 } // end function 160 161 /** 162 * Set $duration variable 163 * 164 * @desc Set $duration variable 165 * @param int $int 166 * @see getDuration() 167 * @see $duration 168 * @since 1.020 - 2002-12-24 169 */ 170 function setDuration($int = 0) { 171 $this->duration = (int) $int; 172 } // end function 173 174 /** 175 * Set $repeat variable 176 * 177 * @desc Set $repeat variable 178 * @param int $int in minutes 179 * @see getRepeat() 180 * @see $repeat 181 * @since 1.020 - 2002-12-24 182 */ 183 function setRepeat($int = 0) { 184 $this->duration = (int) $int; 185 } // end function 186 /**#@-*/ 187 188 /**#@+ 189 * @access public 190 * @since 1.021 - 2002-12-24 191 */ 192 /** 193 * Get $action variable 194 * 195 * @desc Get $action variable 196 * @return string $action 197 * @see setAction() 198 * @see $action 199 */ 200 function &getAction() { 201 $action_status = (array) array('DISPLAY', 'EMAIL', 'AUDIO', 'PROCEDURE'); 202 $ret = (string) ((array_key_exists($this->action, $action_status)) ? $action_status[$this->action] : $action_status[0]); 203 return $ret; 204 } // end function 205 206 /** 207 * Get $trigger variable 208 * 209 * @desc Get $trigger variable 210 * @return int $trigger 211 * @see setTrigger() 212 * @see $trigger 213 */ 214 function &getTrigger() { 215 $ret = (int) $this->trigger; 216 return $ret; 217 } // end function 218 /**#@-*/ 219 220 /** 221 * Get $duration variable 222 * 223 * @desc Get $duration variable 224 * @return int $duration 225 * @see setDuration() 226 * @see $duration 227 * @access private 228 */ 229 function &getDuration() { 230 $ret = (int) $this->duration; 231 return $ret; 232 } // end function 233 234 /** 235 * Get $repeat variable 236 * 237 * @desc Get $repeat variable 238 * @return int $repeat 239 * @see setRepeat() 240 * @see $repeat 241 * @access private 242 */ 243 function &getRepeat() { 244 $ret = (int) $this->duration; 245 return $ret; 246 } // end function 247 } // end class iCalAlarm 248 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 14:38:42 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |