PHP 클래스 IMP_Contents, horde

저자: Michael Slusarz ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_build boolean Have we scanned for embedded parts?
$_embedded array The list of MIME IDs that consist of embedded data.
$_header mixed Message header.
$_indices IMP_Indices_Mailbox The index of the current message.
$_message Horde_Mime_Part The Horde_Mime_Part object for the message.
$_viewcache object Cached data for the MIME Viewer objects.

공개 메소드들

메소드 설명
__construct ( mixed $in ) Constructor.
__toString ( ) : string String representation of object.
canDisplay ( mixed $part, integer $mask, string $type = null ) : integer Can this MIME part be displayed in the given mode?
downloadAllList ( ) : array Get download all list.
findBody ( string $subtype = null ) : string Finds the main "body" text part (if any) in a message.
findMimeType ( string $id, string $type ) : mixed Find a MIME type in parent parts.
fullMessageText ( array $options = [] ) : mixed Returns the full message text.
getBody ( array $options = [] ) : mixed Returns the entire body of the message.
getBodyPart ( integer $id, array $options = [] ) : object Gets the raw text for one section of the message.
getHeader ( integer $type = self::HEADER_OB ) : mixed Returns base header information.
getHeaderAndMarkAsSeen ( integer $type = self::HEADER_OB ) : mixed Returns base header information and marks the message as seen.
getIndicesOb ( ) : IMP_Indices Return an IMP_Indices object for the current message.
getListInformation ( ) : array Returns mailing list information for the message.
getMIMEMessage ( ) : Horde_Mime_Part Returns the Horde_Mime_Part object.
getMailbox ( ) : IMP_Mailbox Returns the IMAP mailbox for the current message.
getMimePart ( integer $id, array $options = [] ) : Horde_Mime_Part Fetch a part of a MIME message.
getPartName ( Horde_Mime_Part $part, boolean $use_descrip = false ) : string Return the descriptive part label, making sure it is not empty.
getSummary ( string $id, integer $mask ) : array Get summary info for a MIME ID.
getTree ( string $renderer = 'Horde_Core_Tree_Renderer_Html' ) : Horde_Tree_Renderer_Base Returns the MIME part tree of the message.
getUid ( ) : integer Returns the IMAP UID for the current message.
getViewCache ( ) : object Return the view cache object for this message.
isEmbedded ( string $mime_id ) : boolean Determines if a given MIME part ID is a part of embedded data.
linkView ( Horde_Mime_Part $mime_part, integer $actionID, string $text, array $options = [] ) : string Generate a link to the download/view page.
linkViewJS ( Horde_Mime_Part $mime_part, string $actionID, string $text, array $options = [] ) : string Generate a javascript link to the download/view page.
renderMIMEPart ( string $mime_id, integer $mode, array $options = [] ) : array Render a MIME Part.
urlView ( Horde_Mime_Part $mime_part = null, integer $actionID = 'view_attach', array $options = [] ) : Horde_Url Return the URL to the download/view page.

보호된 메소드들

메소드 설명
_addTreeNodes ( $tree, Horde_Mime_Part $part ) Adds MIME parts to the tree instance.
_buildMessage ( array $parts = null ) Builds the "virtual" Horde_Mime_Part object by checking for embedded parts.
_fetchData ( Horde_Imap_Client_Fetch_Query $query ) : Horde_Imap_Client_Data_Fetch Get FETCH data from IMAP server for this message.
_getHeader ( integer $type, boolean $seen ) : mixed Returns base header information.
_urlViewParams ( Horde_Mime_Part $mime_part, integer $actionID, array $params ) : array Generates the necessary URL parameters for the download/view page.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( mixed $in )
$in mixed An IMP_Indices_Mailbox or Horde_Mime_Part object.

__toString() 공개 메소드

String representation of object.
public __toString ( ) : string
리턴 string The indices string.

_addTreeNodes() 보호된 메소드

Adds MIME parts to the tree instance.
protected _addTreeNodes ( $tree, Horde_Mime_Part $part )
$part Horde_Mime_Part The MIME part to add.

_buildMessage() 보호된 메소드

Builds the "virtual" Horde_Mime_Part object by checking for embedded parts.
protected _buildMessage ( array $parts = null )
$parts array The parts list to process.

_fetchData() 보호된 메소드

Get FETCH data from IMAP server for this message.
protected _fetchData ( Horde_Imap_Client_Fetch_Query $query ) : Horde_Imap_Client_Data_Fetch
$query Horde_Imap_Client_Fetch_Query Search query.
리턴 Horde_Imap_Client_Data_Fetch Fetch data for the message.

_getHeader() 보호된 메소드

