X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fcalendar%2Fcalendar.php;h=098ef0004caaf62474f7cfcc4ab75aeb6f56d8b2;hb=5f75494fd15729f94af3122e10802686656418ed;hp=31e7ee4745278eaf62f9b283af1fb3924c180f0c;hpb=cf1efdce52fce19388a74b85903cbeb7fd5e31ad;p=squirrelmail.git diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php index 31e7ee47..098ef000 100644 --- a/plugins/calendar/calendar.php +++ b/plugins/calendar/calendar.php @@ -3,7 +3,7 @@ /** * calendar.php * - * Copyright (c) 2002 The SquirrelMail Project Team + * Copyright (c) 2002-2004 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * Originally contrubuted by Michal Szczotka @@ -11,13 +11,17 @@ * Displays the main calendar page (month view). * * $Id$ + * @package plugins + * @subpackage calendar */ -require_once('calendar_data.php'); -require_once('functions.php'); +/** +*/ +define('SM_PATH','../../'); -chdir('..'); -define('SM_PATH','../'); +/* Calender plugin required files. */ +require_once(SM_PATH . 'plugins/calendar/calendar_data.php'); +require_once(SM_PATH . 'plugins/calendar/functions.php'); /* SquirrelMail required files. */ require_once(SM_PATH . 'include/validate.php'); @@ -25,9 +29,25 @@ 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 . 'src/load_prefs.php'); +require_once(SM_PATH . 'include/load_prefs.php'); require_once(SM_PATH . 'functions/html.php'); +/* get globals */ + +if (isset($_GET['month'])) { + $month = $_GET['month']; +} +if (isset($_GET['year'])) { + $year = $_GET['year']; +} +if (isset($_POST['year'])) { + $year = $_POST['year']; +} +if (isset($_POST['month'])) { + $month = $_POST['month']; +} +/* got 'em */ + //display upper part of month calendar view function startcalendar() { global $year, $month, $day, $color; @@ -46,19 +66,19 @@ function startcalendar() { html_tag( 'table', '', '', $color[0], 'width="100%" border="0" cellpadding="2" cellspacing="1"' ) . html_tag( 'tr', "\n". html_tag( 'th', - "<< ".($year-1)."" + "<< ".($year-1)."" ) . "\n". html_tag( 'th', - "< " . + "< " . date_intl( 'M', $prev_date). "" ) . "\n". html_tag( 'th', date_intl( 'F Y', $act_date ), '', $color[0], 'colspan="3"') . html_tag( 'th', - "" . + "" . date_intl( 'M', $next_date) . " >" ) . "\n". html_tag( 'th', - "".($year+1)." >>" + "".($year+1)." >>" ) ) . "\n". html_tag( 'tr', @@ -89,8 +109,8 @@ function drawmonthview() { if ( $aday <= $days_in_month && $aday > 0){ echo html_tag( 'td', '', 'left', $color[4], 'height="50" valign="top"' ) ."\n". html_tag( 'div', '', 'right' ); - echo(($cdate==$todayis) ? "[ " . _("TODAY") . " ] " : ""); - echo "[ ' . _("TODAY") . " ] " : ''); + echo "$aday"; } else { @@ -101,7 +121,8 @@ function drawmonthview() { $i=0; while ($calfoo = each($calendardata[$cdate])) { $calbar = $calendardata[$cdate][$calfoo['key']]; - echo ($calbar['priority']==1) ? "$calbar[title]
\n" : "$calbar[title]
\n"; + $title = '['. $calfoo['key']. '] ' .$calbar['message']; + echo ($calbar['priority']==1) ? "$calbar[title]
\n" : "$calbar[title]
\n"; $i=$i+1; if($i==2){ break; @@ -121,17 +142,17 @@ function endcalendar() { echo html_tag( 'tr' ) ."\n" . html_tag( 'td', '', 'left', '', 'colspan="7"' ) ."\n" . - "
\n". - " \n"; select_option_year($year); - echo " \n". - " \n". + " \n". - ' \n". - "
\n". - " \n". - "\n"; + echo " \n". + ' \n". + " \n". + " \n". + "\n"; }