Class MIME_Contents

Description

The MIME_Contents:: class contains functions related to handling the output of MIME content.

$Horde: framework/MIME/MIME/Contents.php,v 1.129.4.48 2010-10-26 23:21:49 slusarz 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 /MIME/MIME/Contents.php (line 42)


	
			
Variable Summary
Method Summary
 MIME_Contents MIME_Contents (MIME_Message $messageOb, [array $viewID = array()], [ $contents = array()], array &$contents)
 boolean buildMessage ()
 string buildMessagePart (MIME_Part &$mime_part)
 array cacheIDURLParam ()
 boolean canDisplayInline (MIME_Part &$mime_part)
 string findBody ([string $subtype = null])
 string formatStatusMsg (string $msg, [string $img = null], [ $printable = true], [string $class = null], boolean $print)
 string getAttachments ()
 string getBody ()
 string getBodyPart (string $id)
 MIME_Contents &getCache ([string $cacheid = null])
 MIME_Part &getDecodedMIMEPart (integer $id, [boolean $all = false])
 string getIndex (string $id, string $field)
 string getMessage ([boolean $oneframe = false])
 string getMIMEKeyOverride ()
 MIME_Part &getMIMEPart (integer $id)
 MIME_Viewer &getMIMEViewer (MIME_Part &$mime_part, [ $mime_type = null])
 string getMIMEViewerType (MIME_Part &$mime_part)
 MIME_Part getRawMIMEPart (integer $id, [boolean $all = false])
 string linkView (MIME_Part &$mime_part, integer $actionID, string $text, [array $params = array()], [boolean $dload = false])
 string linkViewJS (MIME_Part &$mime_part, integer $actionID, string $text, [string $jstext = null], [string $css = null], [array $params = array()], [boolean $widget = false])
 array partSummary (MIME_Part &$mime_part, [boolean $guess = false])
 void removeIndex (string $id)
 string renderMIMEAttachmentInfo (MIME_Part &$mime_part)
 string renderMIMEPart (MIME_Part &$mime_part)
 void setMIMEKeyOverride ([string $mimekey = null])
 void setSummary (MIME_Part &$mime_part, string $type)
 void showSummaryLinks ([boolean $show = null])
 string urlView (MIME_Part &$mime_part, integer $actionID, [array $params = array()], [boolean $dload = false])
 boolean viewAsAttachment ([boolean $popup = false])
Variables
array $_atc = array() (line 72)

The attachments list.

integer $_attach822 = 0 (line 161)

The number of message/rfc822 levels labeled as 'attachments' of the current part.

MIME_Contents $_base = null (line 153)

The base MIME_Contents object.

integer $_body_id (line 65)

The MIME part id of the message body.

  • since: Horde 3.2
MIME_Message $_cachemessage (line 56)

The MIME_Message object we use when caching.

integer $_displayType = MIME_CONTENTS_DISPLAY_TYPE_BOTH (line 123)

The attachment display type to use.

array $_downloads = null (line 88)

List of all downloadable parts.

  • since: Horde 3.2
boolean $_links = true (line 146)

Show the links in the summaries?

MIME_Message $_message (line 49)

The MIME_Message object for the message.

string $_mimekey = null (line 130)

The MIME index key to use.

array $_parts = array() (line 79)

The message parts list.

string $_sessionCacheID = null (line 109)

The Cache_session identifier.

array $_summary = array() (line 95)

The summary parts list.

string $_summaryType = null (line 102)

The summary type.

array $_viewerCache = array() (line 116)

The MIME_Viewer object cache.

array $_viewID = array() (line 139)

The actionID value for various actions.

'download' -- Downloading a part/attachment. 'view' -- Viewing a part/attachment.

Methods
Constructor MIME_Contents (line 174)

Constructor.

