/***************** GenericCalendar Instruction ******************/ /* GenericCalendar class is a class made to easily be used for * different calendars. It allows for custom week and day * templates to make the calendar look and do what you like. * GenericCalendar has abstract method(s) that MUST be overridden, * whether used or not. Below is a list of helper functions that * can be used in your implementations of functions. * *TEMPLATES (code supplies generic templates, can be overridden): * weekBeginTemplate() - called when a week starts (after saturday) * weekEndTemplate() - called when a week ends (before sunday) * dayTemplate() - called for each day in the given month * offDayTemplate() - called for each day in the previous and * following months that occurs in the calendar * dayLegendTemplate() - called for Sunday, Monday, ... legend * *DEFAULT CSS CLASSES: * day - day of the week * off-day - day of the week for previous, following months * weekend - Saturday and Sunday * date - date of calendar square * day-legend - div that holds Sunday, Monday, ... divs in the legend * *ABSTRACT FUNCTION(S) (must be overridden): * - abstract public function gatherData() * This function is not required, but is a good spot to do * all the necessary calculations and build a 2d array * that contains data that will be passed to * GenericCalendar::fillData(). see fillData for more info. * *HELPER FUNCTIONS/VARIABLES: * Month Information (accessed using $this->exampleFuncName()): * GenericCalendar->allDays (accessed by $this->allDays) 1D array of Day objects. * public function getMonthNum() returns 1 for Jan, 2 for Feb, etc. * public function getMonthName() * public function getDaysInMonth() return number of days in current month * public function getPreviousMonthNum() same as getMonthNum, but for previous month * public function getPreviousMonthName() * public function getPreviousMonthYear() * public function getNextMonthNum() * public function getNextMonthName() * public function getNextMonthYear() * Print Functions: * public function printDaysBefore() prints the days of the previous month * public function printDaysAfter() - see above. uses css class "off-day" * Day Information (accessed using a Day object i.e. $dayObj->exampleFuncName ): * Day->data (Days can be accessed through the GenericCalendar->allDays array) * 1D array of data to be printed in the dayTemplate. * public function getName() * public function getDate() * public function getIsWeekendString() return ' weekend' if day is a sat or sun * public function getIsTodayString() returns ' today' if the date is todays date * *OTHER FUNCTION(S): * public function printCalendar() * GenericCalendar provides a printCalendar() function, but * it may very well be overwritten. It is recommended that * printCalendar() calls seperate template functions for day, * weekBegin and weekEnd using the appropriate data. These * template functions may be methods in your implementation * of GenericCalendar * * public function fillData() * Takes an array of arrays and fills the appropriate days in * the calendar with the information in the given day. * Example: * $yourData = array( * 2 => array("go to the gym", "make dinner"), 7 => array("file taxes"), 13 => array("look at this website: Google", "call mom at 9:30am", "go for a run") * ); * $yourCalName->fillData($myData); * With the proper printCalendar function, the given strings * will be printed on the 2nd, the 7th, and the 13th days respectively. * HTML is allowed within the strings if it works within PHP strings. * * See associated example file (can be found at www.teastburn.com) for more information. /****************************************************************/