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