Class IMP_Contents

Description

The IMP_Contents:: class extends the MIME_Contents:: class and contains all functions related to handling the content and output of mail messages in IMP.

$Horde: imp/lib/MIME/Contents.php,v 1.153.4.61 2009/01/06 15:24:09 jan Exp $

Copyright 2002-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/MIME/Contents.php (line 32)

MIME_Contents
   |
   --IMP_Contents
Variable Summary
 string $_body
 array $_bodypart
 integer $_body_id
 array $_downloads
 integer $_index
 string $_mailbox
 boolean $_strip
Method Summary
 IMP_Contents IMP_Contents (mixed $in)
 void attachmentCount (return 0)
 string buildMessagePart (MIME_Part &$mime_part)
 string findBody ([string $subtype = null])
 string formatStatusMsg (mixed $msg, [string $img = null], [ $printable = true], boolean $print)
 string fullMessageText ()
 string getBody ()
 string getBodyPart (integer $id)
 string getDownloadAllLink ()
 string getFromAddress ()
 integer getMessageIndex ()
 string getMessageMailbox ()
 MIME_Part &getRawMIMEPart (integer $id, [boolean $all = false])
 string linkView (MIME_Part &$mime_part, integer $actionID, string $text, [array $params = array()])
 array partSummary (MIME_Part &$mime_part, [boolean $guess = false])
 MIME_Message rebuildMessage ()
 void removeAtcEntry (string $index)
 string renderMIMEPart (MIME_Part &$mime_part)
 void setStripLink ([boolean $strip = false], [string $message_token = null])
 IMP_Contents &singleton (mixed $in)
 string toString (MIME_Message $message, [boolean $canonical = false])
 string urlView (MIME_Part &$mime_part, integer $actionID, [array $params = array()], [boolean $dload = false])
Variables
string $_body = '' (line 39)

The text of the body of the message.

array $_bodypart = array() (line 55)

The text of various MIME body parts.

integer $_body_id (line 48)

The MIME part id of the message body.

  • todo: Copied to MIME_Contents but kept here for BC.
array $_downloads = null (line 85)

List of all downloadable parts.

  • todo: Copied to MIME_Contents but kept here for BC.
integer $_index (line 62)

The IMAP index of the message.

string $_mailbox (line 69)

The mailbox of the current message.

boolean $_strip = false (line 76)

Should attachment stripping links be generated?

Methods
Constructor IMP_Contents (line 137)

Constructor.

IMP_Contents IMP_Contents (mixed $in)
  • mixed $in: Either an index string (see IMP_Contents::singleton() for the format) or a MIME_Message object.
attachmentCount (line 866)

Return the attachment count.

  • since: IMP 4.2
void attachmentCount (return 0)
  • return 0: array The attachment count.
buildMessagePart (line 567)

Processes a MIME_Part and stores the display information in the internal class variables.

  • return: The rendered text.
string buildMessagePart (MIME_Part &$mime_part)
  • MIME_Part &$mime_part: The MIME_Part object to process.
findBody (line 682)

Finds the main "body" text part (if any) in a message.

"Body" data is the first text part in the base MIME part.

  • return: The MIME ID of the main "body" part.
  • todo: Copied to MIME_Contents but kept here for BC.
string findBody ([string $subtype = null])
  • string $subtype: Specifically search for this subtype.
formatStatusMsg (line 663)

Prints out the status message for a given MIME Part.

  • return: The formatted status message.
string formatStatusMsg (mixed $msg, [string $img = null], [ $printable = true], boolean $print)
  • mixed $msg: See MIME_Contents::formatStatusMsg().
  • string $img: See MIME_Contents::formatStatusMsg().
  • boolean $print: Output this message when in a print view?
  • $printable
fullMessageText (line 346)

Returns the full message text.

  • return: The full message text.
string fullMessageText ()
getBody (line 178)

Returns the entire body of the message.

  • return: The text of the body of the message.
string getBody ()
getBodyPart (line 196)

Gets the raw text for one section of the message.

  • return: The text of the part.
string getBodyPart (integer $id)
  • integer $id: The ID of the MIME_Part.
getDownloadAllLink (line 543)

Generate a download all link, if possible.

  • return: The download link.
string getDownloadAllLink ()
getDownloadAllList (line 500)

Generate the list of MIME IDs to use for download all.

  • return: The list of MIME IDs that should be downloaded when downloading all attachments.
  • todo: Copied to MIME_Contents but kept here for BC.
