Methods summary
public static
string
#
includeJSVars ( )
Outputs the javascript code which defines all javascript variables
that are dependent on the local user's account.
Outputs the javascript code which defines all javascript variables
that are dependent on the local user's account.
Returns
string
Private
public static
array
#
permissionToJson ( Horde_Perms_Permission $perm )
Converts a permission object to a json object.
Converts a permission object to a json object.
This methods filters out any permissions for the owner and converts the
user name if necessary.
Parameters
$perm
A permission object.
Returns
array
A hash suitable for json.
public static
array
#
listAlarms ( Horde_Date $date , array $calendars , boolean $fullevent = false )
Returns all the alarms active on a specific date.
Returns all the alarms active on a specific date.
Parameters
$date
The date to check for alarms.
$calendars
The calendars to check for events.
$fullevent
<p>Whether to return complete alarm objects or
only alarm IDs.</p>
Returns
array
The alarms active on the date. A hash with calendar names
as keys and arrays of events or event ids as values.
Throws
public static
array
#
search ( object $query , string $calendar = null )
Searches for events with the given properties.
Searches for events with the given properties.
Parameters
$query
The search query.
$calendar
<p>The calendar to search in the form
"Driver|calendar_id".</p>
Returns
array
The events.
Throws
public static
#
mergeEvents ( array & $results , array $events )
Merges results from two listEvents() result sets.
Merges results from two listEvents() result sets.
Parameters
$results
First list of events.
$events
List of events to be merged into the first one.
public static
#
addEvents ( mixed & $results , mixed & $event , mixed $startDate , mixed $endDate , mixed $showRecurrence , mixed $json , mixed $coverDates = true )
Calculates recurrences of an event during a certain period.
Calculates recurrences of an event during a certain period.
public static
#
addCoverDates ( array & $results , Kronolith_Event
$event , Horde_Date $eventStart , Horde_Date $eventEnd , boolean $json )
Adds an event to all the days it covers.
Adds an event to all the days it covers.
Parameters
$results
$result The current result list.
$event
An event object.
$eventStart
<p>The event's start at the actual
recurrence.</p>
$eventEnd
The event's end at the actual recurrence.
$json
<p>Store the results of the events' toJson()
method?</p>
public static
#
addSearchEvents ( array & $events , Kronolith_Event
$event , stdClass $query , boolean $json )
Adds an event to set of search results.
Adds an event to set of search results.
Parameters
$events
<p>The list of events to update with the new
event.</p>
$event
An event from a search result.
$query
A search query.
$json
<p>Store the results of the events' toJson()
method?</p>
public static
integer
#
countEvents ( )
Returns the number of events in calendars that the current user owns.
Returns the number of events in calendars that the current user owns.
Returns
integer
The number of events.
public
array
#
quickAdd ( string $text , string $calendar = null )
Imports an event parsed from a string.
Imports an event parsed from a string.
Parameters
$text
The text to parse into an event
$calendar
<p>The calendar into which the event will be
imported. If 'null', the user's default
calendar will be used.</p>
Returns
array
The UID of all events that were added.
Throws
public static
public static
#
initEventMap ( array $params )
Initialize the event map.
Initialize the event map.
Parameters
$params
Parameters to pass the the map
public static
#
getUserName ( mixed $uid )
Returns the real name, if available, of a user.
Returns the real name, if available, of a user.
public static
#
getUserEmail ( mixed $uid )
Returns the email address, if available, of a user.
Returns the email address, if available, of a user.
public static
#
isUserEmail ( mixed $uid , mixed $email )
Checks if an email address belongs to a user.
Checks if an email address belongs to a user.
public static
string
#
recurToString ( integer $type )
Maps a Kronolith recurrence value to a translated string suitable for
display.
Maps a Kronolith recurrence value to a translated string suitable for
display.
Parameters
$type
<p>The recurrence value; one of the
Horde_Date_Recurrence::RECUR_XXX constants.</p>
Returns
string
The translated displayable recurrence value string.
public static
string
#
statusToString ( integer $status )
Maps a Kronolith meeting status string to a translated string suitable
for display.
Maps a Kronolith meeting status string to a translated string suitable
for display.
Parameters
$status
<p>The meeting status; one of the
Kronolith::STATUS_XXX constants.</p>
Returns
string
The translated displayable meeting status string.
public static
string
#
responseToString ( integer $response )
Maps a Kronolith attendee response string to a translated string
suitable for display.
Maps a Kronolith attendee response string to a translated string
suitable for display.
Parameters
$response
<p>The attendee response; one of the
Kronolith::RESPONSE_XXX constants.</p>
Returns
string
The translated displayable attendee response string.
public static
string
#
partToString ( integer $part )
Maps a Kronolith attendee participation string to a translated string
suitable for display.
Maps a Kronolith attendee participation string to a translated string
suitable for display.
Parameters
$part
<p>The attendee participation; one of the
Kronolith::PART_XXX constants.</p>
Returns
string
The translated displayable attendee participation
string.
public static
string
#
responseFromICal ( string $response )
Maps an iCalendar attendee response string to the corresponding
Kronolith value.
Maps an iCalendar attendee response string to the corresponding
Kronolith value.
Parameters
$response
The attendee response.
Returns
string
The Kronolith response value.
public static
string
#
buildStatusWidget ( string $name , string $current = Kronolith::STATUS_CONFIRMED
, string $any = false )
Builds the HTML for an event status widget.
Builds the HTML for an event status widget.
Parameters
$name
The name of the widget.
$current
The selected status value.
$any
Whether an 'any' item should be added
Returns
string
The HTML widget.
public static
array
#
listInternalCalendars ( boolean $owneronly = false , integer $permission = Horde_Perms::SHOW )
Returns all internal calendars a user has access to, according
to several parameters/permission levels.
Returns all internal calendars a user has access to, according
to several parameters/permission levels.
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
<p>Only return calenders that this user owns?
Defaults to false.</p>
$permission
The permission to filter calendars by.
Returns
array
The calendar list.
public static
array
#
listCalendars ( boolean $permission = Horde_Perms::SHOW , boolean $display = false , integer $flat = true )
Returns all calendars a user has access to, according to several
parameters/permission levels.
Returns all calendars a user has access to, according to several
parameters/permission levels.
Parameters
$permission
<p>$owneronly Only return calenders that this user owns?
Defaults to false.</p>
$display
<p>Only return calendars that are supposed to
be displayed per configuration and user
preference.</p>
$flat
$permission The permission to filter calendars by.
Returns
array
The calendar list.
public static
mixed
#
getDefaultCalendar ( integer $permission = Horde_Perms::SHOW , boolean $owner_only = false )
Returns the default calendar for the current user at the specified
permissions level.
Returns the default calendar for the current user at the specified
permissions level.
Parameters
$permission
Horde_Perms constant for permission level required.
$owner_only
Only consider owner-owned calendars.
Returns
mixed
The calendar id, or false if none found.
public static
array
#
getSyncCalendars ( boolean $prune = false )
Returns the calendars that should be used for syncing.
Returns the calendars that should be used for syncing.
Parameters
$prune
<p>Remove calendar ids from the sync list that no
longer exist. The values are pruned <em>after</em> the
results are passed back to the client to give
sync clients a chance to remove their entries.</p>
Returns
array
An array of calendar ids
public static
boolean
#
hasPermission ( string $calendar , integer $perm )
Returns whether the current user has certain permissions on a calendar.
Returns whether the current user has certain permissions on a calendar.
Parameters
$calendar
A calendar id.
$perm
A Horde_Perms permission mask.
Returns
boolean
True if the current user has the requested permissions.
Since
Kronolith 3.0.6
public static
Horde_Share
#
addShare ( array $info )
Creates a new share.
Parameters
$info
Hash with calendar information.
Returns
Horde_Share
The new share.
Throws
public static
#
updateShare ( Horde_Share & $calendar , array $info )
Updates an existing share.
Updates an existing share.
Parameters
$calendar
$share The share to update.
$info
Hash with calendar information.
Throws
public static
#
deleteShare ( Horde_Share $calendar )
Deletes a share.
Parameters
$calendar
The share to delete.
Throws
public static
array
#
readPermsForm ( Horde_Share_Object $share )
Reads a submitted permissions form and updates the share permissions.
Reads a submitted permissions form and updates the share permissions.
Parameters
$share
The share to update.
Returns
array
A list of error messages.
Throws
public static
#
subscribeRemoteCalendar ( array & $info , string $update = false )
Subscribes to or updates a remote calendar.
Subscribes to or updates a remote calendar.
Parameters
$info
Hash with calendar information.
$update
<p>If present, the original URL of the calendar to
update.</p>
Throws
public static
array
#
unsubscribeRemoteCalendar ( string $url )
Unsubscribes from a remote calendar.
Unsubscribes from a remote calendar.
Parameters
Returns
array
Hash with the deleted calendar's information.
Throws
public static
string
#
feedUrl ( string $calendar )
Returns the feed URL for a calendar.
Returns the feed URL for a calendar.
Parameters
$calendar
A calendar name.
Returns
string
The calendar's feed URL.
public static
string
#
embedCode ( string $calendar )
Returs the HTML/javascript snippit needed to embed a calendar in an
external website.
Returs the HTML/javascript snippit needed to embed a calendar in an
external website.
Parameters
$calendar
A calendar name.
Returns
string
The calendar's embed snippit.
public static
array
#
parseAttendees ( string $newAttendees )
Parses a comma separated list of names and e-mail addresses into a list
of attendee hashes.
Parses a comma separated list of names and e-mail addresses into a list
of attendee hashes.
Parameters
$newAttendees
A comma separated attendee list.
Returns
array
The attendee list with e-mail addresses as keys and
attendee information as values.
public static
string
#
attendeeList ( )
Returns a comma separated list of attendees and resources
Returns a comma separated list of attendees and resources
Returns
string
Attendee/Resource list.
public static
#
sendITipNotifications ( Kronolith_Event
$event , Horde_Notification_Handler $notification , integer $action , Horde_Date $instance = null )
Sends out iTip event notifications to all attendees of a specific
event.
Sends out iTip event notifications to all attendees of a specific
event.
Can be used to send event invitations, event updates as well as event
cancellations.
Parameters
$event
The event in question.
$notification
A notification object used to show result status.
$action
<p>The type of notification to send. One of the Kronolith::ITIP_*
values.</p>
$instance
<p>If cancelling a single instance of a recurring event, the date of
this intance.</p>
public static
#
sendNotification ( Kronolith_Event
$event , string $action )
Sends email notifications that a event has been added, edited, or
deleted to users that want such notifications.
Sends email notifications that a event has been added, edited, or
deleted to users that want such notifications.
Parameters
$event
An event.
$action
<p>The event action. One of "add", "edit",
or "delete".</p>
Throws
public static
public static
mixed
#
_notificationPref ( string $user , string $mode , string $calendar = null )
Returns whether a user wants email notifications for a calendar.
Returns whether a user wants email notifications for a calendar.
Parameters
$user
A user name.
$mode
<p>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.</p>
$calendar
The name of the calendar if mode is "read".
Returns
mixed
The user's email, time, and language preferences if they
want a notification for this calendar.
public static
Horde_Mime_Part
#
buildMimeMessage ( Horde_View $view , string $template , Horde_Mime_Part $image )
Builds the body MIME part of a multipart message.
Builds the body MIME part of a multipart message.
Parameters
$view
<p>A view to render the HTML and plain text
templates for the messate.</p>
$template
The template base name for the view.
$image
The MIME part of a related image.
Returns
Horde_Mime_Part
A multipart/alternative MIME part.
public static
Horde_Mime_Part
#
getImagePart ( string $file )
Returns a MIME part for an image to be embedded into a HTML document.
Returns a MIME part for an image to be embedded into a HTML document.
Parameters
$file
An image file name.
Returns
Horde_Mime_Part
A MIME part representing the image.
public static
Horde_Date
public static
Horde_Date
#
parseDate ( string $date , boolean $withtime = true )
Parses a complete date-time string into a Horde_Date object.
Parses a complete date-time string into a Horde_Date object.
Parameters
$date
The date-time string to parse.
$withtime
Whether time is included in the string.
Returns
Horde_Date
The parsed date.
Throws
Horde_Date_Exception
public static
#
tabs ( string $tabname = null )
public static
public static
Kronolith_Driver
#
getDriver ( string $driver = null , string $calendar = null )
Attempts to return a single, concrete Kronolith_Driver instance based
on a driver name.
Attempts to return a single, concrete Kronolith_Driver instance based
on a driver name.
This singleton method automatically retrieves all parameters required
for the specified driver.
Parameters
$driver
<p>The type of concrete Kronolith_Driver subclass
to return.</p>
$calendar
<p>The calendar name. The format depends on the
driver being used.</p>
Returns
Throws
public static
#
getRemoteParams ( mixed $calendar )
Check for HTTP authentication credentials
Check for HTTP authentication credentials
public static
#
getView ( string $view )
Get a named Kronolith_View_* object and load it with the
appropriate date parameters.
Get a named Kronolith_View_* object and load it with the
appropriate date parameters.
Parameters
$view
The name of the view.
public static
#
viewShowLocation ( )
Should we show event location, based on the show_location pref?
Should we show event location, based on the show_location pref?
public static
#
viewShowTime ( )
Should we show event time, based on the show_time preference?
Should we show event time, based on the show_time preference?
public static
string
#
backgroundColor ( array|Horde_Share_Object $calendar )
Returns the background color for a calendar.
Returns the background color for a calendar.
Parameters
$calendar
<p>A calendar share or a hash
from a remote calender
definition.</p>
Returns
string
A HTML color code.
public static
string
#
foregroundColor ( array|Horde_Share_Object|string $calendar )
Returns the foreground color for a calendar or a background color.
Returns the foreground color for a calendar or a background color.
Parameters
$calendar
<p>A color string, a
calendar share or a
hash from a remote
calender definition.</p>
Returns
string
A HTML color code.
public static
string
#
getCSSColors ( array|Horde_Share_Object $calendar , boolean $with_attribute = true )
Returns the CSS color definition for a calendar.
Returns the CSS color definition for a calendar.
Parameters
$calendar
<p>A calendar share or a hash
from a remote calender
definition.</p>
$with_attribute
<p>Whether to wrap the colors
inside a "style" attribute.</p>
Returns
string
A CSS string with color definitions.
public static
#
showAjaxView ( )
Returns whether to display the ajax view.
Returns whether to display the ajax view.
return boolean True if the ajax view should be displayed.
public static
array
#
sortEvents ( array $days )
Sorts an event list.
Parameters
$days
A list of days with events.
Returns
array
The sorted day list.
Since
Kronolith 3.0.5
public static
Kronolith_Tagger
#
getTagger ( )
Obtain a Kronolith_Tagger instance
Obtain a Kronolith_Tagger instance
Returns
public static
Kronolith_Resource
|Horde_Share_Object
#
getInternalCalendar ( string $target )
Obtain an internal calendar. Use this where we don't know if we will
have a Horde_Share or a Kronolith_Resource based calendar.
Obtain an internal calendar. Use this where we don't know if we will
have a Horde_Share or a Kronolith_Resource based calendar.
Parameters
$target
The calendar id to retrieve.
Returns
Throws
public static
array
#
getAddressbookSearchParams ( )
Determines parameters needed to do an address search
Determines parameters needed to do an address search
Returns
array
An array with two keys: 'fields' and 'sources'.
public static
boolean
#
hasApiPermission ( string $api , integer $perm = Horde_Perms::READ )
Checks whether an API (application) exists and the user has permission
to access it.
Checks whether an API (application) exists and the user has permission
to access it.
Parameters
$api
The API (application) to check.
$perm
The permission to check.
Returns
boolean
True if the API can be accessed.
public static
#
removeUserEvents ( string $user )
Remove all events owned by the specified user in all calendars.
Remove all events owned by the specified user in all calendars.
Parameters
$user
The user name to delete events for.
Throws
Since
Kronolith 3.0.10