PHP 클래스 IMP_Mailbox, horde

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

보호된 프로퍼티들

프로퍼티 타입 설명
$_mbox string The IMAP mailbox name (UTF-8).

공개 메소드들

메소드 설명
__construct ( $mbox ) Constructor.
__get ( $key )
__set ( $key, $value )
__toString ( )
create ( array $opts = [] ) : boolean Create this mailbox on the server.
createMailboxName ( string $new ) : IMP_Mailbox Return the mailbox name to create given a submailbox name.
delete ( array $opts = [] ) : boolean Deletes mailbox.
emptyMailbox ( ) Empties the entire mailbox.
equals ( mixed $mbox ) : boolean Determines if this mailbox is equal to the given mailbox.
expunge ( array $to_expunge = [], array $opts = [] ) : IMP_Indices Expunges all deleted messages.
filter ( ) Runs filters on this mailbox.
filterOnDisplay ( ) : boolean Filters this mailbox if it is the INBOX and the filter on display pref is active.
flagAll ( array $flags, boolean $action = true ) : boolean Adds or removes flag(s) for all messages in the mailbox.
formFrom ( mixed $mbox ) : mixed Converts a mailbox string from a form representation.
formTo ( mixed $mbox ) : mixed Converts a mailbox string to a form representation.
fromBuids ( IMP_Indices | array $buids ) : IMP_Indices Create an indices object from a list of browser-UIDs.
get ( mixed $mbox ) : mixed Shortcut to obtaining mailbox object(s).
getImapMboxOb ( mixed $mbox ) : mixed Shortcut to obtaining Horde_Imap_Client_Mailbox object(s).
getIndicesOb ( mixed $in ) : IMP_Indices Return an indices object for this mailbox.
getPref ( $pref ) : IMP_Mailbox Shortcut to obtaining a mailbox object from a preference name.
getSearchOb ( ) : IMP_Search_Query Return the search query object for this mailbox.
getSort ( boolean $convert = false ) : IMP_Prefs_Sort_Sortpref Return the sorting preference for this mailbox.
getSpecialMailboxes ( ) : array Return the list of special mailboxes.
getSpecialMailboxesSort ( ) : array Return the list of sorted special mailboxes.
hideDeletedMsgs ( boolean $deleted = false ) : boolean Are deleted messages hidden in this mailbox?
prefFrom ( string $mbox ) : string Converts a mailbox name from a value stored in the preferences.
prefTo ( string $mbox ) : string Converts a mailbox name to a value to be stored in a preference.
rename ( string $new_name ) : boolean Rename this mailbox on the server. The subscription status remains the same. All subfolders will also be renamed.
runSearchQuery ( Horde_Imap_Client_Search_Query $query, integer $sortby = null, integer $sortdir = null ) : IMP_Indices Run a search query on this mailbox that is not stored in the current session. Allows custom queries with custom sorts to be used without affecting cached mailboxes.
setHideDeletedMsgs ( boolean $value ) Sets the 'delhide' preference and clears necessary cached data.
setSort ( integer $by = null, integer $dir = null, boolean $delete = false ) Set the sorting preference for this mailbox.
subscribe ( boolean $sub, array $opts = [] ) : boolean Subscribe/unsubscribe to an IMAP mailbox.
toBuids ( IMP_Indices $uids ) : IMP_Indices Create a BUID indices object from a list of UIDs.
url ( string | Horde_Url $page, string $buid = null, boolean $encode = true ) : Horde_Url Generate a URL using the current mailbox.
urlParams ( string $buid = null ) : array Returns list of URL parameters necessary to indicate current mailbox status.

보호된 메소드들

메소드 설명
_getCacheID ( boolean $date = false ) : string Returns a unique identifier for this mailbox's status.
_getDisplay ( boolean $notranslate = false ) : string If there is information available to tell us about a prefix in front of mailbox names that shouldn't be displayed to the user, then use it to strip that prefix out. Additionally, translate prefix text if this is a special mailbox.
_getIcon ( ) : object Return icon information.
_onDelete ( array $deleted ) Do the necessary cleanup/cache updates when deleting mailboxes.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( $mbox )

__get() 공개 메소드

public __get ( $key )

__set() 공개 메소드

public __set ( $key, $value )

__toString() 공개 메소드

public __toString ( )

_getCacheID() 보호된 메소드

This cache ID is guaranteed to change if messages are added/deleted from the mailbox. Additionally, if CONDSTORE is available on the remote IMAP server, this ID will change if flag information changes. For search mailboxes, this value never changes (search mailboxes must be forcibly refreshed).
protected _getCacheID ( boolean $date = false ) : string
$date boolean If true, adds date information to ID.
리턴 string The cache ID string, which will change when the composition of this mailbox changes.

