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