libraries/Calendar – Kohana API 2.3 Documentation

system/libraries/Calendar.php

Class: Calendar_Core

class Calendar_Core extends Event_Subject implements SplSubject

Calendar creation library.


Methods

Calendar_Core :: days

public static function days

Returns an array of the names of the days, using the current locale.

Parameters:

boolean short
(FALSE) return short names

Return: array


Calendar_Core :: factory

public static function factory

Create a new Calendar instance. A month and year can be specified. By default, the current month and year are used.

Parameters:

integer month
(NULL) month number
integer year
(NULL) year number

Return: object


Calendar_Core -> __construct

public function __construct

Create a new Calendar instance. A month and year can be specified. By default, the current month and year are used.

Parameters:

integer month
(NULL) month number
integer year
(NULL) year number

Return: void


Calendar_Core -> __get

public function __get

Allows fetching the current month and year.

Parameters:

string key
key to get

Return: mixed


Calendar_Core -> event

public function event

Calendar_Event factory method.

Parameters:

string name
(NULL) unique name for the event

Return: object Calendar_Event


Calendar_Core -> standard

public function standard

Calendar_Event factory method.

Parameters:

string name
standard event type

Return: object


Calendar_Core -> weeks

public function weeks

Returns an array for use with a view. The array contains an array for each week. Each week contains 7 arrays, with a day number and status: TRUE if the day is in the month, FALSE if it is padding.

Return: array


Calendar_Core -> add_data

public function add_data

Adds new data from an observer. All event data contains and array of CSS classes and an array of output messages.

Parameters:

array data
observer data.

Return: void


Calendar_Core -> notify

public function notify

Resets the observed data and sends a notify to all attached events.

Parameters:

array data
UNIX timestamp

Return: void


Calendar_Core -> render

public function render

Convert the calendar to HTML using the kohana_calendar view.

Return: string


Calendar_Core -> __toString

public function __toString

Magically convert this object to a string, the rendered calendar.

Return: string


Calendar_Core -> attach

public function attach

Attach an observer to the object.

Parameters:

object obj
Event_Observer

Return: object


Calendar_Core -> detach

public function detach

Detach an observer from the object.

Parameters:

object obj
Event_Observer

Return: object