From f5c1085fbdb8b1555391d959f3de07412644577f Mon Sep 17 00:00:00 2001 From: alecpl Date: Wed, 7 Sep 2011 08:45:08 +0000 Subject: - Localize (full) forwarded message header (#1488058) --- program/steps/mail/compose.inc | 43 +++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index ddfd62772..7e8a26fc1 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -822,24 +822,27 @@ function rcmail_create_reply_body($body, $bodyIsHtml) function rcmail_create_forward_body($body, $bodyIsHtml) { - global $IMAP, $MESSAGE, $OUTPUT; + global $RCMAIL, $MESSAGE; // add attachments if (!isset($_SESSION['compose']['forward_attachments']) && is_array($MESSAGE->mime_parts)) $cid_map = rcmail_write_compose_attachments($MESSAGE, $bodyIsHtml); + $date = format_date($MESSAGE->headers->date, $RCMAIL->config->get('date_long')); + $charset = $RCMAIL->output->get_charset(); + if (!$bodyIsHtml) { $prefix = "\n\n\n-------- " . rcube_label('originalmessage') . " --------\n"; - $prefix .= 'Subject: ' . $MESSAGE->subject . "\n"; - $prefix .= 'Date: ' . $MESSAGE->headers->date . "\n"; - $prefix .= 'From: ' . $MESSAGE->get_header('from') . "\n"; - $prefix .= 'To: ' . $MESSAGE->get_header('to') . "\n"; + $prefix .= rcube_label('subject') . ': ' . $MESSAGE->subject . "\n"; + $prefix .= rcube_label('date') . ': ' . $date . "\n"; + $prefix .= rcube_label('from') . ': ' . $MESSAGE->get_header('from') . "\n"; + $prefix .= rcube_label('to') . ': ' . $MESSAGE->get_header('to') . "\n"; if ($MESSAGE->headers->cc) - $prefix .= 'Cc: ' . $MESSAGE->get_header('cc') . "\n"; + $prefix .= rcube_label('cc') . ': ' . $MESSAGE->get_header('cc') . "\n"; if ($MESSAGE->headers->replyto && $MESSAGE->headers->replyto != $MESSAGE->headers->from) - $prefix .= 'Reply-To: ' . $MESSAGE->get_header('replyto') . "\n"; + $prefix .= rcube_label('replyto') . ': ' . $MESSAGE->get_header('replyto') . "\n"; $prefix .= "\n"; } @@ -853,22 +856,24 @@ function rcmail_create_forward_body($body, $bodyIsHtml) $prefix = sprintf( "

-------- " . rcube_label('originalmessage') . " --------

" . "" . - "" . - "" . - "" . - "", - Q($MESSAGE->subject), - Q($MESSAGE->headers->date), - htmlspecialchars(Q($MESSAGE->get_header('from'), 'replace'), ENT_COMPAT, $OUTPUT->get_charset()), - htmlspecialchars(Q($MESSAGE->get_header('to'), 'replace'), ENT_COMPAT, $OUTPUT->get_charset())); + "" . + "" . + "" . + "", + rcube_label('subject'), Q($MESSAGE->subject), + rcube_label('date'), Q($date), + rcube_label('from'), htmlspecialchars(Q($MESSAGE->get_header('from'), 'replace'), ENT_COMPAT, $charset), + rcube_label('to'), htmlspecialchars(Q($MESSAGE->get_header('to'), 'replace'), ENT_COMPAT, $charset)); if ($MESSAGE->headers->cc) - $prefix .= sprintf("", - htmlspecialchars(Q($MESSAGE->get_header('cc'), 'replace'), ENT_COMPAT, $OUTPUT->get_charset())); + $prefix .= sprintf("", + rcube_label('cc'), + htmlspecialchars(Q($MESSAGE->get_header('cc'), 'replace'), ENT_COMPAT, $charset)); if ($MESSAGE->headers->replyto && $MESSAGE->headers->replyto != $MESSAGE->headers->from) - $prefix .= sprintf("", - htmlspecialchars(Q($MESSAGE->get_header('replyto'), 'replace'), ENT_COMPAT, $OUTPUT->get_charset())); + $prefix .= sprintf("", + rcube_label('replyto'), + htmlspecialchars(Q($MESSAGE->get_header('replyto'), 'replace'), ENT_COMPAT, $charset)); $prefix .= "
Subject: %s
Date: %s
From: %s
To: %s
%s: %s
%s: %s
%s: %s
%s: %s
Cc: %s
%s: %s
Reply-To: %s
%s: %s

"; } -- cgit v1.2.3