diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-18 11:36:41 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-18 11:36:41 +0000 |
| commit | 14c37c6d0e26e14cd297e469c761f88571821245 (patch) | |
| tree | abab4c51a6e7eda52c6945084c486bbb4b761850 | |
| parent | d2b1ef26d86b6a9e01d810ab7287b71f4d1cf1b7 (diff) | |
Display priority in message headers block
git-svn-id: https://svn.roundcube.net/trunk@5788 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/steps/mail/func.inc | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc index fb8e7fa26..45fc865fa 100644 --- a/roundcubemail/program/steps/mail/func.inc +++ b/roundcubemail/program/steps/mail/func.inc @@ -882,7 +882,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'); + 'mail-reply-to', 'mail-followup-to', 'date', 'priority'); $exclude_headers = $attrib['exclude'] ? explode(',', $attrib['exclude']) : array(); $output_headers = array(); @@ -903,6 +903,13 @@ function rcmail_message_headers($attrib, $headers=NULL) else $header_value = format_date($value); } + if ($hkey == 'priority') { + if ($value) { + $header_value = html::span('prio' . $value, rcmail_localized_priority($value)); + } + else + continue; + } else if ($hkey == 'replyto') { if ($headers['replyto'] != $headers['from']) $header_value = rcmail_address_string($value, null, true, $attrib['addicon'], $headers['charset']); @@ -951,6 +958,24 @@ function rcmail_message_headers($attrib, $headers=NULL) return $table->show($attrib); } +/** + * Convert Priority header value into a localized string + */ +function rcmail_localized_priority($value) +{ + $labels_map = array( + '1' => 'highest', + '2' => 'high', + '3' => 'normal', + '4' => 'low', + '5' => 'lowest', + ); + + if ($value && $labels_map[$value]) + return rcube_label($labels_map[$value]); + + return ''; +} /** * return block to show full message headers |
