Class IMP_Tree

Description

Located in /lib/IMAP/Tree.php (line 75)


	
			
Variable Summary
 boolean $_changed
 integer $_currkey
 string $_currparent
 array $_currstack
 string $_delimiter
 array $_eltdiff
 array $_expanded
 boolean $_forceopen
 array $_fulllist
 IMAP_Sort $_imap_sort
 array $_namespaces
 array $_parent
 array $_poll
 string $_server
 boolean $_showunsub
 array $_subscribed
 boolean $_trackdiff
 array $_tree
 boolean $_unsubview
Method Summary
 IMP_Tree IMP_Tree ()
 void addPollList (mixed $id)
 array build ([integer $mask = 0], [boolean $open = true])
 void collapse (string $folder)
 void collapseAll ()
 string createMailboxName (string $parent,  $new)
 array current ()
 boolean delete (mixed $id)
 array element ( $mailbox, string $name)
 array eltDiff ()
 void eltDiffStart ()
 void expand (string $folder, [boolean $expandall = false])
 void expandAll ()
 array folderList ([integer $mask = 0], [string $base = null])
 array get (string $name)
 array getCustomIcon ( $elt)
 array getElementInfo (string $name)
 array getPollList ([boolean $prune = false], [boolean $sort = false])
 boolean hasChildren (array $elt)
 void init ()
 void insert (mixed $id)
 void insertVFolders (array $id_list)
 integer isContainer (array $elt)
 integer isInvisible (array $elt)
 integer isNamespace (array $elt)
 integer isOpen (array $elt)
 integer isOpenSidebar (array $mbox)
 integer isPolled (array $elt)
 integer isSubscribed (array $elt)
 integer isVFolder (array $elt)
 mixed next ([integer $mask = 0])
 boolean peek ()
 void removePollList (string $id)
 void rename (array $old, array $new)
 mixed reset ()
 void showUnsubscribed (boolean $unsub)
 void subscribe (mixed $id)
 void unsubscribe (mixed $id)
 integer _isNonIMAPElt (array $elt)
 integer _needSort (array $elt)
Variables
boolean $_changed = false (line 152)

Tree changed flag. Set when something in the tree has been altered.

integer $_currkey = null (line 96)

Location of current element in the tree.

string $_currparent = null (line 89)

Location of current element in the tree.

array $_currstack = array() (line 103)

Location of current element in the tree.

string $_delimiter = '/' (line 180)

The server string used for the delimiter.

array $_eltdiff = null (line 194)

Used to determine the list of element changes.

array $_expanded = null (line 131)

The cached list of expanded folders.

boolean $_forceopen = false (line 208)

See $open parameter in build().

array $_fulllist = null (line 145)

The cached full list of mailboxes on the server.

IMAP_Sort $_imap_sort = null (line 166)

The IMAP_Sort object.

array $_namespaces = array() (line 187)

The list of namespaces to add to the tree.

array $_parent = array() (line 117)

Parent list.

array $_poll = null (line 124)

The cached list of mailboxes to poll.

string $_server = '' (line 173)

The server string for the current server.

boolean $_showunsub = false (line 110)

Show unsubscribed mailboxes?

array $_subscribed = null (line 138)

Cached list of subscribed mailboxes.

boolean $_trackdiff = true (line 201)

If set, track element changes.

array $_tree (line 82)

Array containing the mailbox tree.

boolean $_unsubview = false (line 159)

Have we shown unsubscribed folders previously?

Methods
Constructor IMP_Tree (line 244)

Constructor.

IMP_Tree IMP_Tree ()
addPollList (line 1258)

Add element to the poll list.

void addPollList (mixed $id)
  • mixed $id: The element name or a list of element names to add.
build (line 1683)

Builds a list of folders, suitable to render a folder tree.

  • return: An array with three elements: the folder list, the total number of new messages, and a list with folder names suitable for user interaction. The folder list array contains the following added entries on top of the entries provided by element():
     'display' - The mailbox name run through IMP::displayFolder().
     'peek' - See peek().
array build ([integer $mask = 0], [boolean $open = true])
  • integer $mask: The mask to pass to next().
  • boolean $open: If using the base folder icons, display a different icon whether the folder is opened or closed.
collapse (line 561)

Collapse a mail folder.

void collapse (string $folder)
  • string $folder: The folder name to collapse.
