summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-12-12 21:30:04 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-12-12 21:30:04 +0000
commitff135fc2259ce88725406bf02f3603b4c0dd6a02 (patch)
tree67f18c3e45f4921600055e368c2b91f01bcfe23f /roundcubemail/program
parent364dcd7ae2d26139c165c0a19a344d3801737d57 (diff)
More options for message headers output in templates
git-svn-id: https://svn.roundcube.net/trunk@5596 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/steps/mail/func.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc
index 5f36da9a9..fd0bd453f 100644
--- a/roundcubemail/program/steps/mail/func.inc
+++ b/roundcubemail/program/steps/mail/func.inc
@@ -890,6 +890,7 @@ function rcmail_message_headers($attrib, $headers=NULL)
// show these headers
$standard_headers = array('subject', 'from', 'to', 'cc', 'bcc', 'replyto',
'mail-reply-to', 'mail-followup-to', 'date');
+ $exclude_headers = $attrib['exclude'] ? explode(',', $attrib['exclude']) : array();
$output_headers = array();
foreach ($standard_headers as $hkey) {
@@ -900,6 +901,9 @@ function rcmail_message_headers($attrib, $headers=NULL)
else
continue;
+ if (in_array($hkey, $exclude_headers))
+ continue;
+
if ($hkey == 'date') {
if ($PRINT_MODE)
$header_value = format_date($value, $RCMAIL->config->get('date_long', 'x'));
@@ -937,7 +941,11 @@ function rcmail_message_headers($attrib, $headers=NULL)
}
$plugin = $RCMAIL->plugins->exec_hook('message_headers_output',
- array('output' => $output_headers, 'headers' => $MESSAGE->headers));
+ array('output' => $output_headers, 'headers' => $MESSAGE->headers, 'exclude' => $exclude_headers));
+
+ // single header value is requested
+ if (!empty($attrib['valueof']))
+ return Q($plugin['output'][$attrib['valueof']]['value'], ($hkey == 'subject' ? 'strict' : 'show'));
// compose html table
$table = new html_table(array('cols' => 2));