Inheritance diagram for BaseCalendar:
A calendar based manager for dealing with events. Has calendar view, day view, upcoming, past, etc. Very handy.
BaseCalendar uses a heavily modified version of the Calendar class from http://www.cascade.org.uk/software/php/calendar/index.php
Definition at line 12 of file base-calendar.inc.php.
Public Member Functions | |
__construct ($class= 'Event') | |
setup our calendar object | |
getPagesXml () | |
add our calendar pages in | |
getSearchParamXml () | |
get params for search page | |
getSearchSelect ($params) | |
special select SQL | |
getSearchFrom ($params) | |
special from SQL, join on guest table | |
getSearchWhere ($params) | |
special where SQL: dates, etc. | |
getSearchOrder ($params) | |
special order SQL | |
getSearchGroupBy ($params) | |
group by our event id | |
search ($params, $limit=null) | |
do our search. | |
findDate () | |
setup a default month / date thingie based on params | |
initMainPage () | |
prep main page, redirect to calendar | |
initSearchPage () | |
prep search page | |
initCalendarPage () | |
prep our calendar page | |
initDatePage () | |
prep our date page | |
initUpcomingPage () | |
prep our upcoming page | |
initPopularPage () | |
prep our popular page | |
initPastPage () | |
prep our past page | |
drawDatePage () | |
draw our date page | |
drawCalendarPage () | |
draw our calendar page | |
drawUpcomingPage () | |
draw our upcoming events page | |
drawPopularPage () | |
draw our popular events page | |
drawPastPage () | |
draw our past events page | |
drawCalendar ($month, $year, $size= 'big') | |
draw our calendar table html | |
getDayNames () | |
Get the array of strings used to label the days of the week. | |
setDayNames ($names) | |
Set the array of strings used to label the days of the week. | |
getMonthNames () | |
Get the array of strings used to label the months of the year. | |
setMonthNames ($names) | |
Set the array of strings used to label the months of the year. | |
getStartDay () | |
Gets the start day of the week. | |
setStartDay ($day) | |
Sets the start day of the week. | |
getStartMonth () | |
Gets the start month of the year. | |
setStartMonth ($month) | |
Sets the start month of the year. | |
getCalendarLink ($month, $year) | |
Return the URL to link to in order to display a calendar for a given month/year. | |
getDateLink ($day, $month, $year) | |
Return the URL to link to for a given date. | |
getDateContent ($day, $month, $year) | |
get content to put in the calendar day box for that day. | |
getMonthView ($month, $year, $showYear=true) | |
Return the calendar HTML for a specified month. | |
getMonthHeader ($month, $year, $showYear=true) | |
Format the month header row. | |
dayHasEvent ($d) | |
do we have an event on this day on our calendar? | |
getYearView ($year) | |
Return the HTML for a specified year. | |
Public Attributes | |
$startDay = 0 | |
The start day of the week. | |
$startMonth = 1 | |
The start month of the year. | |
$dayNames = array("S", "M", "T", "W", "T", "F", "S") | |
The labels to display for the days of the week. | |
$monthNames | |
The labels to display for the months of the year. | |
$daysInMonth = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) | |
The number of days in each month. | |
$day = 0 | |
what day it is | |
$dayCount = array() | |
this is where we store the day => count of events in that day | |
$size | |
what size of calendar are we showing? large or small | |
$events = null | |
our array of BaseEvent objects | |
Protected Member Functions | |
getSortFieldsArray () | |
get fields to sort by | |
getMonthEvents ($month, $year) | |
get all the events for this month | |
setMonthEvents ($month, $year) | |
setup our month events and per day counts | |
getMonthBody ($month, $year) | |
get the html markup for a month | |
getDaysInMonth ($month, $year) | |
Calculate the number of days in a month, taking into account leap years. | |
getYearHTML ($year) | |
Generate the HTML for a given year. | |
adjustDate ($month, $year) | |
Adjust dates to allow months > 12 and < 0. |
|
setup our calendar object
Definition at line 72 of file base-calendar.inc.php. |
|
Adjust dates to allow months > 12 and < 0. Just adjust the years appropriately. e.g. Month 14 of the year 2001 is actually month 2 of year 2002.
Definition at line 901 of file base-calendar.inc.php. Referenced by getMonthHeader(), and getMonthView(). |
|
do we have an event on this day on our calendar?
Definition at line 787 of file base-calendar.inc.php. Referenced by getDateContent(), and getMonthBody(). |
|
draw our calendar table html
Definition at line 422 of file base-calendar.inc.php. References getMonthView(), and setMonthEvents(). Referenced by drawCalendarPage(). |
|
draw our calendar page
Definition at line 378 of file base-calendar.inc.php. References $events, drawCalendar(), ObjectManager::drawResults(), ObjectManager::drawSearchForm(), getMonthEvents(), and BaseModule::params(). |
|
draw our date page
Definition at line 357 of file base-calendar.inc.php. References $day, ObjectManager::drawResults(), BaseModule::getLink(), BaseModule::params(), and search(). |
|
draw our past events page
Definition at line 410 of file base-calendar.inc.php. References ObjectManager::drawSearchPage(). |
|
draw our popular events page
Definition at line 402 of file base-calendar.inc.php. References ObjectManager::drawSearchPage(). |
|
draw our upcoming events page
Definition at line 394 of file base-calendar.inc.php. References ObjectManager::drawSearchPage(). |
|
setup a default month / date thingie based on params
Definition at line 256 of file base-calendar.inc.php. References $day, BaseModule::params(), and BaseModule::setParam(). Referenced by initCalendarPage(). |
|
Return the URL to link to in order to display a calendar for a given month/year. You must override this method if you want to activate the "forward" and "back" feature of the calendar. Note: If you return an empty string from this function, no navigation link will be displayed. This is the default behaviour. If the calendar is being displayed in "year" view, $month will be set to zero.
Definition at line 586 of file base-calendar.inc.php. References BaseModule::getUrl(). Referenced by getMonthHeader(), and getYearView(). |
|
get content to put in the calendar day box for that day. defaults to the number of events on that day.
Definition at line 618 of file base-calendar.inc.php. References $s, dayHasEvent(), and Util::pluralize(). Referenced by getMonthBody(). |
|
Return the URL to link to for a given date. You must override this method if you want to activate the date linking feature of the calendar. Note: If you return an empty string from this function, no navigation link will be displayed. This is the default behaviour.
Definition at line 603 of file base-calendar.inc.php. References BaseModule::getUrl(). Referenced by getMonthBody(). |
|
Get the array of strings used to label the days of the week. This array contains seven elements, one for each day of the week. The first entry in this array represents Sunday.
Definition at line 484 of file base-calendar.inc.php. |
|
Calculate the number of days in a month, taking into account leap years.
Definition at line 848 of file base-calendar.inc.php. Referenced by getMonthBody(). |
|
get the html markup for a month
Definition at line 715 of file base-calendar.inc.php. References $daysInMonth, $s, dayHasEvent(), getDateContent(), getDateLink(), and getDaysInMonth(). Referenced by getMonthView(). |
|
get all the events for this month
Definition at line 441 of file base-calendar.inc.php. References search(). Referenced by drawCalendarPage(), and setMonthEvents(). |
|
Format the month header row.
Definition at line 666 of file base-calendar.inc.php. References $s, adjustDate(), and getCalendarLink(). Referenced by getMonthView(). |
|
Get the array of strings used to label the months of the year. This array contains twelve elements, one for each month of the year. The first entry in this array represents January.
Definition at line 509 of file base-calendar.inc.php. |
|
Return the calendar HTML for a specified month.
Definition at line 638 of file base-calendar.inc.php. References $s, adjustDate(), getMonthBody(), and getMonthHeader(). Referenced by drawCalendar(). |
|
add our calendar pages in upcoming - events in the future past - events in the past popular - popular events calendar - show calendar / month view date - show events on a date Reimplemented from ObjectManager. Definition at line 89 of file base-calendar.inc.php. |
|
special from SQL, join on guest table
Reimplemented from ObjectManager. Definition at line 144 of file base-calendar.inc.php. |
|
group by our event id
Reimplemented from ObjectManager. Definition at line 238 of file base-calendar.inc.php. |
|
special order SQL
Reimplemented from ObjectManager. Definition at line 204 of file base-calendar.inc.php. |
|
get params for search page montth, day, year, event start, and stop are all added Reimplemented from ObjectManager. Definition at line 112 of file base-calendar.inc.php. |
|
special select SQL
Reimplemented from ObjectManager. Definition at line 130 of file base-calendar.inc.php. |
|
special where SQL: dates, etc.
Reimplemented from ObjectManager. Definition at line 158 of file base-calendar.inc.php. References $day. |
|
get fields to sort by
Reimplemented from ObjectManager. Definition at line 223 of file base-calendar.inc.php. |
|
Gets the start day of the week. This is the day that appears in the first column of the calendar. Sunday = 0.
Definition at line 532 of file base-calendar.inc.php. |
|
Gets the start month of the year. This is the month that appears first in the year view. January = 1.
Definition at line 555 of file base-calendar.inc.php. |
|
Generate the HTML for a given year.
Definition at line 888 of file base-calendar.inc.php. |
|
Return the HTML for a specified year.
Definition at line 798 of file base-calendar.inc.php. References $s, and getCalendarLink(). |
|
prep our calendar page find date, title, etc. Definition at line 297 of file base-calendar.inc.php. References findDate(), and BaseModule::params(). |
|
prep our date page
Definition at line 309 of file base-calendar.inc.php. References BaseModule::params(). |
|
prep main page, redirect to calendar
Reimplemented from ObjectManager. Definition at line 277 of file base-calendar.inc.php. References Util::redirect(). |
|
prep our past page
Definition at line 345 of file base-calendar.inc.php. References initSearchPage(), and BaseModule::setParam(). |
|
prep our popular page
Definition at line 331 of file base-calendar.inc.php. References initSearchPage(), and BaseModule::setParam(). |
|
prep search page
Reimplemented from ObjectManager. Definition at line 285 of file base-calendar.inc.php. Referenced by initPastPage(), initPopularPage(), and initUpcomingPage(). |
|
prep our upcoming page
Definition at line 319 of file base-calendar.inc.php. References initSearchPage(), and BaseModule::setParam(). |
|
do our search.
Reimplemented from ObjectManager. Definition at line 246 of file base-calendar.inc.php. Referenced by drawDatePage(), and getMonthEvents(). |
|
Set the array of strings used to label the days of the week. This array must contain seven elements, one for each day of the week. The first entry in this array represents Sunday.
Definition at line 497 of file base-calendar.inc.php. |
|
setup our month events and per day counts
Definition at line 461 of file base-calendar.inc.php. References getMonthEvents(). Referenced by drawCalendar(). |
|
Set the array of strings used to label the months of the year. This array must contain twelve elements, one for each month of the year. The first entry in this array represents January.
Definition at line 521 of file base-calendar.inc.php. |
|
Sets the start day of the week. This is the day that appears in the first column of the calendar. Sunday = 0.
Definition at line 543 of file base-calendar.inc.php. |
|
Sets the start month of the year. This is the month that appears first in the year view. January = 1.
Definition at line 566 of file base-calendar.inc.php. |
|
what day it is
Definition at line 50 of file base-calendar.inc.php. Referenced by drawDatePage(), findDate(), and getSearchWhere(). |
|
this is where we store the day => count of events in that day
Definition at line 55 of file base-calendar.inc.php. |
|
The labels to display for the days of the week. The first entry in this array represents Sunday. Definition at line 30 of file base-calendar.inc.php. |
|
The number of days in each month. You're unlikely to want to change this... The first entry in this array represents January. Definition at line 43 of file base-calendar.inc.php. Referenced by getMonthBody(). |
|
our array of BaseEvent objects
Definition at line 65 of file base-calendar.inc.php. Referenced by drawCalendarPage(). |
|
Initial value: array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") The first entry in this array represents January. Definition at line 36 of file base-calendar.inc.php. |
|
what size of calendar are we showing? large or small
Definition at line 60 of file base-calendar.inc.php. |
|
The start day of the week. This is the day that appears in the first column of the calendar. Sunday = 0. Definition at line 18 of file base-calendar.inc.php. |
|
The start month of the year. This is the month that appears in the first slot of the calendar in the year view. January = 1. Definition at line 24 of file base-calendar.inc.php. |