array getDownloadAllList ()
getFromAddress (line 486)

Get the from address of the message.

  • return: The from address of the message.
string getFromAddress ()
getHeaderOb (line 357)

Returns the header object.

  • return: The IMP_Headers object.
IMP_Headers &getHeaderOb ()
getMessageIndex (line 371)

Returns the IMAP index for the current message.

  • return: The message index.
integer getMessageIndex ()
getMessageMailbox (line 383)

Returns the IMAP mailbox for the current message.

  • return: The message mailbox.
  • since: IMP 4.2.1
string getMessageMailbox ()
getRawMIMEPart (line 799)

Fetch part of a MIME message.

  • return: The MIME_Part.
  • since: IMP 4.1
MIME_Part &getRawMIMEPart (integer $id, [boolean $all = false])
  • integer $id: The MIME ID of the part requested.
  • boolean $all: If this is a header part, should we return all text in the body?
linkView (line 316)

Generate a link to the view.php page.

  • return: See MIME_Contents::linkView().
string linkView (MIME_Part &$mime_part, integer $actionID, string $text, [array $params = array()])
  • MIME_Part &$mime_part: See MIME_Contents::linkView().
  • integer $actionID: See MIME_Contents::linkView().
  • string $text: See MIME_Contents::linkView().
  • array $params: See MIME_Contents::linkView().
partSummary (line 232)

Returns an array summarizing a part of a MIME message.

  • return: See MIME_Contents::partSummary(). Adds the following key to that return: [6] = Compressed Download Link [7] = Image Save link (if allowed) [8] = Strip Attachment Link (if allowed)
array partSummary (MIME_Part &$mime_part, [boolean $guess = false])
  • MIME_Part &$mime_part: See MIME_Contents::partSummary().
  • boolean $guess: See MIME_Contents::partSummary().
rebuildMessage (line 400)

Rebuild the MIME_Part structure of a message from IMAP data.

This will store IMAP data in all parts of the message - for example, all data for a multipart/mixed part will be stored in the base part, and each part will contain its own data. Note that if you want to build a message string from the MIME_Part data after calling rebuildMessage(), you should use IMP_Contents::toString() instead of MIME_Part::toString().

  • return: A MIME_Message object with all of the body text stored in the individual MIME_Parts.
MIME_Message rebuildMessage ()
removeAtcEntry (line 849)

Remove all attachment entries for the given part.

TODO: This is a total hack to tide us over to Horde 4.0.

  • since: IMP 4.2
void removeAtcEntry (string $index)
  • string $index: The index to remove from the attachment list.
renderMIMEPart (line 443)

Render a MIME Part.

  • return: The rendered data.
string renderMIMEPart (MIME_Part &$mime_part)
  • MIME_Part &$mime_part: A MIME_Part object.
setStripLink (line 214)

Allow attachments to be stripped by providing a link in summary view?

void setStripLink ([boolean $strip = false], [string $message_token = null])
  • boolean $strip: Should the strip links be generated?
  • string $message_token: The message token to append to the strip URL.
singleton (line 102)

Attempts to return a reference to a concrete IMP_Contents instance.

If an IMP_Contents object is currently stored in the local cache, recreate that object. Else, create a new instance. Ensures that only one IMP_Contents instance for any given message is available at any one time.

This method must be invoked as: $imp_contents = &IMP_Contents::singleton($in);

  • return: The IMP_Contents object or null.
IMP_Contents &singleton (mixed $in)
  • mixed $in: Either an index string (see IMP_Contents::singleton() for the format) or a MIME_Message object.
toString (line 821)

Create a message string from a MIME message that has used rebuildMessage() to build the data from the IMAP server.

  • return: The contents of the MIME_Message object.
  • since: IMP 4.1
string toString (MIME_Message $message, [boolean $canonical = false])
  • MIME_Message $message: A MIME_Message object.
  • boolean $canonical: Return a canonical string?
urlView (line 293)

Return the URL to the view.php page.

  • return: The URL to view.php.
string urlView (MIME_Part &$mime_part, integer $actionID, [array $params = array()], [boolean $dload = false])
  • MIME_Part &$mime_part: See MIME_Contents::urlView().
  • integer $actionID: See MIME_Contents::urlView().
  • array $params: See MIME_Contents::urlView().
  • boolean $dload: See MIME_Contents::urlView(). The following parameter names will be overwritten by this function: id, index, mailbox

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