From 26454147784fd3383f7c43560e5025e901d4956c Mon Sep 17 00:00:00 2001 From: alex-brainstorm Date: Sat, 30 Aug 2003 09:48:12 +0000 Subject: [PATCH] Feature: tooltip containing the whole From address (if different from the actual display); Fix: convert nbsp to space in subject before the tooltip comparison (so you were getting the tooltip almost all the time); Fix: put the right includes there instead of relying on imap_search.php; Helper: pass in optional boxes array to getMbxList() so it can be shared with others git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5589 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mailbox_display.php | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index f68704aa..a31d9c02 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -16,6 +16,8 @@ require_once(SM_PATH . 'functions/strings.php'); require_once(SM_PATH . 'functions/html.php'); require_once(SM_PATH . 'class/html.class.php'); require_once(SM_PATH . 'functions/imap_mailbox.php'); +require_once(SM_PATH . 'functions/imap_messages.php'); +require_once(SM_PATH . 'functions/mime.php'); /* Constants: * PG_SEL_MAX: default value for page_selector_max @@ -88,15 +90,21 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox, $senderNames = $msg['FROM']; $senderName = ''; + $senderAddress = ''; if (sizeof($senderNames)){ foreach ($senderNames as $senderNames_part) { if ($senderName != '') { $senderName .= ', '; + $senderAddress .= ', '; } - if ($senderNames_part[1]) { - $senderName .= decodeHeader($senderNames_part[1]); + $sender_address_part = htmlspecialchars($senderNames_part[0]); + $sender_name_part = decodeHeader($senderNames_part[1]); + if ($sender_name_part) { + $senderName .= $sender_name_part; + $senderAddress .= $sender_name_part . ' <' . $sender_address_part . '>'; } else { - $senderName .= htmlspecialchars($senderNames_part[0]); + $senderName .= $sender_address_part; + $senderAddress .= $sender_address_part; } } } @@ -188,9 +196,8 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox, } $checked = ($checkall == 1) ? ' CHECKED' : ''; $col = 0; - $msg['SUBJECT'] = decodeHeader($msg['SUBJECT']); + $msg['SUBJECT'] = str_replace(' ', ' ', decodeHeader($msg['SUBJECT'])); $subject = processSubject($msg['SUBJECT'], $indent_array[$msg['ID']]); - $subject = str_replace(' ',' ',$subject); if (sizeof($index_order)) { foreach ($index_order as $index_order_part) { switch ($index_order_part) { @@ -201,11 +208,17 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox, $hlt_color ); break; case 2: /* from */ + if ($senderAddress != $senderName) { + $senderAddress = strtr($senderAddress, array_flip(get_html_translation_table(HTML_SPECIALCHARS))); + $title = ' title="' . str_replace('"', "''", $senderAddress) . '"'; + } + else + $title = ''; echo html_tag( 'td', $italic . $bold . $flag . $fontstr . $senderName . $fontstr_end . $flag_end . $bold_end . $italic_end, 'left', - $hlt_color ); + $hlt_color, $title ); break; case 3: /* date */ $date_string = $msg['DATE_STRING'] . ''; @@ -1247,10 +1260,10 @@ function processSubject($subject, $threadlevel = 0) { } } -function getMbxList($imapConnection) { +function getMbxList($imapConnection, $boxes = 0) { global $lastTargetMailbox; echo '   '; } -- 2.25.1