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. | |
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:
filename contains the filename for this calendarmethod defines the METHOD for the calendar. This is PUBLISH by default.generator contains the product identifier (optional, defaults to an Anewt-specific string)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.
Definition at line 45 of file calendar.lib.php.
| 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.
| $str | A string to escape. | |
| $multiline | Boolean to indicate whether this is a multiline string. This affects how the string is escaped. |
Definition at line 63 of file calendar.lib.php.
| AnewtCalendar::add_event | ( | $ | event | ) |
Add an event to the calendar.
| $event | An AnewtCalendarEvent instance |
Definition at line 108 of file calendar.lib.php.
| AnewtCalendar::render | ( | ) |
Render this calendar to a string in iCal format.
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.
1.5.9