Overview

Packages

  • IMP
  • None

Classes

  • IMP
  • IMP_Ajax_Application
  • IMP_Ajax_Imple_ContactAutoCompleter
  • IMP_Ajax_Imple_PassphraseDialog
  • IMP_Ajax_Queue
  • IMP_Api
  • IMP_Auth
  • IMP_Block_Newmail
  • IMP_Block_Summary
  • IMP_Compose
  • IMP_Compose_Exception
  • IMP_Compose_Stationery
  • IMP_Contents
  • IMP_Crypt_Pgp
  • IMP_Crypt_Smime
  • IMP_Dimp
  • IMP_Exception
  • IMP_Factory_AuthImap
  • IMP_Factory_Compose
  • IMP_Factory_Contents
  • IMP_Factory_Flags
  • IMP_Factory_Identity
  • IMP_Factory_Imap
  • IMP_Factory_Imaptree
  • IMP_Factory_Mail
  • IMP_Factory_Mailbox
  • IMP_Factory_MailboxList
  • IMP_Factory_MimeViewer
  • IMP_Factory_Pgp
  • IMP_Factory_Quota
  • IMP_Factory_Search
  • IMP_Factory_Sentmail
  • IMP_Factory_Smime
  • IMP_Filter
  • IMP_Flag_Base
  • IMP_Flag_Imap
  • IMP_Flag_Imap_Answered
  • IMP_Flag_Imap_Deleted
  • IMP_Flag_Imap_Draft
  • IMP_Flag_Imap_Flagged
  • IMP_Flag_Imap_Forwarded
  • IMP_Flag_Imap_Junk
  • IMP_Flag_Imap_NotJunk
  • IMP_Flag_Imap_Seen
  • IMP_Flag_System_Attachment
  • IMP_Flag_System_Encrypted
  • IMP_Flag_System_HighPriority
  • IMP_Flag_System_List
  • IMP_Flag_System_LowPriority
  • IMP_Flag_System_Match_Address
  • IMP_Flag_System_Match_Flag
  • IMP_Flag_System_Match_Header
  • IMP_Flag_System_Personal
  • IMP_Flag_System_Signed
  • IMP_Flag_System_Unseen
  • IMP_Flag_User
  • IMP_Flags
  • IMP_Imap
  • IMP_Imap_Acl
  • IMP_Imap_Exception
  • IMP_Imap_PermanentFlags
  • IMP_Imap_Thread
  • IMP_Imap_Tree
  • IMP_Indices
  • IMP_Indices_Form
  • IMP_LoginTasks_SystemTask_GarbageCollection
  • IMP_LoginTasks_SystemTask_Upgrade
  • IMP_LoginTasks_SystemTask_UpgradeAuth
  • IMP_LoginTasks_Task_Autocreate
  • IMP_LoginTasks_Task_DeleteAttachmentsMonthly
  • IMP_LoginTasks_Task_DeleteSentmailMonthly
  • IMP_LoginTasks_Task_FilterOnLogin
  • IMP_LoginTasks_Task_PurgeSentmail
  • IMP_LoginTasks_Task_PurgeSpam
  • IMP_LoginTasks_Task_PurgeTrash
  • IMP_LoginTasks_Task_RecoverDraft
  • IMP_LoginTasks_Task_RenameSentmailMonthly
  • IMP_Mailbox
  • IMP_Mailbox_List
  • IMP_Mailbox_List_Track
  • IMP_Maillog
  • IMP_Menu_Dimp
  • IMP_Message
  • IMP_Mime_Status
  • IMP_Mime_Viewer_Alternative
  • IMP_Mime_Viewer_Appledouble
  • IMP_Mime_Viewer_Audio
  • IMP_Mime_Viewer_Enriched
  • IMP_Mime_Viewer_Externalbody
  • IMP_Mime_Viewer_Html
  • IMP_Mime_Viewer_Images
  • IMP_Mime_Viewer_Itip
  • IMP_Mime_Viewer_Mdn
  • IMP_Mime_Viewer_Partial
  • IMP_Mime_Viewer_Pdf
  • IMP_Mime_Viewer_Pgp
  • IMP_Mime_Viewer_Plain
  • IMP_Mime_Viewer_Related
  • IMP_Mime_Viewer_Rfc822
  • IMP_Mime_Viewer_Smil
  • IMP_Mime_Viewer_Smime
  • IMP_Mime_Viewer_Status
  • IMP_Mime_Viewer_Vcard
  • IMP_Mime_Viewer_Video
  • IMP_Mime_Viewer_Zip
  • IMP_Notification_Event_Status
  • IMP_Notification_Handler_Decorator_ImapAlerts
  • IMP_Notification_Handler_Decorator_NewmailNotify
  • IMP_Notification_Listener_AjaxStatus
  • Imp_Prefs_Identity
  • IMP_Prefs_Ui
  • IMP_Quota
  • IMP_Quota_Base
  • IMP_Quota_Command
  • IMP_Quota_Hook
  • IMP_Quota_Imap
  • IMP_Quota_Maildir
  • IMP_Quota_Mdaemon
  • IMP_Quota_Mercury32
  • IMP_Quota_Null
  • IMP_Quota_Sql
  • IMP_Search
  • IMP_Search_Element
  • IMP_Search_Element_Attachment
  • IMP_Search_Element_Autogenerated
  • IMP_Search_Element_Bulk
  • IMP_Search_Element_Contacts
  • IMP_Search_Element_Date
  • IMP_Search_Element_Flag
  • IMP_Search_Element_Header
  • IMP_Search_Element_Mailinglist
  • IMP_Search_Element_Or
  • IMP_Search_Element_Personal
  • IMP_Search_Element_Recipient
  • IMP_Search_Element_Size
  • IMP_Search_Element_Text
  • IMP_Search_Element_Within
  • IMP_Search_Filter
  • IMP_Search_Filter_Attachment
  • IMP_Search_Filter_Autogenerated
  • IMP_Search_Filter_Builtin
  • IMP_Search_Filter_Bulk
  • IMP_Search_Filter_Contacts
  • IMP_Search_Filter_Mailinglist
  • IMP_Search_Filter_Personal
  • IMP_Search_Query
  • IMP_Search_Vfolder
  • IMP_Search_Vfolder_Builtin
  • IMP_Search_Vfolder_Vinbox
  • IMP_Search_Vfolder_Vtrash
  • IMP_Sentmail
  • IMP_Sentmail_Base
  • IMP_Sentmail_Null
  • IMP_Sentmail_Sql
  • IMP_Spam
  • IMP_Test
  • IMP_Tree_Flist
  • IMP_Tree_Jquerymobile
  • IMP_Tree_Simplehtml
  • IMP_Ui_Compose
  • IMP_Ui_Editor
  • IMP_Ui_Folder
  • IMP_Ui_Headers
  • IMP_Ui_Imageview
  • IMP_Ui_Mailbox
  • IMP_Ui_Message
  • IMP_Ui_Mimp
  • IMP_Ui_Search
  • IMP_Views_Compose
  • IMP_Views_ListMessages
  • IMP_Views_ShowMessage
  • Overview
  • Package
  • Class
  • Tree

