Kronolith
in package
Kronolith base library.
The Kronolith class provides functionality common to all of Kronolith.
Tags
Table of Contents
- ALL_CALENDARS = 'allCalendars'
- ALL_EXTERNAL_CALENDARS = 'allExternal'
- ALL_HOLIDAYS = 'allHolidays'
- ALL_REMOTE_CALENDARS = 'allRemote'
- ALL_RESOURCE_CALENDARS = 'allResource'
- DISPLAY_CALENDARS = 'displayCalendars'
- Calendar Manager Constants
- DISPLAY_EXTERNAL_CALENDARS = 'displayExternal'
- DISPLAY_HOLIDAYS = 'displayHolidays'
- DISPLAY_REMOTE_CALENDARS = 'displayRemote'
- DISPLAY_RESOURCE_CALENDARS = 'displayResource'
- ITIP_CANCEL = 2
- ITIP_REPLY = 3
- ITIP_REQUEST = 1
- iTip requests
- PART_IGNORE = 4
- PART_NONE = 3
- PART_OPTIONAL = 2
- PART_REQUIRED = 1
- Attendee status
- PERMS_DELEGATE = 1024
- The event can be delegated.
- RANGE_THISANDFUTURE = 'THISANDFUTURE'
- RESPONSE_ACCEPTED = 2
- RESPONSE_DECLINED = 3
- RESPONSE_NONE = 1
- Invitation responses
- RESPONSE_TENTATIVE = 4
- SHARE_TYPE_RESOURCE = 2
- SHARE_TYPE_USER = 1
- Share Types
- STATUS_CANCELLED = 3
- STATUS_CONFIRMED = 2
- STATUS_FREE = 4
- STATUS_NONE = 0
- Event status
- STATUS_TENTATIVE = 1
- VFS_PATH = '.horde/kronolith/documents'
- The virtual path to use for VFS data.
- $_tagger : Kronolith_Tagger
- _notificationPref() : array<string|int, mixed>|boolen
- Returns whether a user wants email notifications for a calendar.
- addCalendarLinks() : mixed
- Adds <link> tags for calendar feeds to the HTML header.
- addCoverDates() : mixed
- Adds an event to all the days it covers.
- addEvents() : mixed
- Calculates recurrences of an event during a certain period.
- addSearchEvents() : mixed
- Adds an event to set of search results.
- addShare() : Horde_Share
- Creates a new share.
- attendeeList() : string
- Returns a comma separated list of attendees and resources
- backgroundColor() : string
- Returns the background color for a calendar.
- buildMimeMessage() : Horde_Mime_Part
- Builds the body MIME part of a multipart message.
- buildStatusWidget() : string
- Builds the HTML for an event status widget.
- countEvents() : int
- Returns the number of events in calendars that the current user owns.
- currentDate() : Horde_Date
- deleteShare() : mixed
- Deletes a share and removes all events associated with it.
- displayedCalendars() : array<string|int, mixed>
- Returns a list of currently displayed calendars.
- embedCode() : string
- Returs the HTML/javascript snippit needed to embed a calendar in an external website.
- eventTabs() : mixed
- feedUrl() : string
- Returns the feed URL for a calendar.
- foregroundColor() : string
- Returns the foreground color for a calendar or a background color.
- getAddressbookSearchParams() : array<string|int, mixed>
- Determines parameters needed to do an address search
- getCalendar() : Kronolith_Calendar
- Returns a Kronolith_Calendar object for a driver instance.
- getCSSColors() : string
- Returns the CSS color definition for a calendar.
- getDefaultCalendar() : string
- Returns the default calendar for the current user at the specified permissions level.
- getDriver() : Kronolith_Driver
- Attempts to return a single, concrete Kronolith_Driver instance based on a driver name.
- getImagePart() : Horde_Mime_Part
- Returns a MIME part for an image to be embedded into a HTML document.
- getInternalCalendar() : Kronolith_Resource|Horde_Share_Object
- Obtain an internal calendar. Use this where we don't know if we will have a Horde_Share or a Kronolith_Resource based calendar.
- getLabel() : string
- Returns the label to be used for a calendar.
- getRemoteParams() : mixed
- Check for HTTP authentication credentials
- getSyncCalendars() : array<string|int, mixed>
- Returns the calendars that should be used for syncing.
- getTagger() : Kronolith_Tagger
- Obtain a Kronolith_Tagger instance
- getUserEmail() : mixed
- Returns the email address, if available, of a user.
- getUserName() : mixed
- Returns the real name, if available, of a user.
- getView() : mixed
- Get a named Kronolith_View_* object and load it with the appropriate date parameters.
- hasApiPermission() : bool
- Checks whether an API (application) exists and the user has permission to access it.
- hasPermission() : bool
- Returns whether the current user has certain permissions on a calendar.
- initialize() : mixed
- Initial app setup code.
- isUserEmail() : mixed
- Checks if an email address belongs to a user.
- listAlarms() : array<string|int, mixed>
- Returns all the alarms active on a specific date.
- listCalendars() : array<string|int, mixed>
- Returns all calendars a user has access to, according to several parameters/permission levels.
- listEvents() : array<string|int, mixed>
- Returns all the events that happen each day within a time period
- listInternalCalendars() : array<string|int, mixed>
- Returns all internal calendars a user has access to, according to several parameters/permission levels.
- listShareUsers() : array<string|int, mixed>
- Returns a list of user with read access to a share.
- mergeEvents() : mixed
- Merges results from two listEvents() result sets.
- notifyOfResourceRejection() : mixed
- Check for resource declines and push notice to stack if found.
- parseDate() : Horde_Date
- Parses a complete date-time string into a Horde_Date object.
- partToString() : string
- Maps a Kronolith attendee participation string to a translated string suitable for display.
- permissionToJson() : array<string|int, mixed>
- Converts a permission object to a json object.
- quickAdd() : array<string|int, mixed>
- Imports an event parsed from a string.
- randomColor() : string
- Returns a random CSS color.
- readPermsForm() : array<string|int, mixed>
- Reads a submitted permissions form and updates the share permissions.
- recurToString() : string
- Maps a Kronolith recurrence value to a translated string suitable for display.
- removeUserEvents() : mixed
- Remove all events owned by the specified user in all calendars.
- responseFromICal() : string
- Maps an iCalendar attendee response string to the corresponding Kronolith value.
- responseToString() : string
- Maps a Kronolith attendee response string to a translated string suitable for display.
- search() : array<string|int, mixed>
- Searches for events with the given properties.
- sendITipNotifications() : mixed
- Sends out iTip event notifications to all attendees of a specific event.
- sendNotification() : mixed
- Sends email notifications that a event has been added, :q edited, or deleted to users that want such notifications.
- showAjaxView() : mixed
- Returns whether to display the ajax view.
- sortEvents() : array<string|int, mixed>
- Sorts an event list.
- statusToString() : string
- Maps a Kronolith meeting status string to a translated string suitable for display.
- subscribeRemoteCalendar() : mixed
- Subscribes to or updates a remote calendar.
- tabs() : mixed
- toTimeslice() : mixed
- Exports an event to a timeslice.
- unsubscribeRemoteCalendar() : array<string|int, mixed>
- Unsubscribes from a remote calendar.
- updateShare() : mixed
- Updates an existing share.
- validateUserAttendee() : mixed
- Return Kronolith_Attendee object for a local user.
- viewShowLocation() : mixed
- Should we show event location, based on the show_location pref?
- viewShowTime() : mixed
- Should we show event time, based on the show_time preference?
- _sortEventStartTime() : mixed
- Used with usort() to sort events based on their start times.
Constants
ALL_CALENDARS
public
mixed
ALL_CALENDARS
= 'allCalendars'
ALL_EXTERNAL_CALENDARS
public
mixed
ALL_EXTERNAL_CALENDARS
= 'allExternal'
ALL_HOLIDAYS
public
mixed
ALL_HOLIDAYS
= 'allHolidays'
ALL_REMOTE_CALENDARS
public
mixed
ALL_REMOTE_CALENDARS
= 'allRemote'
ALL_RESOURCE_CALENDARS
public
mixed
ALL_RESOURCE_CALENDARS
= 'allResource'
DISPLAY_CALENDARS
Calendar Manager Constants
public
mixed
DISPLAY_CALENDARS
= 'displayCalendars'
DISPLAY_EXTERNAL_CALENDARS
public
mixed
DISPLAY_EXTERNAL_CALENDARS
= 'displayExternal'
DISPLAY_HOLIDAYS
public
mixed
DISPLAY_HOLIDAYS
= 'displayHolidays'
DISPLAY_REMOTE_CALENDARS
public
mixed
DISPLAY_REMOTE_CALENDARS
= 'displayRemote'
DISPLAY_RESOURCE_CALENDARS
public
mixed
DISPLAY_RESOURCE_CALENDARS
= 'displayResource'
ITIP_CANCEL
public
mixed
ITIP_CANCEL
= 2
ITIP_REPLY
public
mixed
ITIP_REPLY
= 3
ITIP_REQUEST
iTip requests
public
mixed
ITIP_REQUEST
= 1
PART_IGNORE
public
mixed
PART_IGNORE
= 4
PART_NONE
public
mixed
PART_NONE
= 3
PART_OPTIONAL
public
mixed
PART_OPTIONAL
= 2
PART_REQUIRED
Attendee status
public
mixed
PART_REQUIRED
= 1
PERMS_DELEGATE
The event can be delegated.
public
mixed
PERMS_DELEGATE
= 1024
RANGE_THISANDFUTURE
public
mixed
RANGE_THISANDFUTURE
= 'THISANDFUTURE'
RESPONSE_ACCEPTED
public
mixed
RESPONSE_ACCEPTED
= 2
RESPONSE_DECLINED
public
mixed
RESPONSE_DECLINED
= 3
RESPONSE_NONE
Invitation responses
public
mixed
RESPONSE_NONE
= 1
RESPONSE_TENTATIVE
public
mixed
RESPONSE_TENTATIVE
= 4
SHARE_TYPE_RESOURCE
public
mixed
SHARE_TYPE_RESOURCE
= 2
SHARE_TYPE_USER
Share Types
public
mixed
SHARE_TYPE_USER
= 1
STATUS_CANCELLED
public
mixed
STATUS_CANCELLED
= 3
STATUS_CONFIRMED
public
mixed
STATUS_CONFIRMED
= 2
STATUS_FREE
public
mixed
STATUS_FREE
= 4
STATUS_NONE
Event status
public
mixed
STATUS_NONE
= 0
STATUS_TENTATIVE
public
mixed
STATUS_TENTATIVE
= 1
VFS_PATH
The virtual path to use for VFS data.
public
mixed
VFS_PATH
= '.horde/kronolith/documents'
Properties
$_tagger
private
static Kronolith_Tagger
$_tagger
Methods
_notificationPref()
Returns whether a user wants email notifications for a calendar.
public
static _notificationPref(string $user, string $mode[, string $calendar = null ]) : array<string|int, mixed>|boolen
Parameters
- $user : string
-
A user name.
- $mode : string
-
The check "mode". If "owner", the method checks if the user wants notifications only for calendars he owns. If "read", the method checks if the user wants notifications for all calendars he has read access to, or only for shown calendars and the specified calendar is currently shown.
- $calendar : string = null
-
The name of the calendar if mode is "read".
Tags
Return values
array<string|int, mixed>|boolen —The user's email, time, and language preferences if they want a notification for this calendar. False if no notification should be sent.
addCalendarLinks()
Adds <link> tags for calendar feeds to the HTML header.
public
static addCalendarLinks() : mixed
Return values
mixed —addCoverDates()
Adds an event to all the days it covers.
public
static addCoverDates(mixed &$results, Kronolith_Event $event, Horde_Date $eventStart, Horde_Date $eventEnd, bool $json[, Horde_Date $originalStart = null ][, Horde_Date $originalEnd = null ][, Horde_Date $endDate = null ]) : mixed
Parameters
- $results : mixed
- $event : Kronolith_Event
-
An event object.
- $eventStart : Horde_Date
-
The event's start of the actual recurrence.
- $eventEnd : Horde_Date
-
The event's end of the actual recurrence.
- $json : bool
-
Store the results of the events' toJson() method?
- $originalStart : Horde_Date = null
-
The actual starting time of a single event spanning multiple days.
- $originalEnd : Horde_Date = null
-
The actual ending time of a single event spanning multiple days.
- $endDate : Horde_Date = null
Return values
mixed —addEvents()
Calculates recurrences of an event during a certain period.
public
static addEvents(mixed &$results, mixed &$event, mixed $startDate, mixed $endDate, mixed $showRecurrence, mixed $json[, mixed $coverDates = true ]) : mixed
Parameters
- $results : mixed
- $event : mixed
- $startDate : mixed
- $endDate : mixed
- $showRecurrence : mixed
- $json : mixed
- $coverDates : mixed = true
Return values
mixed —addSearchEvents()
Adds an event to set of search results.
public
static addSearchEvents(array<string|int, mixed> &$events, Kronolith_Event $event, stdClass $query, bool $json) : mixed
Parameters
- $events : array<string|int, mixed>
-
The list of events to update with the new event.
- $event : Kronolith_Event
-
An event from a search result.
- $query : stdClass
-
A search query.
- $json : bool
-
Store the results of the events' toJson() method?
Return values
mixed —addShare()
Creates a new share.
public
static addShare(array<string|int, mixed> $info) : Horde_Share
Parameters
- $info : array<string|int, mixed>
-
Hash with calendar information.
Tags
Return values
Horde_Share —The new share.
attendeeList()
Returns a comma separated list of attendees and resources
public
static attendeeList() : string
Return values
string —Attendee/Resource list.
backgroundColor()
Returns the background color for a calendar.
public
static backgroundColor(array<string|int, mixed>|Horde_Share_Object $calendar) : string
Parameters
- $calendar : array<string|int, mixed>|Horde_Share_Object
-
A calendar share or a hash from a remote calender definition.
Return values
string —A HTML color code.
buildMimeMessage()
Builds the body MIME part of a multipart message.
public
static buildMimeMessage(Horde_View $view, string $template, Horde_Mime_Part $image) : Horde_Mime_Part
Parameters
- $view : Horde_View
-
A view to render the HTML and plain text templates for the messate.
- $template : string
-
The template base name for the view.
- $image : Horde_Mime_Part
-
The MIME part of a related image.
Return values
Horde_Mime_Part —A multipart/alternative MIME part.
buildStatusWidget()
Builds the HTML for an event status widget.
public
static buildStatusWidget(string $name[, string $current = self::STATUS_CONFIRMED ][, string $any = false ]) : string
Parameters
- $name : string
-
The name of the widget.
- $current : string = self::STATUS_CONFIRMED
-
The selected status value.
- $any : string = false
-
Whether an 'any' item should be added
Return values
string —The HTML
countEvents()
Returns the number of events in calendars that the current user owns.
public
static countEvents() : int
Return values
int —The number of events.
currentDate()
public
static currentDate() : Horde_Date
Return values
Horde_Date —deleteShare()
Deletes a share and removes all events associated with it.
public
static deleteShare(Horde_Share $calendar) : mixed
Parameters
- $calendar : Horde_Share
-
The share to delete.
Tags
Return values
mixed —displayedCalendars()
Returns a list of currently displayed calendars.
public
static displayedCalendars() : array<string|int, mixed>
Return values
array<string|int, mixed> —Currently displayed calendars.
embedCode()
Returs the HTML/javascript snippit needed to embed a calendar in an external website.
public
static embedCode(string $calendar) : string
Parameters
- $calendar : string
-
A calendar name.
Return values
string —The calendar's embed snippit.
eventTabs()
public
static eventTabs(string $tabname, Kronolith_Event $event) : mixed
Parameters
- $tabname : string
- $event : Kronolith_Event
Return values
mixed —feedUrl()
Returns the feed URL for a calendar.
public
static feedUrl(string $calendar) : string
Parameters
- $calendar : string
-
A calendar name.
Return values
string —The calendar's feed URL.
foregroundColor()
Returns the foreground color for a calendar or a background color.
public
static foregroundColor(array<string|int, mixed>|Horde_Share_Object|string $calendar) : string
Parameters
- $calendar : array<string|int, mixed>|Horde_Share_Object|string
-
A color string, a calendar share or a hash from a remote calender definition.
Return values
string —A HTML color code.
getAddressbookSearchParams()
Determines parameters needed to do an address search
public
static getAddressbookSearchParams() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array with two keys: 'fields' and 'sources'.
getCalendar()
Returns a Kronolith_Calendar object for a driver instance.
public
static getCalendar(Kronolith_Driver $driver) : Kronolith_Calendar
Parameters
- $driver : Kronolith_Driver
Tags
Return values
Kronolith_Calendar —The matching calendar instance.
getCSSColors()
Returns the CSS color definition for a calendar.
public
static getCSSColors(array<string|int, mixed>|Horde_Share_Object $calendar[, bool $with_attribute = true ]) : string
Parameters
- $calendar : array<string|int, mixed>|Horde_Share_Object
-
A calendar share or a hash from a remote calender definition.
- $with_attribute : bool = true
-
Whether to wrap the colors inside a "style" attribute.
Return values
string —A CSS string with color definitions.
getDefaultCalendar()
Returns the default calendar for the current user at the specified permissions level.
public
static getDefaultCalendar([int $permission = Horde_Perms::SHOW ][, bool $owner_only = false ]) : string
Parameters
- $permission : int = Horde_Perms::SHOW
-
Horde_Perms constant for permission level required.
- $owner_only : bool = false
-
Only consider owner-owned calendars.
Return values
string —The calendar id, or null if none.
getDriver()
Attempts to return a single, concrete Kronolith_Driver instance based on a driver name.
public
static getDriver([string $driver = null ][, string $calendar = null ]) : Kronolith_Driver
This singleton method automatically retrieves all parameters required for the specified driver.
Parameters
- $driver : string = null
-
The type of concrete Kronolith_Driver subclass to return.
- $calendar : string = null
-
The calendar name. The format depends on the driver being used.
Tags
Return values
Kronolith_Driver —The newly created concrete Kronolith_Driver instance.
getImagePart()
Returns a MIME part for an image to be embedded into a HTML document.
public
static getImagePart(string $file) : Horde_Mime_Part
Parameters
- $file : string
-
An image file name.
Return values
Horde_Mime_Part —A MIME part representing the image.
getInternalCalendar()
Obtain an internal calendar. Use this where we don't know if we will have a Horde_Share or a Kronolith_Resource based calendar.
public
static getInternalCalendar(string $target) : Kronolith_Resource|Horde_Share_Object
Parameters
- $target : string
-
The calendar id to retrieve.
Tags
Return values
Kronolith_Resource|Horde_Share_Object —getLabel()
Returns the label to be used for a calendar.
public
static getLabel(mixed $calendar) : string
Attaches the owner name of shared calendars if necessary.
Parameters
- $calendar : mixed
Return values
string —The calendar's label.
getRemoteParams()
Check for HTTP authentication credentials
public
static getRemoteParams(mixed $calendar) : mixed
Parameters
- $calendar : mixed
Return values
mixed —getSyncCalendars()
Returns the calendars that should be used for syncing.
public
static getSyncCalendars([bool $prune = false ]) : array<string|int, mixed>
Parameters
- $prune : bool = false
-
Remove calendar ids from the sync list that no longer exist. The values are pruned after the results are passed back to the client to give sync clients a chance to remove their entries.
Return values
array<string|int, mixed> —An array of calendar ids
getTagger()
Obtain a Kronolith_Tagger instance
public
static getTagger() : Kronolith_Tagger
Return values
Kronolith_Tagger —getUserEmail()
Returns the email address, if available, of a user.
public
static getUserEmail(mixed $uid) : mixed
Parameters
- $uid : mixed
Return values
mixed —getUserName()
Returns the real name, if available, of a user.
public
static getUserName(mixed $uid) : mixed
Parameters
- $uid : mixed
Return values
mixed —getView()
Get a named Kronolith_View_* object and load it with the appropriate date parameters.
public
static getView(string $view) : mixed
Parameters
- $view : string
-
The name of the view.
Return values
mixed —hasApiPermission()
Checks whether an API (application) exists and the user has permission to access it.
public
static hasApiPermission(string $api[, int $perm = Horde_Perms::READ ]) : bool
Parameters
- $api : string
-
The API (application) to check.
- $perm : int = Horde_Perms::READ
-
The permission to check.
Return values
bool —True if the API can be accessed.
hasPermission()
Returns whether the current user has certain permissions on a calendar.
public
static hasPermission(string $calendar, int $perm) : bool
Parameters
- $calendar : string
-
A calendar id.
- $perm : int
-
A Horde_Perms permission mask.
Return values
bool —True if the current user has the requested permissions.
initialize()
Initial app setup code.
public
static initialize() : mixed
Globals defined:
Return values
mixed —isUserEmail()
Checks if an email address belongs to a user.
public
static isUserEmail(string $uid, string $email) : mixed
Parameters
- $uid : string
-
user id to check
- $email : string
-
email address to check
Return values
mixed —listAlarms()
Returns all the alarms active on a specific date.
public
static listAlarms(Horde_Date $date, array<string|int, mixed> $calendars[, bool $fullevent = false ]) : array<string|int, mixed>
Parameters
- $date : Horde_Date
-
The date to check for alarms.
- $calendars : array<string|int, mixed>
-
The calendars to check for events.
- $fullevent : bool = false
-
Whether to return complete alarm objects or only alarm IDs.
Tags
Return values
array<string|int, mixed> —The alarms active on the date. A hash with calendar names as keys and arrays of events or event ids as values.
listCalendars()
Returns all calendars a user has access to, according to several parameters/permission levels.
public
static listCalendars([int $permission = Horde_Perms::SHOW ][, bool $display = false ]) : array<string|int, mixed>
Parameters
- $permission : int = Horde_Perms::SHOW
-
The permission to filter calendars by.
- $display : bool = false
-
Only return calendars that are supposed to be displayed per configuration and user preference.
Return values
array<string|int, mixed> —The calendar list.
listEvents()
Returns all the events that happen each day within a time period
public
static listEvents(Horde_Date $startDate, Horde_Date $endDate[, array<string|int, mixed> $calendars = null ][, array<string|int, mixed> $options = array() ]) : array<string|int, mixed>
Parameters
- $startDate : Horde_Date
-
The start of the time range.
- $endDate : Horde_Date
-
The end of the time range.
- $calendars : array<string|int, mixed> = null
-
The calendars to check for events.
- $options : array<string|int, mixed> = array()
-
Additional options:
- show_recurrence: (boolean) Return every instance of a recurring event? DEFAULT: false (Only return recurring events once inside $startDate - $endDate range)
- has_alarm: (boolean) Only return events with alarms. DEFAULT: false (Return all events)
- json: (boolean) Store the results of the event's toJson() method? DEFAULT: false
- cover_dates: (boolean) Add the events to all days that they cover? DEFAULT: true
- hide_exceptions: (boolean) Hide events that represent exceptions to a recurring event. DEFAULT: false (Do not hide exception events)
- fetch_tags: (boolean) Fetch tags for all events. DEFAULT: false (Do not fetch event tags)
Tags
Return values
array<string|int, mixed> —The events happening in this time period.
listInternalCalendars()
Returns all internal calendars a user has access to, according to several parameters/permission levels.
public
static listInternalCalendars([bool $owneronly = false ][, int $permission = Horde_Perms::SHOW ][, string $user = null ]) : array<string|int, mixed>
This method takes the $conf['share']['hidden'] setting into account. If this setting is enabled, even if requesting permissions different than SHOW, it will only return calendars that the user owns or has SHOW permissions for. For checking individual calendar's permissions, use hasPermission() instead.
Parameters
- $owneronly : bool = false
-
Only return calenders that this user owns? Defaults to false.
- $permission : int = Horde_Perms::SHOW
-
The permission to filter calendars by.
- $user : string = null
-
The user to list calendars for, if not the current.
Return values
array<string|int, mixed> —The calendar list.
listShareUsers()
Returns a list of user with read access to a share.
public
static listShareUsers(Horde_Share_Object $share) : array<string|int, mixed>
Parameters
- $share : Horde_Share_Object
-
A share object.
Return values
array<string|int, mixed> —A hash of share users.
mergeEvents()
Merges results from two listEvents() result sets.
public
static mergeEvents(array<string|int, mixed> &$results, array<string|int, mixed> $events) : mixed
Parameters
- $results : array<string|int, mixed>
-
First list of events.
- $events : array<string|int, mixed>
-
List of events to be merged into the first one.
Return values
mixed —notifyOfResourceRejection()
Check for resource declines and push notice to stack if found.
public
static notifyOfResourceRejection(Kronolith_Event $event) : mixed
Parameters
- $event : Kronolith_Event
Tags
Return values
mixed —parseDate()
Parses a complete date-time string into a Horde_Date object.
public
static parseDate(string $date[, bool $withtime = true ][, mixed $timezone = null ]) : Horde_Date
Parameters
- $date : string
-
The date-time string to parse.
- $withtime : bool = true
-
Whether time is included in the string.
- $timezone : mixed = null
Tags
Return values
Horde_Date —The parsed date.
partToString()
Maps a Kronolith attendee participation string to a translated string suitable for display.
public
static partToString(int $part) : string
Parameters
- $part : int
-
The attendee participation; one of the Kronolith::PART_XXX constants.
Return values
string —The translated displayable attendee participation string.
permissionToJson()
Converts a permission object to a json object.
public
static permissionToJson(Horde_Perms_Permission $perm[, bool $systemShare = false ]) : array<string|int, mixed>
This methods filters out any permissions for the owner and converts the user name if necessary.
Parameters
- $perm : Horde_Perms_Permission
-
A permission object.
- $systemShare : bool = false
-
Is this from a system share?
Return values
array<string|int, mixed> —A hash suitable for json.
quickAdd()
Imports an event parsed from a string.
public
quickAdd(string $text[, string $calendar = null ]) : array<string|int, mixed>
Parameters
- $text : string
-
The text to parse into an event
- $calendar : string = null
-
The calendar into which the event will be imported. If 'null', the user's default calendar will be used.
Tags
Return values
array<string|int, mixed> —The UID of all events that were added.
randomColor()
Returns a random CSS color.
public
static randomColor() : string
Return values
string —A random CSS color string.
readPermsForm()
Reads a submitted permissions form and updates the share permissions.
public
static readPermsForm(Horde_Share_Object|Kronolith_Resource_Base $share) : array<string|int, mixed>
Parameters
- $share : Horde_Share_Object|Kronolith_Resource_Base
-
The share to update.
Tags
Return values
array<string|int, mixed> —A list of error messages.
recurToString()
Maps a Kronolith recurrence value to a translated string suitable for display.
public
static recurToString(int $type) : string
Parameters
- $type : int
-
The recurrence value; one of the Horde_Date_Recurrence::RECUR_XXX constants.
Return values
string —The translated displayable recurrence value string.
removeUserEvents()
Remove all events owned by the specified user in all calendars.
public
static removeUserEvents(string $user) : mixed
Parameters
- $user : string
-
The user name to delete events for.
Tags
Return values
mixed —responseFromICal()
Maps an iCalendar attendee response string to the corresponding Kronolith value.
public
static responseFromICal(string $response) : string
Parameters
- $response : string
-
The attendee response.
Return values
string —The Kronolith response value.
responseToString()
Maps a Kronolith attendee response string to a translated string suitable for display.
public
static responseToString(int $response) : string
Parameters
- $response : int
-
The attendee response; one of the Kronolith::RESPONSE_XXX constants.
Return values
string —The translated displayable attendee response string.
search()
Searches for events with the given properties.
public
static search(object $query[, string $calendar = null ]) : array<string|int, mixed>
Parameters
- $query : object
-
The search query.
- $calendar : string = null
-
The calendar to search in the form "Driver|calendar_id".
Tags
Return values
array<string|int, mixed> —The events.
sendITipNotifications()
Sends out iTip event notifications to all attendees of a specific event.
public
static sendITipNotifications(Kronolith_Event $event, Horde_Notification_Handler $notification, int $action[, Horde_Date $instance = null ][, string $range = null ][, Kronolith_Attendee_List $cancellations = null ]) : mixed
Can be used to send event invitations, event updates as well as event cancellations.
Parameters
- $event : Kronolith_Event
-
The event in question.
- $notification : Horde_Notification_Handler
-
A notification object used to show result status.
- $action : int
-
The type of notification to send. One of the Kronolith::ITIP_* values.
- $instance : Horde_Date = null
-
If cancelling a single instance of a recurring event, the date of this instance.
- $range : string = null
-
The range parameter if this is a recurring event. Possible values are self::RANGE_THISANDFUTURE
- $cancellations : Kronolith_Attendee_List = null
-
If $action is 'CANCEL', but it is due to removing attendees and not canceling the entire event, these are the uninvited attendees and are the ONLY people that will receive the CANCEL iTIP. @since 4.2.10
Return values
mixed —sendNotification()
Sends email notifications that a event has been added, :q edited, or deleted to users that want such notifications.
public
static sendNotification(Kronolith_Event $event, string $action) : mixed
Parameters
- $event : Kronolith_Event
-
An event.
- $action : string
-
The event action. One of "add", "edit", or "delete".
Tags
Return values
mixed —showAjaxView()
Returns whether to display the ajax view.
public
static showAjaxView() : mixed
return boolean True if the ajax view should be displayed.
Return values
mixed —sortEvents()
Sorts an event list.
public
static sortEvents(array<string|int, mixed> $days) : array<string|int, mixed>
Parameters
- $days : array<string|int, mixed>
-
A list of days with events.
Return values
array<string|int, mixed> —The sorted day list.
statusToString()
Maps a Kronolith meeting status string to a translated string suitable for display.
public
static statusToString(int $status) : string
Parameters
- $status : int
-
The meeting status; one of the Kronolith::STATUS_XXX constants.
Return values
string —The translated displayable meeting status string.
subscribeRemoteCalendar()
Subscribes to or updates a remote calendar.
public
static subscribeRemoteCalendar(array<string|int, mixed> &$info[, string $update = false ]) : mixed
Parameters
- $info : array<string|int, mixed>
-
Hash with calendar information.
- $update : string = false
-
If present, the original URL of the calendar to update.
Tags
Return values
mixed —tabs()
public
static tabs(object $renderer) : mixed
Parameters
- $renderer : object
-
A Kronolith view.
Return values
mixed —toTimeslice()
Exports an event to a timeslice.
public
static toTimeslice(Kronolith_Event $event, int $type, string $client) : mixed
Parameters
- $event : Kronolith_Event
-
An event.
- $type : int
-
A job type ID.
- $client : string
-
A client ID.
Return values
mixed —unsubscribeRemoteCalendar()
Unsubscribes from a remote calendar.
public
static unsubscribeRemoteCalendar(string $url) : array<string|int, mixed>
Parameters
- $url : string
-
The calendar URL.
Tags
Return values
array<string|int, mixed> —Hash with the deleted calendar's information.
updateShare()
Updates an existing share.
public
static updateShare(mixed &$calendar, array<string|int, mixed> $info) : mixed
Parameters
- $calendar : mixed
- $info : array<string|int, mixed>
-
Hash with calendar information.
Tags
Return values
mixed —validateUserAttendee()
Return Kronolith_Attendee object for a local user.
public
static validateUserAttendee(string $user) : mixed
Parameters
- $user : string
-
The local username OR a user attendee string
Return values
mixed —Return the Kronolith_Attendee object for $user, or false if the auth backend supports user listing and the user is not found.
viewShowLocation()
Should we show event location, based on the show_location pref?
public
static viewShowLocation() : mixed
Return values
mixed —viewShowTime()
Should we show event time, based on the show_time preference?
public
static viewShowTime() : mixed
Return values
mixed —_sortEventStartTime()
Used with usort() to sort events based on their start times.
protected
static _sortEventStartTime(mixed $a, mixed $b) : mixed
Parameters
- $a : mixed
- $b : mixed