File/lib/api.php

Description

Turba external API interface.

$Horde: turba/lib/api.php,v 1.120.2.72 2010-12-28 17:34:57 jan Exp $

This file defines Turba's external API interface. Other applications can interact with Turba through this API.

Functions
_turba_addClient (line 1763)

Adds a client to the client source

void _turba_addClient ([array $attributes = array()])
  • array $attributes: Array containing the client attributes
_turba_addField (line 1824)

Sets the value of the specified attribute of a contact

  • return: The new __key value on success | PEAR_Error on failure
mixed _turba_addField ([string $address = ''], [string $name = ''], [string $field = ''], [string $value = ''], [string $source = ''])
  • string $address: Contact email address
  • string $name: Contact name
  • string $field: Field to update
  • string $value: Field value to set
  • string $source: Contact source
_turba_browse (line 434)
  • return: Content of the specified path.
array _turba_browse ([string $path = ''], [array $properties = array()])
  • string $path: The path of the tree to browse.
  • array $properties: The item properties to return. Defaults to 'name', 'icon', and 'browseable'.
_turba_clientFields (line 1727)

Returns the availabble client fields

  • return: An array describing the fields | PEAR_Error
mixed _turba_clientFields ()
_turba_commentCallback (line 276)

Callback for comment API

  • return: Name of object on success | false on failure
mixed _turba_commentCallback (integer $id)
  • integer $id: Internal data identifier
_turba_delete (line 1139)

Deletes a contact identified by UID.

  • return: Success or failure.
boolean _turba_delete (string|array $uid, [string|array $sources = null])
  • string|array $uid: Identify the contact to delete, either a single UID or an array.
  • string|array $sources: The source(s) from which the contact will be deleted.
_turba_deleteClient (line 1789)

Deletes a client

boolean _turba_deleteClient ([string $objectId = ''])
  • string $objectId: The unique id of the client
_turba_deleteField (line 1985)

Deletes a field value

boolean _turba_deleteField ([string $address = ''], [string $field = ''], [array $sources = array()])
  • string $address: Contact email address
  • string $field: Field to delete value for
  • array $sources: Sources to delete value from
_turba_export (line 1019)

Export a contact, identified by UID, in the requested contentType.

  • return: The requested data | PEAR_Error
mixed _turba_export (string $uid, mixed $contentType, [string|array $sources = null], [array $fields = null])
  • string $uid: Identify the contact to export.
  • mixed $contentType: What format should the data be in? Either a string with one of:
    • text/directory
    • text/vcard
    • text/x-vcard
    The first two produce a vcard3.0 (rfc2426), the second produces a vcard in old 2.1 format defined by imc.org
  • string|array $sources: The source(s) from which the contact will be exported.
  • array $fields: Hash of field names and SyncML_Property properties with the requested fields.
_turba_fields (line 367)

Returns a list of fields avaiable in a source.

  • return: An array describing the fields | PEAR_Error
mixed _turba_fields ([string $source = null])
  • string $source: The name of the source
_turba_getActionTimestamp (line 831)

Returns the timestamp of an operation for a given uid an action.

  • return: The timestamp for this action.
integer _turba_getActionTimestamp (string $uid, string $action, [string|array $sources = null])
  • string $uid: The uid to look for.
  • string $action: The action to check for - add, modify, or delete.
  • string|array $sources: The source(s) for which to retrieve the history.
_turba_getAllAttributeValues (line 1594)

Retrieves a list of all possible values of a field in specified source(s).

  • return: An array of fields and possible values | PEAR_Error
mixed _turba_getAllAttributeValues ([string $field = ''], [array $sources = array()])
  • string $field: Field name to check
  • array $sources: Array containing the sources to look in
_turba_getClient (line 1739)

Returns a contact from the client source.

  • return: Array of client data | PEAR_Error
mixed _turba_getClient ([string $objectId = ''])
  • string $objectId: Client unique ID
_turba_getClients (line 1752)

Returns mulitple contacts from the client source

  • return: An array of clients data | PEAR_Error
mixed _turba_getClients ([array $objectIds = array()])
  • array $objectIds: client unique ids
_turba_getClientSource (line 1717)

Returns the client source name

  • return: The name of the source to use with the clients api.
string _turba_getClientSource ()
_turba_getContact (line 1512)

Retrieves a contact.

  • return: The retrieved contact.
array _turba_getContact ([string $source = null], [string $objectId = ''])
  • string $source: The source name where the contact is stored
  • string $objectId: The unique id of the contact to retrieve
_turba_getContacts (line 1550)

Retrieves a set of contacts from a single source.

  • return: The retrieved contact | PEAR_Error
mixed _turba_getContacts ([string $source = ''], [array $objectIds = array()])
  • string $source: The source name where the contact is stored
  • array $objectIds: The unique ids of the contact to retrieve.
_turba_getDefaultShare (line 394)

Browses through Turba's object tree.

