if we can't open stream. we make up server's error message
[squirrelmail.git] / plugins / calendar / functions.php
CommitLineData
d61a01d4 1<?php
7c67a5e8 2
3/**
4 * functions.php
5 *
7c67a5e8 6 * Originally contrubuted by Michal Szczotka <michal@tuxy.org>
d61a01d4 7 *
7c67a5e8 8 * miscelenous functions.
d61a01d4 9 *
4b4abf93 10 * @copyright &copy; 2002-2005 The SquirrelMail Project Team
11 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
12 * @version $Id$
ea5f4b8e 13 * @package plugins
14 * @subpackage calendar
d61a01d4 15 */
16
ea5f4b8e 17/**
18 * @return void
19 */
d61a01d4 20function calendar_header() {
21 //Add Second layer ofCalendar links to upper menu
22 global $color,$year,$day,$month;
23
b01b21d0 24 echo html_tag( 'table', '', '', $color[0], 'border="0" width="100%" cellspacing="0" cellpadding="2"' ) .
25 html_tag( 'tr' ) .
26 html_tag( 'td', '', 'left', '', 'width="100%"' );
d61a01d4 27
c435f076 28 displayInternalLink("plugins/calendar/calendar.php?year=$year&amp;month=$month",_("Month View"),"right");
1ba8cd6b 29 echo "&nbsp;&nbsp;\n";
c435f076 30 displayInternalLink("plugins/calendar/day.php?year=$year&amp;month=$month&amp;day=$day",_("Day View"),"right");
1ba8cd6b 31 echo "&nbsp;&nbsp;\n";
c435f076 32 // displayInternalLink("plugins/calendar/event_create.php?year=$year&amp;month=$month&amp;day=$day",_("Add Event"),"right");
1ba8cd6b 33 // echo "&nbsp;&nbsp;\n";
b01b21d0 34 echo '</td></tr>';
d61a01d4 35
36}
37
38function select_option_length($selected) {
39
40 $eventlength = array(
1ba8cd6b 41 '0' => _("0 min."),
42 '15' => _("15 min."),
6fe63d4e 43 '30' => _("30 min."),
1ba8cd6b 44 '45' => _("45 min."),
45 '60' => _("1 hr."),
46 '90' => _("1.5 hr."),
47 '120' => _("2 hr."),
48 '150' => _("2.5 hr."),
49 '180' => _("3 hr."),
50 '210' => _("3.5 hr."),
51 '240' => _("4 hr."),
52 '300' => _("5 hr."),
53 '360' => _("6 hr.")
d61a01d4 54 );
55
56 while( $bar = each($eventlength)) {
c02aafdc 57 if($selected==$bar['key']){
6fd95361 58 echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
d61a01d4 59 } else {
6fd95361 60 echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
d61a01d4 61 }
62 }
63}
64
65function select_option_minute($selected) {
66 $eventminute = array(
1ba8cd6b 67 '00'=>'00',
68 '05'=>'05',
69 '10'=>'10',
70 '15'=>'15',
71 '20'=>'20',
72 '25'=>'25',
73 '30'=>'30',
74 '35'=>'35',
75 '40'=>'40',
76 '45'=>'45',
77 '50'=>'50',
78 '55'=>'55'
d61a01d4 79 );
80
81 while ( $bar = each($eventminute)) {
c02aafdc 82 if ($selected==$bar['key']){
6fd95361 83 echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
d61a01d4 84 } else {
6fd95361 85 echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
d61a01d4 86 }
87 }
88}
89
90function select_option_hour($selected) {
91
92 for ($i=0;$i<24;$i++){
93 ($i<10)? $ih = "0" . $i : $ih = $i;
94 if ($ih==$selected){
6fd95361 95 echo ' <option value="'.$ih.'" selected="selected">'.$i."</option>\n";
d61a01d4 96 } else {
6fd95361 97 echo ' <option value="'.$ih.'">'.$i."</option>\n";
d61a01d4 98 }
99 }
100}
101
102function select_option_priority($selected) {
103 $eventpriority = array(
1ba8cd6b 104 '0' => _("Normal"),
105 '1' => _("High"),
d61a01d4 106 );
107
108 while( $bar = each($eventpriority)) {
c02aafdc 109 if($selected==$bar['key']){
6fd95361 110 echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
d61a01d4 111 } else {
6fd95361 112 echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
d61a01d4 113 }
114 }
115}
116
117function select_option_year($selected) {
118
98a792df 119 for ($i=1902;$i<2038;$i++){
d61a01d4 120 if ($i==$selected){
6fd95361 121 echo ' <option value="'.$i.'" selected="selected">'.$i."</option>\n";
d61a01d4 122 } else {
6fd95361 123 echo ' <option value="'.$i.'">'.$i."</option>\n";
d61a01d4 124 }
125 }
126}
127
128function select_option_month($selected) {
129
130 for ($i=1;$i<13;$i++){
131 $im=date('m',mktime(0,0,0,$i,1,1));
e1baa507 132 $is = getMonthAbrv( date('m',mktime(0,0,0,$i,1,1)) );
d61a01d4 133 if ($im==$selected){
6fd95361 134 echo ' <option value="'.$im.'" selected="selected">'.$is."</option>\n";
d61a01d4 135 } else {
6fd95361 136 echo ' <option value="'.$im.'">'.$is."</option>\n";
d61a01d4 137 }
138 }
139}
140
141function select_option_day($selected) {
142
143 for ($i=1;$i<32;$i++){
144 ($i<10)? $ih="0".$i : $ih=$i;
145 if ($i==$selected){
6fd95361 146 echo ' <option value="'.$ih.'" selected="selected">'.$i."</option>\n";
d61a01d4 147 } else {
6fd95361 148 echo ' <option value="'.$ih.'">'.$i."</option>\n";
d61a01d4 149 }
150 }
151}
152
6fd95361 153?>