+
+ $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);
+ $k = 0;
+ 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);
+ $k = 0;
+ 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></FORM>';
+
+ 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;
+ ShowSelectAllLink($startMessage, $sort);
+
+ 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, $sent_folder;
+ $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";
+ }
+
+ 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";
+ ShowSelectAllLink($startMessage, $sort);
+
+ echo '</td></tr></table>';
+ echo '</td></tr>';