PHP Класс Turba, horde

Автор: Chuck Hagenbuch ([email protected])
Автор: Jon Parise ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$source string The current source.

Защищенные свойства (Protected)

Свойство Тип Описание
$_cache array Cached data.

Открытые методы

Метод Описание
addBrowseJs ( ) Add browse.js javascript to page.
availableSources ( ) : array Returns the source entries from config/backends.php that have been configured as available sources in the main Turba configuration.
createShare ( string $share_name, array $params ) : Horde_Share Create a new Turba share.
formatCompositeField ( string $format, array $fields ) : string Builds and cleans up a composite field.
formatEmailAddresses ( mixed $data, string $name ) : mixed TODO
formatName ( Turba_Object $ob, string $name_format = null ) : string Formats the name according to the user's preference.
getAddressBooks ( integer $permission = Horde_Perms::READ, array $options = [] ) : array Get all the address books the user has the requested permissions to and return them in the user's preferred order.
getAvailableEmailFields ( $source = null, $searchable = true ) : array Return an array of all available attributes of type 'email'. Optionally, ensure the field is defined in the specified $source.
getColumnName ( integer $i, array $columns ) : string Retrieves a column's field name.
getColumns ( ) TODO
getConfigFromShares ( array $sources, boolean $owner = false ) : array Replaces all share-enabled sources in a source list with all shares from this source that the current user has access to.
getDefaultAddressbook ( ) : string Returns the current user's default address book.
getExtendedPermission ( Turba_Driver $addressBook, string $permission ) : mixed Gets extended permissions on an address book.
getPreferredSortOrder ( ) : array Returns the sort order selected by the user.
getSourceFromShare ( Horde_Share_Object $share ) : array Retrieve a new source config entry based on a Turba share.
getUserName ( string $uid ) : string Returns the real name, if available, of a user.
guessLastname ( string $name ) : string Returns a best guess at the lastname in a string.
hasMaxContacts ( Turba_Driver $driver, boolean $notify = true ) : string Checks the max_contacts permission.
listShares ( boolean $owneronly = false, integer $permission = Horde_Perms::READ ) : array Returns all shares the current user has specified permissions to.
permissionsFilter ( array $in, integer $permission = Horde_Perms::READ, array $options = [] ) : array Filters sources based on permissions.
setPreferredSortOrder ( Horde_Variables $vars, string $source ) Saves the sort order to the preferences backend.

Описание методов

addBrowseJs() публичный статический Метод

Add browse.js javascript to page.
public static addBrowseJs ( )

availableSources() публичный статический Метод

Returns the source entries from config/backends.php that have been configured as available sources in the main Turba configuration.
public static availableSources ( ) : array
Результат array List of available sources.

createShare() публичный статический Метод

Create a new Turba share.
public static createShare ( string $share_name, array $params ) : Horde_Share
$share_name string The id for the new share.
$params array Parameters for the new share.
Результат Horde_Share The new share object.

formatCompositeField() публичный статический Метод

Builds and cleans up a composite field.
public static formatCompositeField ( string $format, array $fields ) : string
$format string The sprintf field format.
$fields array The fields that compose the composite field.
Результат string The formatted composite field.

formatEmailAddresses() публичный статический Метод

TODO
public static formatEmailAddresses ( mixed $data, string $name ) : mixed
$data mixed Either a single email address or an array of email addresses to format.
$name string The personal name phrase.
Результат mixed Either the formatted address or an array of formatted addresses.

formatName() публичный статический Метод

If the format is 'none', the full name with all parts is returned. If the format is 'last_first' or 'first_last', only the first name and last name are returned.
public static formatName ( Turba_Object $ob, string $name_format = null ) : string
$ob Turba_Object The object to get a name from.
$name_format string The formatting. One of 'none', 'last_first' or 'first_last'. Defaults to the user preference.
Результат string The formatted name, either "Firstname Lastname" or "Lastname, Firstname" depending on $name_format or the user's preference.

getAddressBooks() публичный статический Метод

