4 * Other calendar plugin functions.
6 * @copyright © 2002-2007 The SquirrelMail Project Team
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 * @subpackage calendar
14 * Add link to menu at top of content pane
19 function calendar_do() {
22 $nbsp = $oTemplate->fetch('non_breaking_space.tpl');
23 $output = makeInternalLink('plugins/calendar/calendar.php',_("Calendar"),'right')
25 return array('menuline' => $output);
30 * Adds second layer of calendar links to upper menu
33 function calendar_header() {
34 global $color,$year,$day,$month;
36 echo html_tag( 'table', '', '', $color[0], 'border="0" width="100%" cellspacing="0" cellpadding="2"' ) .
38 html_tag( 'td', '', 'left', '', 'width="100%"' );
40 displayInternalLink("plugins/calendar/calendar.php?year=$year&month=$month",_("Month View"),"right");
41 echo " \n";
42 displayInternalLink("plugins/calendar/day.php?year=$year&month=$month&day=$day",_("Day View"),"right");
43 echo " \n";
44 // displayInternalLink("plugins/calendar/event_create.php?year=$year&month=$month&day=$day",_("Add Event"),"right");
45 // echo " \n";
51 * Generates html option tags with length values
53 * Hardcoded values from 0 minutes to 6 hours
54 * @param integer $selected selected option length
57 function select_option_length($selected) {
66 '150' => _("2.5 hr."),
68 '210' => _("3.5 hr."),
74 while( $bar = each($eventlength)) {
75 if($bar['key']==$selected){
76 echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
78 echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
84 * Generates html option tags with minute values
86 * Hardcoded values in 5 minute intervals
87 * @param integer $selected selected value
90 function select_option_minute($selected) {
106 while ( $bar = each($eventminute)) {
107 if ($bar['key']==$selected){
108 echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
110 echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
116 * Generates html option tags with hour values
117 * @param integer $selected selected value
119 * @todo 12/24 hour format
121 function select_option_hour($selected) {
123 for ($i=0;$i<24;$i++
){
124 ($i<10)?
$ih = "0" . $i : $ih = $i;
126 echo ' <option value="'.$ih.'" selected="selected">'.$i."</option>\n";
128 echo ' <option value="'.$ih.'">'.$i."</option>\n";
134 * Generates html option tags with priority values
135 * @param integer $selected selected value
138 function select_option_priority($selected) {
139 $eventpriority = array(
144 while( $bar = each($eventpriority)) {
145 if($bar['key']==$selected){
146 echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
148 echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
154 * Generates html option tags with year values
156 * Hardcoded values from 1902 to 2037
157 * @param integer $selected selected value
160 function select_option_year($selected) {
162 for ($i=1902;$i<2038;$i++
){
164 echo ' <option value="'.$i.'" selected="selected">'.$i."</option>\n";
166 echo ' <option value="'.$i.'">'.$i."</option>\n";
172 * Generates html option tags with month values
173 * @param integer $selected selected value
176 function select_option_month($selected) {
178 for ($i=1;$i<13;$i++
){
179 $im=date('m',mktime(0,0,0,$i,1,1));
180 $is = getMonthAbrv( date('m',mktime(0,0,0,$i,1,1)) );
182 echo ' <option value="'.$im.'" selected="selected">'.$is."</option>\n";
184 echo ' <option value="'.$im.'">'.$is."</option>\n";
190 * Generates html option tags with day of month values
192 * Hardcoded values from 1 to 31
193 * @param integer $selected selected value
196 function select_option_day($selected) {
198 for ($i=1;$i<32;$i++
){
199 ($i<10)?
$ih="0".$i : $ih=$i;
201 echo ' <option value="'.$ih.'" selected="selected">'.$i."</option>\n";
203 echo ' <option value="'.$ih.'">'.$i."</option>\n";