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
= ""
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