collapseAll (line 1415)

Should we collapse all elements?

void collapseAll ()
createMailboxName (line 2093)

Determines the mailbox name to create given a parent and the new name.

  • return: The full path to the new mailbox, or PEAR_Error.
string createMailboxName (string $parent,  $new)
  • string $parent: The new mailbox name.
  • $new
current (line 684)

Return the current tree element.

  • return: The current tree element or false if there is no element.
array current ()
delete (line 832)

Delete an element from the tree.

  • return: Return true on success, false on error.
boolean delete (mixed $id)
  • mixed $id: The element name or an array of element names.
element (line 1930)

Return extended information on an element.

  • return: Returns the element with extended information, or false if not found. The information returned is as follows:
     'alt' - The alt text for the icon.
     'base_elt' - The return from get().
     'children' - Does the element have children?
     'container' - Is this a container element?
     'editvfolder' - Can this virtual folder be edited?
     'icon' - The name of the icon graphic to use.
     'icondir' - The path of the icon directory.
     'level' - The deepness level of this element.
     'mbox_val' - A html-ized version of 'value'.
     'msgs' - The number of total messages in the element (if polled).
     'name' - A html-ized version of 'label'.
     'newmsg' - The number of new messages in the element (if polled).
     'parent' - The parent element value.
     'polled' - Show polled information?
     'special' - An integer mask indicating if this is a "special" element.
     'specialvfolder' - Is this a "special" virtual folder?
     'unseen' - The number of unseen messages in the element (if polled).
     'user_icon' - Use a user defined icon?
     'value' - The value of this element (i.e. element id).
     'vfolder' - Is this a virtual folder?
  • since: IMP 4.2
array element ( $mailbox, string $name)
  • string $name: The name of the tree element.
  • $mailbox
eltDiff (line 1599)

Return the list of elements that have changed since nodeDiffStart() was last called.

  • return: Returns false if no changes have occurred, or an array with the following keys:
     'a' => A list of elements that have been added.
     'c' => A list of elements that have been changed.
     'd' => A list of elements that have been deleted.
  • since: IMP 4.1
array eltDiff ()
eltDiffStart (line 1580)

Set the start point for determining element differences via eltDiff().

  • since: IMP 4.1
void eltDiffStart ()
expand (line 532)

Expand a mail folder.

void expand (string $folder, [boolean $expandall = false])
  • string $folder: The folder name to expand.
  • boolean $expandall: Expand all folders under this one?
expandAll (line 1405)

Should we expand all elements?

void expandAll ()
folderList (line 1800)

Returns a list of all IMAP mailboxes in the tree.

  • return: An array of IMAP mailbox names.
  • since: IMP 4.1
array folderList ([integer $mask = 0], [string $base = null])
  • integer $mask: A mask with the following elements:
     IMPTREE_FLIST_CONTAINER - Show container elements.
     IMPTREE_FLIST_UNSUB - Show unsubscribed elements.
     IMPTREE_FLIST_OB - Return full tree object.
     IMPTREE_FLIST_VFOLDER - Show Virtual Folders. (since IMP 4.2.1)
  • string $base: Return all mailboxes below this element. (since IMP 4.2.1)
get (line 716)

Returns the requested element.

  • return: Returns the requested element or false if not found.
array get (string $name)
  • string $name: The name of the tree element.
getCustomIcon (line 1721)

Get any custom icon configured for the given element.

  • return: An array with the 'icon', 'icondir', and 'alt' information for the element, or false if no icon available.
array getCustomIcon ( $elt)
  • $elt
getElementInfo (line 1465)

Get information about new/unseen/total messages for the given element.

  • return: Array with the following fields:
     'messages'  --  Number of total messages.
     'newmsg'    --  Number of new messages.
     'unseen'    --  Number of unseen messages.
array getElementInfo (string $name)
  • string $name: The element name.
getPollList (line 1213)

Initializes and returns the list of mailboxes to poll.

  • return: The list of mailboxes to poll.
array getPollList ([boolean $prune = false], [boolean $sort = false])
  • boolean $prune: Prune non-existant folders from list?
  • boolean $sort: Sort the directory list?
hasChildren (line 1038)

Does the element have any active children?

  • return: True if the element has active children.
boolean hasChildren (array $elt)
  • array $elt: A tree element.
init (line 470)