Get all the address books the user has the requested permissions to and return them in the user's preferred order.
public static getAddressBooks ( integer $permission = Horde_Perms::READ, array $options = [] ) : array
$permission integer The Horde_Perms::* constant to filter on.
$options array Any additional options.
Результат array The filtered, ordered $cfgSources entries.

getAvailableEmailFields() публичный статический Метод

Return an array of all available attributes of type 'email'. Optionally, ensure the field is defined in the specified $source.
С версии: 4.2.9
public static getAvailableEmailFields ( $source = null, $searchable = true ) : array
$source string An optional source identifier.
$searchable boolean If true, and $source is provided, ensure that the email field is a configured searchable field.
Результат array An array of email fields.

getColumnName() публичный статический Метод

Retrieves a column's field name.
public static getColumnName ( integer $i, array $columns ) : string
$i integer TODO
$columns array TODO
Результат string TODO

getColumns() публичный статический Метод

TODO
public static getColumns ( )

getConfigFromShares() публичный статический Метод

This will only sync shares that are unique to Horde (such as a SQL or Kolab sources). Any backend that supports ACLs or similar mechanism should be configured from within backends.local.php or via Horde's share_* hooks.
public static getConfigFromShares ( array $sources, boolean $owner = false ) : array
$sources array The default $cfgSources array.
$owner boolean Only return shares that the current user owns?
Результат array The $cfgSources array.

getDefaultAddressbook() публичный статический Метод

Returns the current user's default address book.
public static getDefaultAddressbook ( ) : string
Результат string The default address book name.

getExtendedPermission() публичный статический Метод

Gets extended permissions on an address book.
public static getExtendedPermission ( Turba_Driver $addressBook, string $permission ) : mixed
$addressBook Turba_Driver The address book to get extended permissions for.
$permission string What extended permission to get.
Результат mixed The requested extended permissions value, or true if it doesn't exist.

getPreferredSortOrder() публичный статический Метод

Returns the sort order selected by the user.
public static getPreferredSortOrder ( ) : array
Результат array TODO

getSourceFromShare() публичный статический Метод

Retrieve a new source config entry based on a Turba share.
public static getSourceFromShare ( Horde_Share_Object $share ) : array
$share Horde_Share_Object
Результат array The $cfgSource entry for this share source.

getUserName() публичный статический Метод

Returns the real name, if available, of a user.
public static getUserName ( string $uid ) : string
$uid string The uid of the name to return.
Результат string The user's full, real name.

guessLastname() публичный статический Метод

Returns a best guess at the lastname in a string.
public static guessLastname ( string $name ) : string
$name string String contain the full name.
Результат string String containing the last name.

hasMaxContacts() публичный статический Метод

Checks the max_contacts permission.
public static hasMaxContacts ( Turba_Driver $driver, boolean $notify = true ) : string
$driver Turba_Driver The address book to check.
$notify boolean If true, outputs error to notification.
Результат string Error message if maximum contacts have been reached. False otherwise.

listShares() публичный статический Метод

Returns all shares the current user has specified permissions to.
public static listShares ( boolean $owneronly = false, integer $permission = Horde_Perms::READ ) : array
$owneronly boolean Only return address books owned by the user? Defaults to false.
$permission integer Permissions to filter by.
Результат array Shares the user has the requested permissions to.

permissionsFilter() публичный статический Метод

Filters sources based on permissions.
public static permissionsFilter ( array $in, integer $permission = Horde_Perms::READ, array $options = [] ) : array
$in array The source list we want filtered.
$permission integer The Horde_Perms::* constant we will filter on.
$options array Additional options: - require_add: (boolean) Only return sources that can be added to.
Результат array The filtered data.

setPreferredSortOrder() публичный статический Метод

Saves the sort order to the preferences backend.
public static setPreferredSortOrder ( Horde_Variables $vars, string $source )
$vars Horde_Variables Variables object.
$source string Source.

Описание свойств

$_cache защищенное статическое свойство

Cached data.
protected static array $_cache
Результат array

$source публичное статическое свойство

The current source.
public static string $source
Результат string