+ elseif (($nextGroup <= $numMessages) && ($prevGroup < 0)) {
+ $More = "<FONT COLOR=\"$color[9]\">"._("Previous")."</FONT> | \n";
+ $More .= "<A HREF=\"right_main.php?use_mailbox_cache=$use&startMessage=$nextGroup&mailbox=$urlMailbox\" TARGET=\"right\">". _("Next") ."</A>\n";
+ }
+
+ mail_message_listing_beginning($imapConnection,
+ "move_messages.php?msg=$msg&mailbox=$urlMailbox&startMessage=$startMessage",
+ $mailbox, $sort, $Message, $More, $startMessage);
+
+ $groupNum = $startMessage % ($show_num - 1);
+ $real_startMessage = $startMessage;
+ if ($sort == 6) {
+ if ($endMessage - $startMessage < $show_num - 1) {
+ $endMessage = $endMessage - $startMessage + 1;
+ $startMessage = 1;
+ } else if ($startMessage > $show_num) {
+ $endMessage = $show_num;
+ $startMessage = 1;
+ }
+ }
+
+ $endVar = $endMessage + 1;
+
+ // loop through and display the info for each message.
+ $t = 0; // $t is used for the checkbox number
+ if ($numMessages == 0) { // if there's no messages in this folder
+ echo "<TR><TD BGCOLOR=\"$color[4]\" COLSPAN=" . count($index_order);
+ echo "><CENTER><BR><B>". _("THIS FOLDER IS EMPTY") ."</B><BR> </CENTER></TD></TR>";
+ } else if ($startMessage == $endMessage) { // if there's only one message in the box, handle it different.
+ if ($sort != 6)
+ $i = $startMessage;
+ else
+ $i = 1;
+ reset($msort);
+ do {
+ $key = key($msort);
+ next($msort);
+ $k++;
+ } while (isset ($key) && ($k < $i));
+ printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $real_startMessage, 0, 0);
+ } else {
+ $i = $startMessage;
+
+ reset($msort);
+ do {
+ $key = key($msort);
+ next($msort);
+ $k++;
+ } while (isset ($key) && ($k < $i));
+
+ do {
+ printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $real_startMessage, 0, 0);
+ $key = key($msort);
+ $t++;
+ $i++;
+ next($msort);
+ } while ($i && $i < $endVar);
+ }
+ echo "</TABLE>";
+
+ echo "</td></tr>\n";
+
+ echo "<TR BGCOLOR=\"$color[4]\"><TD>";
+ echo "<table width=100% cellpadding=0 cellspacing=0 border=0><tr><td>";
+ echo "$More</td><td align=right>\n";
+ if (!$startMessage) $startMessage=1;
+ if ( $checkall == "1")
+ echo "\n<A HREF=\"right_main.php?mailbox=$mailbox&startMessage=$startMessage&sort=$sort\">" . _("Unselect All") . "</A>\n";
+ else
+ echo "\n<A HREF=\"right_main.php?mailbox=$mailbox&startMessage=$startMessage&sort=$sort&checkall=1\">" . _("Select All") . "</A>\n";
+
+ echo "</td></tr></table>";
+ echo "</td></tr>";
+ echo "</table>"; /** End of message-list table */
+
+ do_hook("mailbox_index_after");
+ }
+
+ /* Displays the standard message list header.
+ * To finish the table, you need to do a "</table></table>";
+ * $moveURL is the URL to submit the delete/move form to
+ * $mailbox is the current mailbox
+ * $sort is the current sorting method (-1 for no sorting available [searches])
+ * $Message is a message that is centered on top of the list
+ * $More is a second line that is left aligned
+ */
+ function mail_message_listing_beginning($imapConnection, $moveURL,
+ $mailbox = '', $sort = -1, $Message = '', $More = '', $startmessage = 1)
+ {
+ global $color, $index_order, $auto_expunge, $move_to_trash;
+ global $checkall;
+ $urlMailbox = urlencode($mailbox);
+
+ /** This is the beginning of the message list table. It wraps around all messages */
+ echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0>";
+
+ if ($Message)
+ {
+ echo "<TR BGCOLOR=\"$color[4]\"><TD align=center>$Message</td></tr>\n";