X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fmailbox_display.php;h=f6959b5414837d6dcf78335e6a001b81958e66e2;hb=e86ab8720ef0da13a12c0a561b5fb874298a361e;hp=9b7656643ddf74751a821ddffc312f89d247a3ca;hpb=88c813966455692c10444dbf9e091f2b920486a2;p=squirrelmail.git diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 9b765664..f6959b54 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -10,7 +10,7 @@ $mailbox_display_php = true; - function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage) { + function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage, $where, $what) { global $color, $msgs, $msort; global $sent_folder; global $message_highlight_list; @@ -27,27 +27,34 @@ if ($mailbox == $sent_folder) { $italic = ""; $italic_end = ""; } for ($i=0; $i < count($message_highlight_list); $i++) { - if ($message_highlight_list[$i]["match_type"] == "to_cc") { - if (eregi($message_highlight_list[$i]["value"],$msg["TO"]) || eregi($message_highlight_list[$i]["value"],$msg["CC"])) { + if (trim($message_highlight_list[$i]["value"]) != "") { + if ($message_highlight_list[$i]["match_type"] == "to_cc") { + if (strpos("^^".$msg["TO"], $message_highlight_list[$i]["value"]) || strpos("^^".$msg["CC"], $message_highlight_list[$i]["value"])) { + $hlt_color = $message_highlight_list[$i]["color"]; + continue; + } + } else if (strpos("^^".$msg[strtoupper($message_highlight_list[$i]["match_type"])],$message_highlight_list[$i]["value"])) { $hlt_color = $message_highlight_list[$i]["color"]; continue; - } - } else 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]; + + if ($where && $what) { + $search_stuff = "&where=".urlencode($where)."&what=".urlencode($what); + } 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"; - elseif (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) echo " !"; - else echo "  "; - echo " $bold$flag$subject$flag_end$bold_end\n"; + + if ($msg["FLAG_ANSWERED"] == true) echo " A\n"; + elseif (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) echo " !\n"; + else echo "  \n"; + echo " $bold$flag$subject$flag_end$bold_end\n"; echo "\n"; } @@ -166,26 +173,30 @@ global $folder_prefix, $sent_folder; global $imapServerAddress; - // do a check to see if the config stuff has already been included or not -// if (!isset($imapServerAddress)) -// include("../config/config.php"); - // if cache isn't already set, do it now if (!session_is_registered("msgs")) session_register("msgs"); if (!session_is_registered("msort")) session_register("msort"); + if ($startMessage + ($show_num - 1) < $numMessages) { $endMessage = $startMessage + ($show_num-1); } else { $endMessage = $numMessages; } - + + if ($endMessage < $startMessage) { + $startMessage = $startMessage - $show_num; + if ($startMessage < 1) + $startMessage = 1; + } + $nextGroup = $startMessage + $show_num; $prevGroup = $startMessage - $show_num; $urlMailbox = urlencode($mailbox); + do_hook("mailbox_index_before"); /** This is the beginning of the message list table. It wraps around all messages */ echo ""; @@ -220,7 +231,7 @@ echo "\n\n\n"; echo "
\n"; echo " \n"; - echo " "; echo "
\n"; + echo " \n"; echo " ". _("Move selected to:") .""; echo "
"; - echo ""; + echo "
"; echo ""; echo " "; /** FROM HEADER **/ @@ -286,14 +297,14 @@ if ($numMessages == 0) { // if there's no messages in this folder echo ""; } else if ($startMessage == $endMessage) { // if there's only one message in the box, handle it different. - $i = $startMessage - 1; + $i = $startMessage; reset($msort); do { $key = key($msort); next($msort); $k++; } while (isset ($key) && ($k < $i)); - printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage); + printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage, 0, 0); } else { $i = $startMessage; reset($msort); @@ -304,7 +315,7 @@ } while (isset ($key) && ($k < $i)); do { - printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage); + printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage, 0, 0); $key = key($msort); $t++; $i++; @@ -330,5 +341,7 @@ echo "" . _("Next") . "\n"; } echo "
 

". _("THIS FOLDER IS EMPTY") ."
 
"; /** End of message-list table */ + + do_hook("mailbox_index_after"); } ?>