thomascube
2012-01-18 a49a00fd30bda2fc67d74d515bff9bf2d30df089
Display priority in message headers block

1 files modified
27 ■■■■■ changed files
program/steps/mail/func.inc 27 ●●●●● patch | view | raw | blame | history
program/steps/mail/func.inc
@@ -882,7 +882,7 @@
  // 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();
@@ -902,6 +902,13 @@
        $header_value = format_date($value, $RCMAIL->config->get('date_long', 'x'));
      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'])
@@ -951,6 +958,24 @@
  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