X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fcalendar%2Fday.php;h=b8c9c5107e3ba5fa0a838ce7d076d0cd0362dbc3;hp=fc21bf3e9ed4f619f513b5f0bb757f11ea9a1d33;hb=c4faef335b2362c81b8ebf026d4066c12d70536c;hpb=aa7fb30cfbfef6ef28ebde963f6312c79122f411 diff --git a/plugins/calendar/day.php b/plugins/calendar/day.php index fc21bf3e..b8c9c510 100644 --- a/plugins/calendar/day.php +++ b/plugins/calendar/day.php @@ -1,34 +1,44 @@ - * * Displays the day page (day view). * - * $Id$ + * @copyright 2002-2020 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + * @package plugins + * @subpackage calendar + */ + +/** + * Include the SquirrelMail initialization file. */ +require('../../include/init.php'); -require_once('calendar_data.php'); -require_once('functions.php'); +/* date_intl() */ +include_once(SM_PATH . 'functions/date.php'); -chdir('..'); -define('SM_PATH','../'); +/* Calendar plugin required files. */ +include_once(SM_PATH . 'plugins/calendar/calendar_data.php'); +include_once(SM_PATH . 'plugins/calendar/functions.php'); -/* SquirrelMail required files. */ -require_once(SM_PATH . 'include/validate.php'); -require_once(SM_PATH . 'functions/strings.php'); -require_once(SM_PATH . 'functions/date.php'); -require_once(SM_PATH . 'config/config.php'); -require_once(SM_PATH . 'functions/page_header.php'); -require_once(SM_PATH . 'include/load_prefs.php'); -require_once(SM_PATH . 'functions/html.php'); +/* get globals */ +if (! sqGetGlobalVar('year',$year,SQ_FORM) || ! is_numeric($year)) { + unset($year); +} +if (! sqGetGlobalVar('month',$month,SQ_FORM) || ! is_numeric($month)) { + unset($month); +} +if (! sqGetGlobalVar('day',$day,SQ_FORM) || ! is_numeric($day)) { + unset($day); +} +/* got 'em */ -//displays head of day calendar view +/** + * displays head of day calendar view + * @return void + * @access private + */ function day_header() { global $color, $month, $day, $year, $prev_year, $prev_month, $prev_day, $prev_date, $next_month, $next_day, $next_year, $next_date; @@ -36,21 +46,25 @@ function day_header() { echo html_tag( 'tr', '', '', $color[0] ) . "\n". html_tag( 'td', '', 'left' ) . html_tag( 'table', '', '', $color[0], 'width="100%" border="0" cellpadding="2" cellspacing="1"' ) ."\n" . - html_tag( 'tr', + html_tag( 'tr', html_tag( 'th', - "< ". + "< ". date_intl('D',$prev_date)."", 'left' ) . html_tag( 'th', date_intl( _("l, F j Y"), mktime(0, 0, 0, $month, $day, $year)) , '', '', 'width="75%"' ) . html_tag( 'th', - "". + "". date_intl('D',$next_date)." >" , 'right' ) ); } -//events for specific day are inserted into "daily" array +/** + * events for specific day are inserted into "daily" array + * @return void + * @access private + */ function initialize_events() { global $daily_events, $calendardata, $month, $day, $year; @@ -72,7 +86,11 @@ function initialize_events() { } } -//main loop for displaying daily events +/** + * main loop for displaying daily events + * @return void + * @access private + */ function display_events() { global $daily_events, $month, $day, $year, $color; @@ -92,7 +110,8 @@ function display_events() { html_tag( 'td', $ehour . ':' . $eminute, 'left' ) . html_tag( 'td', ' ', 'left' ) . html_tag( 'td', - "". + "". _("ADD") . "" , 'center' ) , '', $color[$eo]); @@ -100,28 +119,32 @@ function display_events() { } else { $calbar=$calfoo['value']; if ($calbar['length']!=0){ - $elength = '-'.date('H:i',mktime($ehour,$eminute+$calbar['length'],0,1,1,0)); + $elength = '-'.date_intl(_("H:i"),mktime($ehour,$eminute+$calbar['length'],0,1,1,0)); } else { $elength=''; } echo html_tag( 'tr', '', '', $color[$eo] ) . - html_tag( 'td', $ehour . ':' . $eminute . $elength, 'left' ) . + html_tag( 'td', date_intl(_("H:i"),mktime($ehour,$eminute,0,1,1,0)) . $elength, 'left' ) . html_tag( 'td', '', 'left' ) . '['; - echo ($calbar['priority']==1) ? "$calbar[title]" : "$calbar[title]"; - echo"] $calbar[message] " . + echo ($calbar['priority']==1) ? + "".sm_encode_html_special_chars($calbar['title']).'' : + sm_encode_html_special_chars($calbar['title']); + echo']
'.nl2br(sm_encode_html_special_chars($calbar['message'])).'
' . html_tag( 'td', "\n" . - "". + "". _("EDIT") . " | \n" . - "" . + "" . _("DEL") . '' . "\n" , 'center' ); + } } } - - -} +/* end of day functions */ if ($month <= 0){ $month = date( 'm'); @@ -146,7 +169,7 @@ $calself=basename($PHP_SELF); $daily_events = array(); -displayPageHeader($color, 'None'); +displayPageHeader($color); calendar_header(); readcalendardata(); day_header();