IMP_Ajax_Application_Handler_Common
extends Horde_Core_Ajax_Application_Handler
in package
Defines common (i.e. used in dynamic and smartmobile views) AJAX actions used in IMP.
Tags
Table of Contents
Methods
- cancelCompose() : bool
- AJAX action: Cancel compose.
- copyMessages() : bool
- AJAX action: Copy messages.
- deleteMessages() : bool
- AJAX action: Delete messages.
- getForwardData() : mixed
- Get forward compose data.
- getRedirectData() : mixed
- AJAX action: Get compose redirect data.
- getReplyData() : mixed
- AJAX action: Get reply data.
- getResumeData() : mixed
- AJAX action: Get resume data.
- moveMessages() : bool
- AJAX action: Move messages.
- poll() : bool
- AJAX action: Poll mailboxes.
- redirectMessage() : object
- Redirect the message.
- reportSpam() : bool
- AJAX action: Report message as [not]spam.
- sendMessage() : object
- AJAX action: Send a message.
- showMessage() : object
- Generate data necessary to display a message.
- viewPort() : bool
- AJAX action: Output ViewPort data.
- _handleBadComposeAddr() : mixed
- Handle bad addresses entered during a compose.
- _passphraseDialog() : mixed
- Outputs the script necessary to generate the passphrase dialog box.
Methods
cancelCompose()
AJAX action: Cancel compose.
public
cancelCompose() : bool
Variables used:
- discard: (boolean) If true, discard draft.
- imp_compose: (string) The IMP_Compose cache identifier.
Return values
bool —True.
copyMessages()
AJAX action: Copy messages.
public
copyMessages() : bool
See the list of variables needed for IMP_Ajax_Application#_checkUidvalidity(). Mailbox/indices form parameters needed. Additional variables used:
- mboxto: (string) Mailbox to copy the message to (base64url encoded).
Return values
bool —True on success, false on failure.
deleteMessages()
AJAX action: Delete messages.
public
deleteMessages() : bool
See the list of variables needed for IMP_Ajax_Application#changed(), IMP_Ajax_Application#deleteMsgs(), and IMP_Ajax_Application@checkUidvalidity(). Mailbox/indices form parameters needed.
Return values
bool —True on success, false on failure.
getForwardData()
Get forward compose data.
public
getForwardData() : mixed
See the list of variables needed for checkUidvalidity(). Mailbox/indices form parameters needed. Additional variables used:
- dataonly: (boolean) Only return data information (DEFAULT: false).
- format: (string) The format to force to ('text' or 'html') (DEFAULT: Auto-determined).
- imp_compose: (string) The IMP_Compose cache identifier.
- type: (string) Forward type.
Return values
mixed —False on failure, or an object with the following entries:
- body: (string) The body text of the message.
- format: (string) Either 'text' or 'html'.
- header: (array) The headers of the message.
- identity: (integer) The identity ID to use for this message.
- opts: (array) Additional options needed for ImpCompose.fillForm().
- type: (string) The input 'type' value.
getRedirectData()
AJAX action: Get compose redirect data.
public
getRedirectData() : mixed
Mailbox/indices form parameters needed.
Return values
mixed —False on failure, or an object with the following entries:
- imp_compose: (string) The IMP_Compose cache identifier.
- type: (string) The input 'type' value.
getReplyData()
AJAX action: Get reply data.
public
getReplyData() : mixed
See the list of variables needed for IMP_Ajax_Application#checkUidvalidity(). Mailbox/indices form parameters needed. Additional variables used:
- headeronly: (boolean) Only return header information (DEFAULT: false).
- format: (string) The format to force to ('text' or 'html') (DEFAULT: Auto-determined).
- imp_compose: (string) The IMP_Compose cache identifier.
- type: (string) See IMP_Compose::replyMessage().
Return values
mixed —False on failure, or an object with the following entries:
- addr: (array) List of addresses (to, cc, bcc).
- body: (string) The body text of the message.
- format: (string) Either 'text' or 'html'.
- identity: (integer) The identity ID to use for this message.
- opts: (array) Additional options needed for ImpCompose.fillForm().
- subject: (string) Subject value.
- type: (string) The input 'type' value.
getResumeData()
AJAX action: Get resume data.
public
getResumeData() : mixed
See the list of variables needed for IMP_Ajax_Application#checkUidvalidity(). Mailbox/indices form parameters needed. Additional variables used:
- format: (string) The format to force to ('text' or 'html') (DEFAULT: Auto-determined).
- imp_compose: (string) The IMP_Compose cache identifier.
- type: (string) Resume type: one of 'editasnew', 'resume', 'template', 'template_edit'.
Return values
mixed —False on failure, or an object with the following entries:
- addr: (array) List of addresses (to, cc, bcc).
- body: (string) The body text of the message.
- format: (string) Either 'text' or 'html'.
- identity: (integer) The identity ID to use for this message.
- opts: (array) Additional options (atc, priority, readreceipt).
- subject: (string) Subject value.
- type: (string) The input 'type' value.
moveMessages()
AJAX action: Move messages.
public
moveMessages() : bool
See the list of variables needed for IMP_Ajax_Application#changed(), IMP_Ajax_Application#deleteMsgs(), and IMP_Ajax_Application#checkUidvalidity(). Mailbox/indices form parameters needed. Additional variables used:
- mboxto: (string) Mailbox to move the message to (base64url encoded).
Return values
bool —True on success, false on failure.
poll()
AJAX action: Poll mailboxes.
public
poll() : bool
See the list of variables needed for IMP_Ajax_Application#changed() and IMP_Ajax_Application#viewPortData().
Return values
bool —True.
redirectMessage()
Redirect the message.
public
redirectMessage() : object
Variables used: See the list of variables needed for IMP_Ajax_Application#composeSetup().
Return values
object —An object with the following entries:
- action: (string) 'redirectMessage'.
- success: (integer) 1 on success, 0 on failure.
reportSpam()
AJAX action: Report message as [not]spam.
public
reportSpam() : bool
See the list of variables needed for IMP_Ajax_Application#changed(), IMP_Ajax_Application#deleteMsgs(), and IMP_Ajax_Application#checkUidvalidity(). Mailbox/indices form parameters needed. Additional variables used:
- spam: (integer) 1 to mark as spam, 0 to mark as innocent.
Return values
bool —True on success.
sendMessage()
AJAX action: Send a message.
public
sendMessage() : object
See the list of variables needed for IMP_Ajax_Application#composeSetup(). Additional variables used:
- encrypt: (integer) The encryption method to use (IMP ENCRYPT constants).
- html: (integer) In HTML compose mode?
- message: (string) The message text.
- pgp_attach_pubkey: (boolean) True if PGP public key should be attached to the message.
- priority: (string) The priority of the message.
- request_read_receipt: (boolean) Add request read receipt header?
- save_attachments_select: (boolean) Whether to save attachments.
- save_sent_mail: (boolean) True if saving sent mail.
- save_sent_mail_mbox: (string) base64url encoded version of sent mail mailbox to use.
- vcard_attach: (boolean) Attach user's vCard to the message?
Return values
object —An object with the following entries:
- action: (string) The AJAX action string
- draft_delete: (integer) If set, remove auto-saved drafts.
- encryptjs: (array) Javascript to run after encryption failure.
- flag: (array) See IMP_Ajax_Queue::add().
- identity: (integer) If set, this is the identity that is tied to the current recipient address.
- success: (integer) 1 on success, 0 on failure.
showMessage()
Generate data necessary to display a message.
public
showMessage() : object
See the list of variables needed for changed() and checkUidvalidity(). Mailbox/indices form parameters needed. Additional variables used:
- is_list: (boolean) If true, check for list existence.
- peek: (integer) If set, don't set seen flag.
- preview: (integer) If set, return preview data. Otherwise, return full data.
Return values
object —Object with the following entries:
- buid: (integer) The message BUID.
- error: (string) On error, the error string.
- errortype: (string) On error, the error type.
- view: (string) The view ID.
viewPort()
AJAX action: Output ViewPort data.
public
viewPort() : bool
See the list of variables needed for IMP_Ajax_Application#changed() and IMP_Ajax_Application#viewPortData(). Additional variables used (contained in 'viewport' parameter):
- checkcache: (integer) If 1, only send data if cache has been invalidated.
- rangeslice: (string) Range slice. See js/viewport.js.
- sortby: (integer) The Horde_Imap_Client sort constant.
- sortdir: (integer) 0 for ascending, 1 for descending.
Return values
bool —True on success, false on failure.
_handleBadComposeAddr()
Handle bad addresses entered during a compose.
protected
_handleBadComposeAddr(IMP_Compose_Exception_Address $e) : mixed
Parameters
- $e : IMP_Compose_Exception_Address
-
The address exception.
_passphraseDialog()
Outputs the script necessary to generate the passphrase dialog box.
protected
_passphraseDialog(string $type[, string $cacheid = null ]) : mixed
Parameters
- $type : string
-
Either 'pgp', 'pgp_symm', or 'smime'.
- $cacheid : string = null
-
Compose cache ID (only needed for 'pgp_symm').