thomascube
2012-02-27 9efa95ea9b51cec0a12502455e9c27e64e3aae14
program/steps/mail/func.inc
@@ -6,7 +6,10 @@
 |                                                                       |
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2010, The Roundcube Dev Team                       |
 | Licensed under the GNU GPL                                            |
 |                                                                       |
 | Licensed under the GNU General Public License version 3 or            |
 | any later version with exceptions for skins & plugins.                |
 | See the README file for a full license statement.                     |
 |                                                                       |
 | PURPOSE:                                                              |
 |   Provide webmail functionality and GUI objects                       |
@@ -879,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();
@@ -899,6 +902,13 @@
        $header_value = format_date($value, $RCMAIL->config->get('date_long', 'x'));
      else
        $header_value = format_date($value);
    }
    else 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'])
@@ -948,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