Class IMP_Imap_Tree

The IMP_Imap_Tree class provides a tree view of the mailboxes in an IMAP/POP3 repository. It provides access functions to iterate through this tree and query information about individual mailboxes. In IMP, folders = IMAP mailboxes so the two terms are used interchangably.

Copyright 2000-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

IMP_Imap_Tree implements ArrayAccess, Countable, Iterator, Serializable
Package: IMP
Category: Horde
License: GPL
Author: Chuck Hagenbuch chuck@horde.org
Author: Jon Parise jon@horde.org
Author: Anil Madhavapeddy avsm@horde.org
Author: Michael Slusarz slusarz@horde.org
Located at Imap/Tree.php
Methods summary
public
# __construct( )

Constructor.

Constructor.

public
# init( )

Initalize the tree.

Initalize the tree.

public
# expand( string $folder, boolean $expandall = false )

Expand a mail folder.

Expand a mail folder.

Parameters

$folder
The folder name to expand.
$expandall
Expand all folders under this one?
public
# collapse( string $folder )

Collapse a mail folder.

Collapse a mail folder.

Parameters

$folder
The folder name to collapse.
public
# insert( mixed $id )

Insert a folder/mailbox into the tree.

Insert a folder/mailbox into the tree.

Parameters

$id
<p>The name of the folder (or a list of folder names) to add.</p>
public boolean
# delete( mixed $id )

