";
- echo "";
- echo "";
- echo " Num | ";
- echo " From | ";
- echo " Date";
- if ($sort == 0)
- echo " | \n";
- else
- echo " \n";
- echo " Subject | \n";
- echo " ";
-
- // loop through and display the info for each message.
+ do_hook('mailbox_index_before');
+
+ $msg_cnt_str = get_msgcnt_str($start_msg, $end_msg, $num_msgs);
+ $paginator_str = get_paginator_str($urlMailbox, $start_msg, $end_msg, $num_msgs, $show_num, $sort);
+
+ if (! isset($msg)) {
+ $msg = '';
+ }
+
+ mail_message_listing_beginning
+ ($imapConnection,
+ "move_messages.php?msg=$msg&mailbox=$urlMailbox&startMessage=$start_msg",
+ $mailbox, $sort, $msg_cnt_str, $paginator_str, $start_msg);
+
+ $groupNum = $start_msg % ($show_num - 1);
+ $real_startMessage = $start_msg;
+ if ($sort == 6) {
+ if ($end_msg - $start_msg < $show_num - 1) {
+ $end_msg = $end_msg - $start_msg + 1;
+ $start_msg = 1;
+ } else if ($start_msg > $show_num) {
+ $end_msg = $show_num;
+ $start_msg = 1;
+ }
+ }
+ $endVar = $end_msg + 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 " THIS FOLDER IS EMPTY   | ";
- } else if ($startMessage == $endMessage) { // if there's only one message in the box, handle it different.
- $i = $startMessage - 1;
- printMessageInfo($imapConnection, $t, $msgs[$i]["ID"], $msgs[$i]["FROM"], $msgs[$i]["SUBJECT"], $msgs[$i]["DATE_STRING"], $msgs[$i]["FLAG_ANSWERED"], $msgs[$i]["FLAG_SEEN"]);
+ if ($num_msgs == 0) { // if there's no messages in this folder
+ echo "\n".
+ " ". _("THIS FOLDER IS EMPTY") ." \n".
+ " | ";
+ } else if ($start_msg == $end_msg) {
+ /* If there's only one message in the box, handle it differently. */
+ if ($sort != 6) {
+ $i = $start_msg;
+ } 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 {
- for ($i = $startMessage - 1;$i <= $endMessage - 1; $i++) {
- printMessageInfo($imapConnection, $t, $msgs[$i]["ID"], $msgs[$i]["FROM"], $msgs[$i]["SUBJECT"], $msgs[$i]["DATE_STRING"], $msgs[$i]["FLAG_ANSWERED"], $msgs[$i]["FLAG_SEEN"]);
- $t++;
+ $i = $start_msg;
+
+ 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 ' '.
+ "" .
+ "" .
+ "$paginator_str | ".
+ "$msg_cnt_str | ".
+ " ".
+ " ";
+ /** End of message-list table */
+
+ do_hook('mailbox_index_after');
+ echo " |