4 * Other calendar plugin functions.
6 * @copyright © 2002-2006 The SquirrelMail Project Team
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 * @subpackage calendar
14 * Adds second layer of calendar links to upper menu
17 function calendar_header() {
18 global $color,$year,$day,$month;
20 echo html_tag( 'table', '', '', $color[0], 'border="0" width="100%" cellspacing="0" cellpadding="2"' ) .
22 html_tag( 'td', '', 'left', '', 'width="100%"' );
24 displayInternalLink("plugins/calendar/calendar.php?year=$year&month=$month",_("Month View"),"right");
25 echo " \n";
26 displayInternalLink("plugins/calendar/day.php?year=$year&month=$month&day=$day",_("Day View"),"right");
27 echo " \n";
28 // displayInternalLink("plugins/calendar/event_create.php?year=$year&month=$month&day=$day",_("Add Event"),"right");
29 // echo " \n";
35 * Generates html option tags with length values
37 * Hardcoded values from 0 minutes to 6 hours
38 * @param integer $selected selected option length
41 function select_option_length($selected) {
50 '150' => _("2.5 hr."),
52 '210' => _("3.5 hr."),
58 while( $bar = each($eventlength)) {
59 if($bar['key']==$selected){
60 echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
62 echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
68 * Generates html option tags with minute values
70 * Hardcoded values in 5 minute intervals
71 * @param integer $selected selected value
74 function select_option_minute($selected) {
90 while ( $bar = each($eventminute)) {
91 if ($bar['key']==$selected){
92 echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
94 echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
100 * Generates html option tags with hour values
101 * @param integer $selected selected value
103 * @todo 12/24 hour format
105 function select_option_hour($selected) {
107 for ($i=0;$i<24;$i++
){
108 ($i<10)?
$ih = "0" . $i : $ih = $i;
110 echo ' <option value="'.$ih.'" selected="selected">'.$i."</option>\n";
112 echo ' <option value="'.$ih.'">'.$i."</option>\n";
118 * Generates html option tags with priority values
119 * @param integer $selected selected value
122 function select_option_priority($selected) {
123 $eventpriority = array(
128 while( $bar = each($eventpriority)) {
129 if($bar['key']==$selected){
130 echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
132 echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
138 * Generates html option tags with year values
140 * Hardcoded values from 1902 to 2037
141 * @param integer $selected selected value
144 function select_option_year($selected) {
146 for ($i=1902;$i<2038;$i++
){
148 echo ' <option value="'.$i.'" selected="selected">'.$i."</option>\n";
150 echo ' <option value="'.$i.'">'.$i."</option>\n";
156 * Generates html option tags with month values
157 * @param integer $selected selected value
160 function select_option_month($selected) {
162 for ($i=1;$i<13;$i++
){
163 $im=date('m',mktime(0,0,0,$i,1,1));
164 $is = getMonthAbrv( date('m',mktime(0,0,0,$i,1,1)) );
166 echo ' <option value="'.$im.'" selected="selected">'.$is."</option>\n";
168 echo ' <option value="'.$im.'">'.$is."</option>\n";
174 * Generates html option tags with day of month values
176 * Hardcoded values from 1 to 31
177 * @param integer $selected selected value
180 function select_option_day($selected) {
182 for ($i=1;$i<32;$i++
){
183 ($i<10)?
$ih="0".$i : $ih=$i;
185 echo ' <option value="'.$ih.'" selected="selected">'.$i."</option>\n";
187 echo ' <option value="'.$ih.'">'.$i."</option>\n";