PHP Class IMP_Ftree, horde

Author: Chuck Hagenbuch ([email protected])
Author: Anil Madhavapeddy ([email protected])
Author: Jon Parise ([email protected])
Author: Michael Slusarz ([email protected])
Inheritance: implements ArrayAccess, implements Countable, implements IteratorAggregate, implements Serializable
Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$_accounts array Account sources.
$_changed boolean Tree changed flag. Set when something in the tree has been altered.
$_eltdiff IMP_Ftree_Eltdiff Element diff tracking.
$_elts array Array containing the mailbox elements.
$_parent array Parent/child list.
$_temp array Temporary data that is not saved across serialization.

Méthodes publiques

Méthode Description
__construct ( ) Constructor.
__get ( $name )
collapse ( mixed $elts ) Collapse an element.
collapseAll ( ) Collapse all elements.
count ( ) Return the number of mailboxes on the server.
createTree ( string | Horde_Tree $name, array $opts = [] ) : Horde_Tree Creates a Horde_Tree representation of the current tree.
delete ( $id ) Delete an element from the tree.
expand ( mixed $elts, boolean $expandall = false ) Expand an element.
expandAll ( ) Expand all elements.
getAccount ( string $id ) : IMP_Ftree_Account Get the account object for a given element ID.
getAttribute ( string $type, string $name ) : mixed Get an attribute value.
getChildren ( string $id ) : array Return the list of children for a given element ID.
getIterator ( ) : IMP_Ftree_Iterator This returns a RecursiveIterator - a RecursiveIteratorIterator is needed to properly iterate through all elements.
getParent ( string $id ) : mixed Get the parent element for a given element ID.
init ( ) Initialize the tree.
insert ( mixed $id ) Insert an element into the tree.
loadUnsubscribed ( ) Load unsubscribed mailboxes.
offsetExists ( $offset )
offsetGet ( $offset ) : IMP_Ftree_Element
offsetSet ( $offset, $value )
offsetUnset ( $offset )
rename ( string $old, string $new ) Rename a mailbox.
serialize ( )
setAttribute ( string $type, string $elt, boolean $bool ) Change an attribute value.
sortList ( &$mbox, IMP_Ftree_Element $base = false ) Sorts a list of mailboxes.
subscribe ( mixed $id ) Subscribe an element to the tree.
unserialize ( $data )
unsubscribe ( mixed $id ) Unsubscribe an element from the tree.

Méthodes protégées

Méthode Description
_insertElt ( array $elt ) Insert an element into the tree.
_normalize ( string $id ) : string Normalize an element ID to the correct, internal name.
_sortLevel ( string $id ) Sort a level in the tree.

Method Details

__construct() public méthode

Constructor.
public __construct ( )

__get() public méthode

public __get ( $name )

_insertElt() protected méthode

Insert an element into the tree.
protected _insertElt ( array $elt )
$elt array Element data. Keys: - a: (integer) Attributes. - p: (string) Parent element ID. - v: (string) Mailbox ID.

_normalize() protected méthode

Normalize an element ID to the correct, internal name.
protected _normalize ( string $id ) : string
$id string The element ID.
Résultat string The converted name.

_sortLevel() protected méthode

Sort a level in the tree.
protected _sortLevel ( string $id )
$id string The parent element whose children need to be sorted.

collapse() public méthode

Collapse an element.
public collapse ( mixed $elts )
$elts mixed The element (or an array of elements) to expand.

collapseAll() public méthode

Collapse all elements.
public collapseAll ( )

count() public méthode

Return the number of mailboxes on the server.
public count ( )

createTree() public méthode

Creates a Horde_Tree representation of the current tree.
public createTree ( string | Horde_Tree $name, array $opts = [] ) : Horde_Tree
$name string | Horde_Tree Either the tree name, or a Horde_Tree object to add nodes to.
$opts array Additional options: - basename: (boolean) Use raw basename instead of abbreviated label? DEFAULT: false - checkbox: (boolean) Display checkboxes? DEFAULT: false - editvfolder: (boolean) Display vfolder edit links? DEFAULT: false - iterator: (Iterator) Tree iterator to use. DEFAULT: Base iterator. - open: (boolean) Force child mailboxes to this status. DEFAULT: null - parent: (string) The parent object of the current level. DEFAULT: null (add to base level) - poll_info: (boolean) Include poll information in output? DEFAULT: false - render_params: (array) List of params to pass to renderer if auto-creating. DEFAULT: 'alternate', 'lines', and 'lines_base' are passed in with true values. - render_type: (string) The renderer name. DEFAULT: Javascript
Résultat Horde_Tree The tree object.