Retrieve the UID for the current user's default Turba share.

void _turba_getDefaultShare ()
_turba_getField (line 1914)

Returns a field value

  • return: An array of field value(s) | PEAR_Error on failure.
mixed _turba_getField ([string $address = ''], [string $field = ''], [array $sources = array()], [boolean $strict = false], [boolean $multiple = false])
  • string $address: Contact email address
  • string $field: Field to get
  • array $sources: Sources to check
  • boolean $strict: Match the email address strictly
  • boolean $multiple: Return more than one entry if found and true, return an error if this is false.
_turba_hasComments (line 305)

Returns if applications allows comments

boolean _turba_hasComments ()
_turba_import (line 884)

Import a contact represented in the specified contentType.

  • return: The new UID, or false on failure.
string _turba_import (string $content, [string $contentType = 'array'], [ $import_source = null], string $source)
  • string $content: The content of the contact.
  • string $contentType: What format is the data in? Currently supports array, text/directory, text/vcard and text/x-vcard.
  • string $source: The source into which the contact will be imported.
  • $import_source
_turba_list (line 715)

Returns an array of UIDs for all contacts that the current user is authorized to see.

  • return: An array of UIDs for all contacts the user can access.
array _turba_list ([string|array $sources = null])
  • string|array $sources: The name(s) of the source(s) to return contacts of. If left empty, the current user's sync sources or default source are used.
_turba_listBy (line 771)

Returns an array of UIDs for contacts that have had $action happen since $timestamp.

  • return: An array of UIDs matching the action and time criteria.
array _turba_listBy (string $action, integer $timestamp, [string|array $sources = null])
  • string $action: The action to check for - add, modify, or delete.
  • integer $timestamp: The time to start the search.
  • string|array $sources: The source(s) for which to retrieve the history.
_turba_listTimeObjectCategories (line 1639)

Retrieves a list of available time objects categories

  • return: An array of all configured time object categories.
array _turba_listTimeObjectCategories ()
_turba_listTimeObjects (line 1670)

Lists birthdays and/or anniversaries as time objects.

  • return: An array of timeObject results || PEAR_Error
mixed _turba_listTimeObjects (array $time_categories, mixed $start, mixed $end)
  • array $time_categories: The time categories (from listTimeObjectCategories) to list.
  • mixed $start: The start date of the period.
  • mixed $end: The end date of the period.
_turba_ownVCard (line 1093)

Exports the user's own contact as a vCard string.

  • return: The requested vCard data or PEAR_Error.
string _turba_ownVCard ()
_turba_path_delete (line 668)

Deletes a file from the Turba tree.

  • return: The event's UID, or a PEAR_Error on failure.
mixed _turba_path_delete (string $path)
  • string $path: The path to the file.
_turba_perms (line 315)

Returns a list of available permissions.

  • return: An array describing all available permissions.
array _turba_perms ()
_turba_removeUserData (line 203)

Removes user data.

  • return: true on success | PEAR_Error on failure
mixed _turba_removeUserData (string $user)
  • string $user: Name of user to remove data for.
_turba_replace (line 1218)

Replaces the contact identified by UID with the content represented in the specified contentType.

  • return: Success or failure.
boolean _turba_replace (string $uid, string $content, string $contentType, [string|array $sources = null])
  • string $uid: Idenfity the contact to replace.
  • string $content: The content of the contact.
  • string $contentType: What format is the data in? Currently supports array, text/directory, text/vcard and text/x-vcard.
  • string|array $sources: The source(s) where the contact will be replaced.
_turba_search (line 1319)

Returns a contact search result.

  • return: Hash containing the search results.
array _turba_search ([array $names = array()], [array $sources = array()], [array $fields = array()], [boolean $matchBegin = false], [boolean $forceSource = false])
  • array $names: The search filter values
  • array $sources: The sources to serach in
  • array $fields: The fields to serach on
  • boolean $matchBegin: Match word boundaries only
  • boolean $forceSource: Whether to use the specified sources, even if they have been disabled in the preferences.
_turba_searchClients (line 1803)

Search for clients

  • return: A hash containing the search results | PEAR_Error
mixed _turba_searchClients ([array $names = array()], [array $fields = array()], [boolean $matchBegin = false])
  • array $names: The search filter values
  • array $fields: The fields to serach in
  • boolean $matchBegin: Match word boundaries only
_turba_sources (line 348)

Returns a list of available sources.

  • return: An array of the available sources.
array _turba_sources ([boolean $writeable = false])
  • boolean $writeable: Set to true to limit to writeable sources.
_turba_updateClient (line 1776)

Updates client data

boolean _turba_updateClient ([string $objectId = ''], [array $attributes = array()])
  • string $objectId: The unique id of the client
  • array $attributes: An array of client attributes

Documentation generated on Sun, 30 Jan 2011 05:39:21 +0000 by phpDocumentor 1.4.3