Class IMP_Message

Description

The IMP_Message:: class contains all functions related to handling messages within IMP. Actions such as moving, copying, and deleting messages are handled in here so that code need not be repeated between mailbox, message, and other pages.

Indices format: =============== For any function below that requires an $indices parameter, see IMP::parseIndicesList() for the list of allowable inputs.

$Horde: imp/lib/Message.php,v 1.164.8.64 2010-09-01 07:57:47 slusarz Exp $

Copyright 2000-2001 Chris Hyde <chris@jeks.net> Copyright 2000-2009 The Horde Project (http://www.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.

Located in /lib/Message.php (line 31)


	
			
Variable Summary
Method Summary
 IMP_Message IMP_Message ()
 boolean copy (string $targetMbox, integer $action, mixed &$indices, [boolean $new = false])
 boolean createTasksOrNotes (string $list, integer $action,  &$indices, [string $type = 'task'], mixed $indices)
 integer|boolean delete (mixed &$indices, [boolean $nuke = false], [boolean $keeplog = false])
 void emptyMailbox (array $mbox_list)
 array expungeMailbox (array $mbox_list)
 boolean flag (array $flag, mixed &$indices, [boolean $action = true])
 boolean flagAllInMailbox (array $flag, array $mboxes, [boolean $action = true])
 void sizeMailbox ( $mbox, [boolean $formatted = true], string $mbox_list)
 boolean stripPart ( &$imp_mailbox, [string $partid = null], IMP_Mailbox $imp_mailbox)
 boolean undelete (mixed &$indices)
Variables
IMP_Mailbox $_mboxOb (line 45)

The active IMP_Mailbox object to update on certain actions

integer $_mboxObCount = 0 (line 52)

Recursion count used to determine when $_mboxOb should be unset.

boolean $_usepop = false (line 38)

Using POP to access mailboxes?

Methods
Constructor IMP_Message (line 79)

Constructor.

IMP_Message IMP_Message ()
copy (line 97)

Copies or moves a list of messages to a new folder.

Handles use of the IMP_SEARCH_MBOX mailbox and the Trash folder.

  • return: True if successful, false if not.
boolean copy (string $targetMbox, integer $action, mixed &$indices, [boolean $new = false])
  • string $targetMbox: The mailbox to move/copy messages to.
  • integer $action: Either IMP_MESSAGE_MOVE or IMP_MESSAGE_COPY.
  • mixed &$indices: See above.
  • boolean $new: Whether the target mailbox has to be created.
createTasksOrNotes (line 354)

Copies or moves a list of messages to a tasklist or notepad.

Handles use of the IMP_SEARCH_MBOX mailbox and the Trash folder.

  • return: True if successful, false if not.
boolean createTasksOrNotes (string $list, integer $action,  &$indices, [string $type = 'task'], mixed $indices)
  • string $list: The list in which the task or note will be created.
  • integer $action: Either IMP_MESSAGE_MOVE or IMP_MESSAGE_COPY.
  • mixed $indices: See above.
  • string $type: The object type to create, defaults to task.
  • &$indices
delete (line 187)

Deletes a list of messages taking into account whether or not a Trash folder is being used.

Handles use of the IMP_SEARCH_MBOX mailbox and the Trash folder.

  • return: The number of messages deleted if successful, false if not.
integer|boolean delete (mixed &$indices, [boolean $nuke = false], [boolean $keeplog = false])
  • mixed &$indices: See above.
  • boolean $nuke: Override user preferences and nuke (i.e. permanently delete) the messages instead?
  • boolean $keeplog: Should any history information of the message be kept?
emptyMailbox (line 767)

Empties an entire mailbox.

void emptyMailbox (array $mbox_list)
  • array $mbox_list: The list of mailboxes to empty.
expungeMailbox (line 703)

Expunges all deleted messages from the list of mailboxes.

  • return: An array of mailbox names as keys and UIDS as values that were expunged.
array expungeMailbox (array $mbox_list)
  • array $mbox_list: The list of mailboxes to empty as keys; an optional array of indices to delete as values. If the value is not an array, all messages flagged as deleted in the mailbox will be deleted.
flag (line 600)

Sets or clears a given flag for a list of messages.

Handles use of the IMP_SEARCH_MBOX mailbox. This function works with IMAP only, not POP3.

Valid flags are: 'seen', 'flagged', 'answered', 'deleted', 'draft'

  • return: True if successful, false if not.
boolean flag (array $flag, mixed &$indices, [boolean $action = true])
  • array $flag: The IMAP flag(s) to set or clear.
  • mixed &$indices: See above.
  • boolean $action: If true, set the flag(s), otherwise clear the flag(s).
flagAllInMailbox (line 666)

Sets or clears a given flag(s) for all messages in a list of mailboxes.

This function works with IMAP only, not POP3.

See flag() for the list of valid flags.

  • return: True if successful, false if not.
boolean flagAllInMailbox (array $flag, array $mboxes, [boolean $action = true])
  • array $flag: The IMAP flag(s) to set or clear.
  • array $mboxes: The list of mailboxes to flag.
  • boolean $action: If true, set the flag(s), otherwise, clear the flag(s).
singleton (line 65)

Returns a reference to the global IMP_Message object, only creating it if it doesn't already exist. This ensures that only one IMP_Message instance is instantiated for any given session.

This method must be invoked as:

  1.    $imp_message &IMP_Message::singleton();

  • return: The IMP_Message instance.
IMP_Message &singleton ()
sizeMailbox (line 855)

Obtains the size of a mailbox.

  • since: IMP 4.2
void sizeMailbox ( $mbox, [boolean $formatted = true], string $mbox_list)
  • string $mbox_list: The mailbox to obtain the size of.
  • boolean $formatted: Whether to return a human readable value.
  • $mbox
stripPart (line 496)

Strips one or all MIME parts out of a message.

Handles the IMP_SEARCH_MBOX mailbox.

  • return: Returns true on success, or PEAR_Error on error.
boolean stripPart ( &$imp_mailbox, [string $partid = null], IMP_Mailbox $imp_mailbox)
  • IMP_Mailbox $imp_mailbox: The IMP_Mailbox object with the current index set to the message to be processed.
  • string $partid: The MIME ID of the part to strip. All parts are stripped if null.
  • &$imp_mailbox
undelete (line 337)

Undeletes a list of messages.

Handles the IMP_SEARCH_MBOX mailbox. This function works with IMAP only, not POP3.

  • return: True if successful, false if not.
boolean undelete (mixed &$indices)
  • mixed &$indices: See above.

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