From 44385fd68f519233615505a68d0e83de4328af18 Mon Sep 17 00:00:00 2001 From: thomascube Date: Thu, 18 Sep 2008 19:50:58 +0000 Subject: Trim and abbreviate subjects in message listing --- program/steps/mail/func.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 440de92b9..49dfe5f6a 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -259,9 +259,9 @@ function rcmail_message_list($attrib) { $action = $mbox==$CONFIG['drafts_mbox'] ? 'compose' : 'show'; $uid_param = $mbox==$CONFIG['drafts_mbox'] ? '_draft_uid' : '_uid'; - $cont = Q($IMAP->decode_header($header->$col)); - if (empty($cont)) $cont = Q(rcube_label('nosubject')); - $cont = sprintf('%s', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), $cont); + $cont = abbreviate_string(trim($IMAP->decode_header($header->$col)), 160); + if (empty($cont)) $cont = rcube_label('nosubject'); + $cont = sprintf('%s', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), Q($cont)); } else if ($col=='flag') $cont = $flagged_icon ? sprintf($image_tag, $skin_path, $flagged_icon, '') : ''; @@ -363,9 +363,9 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE) { $action = $mbox==$CONFIG['drafts_mbox'] ? 'compose' : 'show'; $uid_param = $mbox==$CONFIG['drafts_mbox'] ? '_draft_uid' : '_uid'; - $cont = Q($IMAP->decode_header($header->$col)); - if (!$cont) $cont = Q(rcube_label('nosubject')); - $cont = sprintf('%s', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), $cont); + $cont = abbreviate_string(trim($IMAP->decode_header($header->$col)), 160); + if (!$cont) $cont = rcube_label('nosubject'); + $cont = sprintf('%s', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), Q($cont)); } else if ($col=='size') $cont = show_bytes($header->$col); @@ -809,7 +809,7 @@ function rcmail_message_headers($attrib, $headers=NULL) else if (in_array($hkey, array('from', 'to', 'cc', 'bcc'))) $header_value = Q(rcmail_address_string($headers[$hkey], null, true, $attrib['addicon']), 'show'); else - $header_value = Q($IMAP->decode_header($headers[$hkey])); + $header_value = Q(trim($IMAP->decode_header($headers[$hkey]))); $out .= "\n\n"; $out .= ''.Q(rcube_label($hkey)).": \n"; -- cgit v1.2.3