Initalize the tree.

void init ()
insert (line 728)

Insert a folder/mailbox into the tree.

void insert (mixed $id)
  • mixed $id: The name of the folder (or a list of folder names) to add.
insertVFolders (line 1622)

Inserts virtual folders into the tree.

void insertVFolders (array $id_list)
  • array $id_list: An array with the folder IDs to add as the key and the labels as the value.
isContainer (line 1091)

Is this element a container only, not a mailbox (meaning you can not open it)?

  • return: True if the element is a container.
integer isContainer (array $elt)
  • array $elt: A tree element.
isInvisible (line 1346)

Is the element invisible?

  • return: True if the element is marked as invisible.
  • since: IMP 4.3.4
integer isInvisible (array $elt)
  • array $elt: A tree element.
isNamespace (line 1151)

Is the element a namespace container?

  • return: True if the element is a namespace container.
integer isNamespace (array $elt)
  • array $elt: A tree element.
isOpen (line 1064)

Is the tree element open?

  • return: True if the element is open.
integer isOpen (array $elt)
  • array $elt: A tree element.
isOpenSidebar (line 1857)

Is the mailbox open in the sidebar?

  • return: True if the mailbox is open in the sidebar.
  • since: IMP 4.1.1
integer isOpenSidebar (array $mbox)
  • array $mbox: A mailbox name.
isPolled (line 1319)

Does the user want to poll this mailbox for new/unseen messages?

  • return: True if the user wants to poll the element.
integer isPolled (array $elt)
  • array $elt: A tree element.
isSubscribed (line 1119)

Is the user subscribed to this element?

  • return: True if the user is subscribed to the element.
integer isSubscribed (array $elt)
  • array $elt: A tree element.
isVFolder (line 1757)

Returns whether this element is a virtual folder.

  • return: True if the element is a virtual folder.
integer isVFolder (array $elt)
  • array $elt: A tree element.
next (line 588)

Sets the internal array pointer to the next element, and returns the next object.

  • return: Returns the next element or false if the element doesn't exist.
mixed next ([integer $mask = 0])
  • integer $mask: A mask with the following elements:
     IMPTREE_NEXT_SHOWCLOSED - Don't ignore closed elements.
     IMPTREE_NEXT_SHOWSUB - Only show subscribed elements.
peek (line 697)

Determines if there are more elements in the current tree level.

  • return: True if there are more elements, false if this is the last element.
boolean peek ()
removePollList (line 1286)

Remove element from the poll list.

void removePollList (string $id)
  • string $id: The folder/mailbox or a list of folders/mailboxes to remove.
rename (line 1770)

Rename a current folder.

  • since: IMP 4.1
void rename (array $old, array $new)
  • array $old: The old folder names.
  • array $new: The new folder names.
reset (line 669)

Set internal pointer to the head of the tree.

This MUST be called before you can traverse the tree with next().

  • return: Returns the element at the head of the tree or false if the element doesn't exist.
mixed reset ()
showUnsubscribed (line 1429)

Switch subscribed/unsubscribed viewing.

void showUnsubscribed (boolean $unsub)
  • boolean $unsub: Show unsubscribed elements?
singleton (line 223)

Attempts to return a reference to a concrete IMP_Tree instance.

If an IMP_Tree object is currently stored in the local session, recreate that object. Else, create a new instance. Ensures that only one IMP_Tree instance is available at any time.

This method must be invoked as:

   $imp_tree = &IMP_Tree::singleton();

  • return: The IMP_Tree object or null.
IMP_Tree &singleton ()
subscribe (line 959)

Subscribe an element to the tree.

void subscribe (mixed $id)
  • mixed $id: The element name or an array of element names.
unsubscribe (line 980)

Unsubscribe an element from the tree.

void unsubscribe (mixed $id)
  • mixed $id: The element name or an array of element names.
_isNonIMAPElt (line 1163)

Is the element a non-IMAP element?

  • return: True if the element is a non-IMAP element.
integer _isNonIMAPElt (array $elt)
  • array $elt: A tree element.
_needSort (line 1385)

Does this element's children need sorting?

  • return: True if the children need to be sorted.
integer _needSort (array $elt)
  • array $elt: A tree element.

Documentation generated on Sun, 30 Jan 2011 05:28:19 +0000 by phpDocumentor 1.4.3