Class CalendarTable

Description

This is a widget class that can build and render calendar data in a nicely formated table.

Located in /widgets/CalendarTable.inc (line 60)

Container
   |
   --BaseWidget
      |
      --CalendarTable
Direct descendents
Class Description
This is a widget class that can build and render calendar data in a nicely formated table.
Variable Summary
Method Summary
CalendarTable CalendarTable ()
array adjustDate (int $month, int $year)
string getCalendarLink (int $month, int $year)
Container getCurrentMonthView ()
Container getCurrentYearView ()
string getDateLink (int $day, int $month, int $year)
array getDayNames ()
void getDaysInMonth (int $month, int $year)
Container getMonth (int $m, int $y, [boolean $showYear = true])
array getMonthNames ()
Container getMonthView (int $month, int $year)
void getNextLink ()
void getPrevLink ()
int getStartDay ()
int getStartMonth ()
Container getYear (int $year)
Container getYearView (int $year)
void setDayNames (array $names)
void setMonthNames (array $names)
void setMonthsPerRow (int $months)
void setStartDay (int $day)
void setStartMonth (int $month)
void set_image_path ([string $path = PHPHTMLLIB_WIDGET_IMAGEPATH])
void set_next_image_name ([string $name = "next_group_button.gif"])
void set_prev_image_name ([string $name = "prev_group_button.gif"])
void useButtonNav ()
void useTextNav ()
Variables
mixed $dayNames = array("S", "M", "T", "W", "T", "F", "S") (line 649)

The labels to display for the days of the week. The first entry in this array represents Sunday.

mixed $daysInMonth = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) (line 664)

The number of days in each month. You're unlikely to want to change this... The first entry in this array represents January.

mixed $monthNames = array("January", "February", "March", "April",
"May", "June", "July", "August", "September", "October", "November",
"December")
(line 655)

The labels to display for the months of the year. The first entry in this array represents January.

mixed $monthsPerRow = 3 (line 631)

Number of months per row in the year view. Legal values are 1, 2, 3, 4, 6, and 12.

mixed $startDay = 0 (line 637)

The start day of the week. This is the day that appears in the first column of the calendar. Sunday = 0.

mixed $startMonth = 1 (line 643)

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.

mixed $_image_path = PHPHTMLLIB_WIDGET_IMAGEPATH (line 68)

This stores the base path to where the tool link images live. This lets you specify a new path to where your images live.

mixed $_nextImage = "next_group_button.gif" (line 78)

Name of "Next" button

mixed $_nextText = "»" (line 88)

Path to "Next" button

mixed $_prevImage = "prev_group_button.gif" (line 73)

Name of "Previous" button

mixed $_prevText = "«" (line 83)

Path to "Previous" text

mixed $_useButtons = true (line 93)

Use buttons or test links to previous and next

Inherited Variables

Inherited from BaseWidget

BaseWidget::$title
BaseWidget::$width
BaseWidget::$_image_prefix
Methods
Constructor CalendarTable (line 98)

The constructor

CalendarTable CalendarTable ()
adjustDate (line 606)

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.

  • return: - adjusted month and year
array adjustDate (int $month, int $year)
  • int $month: - month of year (1-12)
  • int $year: - year
getCalendarLink (line 309)

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.

  • return: - constructed URL
string getCalendarLink (int $month, int $year)
  • int $month: - month of year (1-12)
  • int $year: - year

Redefined in descendants as:
getCurrentMonthView (line 338)

Return the current month view.

Container getCurrentMonthView ()
getCurrentYearView (line 350)

Return the current year view.

Container getCurrentYearView ()
getDateLink (line 327)

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.

  • return: - constructed URL
string getDateLink (int $day, int $month, int $year)
  • int $day: - day of month (1-31)
  • int $month: - month of year (1-12)
  • int $year: - year

Redefined in descendants as:
getDayNames (line 183)

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.

  • return: - array of strings representing weekday names
array getDayNames ()
getDaysInMonth (line 394)

Calculate the number of days in a month, taking into account leap years.

void getDaysInMonth (int $month, int $year)
  • int $month: - month of year (1-12)
  • int $year: - year
getMonth (line 436)

Generate the Container for a given month

Container getMonth (int $m, int $y, [boolean $showYear = true])
  • int $m: - month of year (1-12)
  • int $y: - year
  • boolean $showYear: - year display on/off
getMonthNames (line 208)

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.

  • return: - array of strings representing month names
array getMonthNames ()
getMonthView (line 364)

Return a specified month view

Container getMonthView (int $month, int $year)
  • int $month: - month of year (1-12)
  • int $year: - year
getNextLink (line 165)

Construct the "next" link

void getNextLink ()
getPrevLink (line 151)

Construct the "previous" link

void getPrevLink ()
getStartDay (line 232)

Gets the start day of the week. This is the day that appears in the first column of the calendar. Sunday = 0.

  • return: - day of week (0-6) which is the column of the calendar
int getStartDay ()
getStartMonth (line 255)

Gets the start month of the year. This is the month that appears first in the year view. January = 1.

  • return: - month of year (1-12) which is the first month displayed
int getStartMonth ()
getYear (line 547)

Generate the Container for a given year

Container getYear (int $year)
  • int $year: - year
getYearView (line 376)

Return a specified year view.

Container getYearView (int $year)
  • int $year: - year
setDayNames (line 196)

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.

void setDayNames (array $names)
  • array $names: - array of names for the days of the week.
setMonthNames (line 220)

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.

void setMonthNames (array $names)
  • array $names: - array of names for the months of the year.
setMonthsPerRow (line 276)

Sets the numbers of months to show per row in the year view.

void setMonthsPerRow (int $months)
  • int $months: - numbers of months to show in a row (1, 2, 3, 4, 6, 12)
setStartDay (line 243)

Sets the start day of the week. This is the day that appears in the first column of the calendar. Sunday = 0.

void setStartDay (int $day)
  • int $day: - day of week (0-6) which is the column of the calendar
setStartMonth (line 266)

Sets the start month of the year. This is the month that appears first in the year view. January = 1.

void setStartMonth (int $month)
  • int $month: - month of year (1-12) which is the first month displayed
set_image_path (line 123)

Set the image path

void set_image_path ([string $path = PHPHTMLLIB_WIDGET_IMAGEPATH])
  • string $path: - path to the next and previous images.
set_next_image_name (line 143)

Set the next image name

void set_next_image_name ([string $name = "next_group_button.gif"])
  • string $name: - name of next image
set_prev_image_name (line 133)

Set the previous image name

void set_prev_image_name ([string $name = "prev_group_button.gif"])
  • string $name: - name of previous image
useButtonNav (line 105)

Use buttons for previous and next links

void useButtonNav ()
useTextNav (line 113)

Use buttons for previous and next links

void useTextNav ()

Inherited Methods

Inherited From BaseWidget

BaseWidget::get_align()
BaseWidget::get_css()
BaseWidget::get_javascript()
BaseWidget::get_title()
BaseWidget::get_width()
BaseWidget::set_align()
BaseWidget::set_image_path_prefix()
BaseWidget::set_title()
BaseWidget::set_width()

Inherited From Container

Container::Container()
Container::add()
Container::add_reference()
Container::count_content()
Container::get_element()
Container::get_indent_flag()
Container::push()
Container::push_reference()
Container::render()
Container::reset_content()
Container::set_collapse()
Container::set_indent_flag()

Documentation generated on Fri, 28 Jan 2011 08:52:50 -0500 by phpDocumentor 1.4.3