+ echo '</table>';
+
+ echo html_tag( 'table',
+ html_tag( 'tr',
+ html_tag( 'td',
+ html_tag( 'table',
+ html_tag( 'tr',
+ html_tag( 'td', $paginator_str ) .
+ html_tag( 'td', $msg_cnt_str, 'right' )
+ )
+ , '', $color[4], 'width="100%" cellpadding="1" cellspacing="1"' )
+ )
+ , '', $color[4] )
+ , '', $color[9], 'width="100%" cellpadding="1" cellspacing="1"' );
+
+ /* End of message-list table */
+
+ do_hook('mailbox_index_after');
+ echo "</TABLE></FORM>\n";
+}
+
+/*
+* 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,
+$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,
+ $lastTargetMailbox;
+
+ $urlMailbox = urlencode($mailbox);
+
+ /*
+ * This is the beginning of the message list table.
+ * It wraps around all messages
+ */
+ echo "<FORM name=\"messageList\" method=post action=\"$moveURL\">\n"
+ . "<TABLE WIDTH=\"100%\" BORDER=\"0\" CELLPADDING=\"1\" "
+ . "CELLSPACING=\"0\">\n<TR BGCOLOR=\"$color[0]\"><TD>"
+ . " <TABLE BGCOLOR=\"$color[4]\" width=\"100%\" CELLPADDING=\"2\" "
+ . "CELLSPACING=\"0\" BORDER=\"0\"><TR>\n"
+ . html_tag( 'td', $paginator, 'left' )
+ . html_tag( 'td', $msg_cnt_str, 'right' )
+ . " </TR></TABLE>\n"
+ . '</TD></TR>'
+ . "<TR><TD BGCOLOR=\"$color[0]\">\n"
+ . "<TABLE BGCOLOR=\"$color[0]\" BORDER=0 cellpadding=0 "
+ . "cellspacing=0 width=\"100%\">\n"
+ . " <TR>\n"
+ . html_tag( 'td',
+ '<SMALL> ' . _("Move Selected To:") . '</SMALL>',
+ 'left',
+ '',
+ 'valign="middle" nowrap' )
+ . html_tag( 'td',
+ '<SMALL>' . _("Transform Selected Messages") . ': </SMALL><BR>',
+ 'right',
+ '',
+ 'nowrap' )
+ . " </TR>\n"
+ . " <TR>\n"
+ . html_tag( 'td', '', 'left', '', 'valign="middle" nowrap' )
+ . ' <SMALL> <TT><SELECT NAME="targetMailbox">';
+
+ $boxes = sqimap_mailbox_list($imapConnection);
+ foreach ($boxes as $boxes_part) {
+ if (!in_array('noselect', $boxes_part['flags'])) {
+ $box = $boxes_part['unformatted'];
+ $box2 = str_replace(' ', ' ', imap_utf7_decode_local($boxes_part['unformatted-disp']));
+ if( $box2 == 'INBOX' ) {
+ $box2 = _("INBOX");
+ }
+ if ($lastTargetMailbox == $box) {
+ echo " <OPTION VALUE=\"$box\" SELECTED>$box2</OPTION>\n";
+ }
+ else {
+ echo " <OPTION VALUE=\"$box\">$box2</OPTION>\n";
+ }
+ }
+ }
+ echo ' </SELECT></TT> '
+ . '<INPUT TYPE="SUBMIT" NAME="moveButton" VALUE="' . _("Move") . '"> '
+ . '<INPUT TYPE="SUBMIT" NAME="attache" VALUE="' . _("Forward")
+ . "\"> \n" . "</SMALL>\n";
+
+ echo " </TD>\n"
+ . " <TD ALIGN=\"RIGHT\" NOWRAP>";
+ if (!$auto_expunge) {
+ echo '<INPUT TYPE=SUBMIT NAME="expungeButton" VALUE="' . _("Expunge")
+ . '"> ' . _("mailbox") . ' ';
+ }
+ echo '<INPUT TYPE="SUBMIT" NAME="markRead" VALUE="' . _("Read") . '">'
+ . '<INPUT TYPE="SUBMIT" NAME="markUnread" VALUE="' . _("Unread") . '">'
+ . '<INPUT TYPE="SUBMIT" VALUE="' . _("Delete") . '"> '
+ . "</TD>\n"
+ . " </TR>\n";
+
+ /* draws thread sorting links */
+ if ($allow_thread_sort == TRUE) {
+ if ($thread_sort_messages == 1 ) {
+ $set_thread = 2;
+ $thread_name = _("Unthread View");
+ }
+ elseif ($thread_sort_messages == 0) {
+ $set_thread = 1;
+ $thread_name = _("Thread View");
+ }
+ echo '<tr><td> <a href=' . "$base_uri" . 'src/right_main.php?sort='
+ . "$sort" . '&start_messages=1&set_thread=' . "$set_thread"
+ . '&mailbox=' . urlencode($mailbox) . '><small>' . $thread_name
+ . '</a></small> </td></tr>';
+ }