PHP Класс IMP_Ftree, horde

Автор: Chuck Hagenbuch ([email protected])
Автор: Anil Madhavapeddy ([email protected])
Автор: Jon Parise ([email protected])
Автор: Michael Slusarz ([email protected])
Наследование: implements ArrayAccess, implements Countable, implements IteratorAggregate, implements Serializable
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$_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.

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

Метод Описание
__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.

Защищенные методы

Метод Описание
_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.

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

__construct() публичный Метод

Constructor.
public __construct ( )

__get() публичный Метод

public __get ( $name )

_insertElt() защищенный Метод

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() защищенный Метод

Normalize an element ID to the correct, internal name.
protected _normalize ( string $id ) : string
$id string The element ID.
Результат string The converted name.

_sortLevel() защищенный Метод

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

collapse() публичный Метод

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

collapseAll() публичный Метод

Collapse all elements.
public collapseAll ( )

count() публичный Метод

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

createTree() публичный Метод

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
Результат Horde_Tree The tree object.

delete() публичный Метод

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

expand() публичный Метод

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() публичный Метод

Expand all elements.
public expandAll ( )

getAccount() публичный Метод

Get the account object for a given element ID.
public getAccount ( string $id ) : IMP_Ftree_Account
$id string Element ID.
Результат IMP_Ftree_Account Account object.

getAttribute() публичный Метод

Get an attribute value.
public getAttribute ( string $type, string $name ) : mixed
$type string The attribute type.
$name string The element name.
Результат mixed Boolean attribute result, or null if element or attribute doesn't exist

getChildren() публичный Метод

Return the list of children for a given element ID.
public getChildren ( string $id ) : array
$id string Element ID.
Результат array Array of tree elements.

getIterator() публичный Метод

This returns a RecursiveIterator - a RecursiveIteratorIterator is needed to properly iterate through all elements.
public getIterator ( ) : IMP_Ftree_Iterator
Результат IMP_Ftree_Iterator Iterator object.

getParent() публичный Метод

Get the parent element for a given element ID.
public getParent ( string $id ) : mixed
$id string Element ID.
Результат mixed IMP_Ftree_Element object, or null if no parent.

init() публичный Метод

Initialize the tree.
public init ( )

insert() публичный Метод

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() публичный Метод

Load unsubscribed mailboxes.
public loadUnsubscribed ( )

offsetExists() публичный Метод

public offsetExists ( $offset )

offsetGet() публичный Метод

public offsetGet ( $offset ) : IMP_Ftree_Element
Результат IMP_Ftree_Element

offsetSet() публичный Метод

public offsetSet ( $offset, $value )

offsetUnset() публичный Метод

public offsetUnset ( $offset )

rename() публичный Метод

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

serialize() публичный Метод

public serialize ( )

setAttribute() публичный Метод

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() публичный Метод

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

subscribe() публичный Метод

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

unserialize() публичный Метод

public unserialize ( $data )

unsubscribe() публичный Метод

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

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

$_accounts защищенное свойство

Account sources.
protected array $_accounts
Результат array

$_changed защищенное свойство

Tree changed flag. Set when something in the tree has been altered.
protected bool $_changed
Результат boolean

$_eltdiff защищенное свойство

Element diff tracking.
protected IMP_Ftree_Eltdiff $_eltdiff
Результат IMP_Ftree_Eltdiff

$_elts защищенное свойство

Array containing the mailbox elements.
protected array $_elts
Результат array

$_parent защищенное свойство

Parent/child list.
protected array $_parent
Результат array

$_temp защищенное свойство

Temporary data that is not saved across serialization.
protected array $_temp
Результат array