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