Methods summary
public
|
#
__construct( mixed $in )
Constructor.
Parameters
- $in
- An IMP_Indices or Horde_Mime_Part object.
Throws
|
public
integer
|
#
getUid( )
Returns the IMAP UID for the current message.
Returns the IMAP UID for the current message.
Returns
integer The message UID.
|
public
IMP_Mailbox
|
#
getMailbox( )
Returns the IMAP mailbox for the current message.
Returns the IMAP mailbox for the current message.
Returns
|
public
mixed
|
#
getBody( array $options = array() )
Returns the entire body of the message.
Returns the entire body of the message.
Parameters
- $options
- <p>Additional options:
- stream: (boolean) If true, return a stream.
DEFAULT: No</p>
Returns
mixed The text of the part, or a stream resource if 'stream'
is true.
|
public
mixed
|
#
getBodyPart( integer $id, array $options = array() )
Gets the raw text for one section of the message.
Gets the raw text for one section of the message.
Parameters
- $id
- The ID of the MIME part.
- $options
- <p>Additional options:
- decode: (boolean) Attempt to decode the bodypart on the remote
server. If successful, sets self::$lastBodyPartDecode to
the content-type of the decoded data.
DEFAULT: No
- length: (integer) If set, only download this many bytes of the
bodypart from the server.
DEFAULT: All data is retrieved.
- mimeheaders: (boolean) Include the MIME headers also?
DEFAULT: No
- stream: (boolean) If true, return a stream.
DEFAULT: No</p>
Returns
mixed The text of the part or a stream resource if 'stream'
is true.
|
public
mixed
|
#
fullMessageText( array $options = array() )
Returns the full message text.
Returns the full message text.
Parameters
- $options
- <p>Additional options:
- stream: (boolean) If true, return a stream for bodytext.
DEFAULT: No</p>
Returns
mixed The full message text or a stream resource if 'stream'
is true.
|
public
mixed
|
#
getHeaderAndMarkAsSeen( integer $type = IMP_Contents::HEADER_OB )
Returns base header information and marks the message as seen.
Returns base header information and marks the message as seen.
Parameters
Returns
mixed See getHeader().
|
public
Horde_Mime_Part
|
#
getMIMEMessage( )
Returns the Horde_Mime_Part object.
Returns the Horde_Mime_Part object.
Returns
Horde_Mime_Part A Horde_Mime_Part object.
|
public
Horde_Mime_Part
|
#
getMIMEPart( integer $id, array $options = array() )
Fetch a part of a MIME message.
Fetch a part of a MIME message.
Parameters
- $id
- The MIME index of the part requested.
- $options
- <p>Additional options:
- length: (integer) If set, only download this many bytes of the
bodypart from the server.
DEFAULT: All data is retrieved.
- nocontents: (boolean) If true, don't add the contents to the part
DEFAULT: Contents are added to the part</p>
Returns
Horde_Mime_Part The raw MIME part asked for (reference).
|
public
array
|
#
renderMIMEPart( string $mime_id, integer $mode, array $options = array() )
Render a MIME Part.
Parameters
- $mime_id
- The MIME ID to render.
- $mode
- One of the RENDER_ constants.
- $options
- <p>Additional options:
- autodetect: (boolean) Attempt to auto-detect MIME type?
- mime_part: (Horde_Mime_Part) The MIME part to render.
- type: (string) Use this MIME type instead of the MIME type
identified in the MIME part.</p>
Returns
array See Horde_Mime_Viewer_Base::render(). The following
fields may also be present in addition to the fields
defined in Horde_Mime_Viewer_Base:
- attach: (boolean) Force display of this part as an attachment.
- js: (array) A list of javascript commands to run after the content
is displayed on screen.
- name: (string) Contains the MIME name information.
- wrap: (string) If present, indicates that this part, and all child
parts, will be wrapped in a DIV with the given class name.
|
public
string
|
#
findBody( string $subtype = null )
Finds the main "body" text part (if any) in a message.
"Body" data is the first text part in the base MIME part.
Finds the main "body" text part (if any) in a message.
"Body" data is the first text part in the base MIME part.
Parameters
- $subtype
- Specifically search for this subtype.
Returns
string The MIME ID of the main body part.
|
public
array
|
#
generatePreview( )
Generate the preview text.
Generate the preview text.
Returns
array Array with the following keys:
- cut: (boolean) Was the preview text cut?
- text: (string) The preview text.
|
public
array
|
#
getSummary( string $id, integer $mask = 0 )
Get summary info for a MIME ID.
Get summary info for a MIME ID.
Parameters
- $id
- The MIME ID.
- $mask
- A bitmask indicating what information to return:
<pre>Always output:
<span class="php-quote">'type'</span> = MIME type
IMP_Contents::SUMMARY_BYTES
Output: parts = <span class="php-quote">'bytes'</span>
IMP_Contents::SUMMARY_SIZE
Output: parts = <span class="php-quote">'size'</span>
IMP_Contents::SUMMARY_ICON
IMP_Contents::SUMMARY_ICON_RAW
Output: parts = <span class="php-quote">'icon'</span>
IMP_Contents::SUMMARY_DESCRIP_LINK
IMP_Contents::SUMMARY_DESCRIP_NOLINK
IMP_Contents::SUMMARY_DESCRIP_NOLINK_NOHTMLSPECCHARS
Output: parts = <span class="php-quote">'description'</span>
IMP_Contents::SUMMARY_DOWNLOAD
IMP_Contents::SUMMARY_DOWNLOAD_NOJS
Output: parts = <span class="php-quote">'download'</span>
IMP_Contents::SUMMARY_DOWNLOAD_ZIP
Output: parts = <span class="php-quote">'download_zip'</span>
IMP_Contents::SUMMARY_IMAGE_SAVE
Output: parts = <span class="php-quote">'img_save'</span>
IMP_Contents::SUMMARY_PRINT
IMP_Contents::SUMMARY_PRINT_STUB
Output: parts = <span class="php-quote">'print'</span>
IMP_Contents::SUMMARY_STRIP_LINK
IMP_Contents::SUMMARY_STRIP_STUB
Output: parts = <span class="php-quote">'strip'</span></pre>
Returns
array An array with the requested information.
|
public
string
|
#
urlView( Horde_Mime_Part $mime_part = null, integer $actionID = 'view_attach', array $options = array() )
Return the URL to the view.php page.
Return the URL to the view.php page.
Parameters
- $mime_part
- The MIME part to view.
- $actionID
- The actionID to perform.
- $options
- <p>Additional options:
- dload: (boolean) Should we generate a download link?
- params: (array) A list of any additional parameters that need to be
passed to view.php (key => name).</p>
Returns
string The URL to view.php.
|
public
string
|
#
linkView( Horde_Mime_Part $mime_part, integer $actionID, string $text, array $options = array() )
Generate a link to the view.php page.
Generate a link to the view.php page.
Parameters
- $mime_part
- The MIME part to view.
- $actionID
- The actionID value.
- $text
- The ESCAPED (!) link text.
- $options
- <p>Additional parameters:
- class: (string) The CSS class to use.
- dload: (boolean) Should we generate a download link?
- jstext: (string) The JS text to use.
- params: (array) A list of any additional parameters that need to be
passed to view.php.</p>
Returns
string A HTML href link to view.php.
|
public
string
|
#
linkViewJS( Horde_Mime_Part $mime_part, string $actionID, string $text, array $options = array() )
Generate a javascript link to the view.php page.
Generate a javascript link to the view.php page.
Parameters
- $mime_part
- The MIME part to view.
- $actionID
- The actionID to perform.
- $text
- The ESCAPED (!) link text.
- $options
- <p>Additional options:
- css: (string) The CSS class to use.
- jstext: (string) The javascript link text.
- onload: (string) A JS function to run when popup window is
fully loaded.
- params: (array) A list of any additional parameters that need to be
passed to view.php. (key = name)
- widget: (boolean) If true use Horde::widget() to generate,
Horde::link() otherwise.</p>
Returns
string A HTML href link to view.php.
|
public
boolean
|
#
isAttachment( string $mime_type )
Determines if a MIME type is an attachment.
For IMP's purposes, an attachment is any MIME part that can be
downloaded by itself (i.e. all the data needed to view the part is
contained within the download data).
Determines if a MIME type is an attachment.
For IMP's purposes, an attachment is any MIME part that can be
downloaded by itself (i.e. all the data needed to view the part is
contained within the download data).
Parameters
- $mime_type
- $mime_part The MIME type.
Returns
boolean True if an attachment.
|
public
integer
|
#
canDisplay( mixed $part, integer $mask, string $type = null )
Can this MIME part be displayed in the given mode?
Can this MIME part be displayed in the given mode?
Parameters
- $part
- $id The MIME part or a MIME ID string.
- $mask
- One of the RENDER_ constants.
- $type
- <p>The type to use (overrides the MIME ID if $id is
a MIME part).</p>
Returns
integer The RENDER_ constant of the allowable display.
|
public
array
|
#
getContentTypeMap( )
Returns the Content-Type map for the entire message, regenerating
embedded parts if needed.
Returns the Content-Type map for the entire message, regenerating
embedded parts if needed.
Returns
array See Horde_Mime_Part::contentTypeMap().
|
public
Horde_Tree_Base
|
#
getTree( string $renderer = 'Horde_Core_Tree_Html' )
Returns the MIME part tree of the message.
Returns the MIME part tree of the message.
Parameters
- $renderer
- <p>Either the tree renderer driver or a full
class name to use.</p>
Returns
Horde_Tree_Base A tree instance representing the MIME parts.
Throws
Horde_Tree_Exception
|
public
array
|
#
downloadAllList( )
Get download all list.
Returns
array An array of downloadable parts.
|
public
Horde_Mime_Part
|
#
buildMessageContents( array $ignore = array() )
Injects body contents into the base Horde_Mime_part object.
Injects body contents into the base Horde_Mime_part object.
Parameters
- $ignore
- A list of MIME IDs to ignore.
Returns
Horde_Mime_Part The part with body contents set.
|
public
boolean
|
#
isEmbedded( string $mime_id )
Determines if a given MIME part ID is a part of embedded data.
Determines if a given MIME part ID is a part of embedded data.
Parameters
Returns
boolean True if the MIME ID is part of embedded data.
|
public
mixed
|
#
findMimeType( string $id, string $type )
Find a MIME type in parent parts.
Find a MIME type in parent parts.
Parameters
- $id
- The MIME ID to begin the search at.
- $type
- The MIME type to search for.
Returns
mixed Either the requested MIME part, or null if not found.
|
public
string
|
#
getPartName( Horde_Mime_Part $part, boolean $use_descrip = false )
Return the descriptive part label, making sure it is not empty.
Return the descriptive part label, making sure it is not empty.
Parameters
- $part
- The MIME Part object.
- $use_descrip
- Use description? If false, uses name.
Returns
string The part label (non-empty).
|
public
array
|
#
getInlineOutput( array $options = array() )
Generate inline message display.
Generate inline message display.
Parameters
- $options
- <p>Options:
- display_mask: (integer) The mask of display view type to render
inline (DEFAULT: RENDER_INLINE_AUTO).
- mask: (integer) The mask needed for a getSummary() call.
- no_inline_all: (boolean) If true, only display first inline part.
Subsequent inline parts will be treated as
attachments.
- part_info_display: (array) The list of summary fields to display.
- show_parts: (string) The value of the 'parts_display' pref.</p>
Returns
array An array with the following keys:
- atc_parts: (array) The list of attachment MIME IDs.
- display_ids: (array) The list of display MIME IDs.
- js_onload: (array) A list of javascript code to run onload.
- msgtext: (string) The rendered HTML code.
|