summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-08-16 10:07:28 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-08-16 10:07:28 +0000
commit0de0cc8bf4e6bb0829af8e52826a032ca4bcf347 (patch)
treed3eeabdf9256541b089f32c81f5686f8cc2f658d /roundcubemail/program
parent3e496a51aae9f2d41ba220d17e2aae8ba7ea7d59 (diff)
- Added 'message_body_prefix' hook. Now it's possible to add some HTML code
before every displayed part of the message. git-svn-id: https://svn.roundcube.net/trunk@3898 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/steps/mail/func.inc17
1 files changed, 12 insertions, 5 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc
index db2a5241c..96b21c439 100644
--- a/roundcubemail/program/steps/mail/func.inc
+++ b/roundcubemail/program/steps/mail/func.inc
@@ -944,7 +944,7 @@ function rcmail_message_headers($attrib, $headers=NULL)
*/
function rcmail_message_body($attrib)
{
- global $CONFIG, $OUTPUT, $MESSAGE, $IMAP, $REMOTE_OBJECTS;
+ global $CONFIG, $OUTPUT, $MESSAGE, $IMAP, $RCMAIL, $REMOTE_OBJECTS;
if (!is_array($MESSAGE->parts) && empty($MESSAGE->body))
return '';
@@ -980,6 +980,9 @@ function rcmail_message_body($attrib)
rcmail_message_error($MESSAGE->uid);
}
+ $plugin = $RCMAIL->plugins->exec_hook('message_body_prefix', array(
+ 'part' => $part, 'prefix' => ''));
+
// re-format format=flowed content
if ($part->ctype_secondary == "plain" && $part->ctype_parameters['format'] == "flowed")
$part->body = rcube_message::unfold_flowed($part->body);
@@ -998,16 +1001,20 @@ function rcmail_message_body($attrib)
if (!empty($style))
$div_attr['style'] = implode('; ', $style);
- $out .= html::div($div_attr, $body);
+ $out .= html::div($div_attr, $plugin['prefix'] . $body);
}
else
- $out .= html::div('message-part', $body);
+ $out .= html::div('message-part', $plugin['prefix'] . $body);
}
}
}
- else
- $out .= html::div('message-part', html::tag('pre', array(),
+ else {
+ $plugin = $RCMAIL->plugins->exec_hook('message_body_prefix', array(
+ 'part' => $MESSAGE, 'prefix' => ''));
+
+ $out .= html::div('message-part', $plugin['prefix'] . html::tag('pre', array(),
rcmail_plain_body(Q($MESSAGE->body, 'strict', false))));
+ }
$ctype_primary = strtolower($MESSAGE->structure->ctype_primary);
$ctype_secondary = strtolower($MESSAGE->structure->ctype_secondary);