Returns base header information.
protected _getHeader ( integer $type, boolean $seen ) : mixed
$type integer See getHeader().
$seen boolean Mark message as seen?
리턴 mixed See getHeader().

_urlViewParams() 보호된 메소드

Generates the necessary URL parameters for the download/view page.
protected _urlViewParams ( Horde_Mime_Part $mime_part, integer $actionID, array $params ) : array
$mime_part Horde_Mime_Part The MIME part to view.
$actionID integer The actionID to perform.
$params array Additional parameters to pass.
리턴 array The array of parameters.

canDisplay() 공개 메소드

Can this MIME part be displayed in the given mode?
public canDisplay ( mixed $part, integer $mask, string $type = null ) : integer
$part mixed The MIME part or a MIME ID string.
$mask integer One of the RENDER_ constants.
$type string The type to use (overrides the MIME ID if $id is a MIME part).
리턴 integer The RENDER_ constant of the allowable display.

downloadAllList() 공개 메소드

Get download all list.
public downloadAllList ( ) : array
리턴 array An array of downloadable parts.

findBody() 공개 메소드

"Body" data is the first text part in the base MIME part.
public findBody ( string $subtype = null ) : string
$subtype string Specifically search for this subtype.
리턴 string The MIME ID of the main body part.

findMimeType() 공개 메소드

Find a MIME type in parent parts.
public findMimeType ( string $id, string $type ) : mixed
$id string The MIME ID to begin the search at.
$type string The MIME type to search for.
리턴 mixed Either the requested MIME part, or null if not found.

fullMessageText() 공개 메소드

Returns the full message text.
public fullMessageText ( array $options = [] ) : mixed
$options array Additional options: - stream: (boolean) If true, return a stream for bodytext. DEFAULT: No
리턴 mixed The full message text or a stream resource if 'stream' is true.

getBody() 공개 메소드

Returns the entire body of the message.
public getBody ( array $options = [] ) : mixed
$options array Additional options: - stream: (boolean) If true, return a stream. DEFAULT: No
리턴 mixed The text of the part, or a stream resource if 'stream' is true.

getBodyPart() 공개 메소드

Gets the raw text for one section of the message.
public getBodyPart ( integer $id, array $options = [] ) : object
$id integer The ID of the MIME part.
$options array Additional options: - decode: (boolean) Attempt to decode the bodypart on the remote server. 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
리턴 object Object with the following properties: - data: (mixed) The text of the part or a stream resource if 'stream' option is true. - decode: (string) If 'decode' option is true, and bodypart decoded on server, the content-type of the decoded data.

getHeader() 공개 메소드

Returns base header information.
public getHeader ( integer $type = self::HEADER_OB ) : mixed
$type integer Return type (HEADER_* constant).
리턴 mixed Either a Horde_Mime_Headers object (HEADER_OB), header text (HEADER_TEXT), or a stream resource (HEADER_STREAM).

getHeaderAndMarkAsSeen() 공개 메소드

Returns base header information and marks the message as seen.
public getHeaderAndMarkAsSeen ( integer $type = self::HEADER_OB ) : mixed
$type integer See getHeader().
리턴 mixed See getHeader().

getIndicesOb() 공개 메소드

Return an IMP_Indices object for the current message.
public getIndicesOb ( ) : IMP_Indices
리턴 IMP_Indices An indices object.

getListInformation() 공개 메소드

Returns mailing list information for the message.
public getListInformation ( ) : array
리턴 array An array with 2 elements:
  - exists: (boolean) True if this is a mailing list message.
  - reply_list: (string) If non-null, the e-mail address to use to post
                to the list.

getMIMEMessage() 공개 메소드

Returns the Horde_Mime_Part object.
public getMIMEMessage ( ) : Horde_Mime_Part
리턴 Horde_Mime_Part A Horde_Mime_Part object.

getMailbox() 공개 메소드

Returns the IMAP mailbox for the current message.
public getMailbox ( ) : IMP_Mailbox
리턴 IMP_Mailbox The message mailbox.

getMimePart() 공개 메소드

Fetch a part of a MIME message.
public getMimePart ( integer $id, array $options = [] ) : Horde_Mime_Part
$id integer The MIME index of the part requested.
$options array 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
리턴 Horde_Mime_Part The raw MIME part asked for. If not found, returns null.

getPartName() 공개 메소드

Return the descriptive part label, making sure it is not empty.
public getPartName ( Horde_Mime_Part $part, boolean $use_descrip = false ) : string
$part Horde_Mime_Part The MIME Part object.
$use_descrip boolean Use description? If false, uses name.
리턴 string The part label (non-empty).

getSummary() 공개 메소드

