File/nasmail/functions/addressbook.php

Description

functions/addressbook.php - Functions and classes for the addressbook system

Functions require SM_PATH and support of forms.php functions

  • version: $Id: addressbook.php 1462 2009-11-03 08:24:29Z tokul $
  • copyright: (c) 1999-2006 The SquirrelMail Project Team
  • copyright: (c) 2006-2007 The NaSMail Project
  • license: GNU Public License
Classes
Class Description
 class AddressBook This is the main address book class that connect all the backends and provide services to the functions above.
 class addressbook_backend Generic backend that all other backends extend
Includes
 include_once (SM_PATH.'functions/display_messages.php') (line 25)
 include_once (SM_PATH.'functions/abook_local_file.php') (line 1313)

PHP 5 requires that the class be made first, which seems rather logical, and should have been the way it was generated the first time.

 include_once (SM_PATH.'functions/abook_database.php') (line 1321)

Only load database backend if database is configured

 include_once (SM_PATH.'functions/abook_ldap_server.php') (line 1314)
Functions
abook_list_writable_backends (line 364)

Provides list of writeable backends.

Works only when address is added ($name='addaddr') Function uses different name in SquirrelMail 1.4.9 and it is not available when functions/addressbook.php is loaded.

  • return: html formated backend field (select or hidden)
string abook_list_writable_backends (string $name)
  • string $name: name of form
addressbook_cmp (line 176)

Callback function used to sort address book entries by name Had to move this function outside of the Addressbook Class PHP 4.0.4 Seemed to be having problems with inline functions.

integer addressbook_cmp (array $a, array $b)
  • array $a: first address book entry
  • array $b: second address book entry
addressbook_init (line 38)

Create and initialize an addressbook object.

  • return: object
object AddressBook addressbook_init ([boolean $showerr = true], [boolean $onlylocal = false])
  • boolean $onlylocal: Does nothing. Variable is kept for backwards compatibility with SquirrelMail. Loads only local address book backends in SquirrelMail. In NaSMail all address book backends are always loaded.
  • boolean $showerr: show error message or let code handle errors.
addressbook_inp_field (line 315)

Make an input field In SquirrelMail 1.4.9 function is not available when functions/addressbook.php is loaded.

  • return: html formated table row
string addressbook_inp_field (string $label, string $field, string $name, string $size, array $values, string $add)
  • string $label
  • string $field
  • string $name
  • string $size
  • array $values
  • string $add
address_form (line 336)

Output form to add and modify address data In SquirrelMail 1.4.9 function is not available when functions/addressbook.php is loaded.

void address_form (string $name, string $submittext, [array $values = array()])
  • string $name: address book form name (passed to abook_list_writable_backends())
  • string $submittext: Name of submit button
  • array $values: address book entry
addr_display_result (line 453)

List search results

Function was available only to src/compose.php in html address book mode in NaSMail 1.0-1.3.

  • since: 1.4
void addr_display_result (array $res, [bool $includesource = true])
  • array $res: Array containing results of search
  • bool $includesource: If true, adds backend column to address listing
addr_insert_hidden (line 401)

Print hidden input fields in address book form

Function was available only to src/compose.php in html address book mode in NaSMail 1.0-1.3.

  • since: 1.4
void addr_insert_hidden ()
alistcmp (line 196)

Callback function used to sort address book entries

Sorting order depends on return value of get_abook_sort() function

  • return: positive integer when $a should be listed before $b. Negative when $b comes first.
integer alistcmp (array $a, array $b)
  • array $a: first address book entry
  • array $b: second address book entry
get_abook_sort (line 250)

Address book sorting options

returns address book sorting order. Possible return values

  1. nickname, ascending
  2. nickname, descending
  3. name, ascending
  4. name, descending
  5. email, ascending
  6. email, descending
  7. label, ascending
  8. label, descending
  9. name, ascending, default sort order

  • return: book sorting options order
integer get_abook_sort ()
nsm_abook_count (line 763)

Creates "Viewing Addresses: x to x (x total)" string

  • return: html formated string
  • since: 1.6
string nsm_abook_count (int $start_idx, int $count)
  • int $start_idx
  • int $count
nsm_abook_pager (line 552)

Creates page navigation links for address book listing

Function shares some code with get_paginator_str() function.

  • since: 1.6
string nsm_abook_pager (int $start, int $total, int $backend)
  • int $start
  • int $total
  • int $backend
nsm_abook_page_link (line 713)

Creates link to some address book page

  • since: 1.6
string nsm_abook_page_link (int $start, string $title, int $backend)
  • int $start
  • string $title
  • int $backend
nsm_abook_toggle_link (line 726)

Adds checkbox toggle control in address book listing

  • since: 1.6
string nsm_abook_toggle_link (int $start, int $backend)
  • int $start
  • int $backend
show_abook_sort_button (line 279)

This function shows the address book sort button.

  • return: html code with sorting images and urls
string show_abook_sort_button (integer $abook_sort_order, string $alt_tag, integer $Down, integer $Up)
  • integer $abook_sort_order: current sort value
  • string $alt_tag: alt tag value (string visible to text only browsers). If set to empty string, NaSMail 1.5+ defaults to standard tags.
  • integer $Down: sort value when list is sorted ascending
  • integer $Up: sort value when list is sorted descending

Documentation generated on Sun, 22 Nov 2009 17:36:14 +0200 by phpDocumentor 1.4.3