Class: SimpleCal
- Package: saf.Date
- Author: John Luxford <lux@simian.ca>
- Copyright: Copyright (C) 2004, Simian Systems Inc.
- License: http://www.sitellite.org/index/license Simian Open Software License
- Version: 1.0, 2004-04-26, $Id: Simple.php,v 1.2 2007/06/10 09:30:45 lux Exp $
- Access: public
A concise calendar class, useful for displaying monthly calendars in a
web site or application UI.
Usage Example
<?php
loader_import ('saf.Date.Calendar.Simple');
$cal = new SimpleCal ($parameters['simplecal']);
$cal->addLink (5, 'Dentist Appointment', '/index/sitellite-calendar-event-action?id=3');
$cal->addLink (5, 'BBQ at Joe\'s', '/index/sitellite-calendar-event-action?id=5');
$cal->addLink (16, 'Board Meeting', '/index/sitellite-calendar-event-action?id=7');
$cal->addLink (21, 'Anniversary', '/index/sitellite-calendar-event-action?id=9', true);
$cal->addLink (26, 'Golf w/ Boss', '/index/sitellite-calendar-event-action?id=11', true);
echo $cal->render ();
?>
Properties
$dayLinks = false
- Access: public
Link pattern for days.
Methods
SimpleCal ($mc)
- Access: public
Constructor method.
addLink ($day, $text, $link, $important = false, $alt = '', $pre = '', $time = false)
- Access: public
Sets the specified day to link to the specified link.
addHTML ($day, $html)
- Access: public
Adds the specified HTML to the specified day.
prevDate ()
- Access: public
- Return: string
Returns the previous month as a $mc value.
nextDate ()
- Access: public
- Return: string
Returns the next month as a $mc value.
monthName ()
- Access: public
- Return: string
Returns the name of the current month.
prevMonth ()
- Access: public
- Return: string
Returns the name of the previous month.
nextMonth ()
- Access: public
- Return: string
Returns the name of the next month.
isActive ($r, $c)
- Access: public
- Return: boolean
Determines whether the specified row and column is active.
isLink ($day)
- Access: public
- Return: boolean
Determines whether there is a link for the specified day.
isCurrent ($day)
- Access: public
- Return: boolean
Determines whether the specified day is the current date.
isWeekend ($day)
- Access: public
- Return: boolean
Determines whether the specified day is on a weekend.
weekday ($day)
- Access: public
- Return: string
Returns an abbreviated week day formatted by strftime(). $day is
a lowercase, English weekday abbreviation (sun, mon, tue, wed, thu,
fri, or sat).
weekdaySun ()
- Access: public
- Return: string
Calls weekday() with 'sun' (as in Sunday).
weekdayMon ()
- Access: public
- Return: string
Calls weekday() with 'mon' (as in Monday).
weekdayTue ()
- Access: public
- Return: string
Calls weekday() with 'tue' (as in Tuesday).
weekdayWed ()
- Access: public
- Return: string
Calls weekday() with 'wed' (as in Wednesday).
weekdayThu ()
- Access: public
- Return: string
Calls weekday() with 'thu' (as in Thursday).
weekdayFri ()
- Access: public
- Return: string
Calls weekday() with 'fri' (as in Friday).
weekdaySat ()
- Access: public
- Return: string
Calls weekday() with 'sat' (as in Saturday).
render ()
- Access: public
- Return: string
Renders the HTML calendar.
