Xataface Calendar Module 0.1
Full Calendar for Xataface
Public Member Functions
DelegateClass Interface Reference

This interface defines the delegate class methods that are supported by the calendar module. This interface is not *real* it is only used for documentation purposes. More...

Public Member Functions

 getColor (Dataface_Record $record)
 Returns the foreground color for a record when it is rendered in the calendar.
 getBgColor (Dataface_Record $record)
 Returns the background color for a record when it is rendered in the calendar.
 calendar__decorateEvent (Dataface_Record $record, array &$eventData)
 Modifies the event data for a record just before it is sent to the calendar for rendering. The event data will be converted to JSON and returned to the calendar for rendering. This data follows the structure of, and will ultimately be wrapped by, the full calendar event object.

Detailed Description

This interface defines the delegate class methods that are supported by the calendar module. This interface is not *real* it is only used for documentation purposes.

See also:
Xataface Table Delegate Class for the full interface of available delegate classes in Xataface.
Delegate Classes section of the Xataface Getting Started tutorial if you are not familiar with delegate classes.
The Delegate Classes wiki page for more information about delegate classes.

Definition at line 14 of file DelegateClass.php.


Member Function Documentation

calendar__decorateEvent ( Dataface_Record $  record,
array &$  eventData 
)

Modifies the event data for a record just before it is sent to the calendar for rendering. The event data will be converted to JSON and returned to the calendar for rendering. This data follows the structure of, and will ultimately be wrapped by, the full calendar event object.

Returns:
void There is no output for this method. The $eventData array should be passed by reference so that data can be modified in place.
Example
Adding a CSS class to each event so that events can be referenced by tool id in javascript:
 function calendar__decorateEvent(Dataface_Record $record, &$event){
           if ( !$event['className'] ) $event['className'] = '';
           $event['className'] .= 'event-for-tool-'.$record->val('tool_id');
 }
getBgColor ( Dataface_Record $  record)

Returns the background color for a record when it is rendered in the calendar.

Parameters:
Dataface_RecordThe record that is to be rendered.
Returns:
string The background color as a string. This should be in a form that can be accepted by CSS (e.g. as hex, an english name, or as an RGB value).
Example
 function getBgColor($record){
     if ( $record->val('country') == 'Canada') return 'red';
     else return 'rgb(0,0,255)';
 }
getColor ( Dataface_Record $  record)

Returns the foreground color for a record when it is rendered in the calendar.

Parameters:
Dataface_RecordThe record that is to be rendered.
Returns:
string The foreground color as a string. This should be in a form that can be accepted by CSS (e.g. as #ededed, or an english name e.g. "blue", or an RGB value e.g. rgb(255,255,255)
Example
 function getColor($record){
     if ( $record->val('status') == 'Approved' ) return 'black';
     else return '#ccc';
 }

The documentation for this interface was generated from the following file:
 All Data Structures Files Functions Variables