Skip to content

Developer Docs

craigh edited this page May 2, 2012 · 2 revisions

PostCalendar Developer Documentation

Hooks

Please note: this information applies to PostCalendar v8.0.0+ only.

PostCalendar hooks have been updated in version 8.0.0 and require a refactoring of provided plugin classes. If your module supplies a plugin, please be sure to update it as outlined here.

PostCalendar provides create, update and delete hooks that can be utilized and customized by any modules that wishes to create a calendar event along with their own item creation. PostCalendar ships with an example of this technology: News (and Generic). You can find these examples as follows:

modules/PostCalendar/lib/PostCalendar/PostCalendarEvent/News.php
modules/PostCalendar/lib/PostCalendar/PostCalendarEvent/Generic.php

Each of these functions could (and should) be located in their respective module's own directory. Create the following directory structure with your module:

modules/<yourmodulename>/lib/<yourmodulename>/PostCalendarEvent/<yourmodulename>.php

within this file, create a class which extends the base class like so:

class <yourmodulename>_PostCalendarEvent_<yourmodulename> extends PostCalendar_PostCalendarEvent_AbstractBase

within that class, you must create at least the following required method:

public function makeEvent()

Again, please see the PostCalendar module for examples.

Your makeEvent method must set the following properties that will form the event:

    title
    hometext
    eventStart
    eventEnd
    sharing

Use the provided Setter methods to set the property values.

There are additional class properties that can be set if you wish. Please see the Base class for additional information.

modules/PostCalendar/lib/PostCalendar/PostCalendarEvent/Base.php

Clone this wiki locally