X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fcalendar%2Ffunctions.php;h=29d507e20ef288899c27c3c1537ed9e125fd046d;hp=b4ee71aaa5d72e261e26f7cea047e1cf007aba31;hb=821d1f1424ce74d60ae3b6e357a148658f17424e;hpb=1ba8cd6be9ab9e969978e0149e79b82769c199d3 diff --git a/plugins/calendar/functions.php b/plugins/calendar/functions.php index b4ee71aa..29d507e2 100644 --- a/plugins/calendar/functions.php +++ b/plugins/calendar/functions.php @@ -1,43 +1,64 @@ - * - * miscelenous functions. - * - * $Id$ + * @copyright 2002-2012 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + * @package plugins + * @subpackage calendar */ +/** + * Add link to menu at top of content pane + * + * @return void + * + */ +function calendar_do() { + + global $oTemplate, $nbsp; + $output = makeInternalLink('plugins/calendar/calendar.php',_("Calendar"),'right') + . $nbsp . $nbsp; + return array('menuline' => $output); + +} +/** + * Adds second layer of calendar links to upper menu + * @return void + */ function calendar_header() { - //Add Second layer ofCalendar links to upper menu global $color,$year,$day,$month; +// FIXME: Don't echo HTML from core. This whole function should probably be moved into a template file echo html_tag( 'table', '', '', $color[0], 'border="0" width="100%" cellspacing="0" cellpadding="2"' ) . html_tag( 'tr' ) . html_tag( 'td', '', 'left', '', 'width="100%"' ); - displayInternalLink("plugins/calendar/calendar.php?year=$year&month=$month",_("Month View"),"right"); + echo makeInternalLink("plugins/calendar/calendar.php?year=$year&month=$month",_("Month View"),"right"); echo "  \n"; - displayInternalLink("plugins/calendar/day.php?year=$year&month=$month&day=$day",_("Day View"),"right"); + echo makeInternalLink("plugins/calendar/day.php?year=$year&month=$month&day=$day",_("Day View"),"right"); echo "  \n"; - // displayInternalLink("plugins/calendar/event_create.php?year=$year&month=$month&day=$day",_("Add Event"),"right"); + // echo makeInternalLink("plugins/calendar/event_create.php?year=$year&month=$month&day=$day",_("Add Event"),"right"); // echo "  \n"; echo ''; } +/** + * Generates html option tags with length values + * + * Hardcoded values from 0 minutes to 6 hours + * @param integer $selected selected option length + * @return void + */ function select_option_length($selected) { - $eventlength = array( '0' => _("0 min."), '15' => _("15 min."), - '30' => _("35 min."), + '30' => _("30 min."), '45' => _("45 min."), '60' => _("1 hr."), '90' => _("1.5 hr."), @@ -51,51 +72,69 @@ function select_option_length($selected) { ); while( $bar = each($eventlength)) { - if($selected==$bar[key]){ - echo " \n"; + if($bar['key']==$selected){ + echo ' \n"; } else { - echo " \n"; + echo ' \n"; } } } +/** + * Generates html option tags with minute values + * + * Hardcoded values in 5 minute intervals + * @param integer $selected selected value + * @return void + */ function select_option_minute($selected) { $eventminute = array( - '00'=>'00', - '05'=>'05', - '10'=>'10', - '15'=>'15', - '20'=>'20', - '25'=>'25', - '30'=>'30', - '35'=>'35', - '40'=>'40', - '45'=>'45', - '50'=>'50', - '55'=>'55' + '00'=>'00', + '05'=>'05', + '10'=>'10', + '15'=>'15', + '20'=>'20', + '25'=>'25', + '30'=>'30', + '35'=>'35', + '40'=>'40', + '45'=>'45', + '50'=>'50', + '55'=>'55' ); while ( $bar = each($eventminute)) { - if ($selected==$bar[key]){ - echo " \n"; + if ($bar['key']==$selected){ + echo ' \n"; } else { - echo " \n"; + echo ' \n"; } } } +/** + * Generates html option tags with hour values + * @param integer $selected selected value + * @return void + * @todo 12/24 hour format + */ function select_option_hour($selected) { for ($i=0;$i<24;$i++){ ($i<10)? $ih = "0" . $i : $ih = $i; if ($ih==$selected){ - echo " \n"; + echo ' \n"; } else { - echo " \n"; + echo ' \n"; } } } +/** + * Generates html option tags with priority values + * @param integer $selected selected value + * @return void + */ function select_option_priority($selected) { $eventpriority = array( '0' => _("Normal"), @@ -103,48 +142,66 @@ function select_option_priority($selected) { ); while( $bar = each($eventpriority)) { - if($selected==$bar[key]){ - echo " \n"; + if($bar['key']==$selected){ + echo ' \n"; } else { - echo " \n"; + echo ' \n"; } } } +/** + * Generates html option tags with year values + * + * Hardcoded values from 1902 to 2037 + * @param integer $selected selected value + * @return void + */ function select_option_year($selected) { for ($i=1902;$i<2038;$i++){ if ($i==$selected){ - echo " \n"; + echo ' \n"; } else { - echo " \n"; + echo ' \n"; } } } +/** + * Generates html option tags with month values + * @param integer $selected selected value + * @return void + */ function select_option_month($selected) { for ($i=1;$i<13;$i++){ $im=date('m',mktime(0,0,0,$i,1,1)); - $is = substr( _( date('F',mktime(0,0,0,$i,1,1)) ), 0, 3 ); + $is = getMonthAbrv( date('m',mktime(0,0,0,$i,1,1)) ); if ($im==$selected){ - echo " \n"; + echo ' \n"; } else { - echo " \n"; + echo ' \n"; } } } +/** + * Generates html option tags with day of month values + * + * Hardcoded values from 1 to 31 + * @param integer $selected selected value + * @return void + */ function select_option_day($selected) { for ($i=1;$i<32;$i++){ ($i<10)? $ih="0".$i : $ih=$i; if ($i==$selected){ - echo " \n"; + echo ' \n"; } else { - echo " \n"; + echo ' \n"; } } } -?>