Split out functionality that gathers system specs
[squirrelmail.git] / plugins / calendar / functions.php
CommitLineData
d61a01d4 1<?php
7c67a5e8 2
3/**
4 * functions.php
5 *
82d304a0 6 * Copyright (c) 2002-2004 The SquirrelMail Project Team
7c67a5e8 7 * Licensed under the GNU GPL. For full terms see the file COPYING.
d61a01d4 8 *
7c67a5e8 9 * Originally contrubuted by Michal Szczotka <michal@tuxy.org>
d61a01d4 10 *
7c67a5e8 11 * miscelenous functions.
d61a01d4 12 *
2c85de8f 13 * $Id$
ea5f4b8e 14 * @package plugins
15 * @subpackage calendar
d61a01d4 16 */
17
ea5f4b8e 18/**
19 * @return void
20 */
d61a01d4 21function calendar_header() {
22 //Add Second layer ofCalendar links to upper menu
23 global $color,$year,$day,$month;
24
b01b21d0 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%"' );
d61a01d4 28
29 displayInternalLink("plugins/calendar/calendar.php?year=$year&month=$month",_("Month View"),"right");
1ba8cd6b 30 echo "&nbsp;&nbsp;\n";
d61a01d4 31 displayInternalLink("plugins/calendar/day.php?year=$year&month=$month&day=$day",_("Day View"),"right");
1ba8cd6b 32 echo "&nbsp;&nbsp;\n";
d61a01d4 33 // displayInternalLink("plugins/calendar/event_create.php?year=$year&month=$month&day=$day",_("Add Event"),"right");
1ba8cd6b 34 // echo "&nbsp;&nbsp;\n";
b01b21d0 35 echo '</td></tr>';
d61a01d4 36
37}
38
39function select_option_length($selected) {
40
41 $eventlength = array(
1ba8cd6b 42 '0' => _("0 min."),
43 '15' => _("15 min."),
6fe63d4e 44 '30' => _("30 min."),
1ba8cd6b 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.")
d61a01d4 55 );
56
57 while( $bar = each($eventlength)) {
c02aafdc 58 if($selected==$bar['key']){
59 echo " <OPTION VALUE=\"".$bar['key']."\" SELECTED>".$bar['value']."</OPTION>\n";
d61a01d4 60 } else {
c02aafdc 61 echo " <OPTION VALUE=\"".$bar['key']."\">".$bar['value']."</OPTION>\n";
d61a01d4 62 }
63 }
64}
65
66function select_option_minute($selected) {
67 $eventminute = array(
1ba8cd6b 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'
d61a01d4 80 );
81
82 while ( $bar = each($eventminute)) {
c02aafdc 83 if ($selected==$bar['key']){
84 echo " <OPTION VALUE=\"".$bar['key']."\" SELECTED>".$bar['value']."</OPTION>\n";
d61a01d4 85 } else {
c02aafdc 86 echo " <OPTION VALUE=\"".$bar['key']."\">".$bar['value']."</OPTION>\n";
d61a01d4 87 }
88 }
89}
90
91function 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
103function select_option_priority($selected) {
104 $eventpriority = array(
1ba8cd6b 105 '0' => _("Normal"),
106 '1' => _("High"),
d61a01d4 107 );
108
109 while( $bar = each($eventpriority)) {
c02aafdc 110 if($selected==$bar['key']){
111 echo " <OPTION VALUE=\"".$bar['key']."\" SELECTED>".$bar['value']."</OPTION>\n";
d61a01d4 112 } else {
c02aafdc 113 echo " <OPTION VALUE=\"".$bar['key']."\">".$bar['value']."</OPTION>\n";
d61a01d4 114 }
115 }
116}
117
118function select_option_year($selected) {
119
98a792df 120 for ($i=1902;$i<2038;$i++){
d61a01d4 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
129function select_option_month($selected) {
130
131 for ($i=1;$i<13;$i++){
132 $im=date('m',mktime(0,0,0,$i,1,1));
e1baa507 133 $is = getMonthAbrv( date('m',mktime(0,0,0,$i,1,1)) );
d61a01d4 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
142function 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
7c67a5e8 154?>