\n";
+ break;
+ }
+ }
+ }
+ echo "\n";
+}
- $senderName = sqimap_find_displayable_name($msg['FROM']);
- $urlMailbox = urlencode($mailbox);
- $subject = processSubject($msg['SUBJECT']);
+/*
+ * This function loops through a group of messages in the mailbox
+ * and shows them to the user.
+ */
+function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs,
+ $start_msg, $sort, $color, $show_num,
+ $use_cache) {
+ global $msgs, $msort,
+ $sent_folder, $draft_folder,
+ $message_highlight_list,
+ $auto_expunge, $thread_sort_messages, $allow_server_sort,
+ $data_dir, $username, $server_sort_order;
+
+ /* if $start_msg is lower than $num_msgs, we probably deleted all messages
+ * in the last page. We need to re-adjust the start_msg
+ */
- echo "
\n";
+ if($start_msg > $num_msgs) {
+ $start_msg -= $show_num;
+ if($start_msg < 1) {
+ $start_msg = 1;
+ }
+ }
- if (isset($msg['FLAG_FLAGGED']) && $msg['FLAG_FLAGGED'] == true)
- {
- $flag = "";
- $flag_end = '';
+ /* This code and the next if() block check for
+ * server-side sorting methods. The $id array is
+ * formatted and $sort is set to 6 to disable
+ * SM internal sorting
+ */
+ if ($thread_sort_messages == 1) {
+ $id = get_thread_sort($imapConnection);
+ if ($id == 'no') {
+ echo '
Thread sorting is not'.
+ ' supported by your IMAP server. Please report this'.
+ 'to the system administrator.
";
+ /* End of message-list table */
+
+ do_hook('mailbox_index_after');
+ echo "\n";
+}
- $Message = '';
- if ($startMessage < $endMessage) {
- $Message = _("Viewing messages") ." $startMessage ". _("to") ." $endMessage ($numMessages " . _("total") . ")\n";
- } elseif ($startMessage == $endMessage) {
- $Message = _("Viewing message") ." $startMessage ($numMessages " . _("total") . ")\n";
+/*
+ * Displays the standard message list header. To finish the table,
+ * you need to do a "";
+ *
+ * $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,
+ $msg_cnt_str = '',
+ $paginator = ' ',
+ $start_msg = 1) {
+ global $color, $index_order, $auto_expunge, $move_to_trash, $base_uri,
+ $checkall, $sent_folder, $draft_folder, $thread_sort_messages,
+ $allow_thread_sort, $allow_server_sort, $server_sort_order;
+ $urlMailbox = urlencode($mailbox);
+
+ /*
+ * This is the beginning of the message list table.
+ * It wraps around all messages
+ */
+ echo "