From: Michael M Slusarz Date: Thu, 4 Nov 2010 20:37:01 +0000 (-0600) Subject: Make html mode an optional argument to buildAndSendMessage() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d9a73ca85f901393c3ec43dfa1994c8b5660601c;p=horde.git Make html mode an optional argument to buildAndSendMessage() --- diff --git a/imp/compose-mimp.php b/imp/compose-mimp.php index 5d00cf453..033ca09f6 100644 --- a/imp/compose-mimp.php +++ b/imp/compose-mimp.php @@ -282,7 +282,7 @@ case _("Send"): ); try { - if ($imp_compose->buildAndSendMessage($message, $header, $registry->getEmailCharset(), false, $options)) { + if ($imp_compose->buildAndSendMessage($message, $header, $registry->getEmailCharset(), $options)) { $imp_compose->destroy('send'); $notification->push(_("Message sent successfully."), 'horde.success'); diff --git a/imp/compose.php b/imp/compose.php index 34462a982..0b456b2d7 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -417,6 +417,7 @@ case 'send_message': $options = array( 'encrypt' => $prefs->isLocked('default_encrypt') ? $prefs->getValue('default_encrypt') : $vars->encrypt_options, + 'html' => $rtemode, 'identity' => $identity, 'priority' => $vars->priority, 'save_sent' => $save_sent_mail, @@ -426,7 +427,7 @@ case 'send_message': ); try { - $sent = $imp_compose->buildAndSendMessage($message, $header, $charset, $rtemode, $options); + $sent = $imp_compose->buildAndSendMessage($message, $header, $charset, $options); $imp_compose->destroy('send'); } catch (IMP_Compose_Exception $e) { $get_sig = false; diff --git a/imp/lib/Ajax/Application.php b/imp/lib/Ajax/Application.php index bd44638c8..81b4fcce1 100644 --- a/imp/lib/Ajax/Application.php +++ b/imp/lib/Ajax/Application.php @@ -1624,6 +1624,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application $options = array( 'encrypt' => ($GLOBALS['prefs']->isLocked('default_encrypt') ? $GLOBALS['prefs']->getValue('default_encrypt') : $this->_vars->encrypt), + 'html' => $this->_vars->html, 'identity' => $identity, 'priority' => $this->_vars->priority, 'readreceipt' => $this->_vars->request_read_receipt, @@ -1638,7 +1639,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application try { // TODO: Use 'sending_charset' - $sent = $imp_compose->buildAndSendMessage($this->_vars->message, $headers, $GLOBALS['registry']->getEmailCharset(), $this->_vars->html, $options); + $sent = $imp_compose->buildAndSendMessage($this->_vars->message, $headers, $GLOBALS['registry']->getEmailCharset(), $options); } catch (IMP_Compose_Exception $e) { $result->success = 0; diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index 1c17852bf..413f47f43 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -445,20 +445,21 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator * @param string $body The message body. * @param array $header List of message headers. * @param string $charset The sending charset. - * @param boolean $html Whether this is an HTML message. * @param array $opts An array of options w/the following keys: *
-     * 'encrypt' => (integer) A flag whether to encrypt or sign the message.
-     *              One of IMP::PGP_ENCRYPT, IMP::PGP_SIGNENC,
-     *              IMP::SMIME_ENCRYPT, or IMP::SMIME_SIGNENC.
-     * 'identity' => (IMP_Prefs_Identity) If set, checks for proper tie-to
-     *               addresses.
-     * 'priority' => (string) The message priority ('high', 'normal', 'low').
-     * 'save_sent' = (bool) Save sent mail?
-     * 'sent_folder' = (string) The sent-mail folder (UTF7-IMAP).
-     * 'save_attachments' = (bool) Save attachments with the message?
-     * 'readreceipt' => (bool) Add return receipt headers?
-     * 'useragent' => (string) The User-Agent string to use.
+     * encrypt - (integer) A flag whether to encrypt or sign the message.
+     *           One of IMP::PGP_ENCRYPT, IMP::PGP_SIGNENC,
+     *           IMP::SMIME_ENCRYPT, or IMP::SMIME_SIGNENC.
+     * html - (boolean) Whether this is an HTML message.
+     *        DEFAULT: false
+     * identity - (IMP_Prefs_Identity) If set, checks for proper tie-to
+     *            addresses.
+     * priority - (string) The message priority ('high', 'normal', 'low').
+     * save_sent - (boolean) Save sent mail?
+     * sent_folder - (string) The sent-mail folder (UTF7-IMAP).
+     * save_attachments - (bool) Save attachments with the message?
+     * readreceipt - (boolean) Add return receipt headers?
+     * useragent - (string) The User-Agent string to use.
      * 
* * @return boolean Whether the sent message has been saved in the @@ -467,8 +468,8 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator * @throws IMP_Compose_Exception * @throws IMP_Exception */ - public function buildAndSendMessage($body, $header, $charset, $html, - $opts = array()) + public function buildAndSendMessage($body, $header, $charset, + array $opts = array()) { global $conf, $notification, $prefs, $registry; @@ -501,7 +502,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator $send_msgs = array(); $msg_options = array( 'encrypt' => $encrypt, - 'html' => $html + 'html' => !empty($opts['html']) ); /* Must encrypt & send the message one recipient at a time. */