X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fmailbox_display.php;h=5d95cdfeb1f09a58c578c6977a678ea95e7ecf51;hb=3e69e88b2bd4d8ed662ff6443aa4567bf1c26be2;hp=ab348b92049ec893724f8ccfc64c511d97586a61;hpb=15a9cd31950714c2cadd6cb6dfe92c178aa71abc;p=squirrelmail.git diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index ab348b92..5d95cdfe 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -13,6 +13,7 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage) { global $color, $msgs, $msort; global $sent_folder; + global $message_highlight_list; $msg = $msgs[$key]; @@ -25,12 +26,21 @@ if ($msg["FLAG_SEEN"] == false) { $bold = ""; $bold_end = ""; } if ($mailbox == $sent_folder) { $italic = ""; $italic_end = ""; } - echo " \n"; - echo " $italic$bold$flag$senderName$flag_end$bold_end$italic_end\n"; - echo "
$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end
\n"; - if ($msg["FLAG_ANSWERED"] == true) echo " A"; - else echo "  "; - echo " $bold$flag$subject$flag_end$bold_end\n"; + for ($i=0; $i < count($message_highlight_list); $i++) { + if (eregi($message_highlight_list[$i]["value"],$msg[strtoupper($message_highlight_list[$i]["match_type"])])) { + $hlt_color = $message_highlight_list[$i]["color"]; + continue; + } + } + if (!$hlt_color) + $hlt_color = $color[4]; + + echo " \n"; + echo " $italic$bold$flag$senderName$flag_end$bold_end$italic_end\n"; + echo "
$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end
\n"; + if ($msg["FLAG_ANSWERED"] == true) echo " A"; + else echo "  "; + echo " $bold$flag$subject$flag_end$bold_end\n"; echo "\n"; } @@ -41,18 +51,20 @@ function showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color,$show_num, $use_cache) { global $msgs, $msort; global $sent_folder; + global $message_highlight_list; if (!$use_cache) { if ($numMessages >= 1) { - if ($mailbox == $sent_folder) - $ary = sqimap_get_small_header ($imapConnection, 1, $numMessages, true); - else - $ary = sqimap_get_small_header ($imapConnection, 1, $numMessages, false); - for ($q = 0; $q < $numMessages; $q++) { - $from[$q] = $ary[$q]->from; - $date[$q] = $ary[$q]->date; - $subject[$q] = $ary[$q]->subject; + if ($mailbox == $sent_folder) + $hdr = sqimap_get_small_header ($imapConnection, $q+1, true); + else + $hdr = sqimap_get_small_header ($imapConnection, $q+1, false); + + $from[$q] = $hdr->from; + $date[$q] = $hdr->date; + $subject[$q] = $hdr->subject; + $to[$q] = $hdr->to; $flags[$q] = sqimap_get_flags ($imapConnection, $q+1); } @@ -68,6 +80,7 @@ $messages[$j]["ID"] = $j+1; $messages[$j]["FROM"] = decodeHeader($from[$j]); $messages[$j]["SUBJECT"] = decodeHeader($subject[$j]); + $messages[$j]["TO"] = decodeHeader($to[$j]); $num = 0; while ($num < count($flags[$j])) { @@ -111,7 +124,7 @@ ** 2 = Name (up) ** 3 = Name (dn) **/ - + session_unregister("msgs"); if (($sort == 0) || ($sort == 1)) $msort = array_cleave ($msgs, "TIME_STAMP"); if (($sort == 2) || ($sort == 3)) @@ -127,6 +140,7 @@ session_register("msort"); } displayMessageArray($imapConnection, $numMessages, $startMessage, $msgs, $msort, $mailbox, $sort, $color,$show_num); + session_register("msgs"); } // generic function to convert the msgs array into an HTML table @@ -194,9 +208,11 @@ $boxes = sqimap_mailbox_list($imapConnection); for ($i = 0; $i < count($boxes); $i++) { - $box = $boxes[$i]["unformatted"]; - $box2 = replace_spaces($boxes[$i]["formatted"]); - echo "