Source for file calendar.php
Documentation is available at calendar.php
* Displays the main calendar page (month view).
* @copyright 2002-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: calendar.php 14845 2020-01-07 08:09:34Z pdontthink $
* Include the SquirrelMail initialization file.
require
('../../include/init.php');
include_once(SM_PATH .
'functions/date.php');
/* Calendar plugin required files. */
include_once(SM_PATH .
'plugins/calendar/calendar_data.php');
include_once(SM_PATH .
'plugins/calendar/functions.php');
* display upper part of month calendar view
function startcalendar() {
global $year, $month, $color;
$prev_date =
mktime(0, 0, 0, $month -
1, 1, $year);
$act_date =
mktime(0, 0, 0, $month, 1, $year);
$next_date =
mktime(0, 0, 0, $month +
1, 1, $year);
$prev_month =
date( 'm', $prev_date );
$next_month =
date( 'm', $next_date);
$prev_year =
date( 'Y', $prev_date);
$next_year =
date( 'Y', $next_date );
html_tag( 'table', '', '', $color[0], 'width="100%" border="0" cellpadding="2" cellspacing="1"' ) .
"<a href=\"$self?year=".
($year-
1).
"&month=$month\"><< ".
($year-
1).
"</a>"
"<a href=\"$self?year=$prev_year&month=$prev_month\">< " .
"<a href=\"$self?year=$next_year&month=$next_month\">" .
date_intl( 'M', $next_date) .
" ></a>"
"<a href=\"$self?year=".
($year+
1).
"&month=$month\">".
($year+
1).
" >></a>"
html_tag( 'th', _("Sunday"), '', $color[5], 'width="14%" width="90"' ) .
"\n" .
html_tag( 'th', _("Monday"), '', $color[5], 'width="14%" width="90"' ) .
"\n" .
html_tag( 'th', _("Tuesday"), '', $color[5], 'width="14%" width="90"' ) .
"\n" .
html_tag( 'th', _("Wednesday"), '', $color[5], 'width="14%" width="90"' ) .
"\n" .
html_tag( 'th', _("Thursday"), '', $color[5], 'width="14%" width="90"' ) .
"\n" .
html_tag( 'th', _("Friday"), '', $color[5], 'width="14%" width="90"' ) .
"\n" .
html_tag( 'th', _("Saturday"), '', $color[5], 'width="14%" width="90"' ) .
"\n"
* main logic for month view of calendar
function drawmonthview() {
global $year, $month, $color, $calendardata, $todayis;
$aday =
1 -
date('w', mktime(0, 0, 0, $month, 1, $year));
$days_in_month =
date('t', mktime(0, 0, 0, $month, 1, $year));
while ($aday <=
$days_in_month) {
for ($j=
1; $j<=
7; $j++
) {
($aday<
10)?
$cdate=
$cdate.
"0$aday":
$cdate=
$cdate.
"$aday";
if ( $aday <=
$days_in_month &&
$aday >
0){
echo
html_tag( 'td', '', 'left', $color[4], 'height="50" valign="top"' ) .
"\n".
echo
(($cdate==
$todayis) ?
'<font size="-1" color="'.
$color[1].
'">[ ' .
_("TODAY") .
" ] " :
'<font size="-1">');
echo
"<a href=day.php?year=$year&month=$month&day=";
echo
(($aday<
10) ?
"0" :
"");
echo
"$aday>$aday</a></font></div>";
echo
html_tag( 'td', '', 'left', $color[0]) .
"\n".
if (isset
($calendardata[$cdate])){
while ($calfoo =
each($calendardata[$cdate])) {
$calbar =
$calendardata[$cdate][$calfoo['key']];
// FIXME: how to display multiline task
$title =
'['.
$calfoo['key'].
'] ' .
// FIXME: link to nowhere
echo
"<a href=\"#\" style=\"text-decoration:none; color: "
.
($calbar['priority']==
1 ?
$color[1] :
$color[6])
* end of monthly view and form to jump to any month and year
html_tag( 'td', '', 'left', '', 'colspan="7"' ) .
"\n" .
" <form name=\"caljump\" action=\"calendar.php\" method=\"post\">\n".
" <select name=\"year\">\n";
" <select name=\"month\">\n";
' <input type="submit" value="' .
_("Go") .
"\" />\n".
"</table></td></tr></table>\n";
if( !isset
( $month ) ||
$month <=
0){
if( !isset
($year) ||
$year <=
0){
if( !isset
($day) ||
$day <=
0){
$todayis =
date( 'mdY' );
Documentation generated on Mon, 13 Jan 2020 04:22:02 +0100 by phpDocumentor 1.4.3