MIME_Contents MIME_Contents (MIME_Message $messageOb, [array $viewID = array()], [ $contents = array()], array &$contents)
  • MIME_Message $messageOb: The object to work with.
  • array $viewID: The actionID values for viewing parts/attachments.
  • array &$contents: Array containing a single value: a reference to the base object. (This last parameter needs to be handled via an array because PHP < 5.0 doesn't handle optional pointer parameters otherwise.)
  • $contents
buildMessage (line 649)

Build the message deciding what MIME Parts to show.

  • return: False on error.
boolean buildMessage ()
buildMessagePart (line 674)

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.
cacheIDURLParam (line 1303)

Add the current object to the cache, and return the cache identifier to be used in URLs.

  • return: The parameter key/value set to use in URLs.
array cacheIDURLParam ()
canDisplayInline (line 433)

Determine if we can (and know how to) inline a MIME Part.

  • return: True if part can be inlined. False if it cannot.
boolean canDisplayInline (MIME_Part &$mime_part)
findBody (line 828)

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.
  • since: Horde 3.2
string findBody ([string $subtype = null])
  • string $subtype: Specifically search for this subtype.
formatStatusMsg (line 1150)

Prints out the status message for a given MIME Part.

  • return: The formatted status message string.
string formatStatusMsg (string $msg, [string $img = null], [ $printable = true], [string $class = null], boolean $print)
  • string $msg: The message to output.
  • string $img: An image link to add to the beginning of the message.
  • boolean $print: Output this message when in a print view?
  • string $class: An optional style for the status box.
  • $printable
getAttachmentContents (line 802)

Returns a list of attachments and their contents.

  • return: List of hashes with the keys 'name' and 'data'.
  • since: Horde 3.2
array getAttachmentContents ()
getAttachments (line 307)

Return the attachment list (HTML table format).

  • return: The list of attachments formatted into HTML.
string getAttachments ()
getBaseObjectPtr (line 1199)

Return a pointer to the base object.

  • return: Returns a pointer to the base object. Returns false if there is no base object.
mixed &getBaseObjectPtr ()
getBody (line 196)

Returns the entire body of the message.

You probably want to override this function in any subclass.

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

Returns the raw text for one section of the message.

You probably want to override this function in any subclass.

  • return: The text of the part.
string getBodyPart (string $id)
  • string $id: The ID of the MIME_Part.
getCache (line 1278)

Returns the cached MIME_Contents:: object.

This function should be called statically e.g.: $ptr = &MIME_Contents::getCache().

  • return: The MIME_Contents object, or null if it does not exist.
MIME_Contents &getCache ([string $cacheid = null])
  • string $cacheid: The cache ID to use. If empty, will use the cache ID located in the URL parameter named MIME_CONTENTS_CACHE.
getDecodedMIMEPart (line 291)

Fetch part of a MIME message and decode it, if it is base_64 or qprint encoded.

  • return: The MIME_Part with its contents decoded.
MIME_Part &getDecodedMIMEPart (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?
getDownloadAllList (line 756)

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.
  • since: Horde 3.2
array getDownloadAllList ()
getIndex (line 402)

Returns the data for a specific MIME index.

  • return: The text currently set for that index.
string getIndex (string $id, string $field)
  • string $id: The MIME index.
  • string $field: The field to return (message, atc, summary)
getMessage (line 328)

Return the message list (HTML table format).

  • return: The message formatted into HTML.
string getMessage ([boolean $oneframe = false])
  • boolean $oneframe: Should the output be designed for display in a single frame?
getMIMEKeyOverride (line 533)

Gets the MIME key override.

  • return: The MIME key override - null if no override.
string getMIMEKeyOverride ()
getMIMEMessage (line 223)

Returns the MIME_Message object for the mail message.

  • return: A MIME_Message object.
MIME_Message getMIMEMessage ()
getMIMEPart (line 235)

Fetch a part of a MIME message.

  • return: The raw MIME part asked for.
MIME_Part &getMIMEPart (integer $id)
  • integer $id: The MIME index of the part requested.
getMIMEViewer (line 461)

Get MIME_Viewer object.

  • return: The MIME_Viewer object, or false on error.
MIME_Viewer &getMIMEViewer (MIME_Part &$mime_part, [ $mime_type = null])
  • MIME_Part &$mime_part: A MIME_Part object.
  • $mime_type
getMIMEViewerType (line 491)

Get the MIME Content-Type output by a MIME_Viewer for a particular MIME_Part.

  • return: The MIME type output by the MIME_Viewer, or false on error.
string getMIMEViewerType (MIME_Part &$mime_part)
getRawMIMEPart (line 261)

Fetch part of a MIME message.

  • return: The MIME_Part.
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 1072)

Generate a link to the view.php page.

Important: the calling code has to make sure that the $text parameter is properly escaped!

  • return: A HTML href link to view.php.
string linkView (MIME_Part &$mime_part, integer $actionID, string $text, [array $params = array()], [boolean $dload = false])
  • MIME_Part &$mime_part: The MIME_Part object to view.
  • integer $actionID: The actionID value.
  • string $text: The ESCAPED link text.
  • array $params: A list of additional parameters. 'class' - The CSS class to use. 'jstext' - The JS text to use. 'viewparams' - A list of any additional parameters that need to be passed to view.php.
  • boolean $dload: Should we generate a download link?
linkViewJS (line 1113)

Generate a javascript link to the view.php page.

Important: the calling code has to make sure that the $text parameter is properly escaped!

  • return: A HTML href link to view.php.
string linkViewJS (MIME_Part &$mime_part, integer $actionID, string $text, [string $jstext = null], [string $css = null], [array $params = array()], [boolean $widget = false])
  • MIME_Part &$mime_part: The MIME_Part object to view.
  • integer $actionID: The ActionID to perform.
  • string $text: The ESCAPED link text.
  • string $jstext: The Javascript link text.
  • string $css: The CSS class to use.
  • array $params: A list of any additional parameters that need to be passed to view.php. (key = name)
  • boolean $widget: If true use Horde::widget() to generate, Horde::link() otherwise.
partSummary (line 943)

Returns an array summarizing a part of a MIME message.

  • return: The summary of the part. [0] = Icon [1] = IMAP ID [2] = Description [3] = MIME Type [4] = Size [5] = Download link/icon
array partSummary (MIME_Part &$mime_part, [boolean $guess = false])
  • MIME_Part &$mime_part: The MIME_Part to summarize.
  • boolean $guess: Is this a temporary guessed-type part?
rebuildMessage (line 247)

Rebuild the MIME_Part structure of a message.

You probably want to override this function in any subclass.

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

Removes the message text and summary for a specific MIME index.

void removeIndex (string $id)
  • string $id: The MIME index.
renderMIMEAttachmentInfo (line 581)

Render MIME Part attachment info.

  • return: The rendered data.
string renderMIMEAttachmentInfo (MIME_Part &$mime_part)
renderMIMEPart (line 569)

Render a MIME Part.

  • return: The rendered data.
string renderMIMEPart (MIME_Part &$mime_part)
setMIMEKeyOverride (line 543)

Sets an override for the MIME key.

void setMIMEKeyOverride ([string $mimekey = null])
  • string $mimekey
setSummary (line 905)

Sets a summary entry.

void setSummary (MIME_Part &$mime_part, string $type)
  • MIME_Part &$mime_part: The MIME_Part object.
  • string $type: The summary cache to use.
showSummaryLinks (line 553)

Should we display links for the summaries?

void showSummaryLinks ([boolean $show = null])
  • boolean $show: Show the summary links?
urlView (line 1035)

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: The MIME_Part object to view.
  • integer $actionID: The ActionID to perform.
  • array $params: A list of any additional parameters that need to be passed to view.php. (key = name)
  • boolean $dload: Should we generate a download link?
viewAsAttachment (line 893)

Are we viewing this page as an attachment through view.php? This method can also be called via MIME_Contents::viewAsAttachment().

  • return: True if we are viewing this part as an attachment through view.php.
boolean viewAsAttachment ([boolean $popup = false])
  • boolean $popup: If true, also check if we are viewing attachment in popup view window.

Documentation generated on Sun, 30 Jan 2011 05:16:02 +0000 by phpDocumentor 1.4.3