+ $More = "<FONT COLOR=\"$color[9]\">"._("Previous")."</FONT> | \n";
+ $More .= "<A HREF=\"right_main.php?use_mailbox_cache=1&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);
+
+
+ // 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.
+ $i = $startMessage;
+ reset($msort);
+ do {
+ $key = key($msort);
+ next($msort);
+ $k++;
+ } while (isset ($key) && ($k < $i));
+ printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $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, $startMessage, 0, 0);
+ $key = key($msort);
+ $t++;
+ $i++;
+ next($msort);
+ } while ($i < ($endMessage+1));
+ }
+ echo "</TABLE>";
+
+ echo "</td></tr>\n";
+
+ if ($More)
+ {
+ echo "<TR BGCOLOR=\"$color[4]\"><TD>$More</td></tr>\n";
+ }
+ 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 = '')
+ {
+ global $color, $index_order;
+
+ /** 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";
+ }
+
+ if ($More)
+ {
+ echo "<TR BGCOLOR=\"$color[4]\"><TD>$More</td></tr>\n";