<?php
/*=====================================================================*\
|| ###################################################################
|| # Kalens [#]version[#]
|| # Copyright ©2002-[#]year[#] Iris Studios, Inc.
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| # the Free Software Foundation; version [#]gpl[#] of the License.
|| #
|| # This program is distributed in the hope that it will be useful, but
|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|| # more details.
|| #
|| # You should have received a copy of the GNU General Public License along
|| # with this program; if not, write to the Free Software Foundation, Inc.,
|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|| ###################################################################
\*=====================================================================*/
define('SVN', '$Id$');
$cachetemplates = array(
'calendar_month',
'day',
'event'
);
require_once('./global.php');
require_once('./includes/class_calendar_month.php');
require_once('./includes/functions_lists.php');
// ###################################################################
$calendar = new CalendarMonth($kalens->input_clean('month', TYPE_UINT), $kalens->input_clean('year', TYPE_UINT));
//$calendar->setWeekStartDay(DAY_MONDAY);
$calendar->generate();
$counter = 0;
$weeks = '';
while ($week = $calendar->getNextWeek())
{
$days = '';
while ($day = $week->getNextDay())
{
$events = '';
// blank day
// TODO - we should get events on these days
if ($day == -1)
{
$date = '';
eval('$days .= "' . $template->fetch('day') . '";');
}
else
{
$date = $day->getDay();
$show['today'] = ($day->getDay() == date('d') AND $day->getMonth() == date('m') AND $day->getYear() == date('Y'));
if ($day->hasEvents())
{
foreach ($day->getEvents() AS $event)
{
$event['time'] = ($event['allday'] ? _('All Day') : gmdate('H:i', $event['startstamp']));
eval('$events .= "' . $template->fetch('event') . '";');
}
}
eval('$days .= "' . $template->fetch('day') . '";');
}
}
eval('$weeks .= "' . $template->fetch('calendar_month_week') . '";');
}
$month = FetchMonthByNumber($calendar->getMonth());
$year = $calendar->getYear();
$select['months'] = ConstructMonthList($calendar->getMonth());
$select['years'] = ConstructYearList($calendar->getYear());
$select['calendars'] = ConstructCalendarList($kalens->userinfo['calendarids']);
eval('$template->flush("' . $template->fetch('calendar_month') . '");');
/*=====================================================================*\
|| ###################################################################
|| # $HeadURL$
|| # $Id$
|| ###################################################################
\*=====================================================================*/
?>