Delete an element from the tree.

Delete an element from the tree.

Parameters

$id
The element name or an array of element names.

Returns

boolean
Return true on success, false on error.
public
# subscribe( mixed $id )

Subscribe an element to the tree.

Subscribe an element to the tree.

Parameters

$id
The element name or an array of element names.
public
# unsubscribe( mixed $id )

Unsubscribe an element from the tree.

Unsubscribe an element from the tree.

Parameters

$id
The element name or an array of element names.
public boolean
# hasChildren( mixed $in )

Does the element have any active children?

Does the element have any active children?

Parameters

$in
A mailbox name or a tree element.

Returns

boolean
True if the element has active children.
public integer
# isOpen( mixed $in )

Is the tree element open?

Is the tree element open?

Parameters

$in
A mailbox name or a tree element.

Returns

integer
True if the element is open.
public integer
# isContainer( mixed $in )

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

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

Parameters

$in
A mailbox name or a tree element.

Returns

integer
True if the element is a container.
public integer
# isSubscribed( mixed $in )

Is the user subscribed to this element?

Is the user subscribed to this element?

Parameters

$in
A mailbox name or a tree element.

Returns

integer
True if the user is subscribed to the element.
public integer
# isNamespace( mixed $in )

Is the element a namespace container?

Is the element a namespace container?

Parameters

$in
A mailbox name or a tree element.

Returns

integer
True if the element is a namespace container.
public integer
# isNonImapElt( mixed $in )

Is the element a non-IMAP element?

Is the element a non-IMAP element?

Parameters

$in
A mailbox name or a tree element.

Returns

integer
True if the element is a non-IMAP element.
public array
# getPollList( boolean $sort = false )

Initializes and returns the list of mailboxes to poll.

Initializes and returns the list of mailboxes to poll.

Parameters

$sort
Sort the directory list?

Returns

array
The list of mailboxes to poll (IMP_Mailbox objects).
public
# addPollList( mixed $id )

Add element to the poll list.

Add element to the poll list.

Parameters

$id
The element name or a list of element names to add.
public
# removePollList( mixed $id )

Remove element from the poll list.

Remove element from the poll list.

Parameters

$id
<p>The folder/mailbox or a list of folders/mailboxes to remove.</p>
public
# prunePollList( )

Prune non-existent folders from poll list.

Prune non-existent folders from poll list.

public integer
# isPolled( mixed $in )

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

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

Parameters

$in
A mailbox name or a tree element.

Returns

integer
True if the user wants to poll the element.
public integer
# isInvisible( mixed $in )

Is the element invisible?

Is the element invisible?

Parameters

$in
A mailbox name or a tree element.

Returns

integer
True if the element is marked as invisible.
public
# expandAll( )

Should we expand all elements?

Should we expand all elements?

public
# collapseAll( )

Should we collapse all elements?

Should we collapse all elements?

public
# showUnsubscribed( boolean $unsub )

Switch subscribed/unsubscribed viewing.

Switch subscribed/unsubscribed viewing.

Parameters

$unsub
Show unsubscribed elements?
public
# eltDiffStart( )

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

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

public array
# eltDiff( )

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

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

Returns

array

Returns false if no changes have occurred, or an array with the following keys: - a: (array) Elements that have been added. - c: (array) Elements that have been changed. - d: (array) Elements that have been deleted.

public
# updateVFolders( array $vfolders )

Updates the virtual folder list in the tree.

Updates the virtual folder list in the tree.

Parameters

$vfolders
A list of IMP_Search_VFolder objects.
public integer
# isVFolder( mixed $in )

Returns whether this element is a virtual folder.

Returns whether this element is a virtual folder.

Parameters

$in
A mailbox name or a tree element.

Returns

integer
True if the element is a virtual folder.
public
# rename( string $old, string $new )

Rename a current folder.

Rename a current folder.

Parameters

$old
The old mailbox name.
$new
The new mailbox name.
public IMP_Mailbox
# createMailboxName( string $parent, string $new )

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

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

Parameters

$parent
The parent name (UTF7-IMAP).
$new
$parent The new mailbox name (UTF7-IMAP).

Returns

