class CalendarView { private static $Days = array('S', 'M', 'T', 'W', 'T', 'F', 'S'); private static $Headings = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); private static $Events; public static function render_title($Month, $Year) { $NextMonth = $Month % 12 == 0 ? 1 : $Month + 1; $PreviousMonth = $Month == 1 ? 12 : $Month - 1; $NextYear = $Year; if ($NextMonth == 1) { $NextYear++; } $PreviousYear = $Year; if ($PreviousMonth == 12) { $PreviousYear--; } ?>
=Format::cut_string($Event['Title'], 8, true)?>
} } public static function render_calendar($Month, $Year, $Events) { $RunningDay = date('w', mktime(0, 0, 0, $Month, 1, $Year)); $DaysInMonth = date('t', mktime(0 ,0 ,0, $Month, 1, $Year)); $DaysThisWeek = 1; $DayCounter = 0; $DatesArray = array(); ?>=$Heading?> | } ?>|
$DaysThisWeek++; } for ($i = 1; $i <= $DaysInMonth; $i++) { ?> |
self::render_events_day($i, $Events); ?>
=$i?>
|
if ($RunningDay == 6) { ?>
} } ?> |