Documentation

IMP_Ajax_Addresses
in package

Outputs an address list in the form used by the browser-side javascript code.

Tags
author

Michael Slusarz slusarz@horde.org

category

Horde

copyright

2014-2017 Horde LLC

license

http://www.horde.org/licenses/gpl GPL

Table of Contents

Properties

$_addr  : Horde_Mail_Rfc822_Object
Address object.
$_count  : int
Address counter for toArray().

Methods

__construct()  : mixed
Constructor.
toArray()  : object
Output the address list.
toAutocompleteArray()  : array<string|int, mixed>
Creates the output list for the 'email' autocomplete search.
_toAutocompleteArray()  : mixed
_addAddress()  : object
Create a bare address entry.

Properties

$_addr

Address object.

private Horde_Mail_Rfc822_Object $_addr

$_count

Address counter for toArray().

private int $_count

Methods

__construct()

Constructor.

public __construct(Horde_Mail_Rfc822_Object $addr) : mixed
Parameters
$addr : Horde_Mail_Rfc822_Object

Address object.

toArray()

Output the address list.

public toArray([int $limit = null ]) : object
Parameters
$limit : int = null

Limit display to this many addresses. If null, shows all addresses.

Return values
object

Object with the following properties:

  • addr: (array) Array of objects with 2 possible formats:
    • Address keys: 'b' (bare address); 'p' (personal part)
    • Group keys: 'a' (list of addresses); 'g' (group name)
    • Both: 'v' (full value of address)
  • limit: (boolean) True if limit was reached.
  • total: (integer) Total address count.

toAutocompleteArray()

Creates the output list for the 'email' autocomplete search.

public toAutocompleteArray([int $limit = null ]) : array<string|int, mixed>
Parameters
$limit : int = null

Limit display to this many addresses. If null, shows all addresses.

Return values
array<string|int, mixed>

An array with the following keys for each result:

  - g: (array) List of addresses in the group.
  - l: (string) Full label.
  - s: (string) Short display string.
  - v: (string) Value.

_toAutocompleteArray()

protected _toAutocompleteArray(Horde_Mail_Rfc822_List $alist, int $limit) : mixed
Parameters
$alist : Horde_Mail_Rfc822_List

Address list.

$limit : int

Limit to this many entries.

Tags
see
toAutocompleteArray

_addAddress()

Create a bare address entry.

private _addAddress(Horde_Mail_Rfc822_Address $addr) : object
Parameters
$addr : Horde_Mail_Rfc822_Address

Address object.

Return values
object

Address object for use in JS code.


        
On this page

Search results