Class AddressBook

Description

This is the main address book class that connect all the backends and provide services to the functions above.

Located in /functions/addressbook.php (line 354)


	
			
Variable Summary
array $backends
string $error
integer $localbackend
integer $numbackends
Method Summary
AddressBook AddressBook ()
integer add (array $userdata, integer $bnum)
integer add_backend (string $backend, [mixed $param = ''])
string full_address (array $row)
array get_backend_list ([string $type = ''])
mixed list_addr ([integer $bnum = -1])
array lookup (string $alias, [mixed $bnum = -1])
void modify (string $alias, array $userdata, integer $bnum)
bool remove (mixed $alias, integer $bnum)
array search (string $expression, [integer $bnum = -1])
array s_search (string $expression, [integer $bnum = -1])
Variables
boolean $add_extra_field = false (line 393)

Controls use of 'extra' field

Extra field can be used to add link to form, which allows to modify all fields supported by backend. This is the only field that is not sanitized with htmlspecialchars. Backends MUST make sure that field data is sanitized and displayed correctly inside table cell. Use of html formating in other address book fields is not allowed. Backends that don't return 'extra' row in address book data should not modify this object property.

  • since: 1.5.1
array $backends = array() (line 359)

Enabled address book backends

string $error = '' (line 369)

Error messages

integer $localbackend = 0 (line 374)

id of backend with personal address book

string $localbackendname = '' (line 379)

Name of backend with personal address book

integer $numbackends = 0 (line 364)

Number of enabled backends

Methods
Constructor AddressBook (line 398)

Constructor function.

AddressBook AddressBook ()
add (line 648)

Create a new address

  • return: the backend number that the/ address was added to, or false if it failed.
integer add (array $userdata, integer $bnum)
  • array $userdata: added address record
  • integer $bnum: backend number
add_backend (line 429)

Add a new backend.

  • return: number of backends
integer add_backend (string $backend, [mixed $param = ''])
  • string $backend: backend name (without the abook_ prefix)
full_address (line 484)

create string with name and email address

This function takes a $row array as returned by the addressbook search and returns an e-mail address with the full name or nickname optionally prepended.

  • return: email address with real name prepended
string full_address (array $row)
  • array $row: address book entry
get_backend_list (line 408)

Return an array of backends of a given type, or all backends if no type is specified.

  • return: list of backends
array get_backend_list ([string $type = ''])
  • string $type: backend type
list_addr (line 613)

Return all addresses

  • return: array with search results or boolean false on error.
mixed list_addr ([integer $bnum = -1])
  • integer $bnum: backend number
lookup (line 572)

Lookup an address by alias.

Only possible in local backends.

  • return: lookup results. False, if not found.
array lookup (string $alias, [mixed $bnum = -1])
  • string $alias
modify (line 747)

Modify entry in address book

void modify (string $alias, array $userdata, integer $bnum)
  • string $alias: nickname
  • array $userdata: newdata
  • integer $bnum: backend number
remove (line 704)

Remove the entries from address book

  • return: true if removed successfully. false if there s an error. $this->error contains error message
bool remove (mixed $alias, integer $bnum)
  • mixed $alias: entries that have to be removed. Can be string with nickname or array with list of nicknames
  • integer $bnum: backend number
search (line 505)

Search for entries in address books

Return a list of addresses matching expression in all backends of a given type.

  • return: search results
array search (string $expression, [integer $bnum = -1])
  • string $expression: search expression
  • integer $bnum: backend number. default to search in all backends
s_search (line 555)

Sorted search

  • return: search results
array s_search (string $expression, [integer $bnum = -1])
  • string $expression: search expression
  • integer $bnum: backend number. default to search in all backends

Documentation generated on Sat, 07 Oct 2006 16:08:48 +0300 by phpDocumentor 1.3.0RC6