4 * Other calendar plugin functions.
6 * @copyright © 2002-2007 The SquirrelMail Project Team
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 * @subpackage calendar
14 * Add link to menu at top of content pane
19 function calendar_do() {
21 global $oTemplate, $nbsp;
22 $output = makeInternalLink('plugins/calendar/calendar.php',_("Calendar"),'right')
24 return array('menuline' => $output);
29 * Adds second layer of calendar links to upper menu
32 function calendar_header() {
33 global $color,$year,$day,$month;
35 echo html_tag( 'table', '', '', $color[0], 'border="0" width="100%" cellspacing="0" cellpadding="2"' ) .
37 html_tag( 'td', '', 'left', '', 'width="100%"' );
39 displayInternalLink("plugins/calendar/calendar.php?year=$year&month=$month",_("Month View"),"right");
40 echo " \n";
41 displayInternalLink("plugins/calendar/day.php?year=$year&month=$month&day=$day",_("Day View"),"right");
42 echo " \n";
43 // displayInternalLink("plugins/calendar/event_create.php?year=$year&month=$month&day=$day",_("Add Event"),"right");
44 // echo " \n";
50 * Generates html option tags with length values
52 * Hardcoded values from 0 minutes to 6 hours
53 * @param integer $selected selected option length
56 function select_option_length($selected) {
65 '150' => _("2.5 hr."),
67 '210' => _("3.5 hr."),
73 while( $bar = each($eventlength)) {
74 if($bar['key']==$selected){
75 echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
77 echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
83 * Generates html option tags with minute values
85 * Hardcoded values in 5 minute intervals
86 * @param integer $selected selected value
89 function select_option_minute($selected) {
105 while ( $bar = each($eventminute)) {
106 if ($bar['key']==$selected){
107 echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
109 echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
115 * Generates html option tags with hour values
116 * @param integer $selected selected value
118 * @todo 12/24 hour format
120 function select_option_hour($selected) {
122 for ($i=0;$i<24;$i++
){
123 ($i<10)?
$ih = "0" . $i : $ih = $i;
125 echo ' <option value="'.$ih.'" selected="selected">'.$i."</option>\n";
127 echo ' <option value="'.$ih.'">'.$i."</option>\n";
133 * Generates html option tags with priority values
134 * @param integer $selected selected value
137 function select_option_priority($selected) {
138 $eventpriority = array(
143 while( $bar = each($eventpriority)) {
144 if($bar['key']==$selected){
145 echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
147 echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
153 * Generates html option tags with year values
155 * Hardcoded values from 1902 to 2037
156 * @param integer $selected selected value
159 function select_option_year($selected) {
161 for ($i=1902;$i<2038;$i++
){
163 echo ' <option value="'.$i.'" selected="selected">'.$i."</option>\n";
165 echo ' <option value="'.$i.'">'.$i."</option>\n";
171 * Generates html option tags with month values
172 * @param integer $selected selected value
175 function select_option_month($selected) {
177 for ($i=1;$i<13;$i++
){
178 $im=date('m',mktime(0,0,0,$i,1,1));
179 $is = getMonthAbrv( date('m',mktime(0,0,0,$i,1,1)) );
181 echo ' <option value="'.$im.'" selected="selected">'.$is."</option>\n";
183 echo ' <option value="'.$im.'">'.$is."</option>\n";
189 * Generates html option tags with day of month values
191 * Hardcoded values from 1 to 31
192 * @param integer $selected selected value
195 function select_option_day($selected) {
197 for ($i=1;$i<32;$i++
){
198 ($i<10)?
$ih="0".$i : $ih=$i;
200 echo ' <option value="'.$ih.'" selected="selected">'.$i."</option>\n";
202 echo ' <option value="'.$ih.'">'.$i."</option>\n";