Class IMP_Flags
The IMP_Flags class provides an interface to deal with display of
flags/keywords/labels on messages.
Copyright 2009-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_Flags
implements
ArrayAccess,
Serializable
Methods summary
public
|
|
public
array
|
#
getList( array $opts = array() )
Return the raw list of flags.
Return the raw list of flags.
Parameters
- $opts
- <p>Additional options:
- imap: (boolean) If true, only return IMAP flags that can be set by
the user.
DEFAULT: false
- mailbox: (string) A real (not virtual) IMAP mailbox. If set, will
determine what flags are available in the mailbox.
DEFAULT: '' (no mailbox check)</p>
Returns
array An array of IMP_Flag_Base elements.
|
public
string
|
#
addFlag( string $label )
Add a user-defined IMAP flag.
Add a user-defined IMAP flag.
Parameters
- $label
- The label to use for the new flag.
Returns
string The IMAP flag name.
|
public
|
#
updateFlag( string $key, string $type, string $data )
Updates flag properties.
Parameters
- $key
- The flag key.
- $type
- <p>The property to update. Either 'bgcolor' or
'label'.</p>
- $data
- The updated data.
|
public
array
|
#
parse( array $opts = array() )
Parse a list of flag information.
Parse a list of flag information.
Parameters
- $opts
- <p>Options:
- flags: (array) IMAP flag info. A lowercase list of flags returned
by the IMAP server.
- headers: (Horde_Mime_Headers) Determines message information
from a headers object.
- personal: (mixed) Personal message info. Either an array of To
addresses as returned by
Horde_Mime_Address::getAddressesFromObject() or the
identity that matched the address list.</p>
Returns
array A list of IMP_Flag_Base objects.
|
public
array
|
#
parseFormId( string $id )
Process a flag ID formatted for use in form data.
Process a flag ID formatted for use in form data.
Parameters
- $id
- The ID from form data.
Returns
array Two element array:
- flag: (string) The flag name.
- set: (boolean) Whether the flag should be set or not.
|
public
array
|
#
changed( array $flags, boolean $add )
Returns a list of flags that have changed due to IMAP flag changes.
Returns a list of flags that have changed due to IMAP flag changes.
Parameters
- $flags
- The list of IMAP flags added/removed.
- $add
- <p>True if these flags were added, false if they were
removed.</p>
Returns
array Array with two keys: 'add' and 'remove'. Each key
contains a list of IMP_Flag_Base objects.
|
public
|
#
offsetExists( mixed $offset )
Implementation of
ArrayAccess::offsetExists()
|
public
|
#
offsetGet( mixed $offset )
Implementation of
ArrayAccess::offsetGet()
|
public
|
#
offsetSet( mixed $offset, mixed $value )
Throws
InvalidArgumentException
Implementation of
ArrayAccess::offsetSet()
|
public
|
#
offsetUnset( mixed $offset )
Implementation of
ArrayAccess::offsetUnset()
|
public
|
#
serialize( )
Implementation of
Serializable::serialize()
|
public
|
#
unserialize( mixed $data )
Implementation of
Serializable::unserialize()
|
Properties summary
public
boolean
|
$changed
Has the object data changed?
Has the object data changed?
|
|