delete() public méthode

Delete an element from the tree.
public delete ( $id )

expand() public méthode

Expand an element.
public expand ( mixed $elts, boolean $expandall = false )
$elts mixed The element (or an array of elements) to expand.
$expandall boolean Expand all subelements?

expandAll() public méthode

Expand all elements.
public expandAll ( )

getAccount() public méthode

Get the account object for a given element ID.
public getAccount ( string $id ) : IMP_Ftree_Account
$id string Element ID.
Résultat IMP_Ftree_Account Account object.

getAttribute() public méthode

Get an attribute value.
public getAttribute ( string $type, string $name ) : mixed
$type string The attribute type.
$name string The element name.
Résultat mixed Boolean attribute result, or null if element or attribute doesn't exist

getChildren() public méthode

Return the list of children for a given element ID.
public getChildren ( string $id ) : array
$id string Element ID.
Résultat array Array of tree elements.

getIterator() public méthode

This returns a RecursiveIterator - a RecursiveIteratorIterator is needed to properly iterate through all elements.
public getIterator ( ) : IMP_Ftree_Iterator
Résultat IMP_Ftree_Iterator Iterator object.

getParent() public méthode

Get the parent element for a given element ID.
public getParent ( string $id ) : mixed
$id string Element ID.
Résultat mixed IMP_Ftree_Element object, or null if no parent.

init() public méthode

Initialize the tree.
public init ( )

insert() public méthode

Insert an element into the tree.
public insert ( mixed $id )
$id mixed The name of the mailbox (or a list of mailboxes), an IMP_Search_Vfolder object, an IMP_Remote_Account object, or an array containing any mixture of these.

loadUnsubscribed() public méthode

Load unsubscribed mailboxes.
public loadUnsubscribed ( )

offsetExists() public méthode

public offsetExists ( $offset )

offsetGet() public méthode

public offsetGet ( $offset ) : IMP_Ftree_Element
Résultat IMP_Ftree_Element

offsetSet() public méthode

public offsetSet ( $offset, $value )

offsetUnset() public méthode

public offsetUnset ( $offset )

rename() public méthode

Rename a mailbox.
public rename ( string $old, string $new )
$old string The old mailbox name.
$new string The new mailbox name.

serialize() public méthode

public serialize ( )

setAttribute() public méthode

Change an attribute value.
public setAttribute ( string $type, string $elt, boolean $bool )
$type string The attribute type.
$elt string The element name.
$bool boolean The boolean value.

sortList() public méthode

Sorts a list of mailboxes.
public sortList ( &$mbox, IMP_Ftree_Element $base = false )
$base IMP_Ftree_Element The base element.

subscribe() public méthode

Subscribe an element to the tree.
public subscribe ( mixed $id )
$id mixed The element name or an array of element names.

unserialize() public méthode

public unserialize ( $data )

unsubscribe() public méthode

Unsubscribe an element from the tree.
public unsubscribe ( mixed $id )
$id mixed The element name or an array of element names.

Property Details

$_accounts protected_oe property

Account sources.
protected array $_accounts
Résultat array

$_changed protected_oe property

Tree changed flag. Set when something in the tree has been altered.
protected bool $_changed
Résultat boolean

$_eltdiff protected_oe property

Element diff tracking.
protected IMP_Ftree_Eltdiff $_eltdiff
Résultat IMP_Ftree_Eltdiff

$_elts protected_oe property

Array containing the mailbox elements.
protected array $_elts
Résultat array

$_parent protected_oe property

Parent/child list.
protected array $_parent
Résultat array

$_temp protected_oe property

Temporary data that is not saved across serialization.
protected array $_temp
Résultat array