[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/IMAP/ -> Tree.php (sommaire)

(pas de description)

Poids: 2002 lignes (60 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

IMAP_Tree:: (65 méthodes):
  singleton()
  IMAP_Tree()
  _store()
  _getList()
  _makeMailboxTreeElt()
  init()
  _init()
  expand()
  collapse()
  next()
  reset()
  current()
  peek()
  _addAliases()
  get()
  insert()
  _insertElt()
  delete()
  subscribe()
  unsubscribe()
  _addLevel()
  _setAttribute()
  hasChildren()
  _setChildren()
  isDiscovered()
  _setDiscovered()
  isOpen()
  _setOpen()
  isContainer()
  _setContainer()
  isSubscribed()
  _setSubscribed()
  isNamespace()
  _removeServerString()
  _initExpandedList()
  _addExpandedList()
  _removeExpandedList()
  getPollList()
  addPollList()
  removePollList()
  isPolled()
  _setPolled()
  _setNeedSort()
  _needSort()
  _initSubscribed()
  _initUnsubscribed()
  expandAll()
  collapseAll()
  _childrenInfo()
  showUnsubscribed()
  _getStream()
  _getInitExpandedMode()
  getElementInfo()
  _sortList()
  _getNonIMAPElt()
  _activeElt()
  _convertName()
  _getNamespace()
  IMAPchildrenSupport()
  eltDiffStart()
  eltDiff()
  extendedNamespaceSupport()
  getPrefix()
  _getMailbox()
  noTrailingDelimiter()


Classe: IMAP_Tree  - X-Ref

The IMAP_Tree class provides a tree view of the folders supported with
the PHP imap extension (IMAP/POP3/NNTP repositories).  It provides access
functions to iterate through this tree and query information about
individual mailboxes/folders.

$Horde: framework/IMAP/IMAP/Tree.php,v 1.48.2.43 2006/05/12 16:29:29 slusarz Exp $

Copyright 2000-2006 Chuck Hagenbuch <chuck@horde.org>
Copyright 2000-2006 Jon Parise <jon@horde.org>
Copyright 2000-2006 Anil Madhavapeddy <avsm@horde.org>
Copyright 2003-2006 Michael Slusarz <slusarz@horde.org>

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

singleton($app, $classname, $create = false,$init = IMAPTREE_INIT_SUB, $cachename = 'imaptree')   X-Ref
Attempts to return a reference to a concrete IMAP_Tree instance.

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

This method must be invoked as:<pre>
$imap_tree = &IMAP_Tree::singleton($app, $classname, [$create[, $unsub]]);</pre>

param: string $app        The current application name.
param: string $classname  The class name to use when instantiating a new
param: boolean $create    Create a new IMAP_Tree if it doesn't exist in
param: integer $init      The initialization mode to use.
param: string $cachename  The name to use when storing in the session.
return: IMAP_Tree  The IMAP_Tree object or null.

IMAP_Tree($init = IMAPTREE_INIT_SUB, $cachename = 'imaptree')   X-Ref
Constructor.

param: integer $init      The initialization mode to use.
param: string $cachename  The name to use when storing in the session.

_store()   X-Ref
Store a serialized version of ourself in the current session.


_getList($path)   X-Ref
Returns a list of folders/mailboxes matching a certain path.

param: string $path  The mailbox path.
return: array  A list of mailbox_objects whose name matched $path.

_makeMailboxTreeElt($ob)   X-Ref
Make a single mailbox tree element.
An element consists of the following items (we use single letters here
to save in session storage space):
'a'  --  Attributes
'c'  --  Level count
'l'  --  Label
'p'  --  Parent node
'v'  --  Value

param: object stdClass $ob  The object returned by imap_getmailboxes().
return: array  See format above.

init($init)   X-Ref
Initalize the list at the top level of the hierarchy.

param: integer $init  The initialization mode.

_init()   X-Ref
Subclass specific initialization tasks.
THIS METHOD MUST BE DEFINED IN ALL SUBCLASSES.

return: array  The initial list of elements to add to the tree.

expand($folder, $expandall = false)   X-Ref
Expand a mail folder.

param: string $folder      The folder name to expand.
param: boolean $expandall  Expand all folders under this one?

collapse($folder)   X-Ref
Collapse a mail folder.

param: string $folder  The folder name to collapse.

next($mask = 0)   X-Ref
Sets the internal array pointer to the next element, and returns the
next object.

param: integer $mask  A mask with the following elements:
return: mixed  Returns the next element or false if the element doesn't

reset()   X-Ref
Set internal pointer to the head of the tree.
This MUST be called before you can traverse the tree with next().

return: mixed  Returns the element at the head of the tree or false

current()   X-Ref
Return the current tree element.

return: array  The current tree element or false if there is no

peek()   X-Ref
Determines if there are more elements in the current tree level.

return: boolean  True if there are more elements, false if this is the

_addAliases($elt)   X-Ref
Adds aliases to a tree element and returns the resulting array.

param: array $elt  A tree element.
return: array  A tree element with the aliases added.

get($name)   X-Ref
Returns the requested element.

param: string $name  The name of the tree element.
return: array  Returns the requested element or false if not found.

insert($id)   X-Ref
Insert a folder/mailbox into the tree.

param: mixed $id  The name of the folder (or a list of folder names)
return: boolean  True on success, false on error.

_insertElt($elt)   X-Ref
Insert an element into the tree.

param: array $elt  The element to insert. The key in the tree is the
return: boolean  True if added to the tree.

delete($id)   X-Ref
Delete an element from the tree.

param: mixed $id  The element name or an array of element names.
return: boolean  Return true on success, false on error.

subscribe($id)   X-Ref
Subscribe an element to the tree.

param: mixed $id  The element name or an array of element names.

unsubscribe($id)   X-Ref
Unsubscribe an element from the tree.

param: mixed $id  The element name or an array of element names.

_addLevel($list)   X-Ref
Add another level of hierarchy to the tree.

param: array $list  A list of stdClass objects in the format returned

_setAttribute(&$elt, $const, $bool)   X-Ref
Set an attribute for an element.

param: array &$elt     The tree element.
param: integer $const  The constant to set/remove from the bitmask.
param: boolean $bool   Should the attribute be set?

hasChildren($elt)   X-Ref
Does the element have any active children?

param: array $elt  A tree element.
return: boolean  True if the element has active children.

_setChildren(&$elt, $bool)   X-Ref
Set the children attribute for an element.

param: array &$elt  A tree element.
param: mixed $bool  The setting. If null, clears the flag.

isDiscovered($elt)   X-Ref
Has the tree element been discovered?

param: array $elt  A tree element.
return: integer  Non-zero if the element has been discovered.

_setDiscovered(&$elt, $bool)   X-Ref
Set the discovered attribute for an element.

param: array &$elt    A tree element.
param: boolean $bool  The setting.

isOpen($elt)   X-Ref
Is the tree element open?

param: array $elt  A tree element.
return: integer  True if the element is open.

_setOpen(&$elt, $bool)   X-Ref
Set the open attribute for an element.

param: array &$elt    A tree element.
param: boolean $bool  The setting.

isContainer($elt)   X-Ref
Is this element a container only, not a mailbox (meaning you can
not open it)?

param: array $elt  A tree element.
return: integer  True if the element is a container.

_setContainer(&$elt, $bool)   X-Ref
Set the element as a container?

param: array &$elt    A tree element.
param: boolean $bool  Is the element a container?

isSubscribed($elt)   X-Ref
Is the user subscribed to this element?

param: array $elt  A tree element.
return: integer  True if the user is subscribed to the element.

_setSubscribed(&$elt, $bool)   X-Ref
Set the subscription status for an element.

param: array &$elt    A tree element.
param: boolean $bool  Is the element subscribed to?

isNamespace($elt)   X-Ref
Is the element a namespace container?

param: array $elt  A tree element.
return: integer  True if the element is a namespace container?

_removeServerString($ob)   X-Ref
Remove the server string from the 'name' parameter.

param: object stdClass $ob  An object returned from
return: stdClass  The object returned with the server string stripped

_initExpandedList()   X-Ref
Initialize the expanded folder list.
THIS METHOD SHOULD BE DEFINED IN ALL SUBCLASSES.


_addExpandedList($id)   X-Ref
Add an element to the expanded list.
THIS METHOD SHOULD BE DEFINED IN ALL SUBCLASSES.

param: string $id  The element name to remove.

_removeExpandedList($id)   X-Ref
Remove an element from the expanded list.
THIS METHOD SHOULD BE DEFINED IN ALL SUBCLASSES.

param: string $id  The element name to remove.

getPollList()   X-Ref
Initialize/get the list of elements to poll.
THIS METHOD SHOULD BE DEFINED IN ALL SUBCLASSES.

return: array  The list of elements to poll (name in key field).

addPollList($id)   X-Ref
Add element to the poll list.
THIS METHOD SHOULD BE DEFINED IN ALL SUBCLASSES.

param: mixed $id  The element name or a list of element names to add.

removePollList($id)   X-Ref
Remove element from the poll list.
THIS METHOD SHOULD BE DEFINED IN ALL SUBCLASSES.

param: string $id  The folder/mailbox or a list of folders/mailboxes

isPolled($elt)   X-Ref
Does the user want to poll this mailbox for new/unseen messages?

param: array $elt  A tree element.
return: integer  True if the user wants to poll the element.

_setPolled(&$elt, $bool)   X-Ref
Set the polled attribute for an element.

param: array &$elt    A tree element.
param: boolean $bool  The setting.

_setNeedSort(&$elt, $bool)   X-Ref
Flag the element as needing its children to be sorted.

param: array &$elt    A tree element.
param: boolean $bool  The setting.

_needSort($elt)   X-Ref
Does this element's children need sorting?

param: array $elt  A tree element.
return: integer  True if the children need to be sorted.

_initSubscribed()   X-Ref
Initialize the list of subscribed mailboxes.


_initUnsubscribed()   X-Ref
Initialize the list of unsubscribed mailboxes.


expandAll()   X-Ref
Should we expand all elements?


collapseAll()   X-Ref
Should we collapse all elements?


_childrenInfo($id)   X-Ref
Return the list of mailboxes in the next level.

param: string $id  The current mailbox.
return: array  A list of mailbox objects or the empty list.

showUnsubscribed($unsub)   X-Ref
Switch subscribed/unsubscribed viewing.

param: boolean $unsub  Show unsubscribed elements?

_getStream()   X-Ref
Returns a reference to a currently open IMAP stream.
THIS METHOD MUST BE DEFINED IN ALL SUBCLASSES.

return: resource  An IMAP resource stream.

_getInitExpandedMode()   X-Ref
Returns the currently selected initialization expanded mode.
THIS METHOD SHOULD BE DEFINED IN ALL SUBCLASSES.

return: integer  The current initialization expanded mode.

getElementInfo($name)   X-Ref
Get information about new/unseen/total messages for the given element.

param: string $name  The element name.
return: array  Array with the following fields:

_sortList(&$mbox, $base = false)   X-Ref
Sorts a list of mailboxes.

param: array &$mbox   The list of mailboxes to sort.
param: boolean $base  Are we sorting a list of mailboxes in the base

_getNonIMAPElt($id)   X-Ref
Return a Non-IMAP mailbox element given an element identifier.

param: string $id  The element identifier.
return: array  A mailbox element.

_activeElt($elt)   X-Ref
Is the given element an "active" element (i.e. an element that should
be worked with given the current viewing parameters).

param: array $elt  A tree element.
return: boolean  True if it is an active element.

_convertName($name)   X-Ref
Convert a mailbox name to the correct, internal name (i.e. make sure
INBOX is always capitalized for IMAP servers).

param: string $name  The mailbox name.
return: string  The converted name.

_getNamespace($mailbox)   X-Ref
Get namespace info for a full folder path.

param: string $mailbox  The folder path.
return: mixed  The namespace info for the folder path or null if the

IMAPchildrenSupport($support)   X-Ref
Does the IMAP server support the 'CHILDREN' IMAP extension?

param: boolean $support  True if the IMAP server supports the CHILDREN

eltDiffStart()   X-Ref
Set the start point for determining element differences via eltDiff().


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

return: array  An array with the following keys:

extendedNamespaceSupport()   X-Ref
The existence of this function in IMAP_Tree indicates that extended
namespace support is available.

return: boolean  Returns true.

getPrefix()   X-Ref
Return the prefix.

return: string  The prefix where folders begin to be listed.

_getMailbox($path)   X-Ref
Get information about a specific mailbox.

param: string $path  The mailbox to query.
return: stdClass  See imap_getmailboxes().  The server string has

noTrailingDelimiter($name)   X-Ref
Make sure there is no trailing delimiter on the element name.

param: string $name  The element name.
return: string  The element name with any trailing delimiter stripped



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7