IMP_Mailbox
The new mailbox.

Throws

IMP_Exception
public Horde_Tree
# createTree( string|Horde_Tree $name, array $opts = array() )

Creates a Horde_Tree representation of the current tree (respecting the current iterator filter).

Creates a Horde_Tree representation of the current tree (respecting the current iterator filter).

Parameters

$name
<p>Either the tree name, or a Horde_Tree object to add nodes to.</p>
$opts
<p>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 - 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? 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</p>

Returns

Horde_Tree
The tree object.
public mixed
# getElement( mixed $in )

Returns the internal IMAP Tree element for a given mailbox.

Returns the internal IMAP Tree element for a given mailbox.

Parameters

$in
$elt A mailbox name or a tree element.

Returns

mixed
The element array, or null if not found.
public
# offsetExists( mixed $offset )

Implementation of

ArrayAccess::offsetExists()
public
# offsetGet( mixed $offset )

Implementation of

ArrayAccess::offsetGet()
public
# offsetSet( mixed $offset, mixed $value )

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( mixed $offset )

Implementation of

ArrayAccess::offsetUnset()
public
# count( )

Return the number of mailboxes on the server.

Return the number of mailboxes on the server.

Implementation of

Countable::count()
public
# current( )

Implementation of

Iterator::current()
public
# key( )

Implementation of

Iterator::key()
public
# next( )

Implementation of

Iterator::next()
public
# rewind( )

Implementation of

Iterator::rewind()
public
# valid( )

Implementation of

Iterator::valid()
public
# setIteratorFilter( integer $mask = 0, string $base = null )

Set the current iterator filter and reset the internal pointer.

Set the current iterator filter and reset the internal pointer.

Parameters

$mask
A mask with the following possible elements: <ul> <li> IMP_Imap_Tree::FLIST_NOCONTAINER: Don't include container elements. </li> <li> IMP_Imap_Tree::FLIST_UNSUB: Include unsubscribed elements. </li> <li> IMP_Imap_Tree::FLIST_VFOLDER: Include Virtual Folders. </li> <li> IMP_Imap_Tree::FLIST_NOCHILDREN: Don't include child elements. </li> <li> IMP_Imap_Tree::FLIST_EXPANDED: Only include expanded folders. </li> <li> IMP_Imap_Tree::FLIST_ASIS: Display the list as is currently cached in this object. </li> <li>Options that require $base to be set: <ul> <li> IMP_Imap_Tree::FLIST_ANCESTORS: Include ancestors of $base. </li> <li> IMP_Imap_Tree::FLIST_SAMELEVEL: Include all mailboxes at the same level as $base. </li> <li> IMP_Imap_Tree::FLIST_NOBASE: Don't include $base in the return. </li> </ul> </li> </ul>
$base
Include all mailboxes below this element.
public
# serialize( )

Implementation of

Serializable::serialize()
public
# unserialize( mixed $data )

Throws

Exception

Implementation of

Serializable::unserialize()
Constants summary
integer VERSION
# 1
integer ELT_NOSELECT
# 1
integer ELT_NAMESPACE
# 2
integer ELT_IS_OPEN
# 4
integer ELT_IS_SUBSCRIBED
# 8
integer ELT_IS_POLLED
# 32
integer ELT_NEED_SORT
# 64
integer ELT_VFOLDER
# 128
integer ELT_NONIMAP
# 256
integer ELT_INVISIBLE
# 512
integer OPEN_NONE
# 0
integer OPEN_ALL
# 1
integer OPEN_USER
# 2
integer FLIST_NOCONTAINER
# 1
integer FLIST_UNSUB
# 2
integer FLIST_VFOLDER
# 4
integer FLIST_NOCHILDREN
# 8
integer FLIST_EXPANDED
# 16
integer FLIST_ANCESTORS
# 32
integer FLIST_SAMELEVEL
# 64
integer FLIST_NOBASE
# 128
integer FLIST_ASIS
# 256
string BASE_ELT
# "base\0"
string VFOLDER_KEY
# "vfolder\0"
string SHARED_KEY
# "shared\0"
string OTHER_KEY
# "other\0"
Properties summary
public boolean $changed

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

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

# false
public array $unseen

Unseen count.

Unseen count.

# 0
API documentation generated by ApiGen