_getDisplay() 보호된 메소드

If there is information available to tell us about a prefix in front of mailbox names that shouldn't be displayed to the user, then use it to strip that prefix out. Additionally, translate prefix text if this is a special mailbox.
protected _getDisplay ( boolean $notranslate = false ) : string
$notranslate boolean Don't translate the mailbox prefix?
리턴 string The mailbox, with any prefix gone/translated.

_getIcon() 보호된 메소드

Return icon information.
protected _getIcon ( ) : object
리턴 object Object with the following properties: - alt - class - icon - iconopen - user_icon

_onDelete() 보호된 메소드

Do the necessary cleanup/cache updates when deleting mailboxes.
protected _onDelete ( array $deleted )
$deleted array The list of deleted mailboxes.

create() 공개 메소드

Create this mailbox on the server.
public create ( array $opts = [] ) : boolean
$opts array Additional options: - special_use: (array) An array of special-use attributes to attempt to add to the mailbox. DEFAULT: NONE - subscribe: (boolean) Override preference value of subscribe.
리턴 boolean True on success.

createMailboxName() 공개 메소드

Return the mailbox name to create given a submailbox name.
public createMailboxName ( string $new ) : IMP_Mailbox
$new string The submailbox name (UTF-8).
리턴 IMP_Mailbox The mailbox to create.

delete() 공개 메소드

Deletes mailbox.
public delete ( array $opts = [] ) : boolean
$opts array Addtional options: - subfolders: (boolean) Delete all subfolders? DEFAULT: false - subfolders_only: (boolean) If deleting subfolders, delete only subfolders (not current mailbox)? DEFAULT: false
리턴 boolean True on success.

emptyMailbox() 공개 메소드

Empties the entire mailbox.
public emptyMailbox ( )

equals() 공개 메소드

Needed because directly comparing two mailbox objects may fail (the member variables may be different).
public equals ( mixed $mbox ) : boolean
$mbox mixed The mailbox to compare to.
리턴 boolean True if the mailboxes are the same.

expunge() 공개 메소드

Expunges all deleted messages.
public expunge ( array $to_expunge = [], array $opts = [] ) : IMP_Indices
$to_expunge array An optional array of indices to delete. If empty, all messages flagged as deleted in the mailbox will be deleted.
$opts array Additional options:
  - list: (boolean) Return a list of messages expunged.
          DEFAULT: false
리턴 IMP_Indices If 'list' option is true, an indices object containing the messages that have been expunged.

filter() 공개 메소드

Runs filters on this mailbox.
public filter ( )

filterOnDisplay() 공개 메소드

Filters this mailbox if it is the INBOX and the filter on display pref is active.
public filterOnDisplay ( ) : boolean
리턴 boolean True if filter() was called.

flagAll() 공개 메소드

This function works with IMAP only, not POP3.
public flagAll ( array $flags, boolean $action = true ) : boolean
$flags array The IMAP flag(s) to add or remove.
$action boolean If true, add the flag(s); otherwise, remove the flag(s).
리턴 boolean True if successful, false if not.

formFrom() 공개 정적인 메소드

Needed because null characters (used for various internal non-IMAP mailbox representations) will not work in form elements.
public static formFrom ( mixed $mbox ) : mixed
$mbox mixed The mailbox name(s).
리턴 mixed The mailbox object(s).

formTo() 공개 정적인 메소드

Needed because null characters (used for various internal non-IMAP mailbox representations) will not work in form elements.
public static formTo ( mixed $mbox ) : mixed
$mbox mixed The mailbox name(s).
리턴 mixed The converted mailbox string(s).

fromBuids() 공개 메소드

Create an indices object from a list of browser-UIDs.
public fromBuids ( IMP_Indices | array $buids ) : IMP_Indices
$buids IMP_Indices | array Browser-UIDs.
리턴 IMP_Indices An indices object.

get() 공개 정적인 메소드

Shortcut to obtaining mailbox object(s).
public static get ( mixed $mbox ) : mixed
$mbox mixed The full IMAP mailbox name(s).
리턴 mixed The IMP_Mailbox object(s).

getImapMboxOb() 공개 정적인 메소드

Shortcut to obtaining Horde_Imap_Client_Mailbox object(s).
public static getImapMboxOb ( mixed $mbox ) : mixed
$mbox mixed The full IMAP mailbox name(s).
리턴 mixed The Horde_Imap_Client_Mailbox object(s).

getIndicesOb() 공개 메소드

Return an indices object for this mailbox.
public getIndicesOb ( mixed $in ) : IMP_Indices
$in mixed Either a single UID, array of UIDs, or a Horde_Imap_Client_Ids object.
리턴 IMP_Indices An indices object.

