|
|
@ -969,6 +969,8 @@ function rcmail_message_headers($attrib, $headers=NULL)
|
|
|
|
if (in_array($hkey, $exclude_headers))
|
|
|
|
if (in_array($hkey, $exclude_headers))
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$header_title = rcube_label(preg_replace('/(^mail-|-)/', '', $hkey));
|
|
|
|
|
|
|
|
|
|
|
|
if ($hkey == 'date') {
|
|
|
|
if ($hkey == 'date') {
|
|
|
|
if ($PRINT_MODE)
|
|
|
|
if ($PRINT_MODE)
|
|
|
|
$header_value = format_date($value, $RCMAIL->config->get('date_long', 'x'));
|
|
|
|
$header_value = format_date($value, $RCMAIL->config->get('date_long', 'x'));
|
|
|
@ -984,7 +986,7 @@ function rcmail_message_headers($attrib, $headers=NULL)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ($hkey == 'replyto') {
|
|
|
|
else if ($hkey == 'replyto') {
|
|
|
|
if ($headers['replyto'] != $headers['from']) {
|
|
|
|
if ($headers['replyto'] != $headers['from']) {
|
|
|
|
$header_value = rcmail_address_string($value, null, true, $attrib['addicon'], $headers['charset']);
|
|
|
|
$header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset'], $header_title);
|
|
|
|
$ishtml = true;
|
|
|
|
$ishtml = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -994,18 +996,18 @@ function rcmail_message_headers($attrib, $headers=NULL)
|
|
|
|
if ($headers['mail-replyto'] != $headers['reply-to']
|
|
|
|
if ($headers['mail-replyto'] != $headers['reply-to']
|
|
|
|
&& $headers['reply-to'] != $headers['from']
|
|
|
|
&& $headers['reply-to'] != $headers['from']
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
$header_value = rcmail_address_string($value, null, true, $attrib['addicon'], $headers['charset']);
|
|
|
|
$header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset'], $header_title);
|
|
|
|
$ishtml = true;
|
|
|
|
$ishtml = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ($hkey == 'mail-followup-to') {
|
|
|
|
else if ($hkey == 'mail-followup-to') {
|
|
|
|
$header_value = rcmail_address_string($value, null, true, $attrib['addicon'], $headers['charset']);
|
|
|
|
$header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset'], $header_title);
|
|
|
|
$ishtml = true;
|
|
|
|
$ishtml = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (in_array($hkey, array('from', 'to', 'cc', 'bcc'))) {
|
|
|
|
else if (in_array($hkey, array('from', 'to', 'cc', 'bcc'))) {
|
|
|
|
$header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset']);
|
|
|
|
$header_value = rcmail_address_string($value, $attrib['max'], true, $attrib['addicon'], $headers['charset'], $header_title);
|
|
|
|
$ishtml = true;
|
|
|
|
$ishtml = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ($hkey == 'subject' && empty($value))
|
|
|
|
else if ($hkey == 'subject' && empty($value))
|
|
|
@ -1014,7 +1016,7 @@ function rcmail_message_headers($attrib, $headers=NULL)
|
|
|
|
$header_value = trim(rcube_mime::decode_header($value, $headers['charset']));
|
|
|
|
$header_value = trim(rcube_mime::decode_header($value, $headers['charset']));
|
|
|
|
|
|
|
|
|
|
|
|
$output_headers[$hkey] = array(
|
|
|
|
$output_headers[$hkey] = array(
|
|
|
|
'title' => rcube_label(preg_replace('/(^mail-|-)/', '', $hkey)),
|
|
|
|
'title' => $header_title,
|
|
|
|
'value' => $header_value,
|
|
|
|
'value' => $header_value,
|
|
|
|
'raw' => $value,
|
|
|
|
'raw' => $value,
|
|
|
|
'html' => $ishtml,
|
|
|
|
'html' => $ishtml,
|
|
|
@ -1405,7 +1407,7 @@ function rcmail_alter_html_link($matches)
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* decode address string and re-format it as HTML links
|
|
|
|
* decode address string and re-format it as HTML links
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, $default_charset=null)
|
|
|
|
function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, $default_charset=null, $title=null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $RCMAIL, $PRINT_MODE, $CONFIG;
|
|
|
|
global $RCMAIL, $PRINT_MODE, $CONFIG;
|
|
|
|
|
|
|
|
|
|
|
@ -1417,6 +1419,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
|
|
|
|
$c = count($a_parts);
|
|
|
|
$c = count($a_parts);
|
|
|
|
$j = 0;
|
|
|
|
$j = 0;
|
|
|
|
$out = '';
|
|
|
|
$out = '';
|
|
|
|
|
|
|
|
$allvalues = array();
|
|
|
|
|
|
|
|
|
|
|
|
if ($addicon && !isset($_SESSION['writeable_abook'])) {
|
|
|
|
if ($addicon && !isset($_SESSION['writeable_abook'])) {
|
|
|
|
$_SESSION['writeable_abook'] = $RCMAIL->get_address_sources(true) ? true : false;
|
|
|
|
$_SESSION['writeable_abook'] = $RCMAIL->get_address_sources(true) ? true : false;
|
|
|
@ -1424,7 +1427,6 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($a_parts as $part) {
|
|
|
|
foreach ($a_parts as $part) {
|
|
|
|
$j++;
|
|
|
|
$j++;
|
|
|
|
|
|
|
|
|
|
|
|
$name = $part['name'];
|
|
|
|
$name = $part['name'];
|
|
|
|
$mailto = $part['mailto'];
|
|
|
|
$mailto = $part['mailto'];
|
|
|
|
$string = $part['string'];
|
|
|
|
$string = $part['string'];
|
|
|
@ -1466,7 +1468,6 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
|
|
|
|
'alt' => "Add contact",
|
|
|
|
'alt' => "Add contact",
|
|
|
|
)));
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$out .= html::span('adr', $address);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
$address = '';
|
|
|
|
$address = '';
|
|
|
@ -1474,19 +1475,37 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
|
|
|
|
$address .= Q($name);
|
|
|
|
$address .= Q($name);
|
|
|
|
if ($mailto)
|
|
|
|
if ($mailto)
|
|
|
|
$address .= (strlen($address) ? ' ' : '') . sprintf('<%s>', Q($mailto));
|
|
|
|
$address .= (strlen($address) ? ' ' : '') . sprintf('<%s>', Q($mailto));
|
|
|
|
|
|
|
|
|
|
|
|
$out .= html::span('adr', $address);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($c>$j)
|
|
|
|
$address = html::span('adr', $address);
|
|
|
|
$out .= ','.($max ? ' ' : ' ');
|
|
|
|
$allvalues[] = $address;
|
|
|
|
|
|
|
|
|
|
|
|
if ($max && $j==$max && $c>$j) {
|
|
|
|
if (!$moreadrs)
|
|
|
|
$out .= '...';
|
|
|
|
$out .= ($out ? ', ' : '') . $address;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
if ($max && $j == $max && $c > $j) {
|
|
|
|
|
|
|
|
if ($linked) {
|
|
|
|
|
|
|
|
$moreadrs = $c - $j;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
$out .= '...';
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($moreadrs) {
|
|
|
|
|
|
|
|
$out .= ' ' . html::a(array(
|
|
|
|
|
|
|
|
'href' => '#more',
|
|
|
|
|
|
|
|
'class' => 'morelink',
|
|
|
|
|
|
|
|
'onclick' => sprintf("return %s.show_popup_dialog('%s','%s')",
|
|
|
|
|
|
|
|
JS_OBJECT_NAME,
|
|
|
|
|
|
|
|
JQ(join(', ', $allvalues)),
|
|
|
|
|
|
|
|
JQ($title))
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Q(rcube_label(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs)))));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return $out;
|
|
|
|
return $out;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|