AnewtCalendar Class Reference

A class representing an iCalendar calendar object. More...

List of all members.

Public Member Functions

 __construct ()
 Construct a new AnewtCalendar instance.
 add_event ($event)
 Add an event to the calendar.
 render ()
 Render this calendar to a string in iCal format.
 flush ()
 Output the calendar to a browser.

Static Private Member Functions

static escape_string ($str, $multiline)
 Escape a string so that it can be used for TEXT fields.

Private Attributes

 $events = array()
 Array holding all events.


Detailed Description

A class representing an iCalendar calendar object.

It has some basic properties and may contain one or more events (represented by AnewtCalendarEvent). An instance of this class can be serialized to a text/calendar (.ics) file, which can be imported into calendering applications such as Evolution, iCal or Outlook.

The available properties are:

A filename is optional, but it is recommended to set one for better client compatibility, since some platforms ignore the MIME type information and rely on the file name (extension) to determine what actions to perform.

See also:
AnewtCalendarEvent

Definition at line 45 of file calendar.lib.php.


Member Function Documentation

static AnewtCalendar::escape_string ( str,
multiline 
) [static, private]

Escape a string so that it can be used for TEXT fields.

Newlines and other characters are escaped to match the iCalendar specification.

Parameters:
$str A string to escape.
$multiline Boolean to indicate whether this is a multiline string. This affects how the string is escaped.
Returns:
The escaped string

Definition at line 63 of file calendar.lib.php.

AnewtCalendar::add_event ( event  ) 

Add an event to the calendar.

Parameters:
$event An AnewtCalendarEvent instance

Definition at line 108 of file calendar.lib.php.

AnewtCalendar::render (  ) 

Render this calendar to a string in iCal format.

Returns:
String representation of this calendar

Definition at line 120 of file calendar.lib.php.

AnewtCalendar::flush (  ) 

Output the calendar to a browser.

This renders the calendar and all its asssociated events, and sends the output to the browser with the correct HTTP headers for the MIME type and (optionally) the downoad filename.

Definition at line 209 of file calendar.lib.php.


The documentation for this class was generated from the following file:

Generated on Sun Aug 2 22:54:37 2009 for Anewt by  doxygen 1.5.9