Get summary info for a MIME ID.
public getSummary ( string $id, integer $mask ) : array
$id string The MIME ID.
$mask integer A bitmask indicating what information to return:
Always output:
  'type' = MIME type

IMP_Contents::SUMMARY_BYTES
  Output: parts = 'bytes'

IMP_Contents::SUMMARY_SIZE
  Output: parts = 'size'

IMP_Contents::SUMMARY_ICON
IMP_Contents::SUMMARY_ICON_RAW
  Output: parts = 'icon'

IMP_Contents::SUMMARY_DESCRIP
  Output: parts = 'description_raw'

IMP_Contents::SUMMARY_DESCRIP_LINK
  Output: parts = 'description'

IMP_Contents::SUMMARY_DOWNLOAD
  Output: parts = 'download', 'download_url'

IMP_Contents::SUMMARY_IMAGE_SAVE
  Output: parts = 'img_save'

IMP_Contents::SUMMARY_PRINT
IMP_Contents::SUMMARY_PRINT_STUB
  Output: parts = 'print'

IMP_Contents::SUMMARY_STRIP
  Output: parts = 'strip'
리턴 array An array with the requested information.

getTree() 공개 메소드

Returns the MIME part tree of the message.
public getTree ( string $renderer = 'Horde_Core_Tree_Renderer_Html' ) : Horde_Tree_Renderer_Base
$renderer string Either the tree renderer driver or a full class name to use.
리턴 Horde_Tree_Renderer_Base A tree instance representing the MIME parts.

getUid() 공개 메소드

Returns the IMAP UID for the current message.
public getUid ( ) : integer
리턴 integer The message UID.

getViewCache() 공개 메소드

Return the view cache object for this message.
public getViewCache ( ) : object
리턴 object View object.

isEmbedded() 공개 메소드

Determines if a given MIME part ID is a part of embedded data.
public isEmbedded ( string $mime_id ) : boolean
$mime_id string The MIME ID.
리턴 boolean True if the MIME ID is part of embedded data.

linkView() 공개 메소드

Generate a link to the download/view page.
public linkView ( Horde_Mime_Part $mime_part, integer $actionID, string $text, array $options = [] ) : string
$mime_part Horde_Mime_Part The MIME part to view.
$actionID integer The actionID value.
$text string The ESCAPED (!) link text.
$options array Additional parameters:
  - attr: (array) Additional attributed to set on the link.
  - class: (string) The CSS class to use.
  - jstext: (string) The JS text to use.
  - params: (array) A list of any additional parameters that need to be
            passed to the download/view page.
리턴 string A HTML href link to the download/view page.

linkViewJS() 공개 메소드

Generate a javascript link to the download/view page.
public linkViewJS ( Horde_Mime_Part $mime_part, string $actionID, string $text, array $options = [] ) : string
$mime_part Horde_Mime_Part The MIME part to view.
$actionID string The actionID to perform.
$text string The ESCAPED (!) link text.
$options array 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 download/view page. (key = name) - widget: (boolean) If true use Horde::widget() to generate, Horde::link() otherwise.
리턴 string A HTML href link to the download/view page.

renderMIMEPart() 공개 메소드

Render a MIME Part.
public renderMIMEPart ( string $mime_id, integer $mode, array $options = [] ) : array
$mime_id string The MIME ID to render.
$mode integer One of the RENDER_ constants.
$options array 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.
리턴 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.

urlView() 공개 메소드

Return the URL to the download/view page.
public urlView ( Horde_Mime_Part $mime_part = null, integer $actionID = 'view_attach', array $options = [] ) : Horde_Url
$mime_part Horde_Mime_Part The MIME part to view.
$actionID integer The actionID to perform.
$options array Additional options: - params: (array) A list of any additional parameters that need to be passed to the download/view page (key => name).
리턴 Horde_Url The URL to the download/view page.

프로퍼티 상세

$_build 보호되어 있는 프로퍼티

Have we scanned for embedded parts?
protected bool $_build
리턴 boolean

$_embedded 보호되어 있는 프로퍼티

The list of MIME IDs that consist of embedded data.
protected array $_embedded
리턴 array

$_header 보호되어 있는 프로퍼티

Message header.
protected mixed $_header
리턴 mixed

$_indices 보호되어 있는 프로퍼티

The index of the current message.
protected IMP_Indices_Mailbox $_indices
리턴 IMP_Indices_Mailbox

$_message 보호되어 있는 프로퍼티

The Horde_Mime_Part object for the message.
protected Horde_Mime_Part $_message
리턴 Horde_Mime_Part

$_viewcache 보호되어 있는 프로퍼티

Cached data for the MIME Viewer objects.
protected object $_viewcache
리턴 object