diff options
author | thomascube <thomas@roundcube.net> | 2008-09-18 19:50:58 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2008-09-18 19:50:58 +0000 |
commit | 44385fd68f519233615505a68d0e83de4328af18 (patch) | |
tree | bcb826b0f869575f36c6bd31235b245f93eaa04a /program/steps/mail/func.inc | |
parent | 7dfb1fba5001299300736e6b5d95d9400575e3e7 (diff) |
Trim and abbreviate subjects in message listing
Diffstat (limited to 'program/steps/mail/func.inc')
-rw-r--r-- | program/steps/mail/func.inc | 14 |
1 files 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('<a href="%s" onclick="return rcube_event.cancel(event)">%s</a>', 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('<a href="%s" onclick="return rcube_event.cancel(event)">%s</a>', 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('<a href="%s" onclick="return rcube_event.cancel(event)">%s</a>', 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('<a href="%s" onclick="return rcube_event.cancel(event)">%s</a>', 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<tr>\n"; $out .= '<td class="header-title">'.Q(rcube_label($hkey)).": </td>\n"; |