getPref() 공개 정적인 메소드

Shortcut to obtaining a mailbox object from a preference name.
public static getPref ( $pref ) : IMP_Mailbox
리턴 IMP_Mailbox The IMP_Mailbox object.

getSearchOb() 공개 메소드

Return the search query object for this mailbox.
public getSearchOb ( ) : IMP_Search_Query
리턴 IMP_Search_Query The search query object.

getSort() 공개 메소드

Return the sorting preference for this mailbox.
public getSort ( boolean $convert = false ) : IMP_Prefs_Sort_Sortpref
$convert boolean Convert 'by' to a Horde_Imap_Client constant?
리턴 IMP_Prefs_Sort_Sortpref Sortpref object.

getSpecialMailboxes() 공개 정적인 메소드

Return the list of special mailboxes.
public static getSpecialMailboxes ( ) : array
리턴 array A list of mailboxes, with the self::SPECIAL_* constants as keys and values containing the IMP_Mailbox objects or null if the mailbox doesn't exist (self::SPECIAL_SENT contains an array of objects).

getSpecialMailboxesSort() 공개 정적인 메소드

Return the list of sorted special mailboxes.
public static getSpecialMailboxesSort ( ) : array
리턴 array The list of sorted special mailboxes (IMP_Mailbox objects).

hideDeletedMsgs() 공개 메소드

Are deleted messages hidden in this mailbox?
public hideDeletedMsgs ( boolean $deleted = false ) : boolean
$deleted boolean Return value is what should be done with deleted messages in general, as opposed to any deleted message in the mailbox.
리턴 boolean True if deleted messages should be hidden.

prefFrom() 공개 정적인 메소드

Converts a mailbox name from a value stored in the preferences.
public static prefFrom ( string $mbox ) : string
$mbox string The mailbox name as stored in a preference.
리턴 string The full IMAP mailbox name (UTF-8).

prefTo() 공개 정적인 메소드

Converts a mailbox name to a value to be stored in a preference.
public static prefTo ( string $mbox ) : string
$mbox string The full IMAP mailbox name (UTF-8).
리턴 string The value to store in a preference.

rename() 공개 메소드

Rename this mailbox on the server. The subscription status remains the same. All subfolders will also be renamed.
public rename ( string $new_name ) : boolean
$new_name string The new mailbox name (UTF-8).
리턴 boolean True on success

runSearchQuery() 공개 메소드

Run a search query on this mailbox that is not stored in the current session. Allows custom queries with custom sorts to be used without affecting cached mailboxes.
public runSearchQuery ( Horde_Imap_Client_Search_Query $query, integer $sortby = null, integer $sortdir = null ) : IMP_Indices
$query Horde_Imap_Client_Search_Query The search query object.
$sortby integer The sort criteria.
$sortdir integer The sort directory.
리턴 IMP_Indices An indices object.

setHideDeletedMsgs() 공개 메소드

Sets the 'delhide' preference and clears necessary cached data.
public setHideDeletedMsgs ( boolean $value )
$value boolean The value to set 'delhide' to.

setSort() 공개 메소드

Set the sorting preference for this mailbox.
public setSort ( integer $by = null, integer $dir = null, boolean $delete = false )
$by integer The sort type.
$dir integer The sort direction.
$delete boolean Delete the entry?

subscribe() 공개 메소드

Subscribe/unsubscribe to an IMAP mailbox.
public subscribe ( boolean $sub, array $opts = [] ) : boolean
$sub boolean True to subscribe, false to unsubscribe.
$opts array Additional options: - subfolders: (boolean) If true, applies actions to all subfolders.
리턴 boolean True on success.

toBuids() 공개 메소드

Create a BUID indices object from a list of UIDs.
public toBuids ( IMP_Indices $uids ) : IMP_Indices
$uids IMP_Indices UIDs.
리턴 IMP_Indices An indices object.

url() 공개 메소드

Generate a URL using the current mailbox.
public url ( string | Horde_Url $page, string $buid = null, boolean $encode = true ) : Horde_Url
$page string | Horde_Url Page name to link to.
$buid string The BUID to use on the linked page.
$encode boolean Encode the argument separator?
리턴 Horde_Url URL to $page with any necessary mailbox information added to the parameter list of the URL.

urlParams() 공개 메소드

Returns list of URL parameters necessary to indicate current mailbox status.
public urlParams ( string $buid = null ) : array
$buid string The BUID to use on the linked page.
리턴 array The list of parameters needed to indicate the current mailbox status.

프로퍼티 상세

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

The IMAP mailbox name (UTF-8).
protected string $_mbox
리턴 string