+ $moveURL = "move_messages.php?msg=$msg&mailbox=$urlMailbox"
+ . "&startMessage=$start_msg";
+ /*
+ * This is the beginning of the message list table.
+ * It wraps around all messages
+ */
+
+ echo "<FORM name=\"messageList\" method=post action=\"$moveURL\">\n"
+ . html_tag( 'table' ,'' , '', '', 'border="0" width="100%" cellpadding="1" cellspacing="0"' ) .
+ html_tag( 'tr',
+ html_tag( 'td' ,
+ html_tag( 'table' ,
+ html_tag( 'tr',
+ html_tag( 'td', $paginator, 'left' ) .
+ html_tag( 'td', $msg_cnt_str, 'right' )
+ )
+ , '', $color[4], 'border="0" width="100%" cellpadding="2" cellspacing="0"' )
+ , 'left', '', '' )
+ , '', $color[0] )
+ . html_tag( 'tr' ) . "\n"
+ . html_tag( 'td' ,'' , 'left', $color[0], '' )
+ . html_tag( 'table' ,'' , '', $color[0], 'border="0" width="100%" cellpadding="0" cellspacing="0"' )
+ . html_tag( 'tr',
+ getSmallStringCell(' ' . _("Move Selected To"), 'left') .
+ getSmallStringCell(_("Transform Selected Messages"), 'right')
+ )
+ . html_tag( 'tr' ) ."\n"
+ . html_tag( 'td', '', 'left', '', 'valign="middle" nowrap' );
+ getMbxList($imapConnection);
+ echo getButton('SUBMIT', 'moveButton',_("Move")) . "\n";
+ echo getButton('SUBMIT', 'attache',_("Forward")) . "\n";
+
+ echo " </TD>\n"
+ . html_tag( 'td', '', 'right', '', 'nowrap' );
+
+ if (!$auto_expunge) {
+ echo getButton('SUBMIT', 'expungeButton',_("Expunge"))
+ .' ' . _("mailbox") . "\n";
+ }
+
+ echo getButton('SUBMIT', 'markRead',_("Read"));
+ echo getButton('SUBMIT', 'markUnread',_("Unread"));
+ echo getButton('SUBMIT', 'delete',_("Delete")) ." \n";
+ if (!strpos($php_self,'mailbox')) {
+ $location = $php_self.'?mailbox=INBOX&startMessage=1';
+ } else {
+ $location = $php_self;
+ }
+ echo '<INPUT TYPE="HIDDEN" NAME="location" VALUE="'.$location.'">';
+ echo "</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 html_tag( 'tr' ,
+ html_tag( 'td' ,
+ ' <a href=' . $source_url . '?sort='
+ . "$sort" . '&start_messages=1&set_thread=' . "$set_thread"
+ . '&mailbox=' . urlencode($mailbox) . '><small>' . $thread_name
+ . '</a></small> '
+ , '', '', '' )
+ , '', '', '' );
+ }
+
+ echo "</TABLE>\n";
+ echo "</table>\n";
+
+ do_hook('mailbox_form_before');
+
+ echo '</td></tr>'
+ . html_tag( 'tr' )
+ . html_tag( 'td' ,'' , '', $color[0], '' );
+
+ /* if using server sort we highjack the
+ * the $sort var and use $server_sort_order
+ * instead. but here we reset sort for a bit
+ * since its easy
+ */
+ if ($allow_server_sort == TRUE) {
+ $sort = $server_sort_order;
+ }
+}
+
+function mail_message_listing_end($num_msgs, $paginator_str, $msg_cnt_str, $color) {
+ if ($num_msgs) {
+ 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 "</FORM>\n";
+}
+
+function printHeader($mailbox, $sort, $color, $showsort=true) {
+ global $index_order;
+ echo html_tag( 'table' ,'' , '', $color[4], 'border="0" width="100%" cellpadding="1" cellspacing="0"' );
+ echo html_tag( 'tr' ,'' , 'center', $color[5] );
+ for ($i = 1; $i <= count($index_order); $i++) {
+ switch ($index_order[$i]) {
+ case 1: /* checkbox */
+ case 5: /* flags */
+ echo html_tag( 'td' ,' ' , '', '', 'width="1%"' );
+ break;
+ case 2: /* from */
+ if (handleAsSent($mailbox)) {
+ echo html_tag( 'td' ,'' , 'left', '', 'width="25%"' )
+ . '<b>' . _("To") . '</b>';
+ } else {
+ echo html_tag( 'td' ,'' , 'left', '', 'width="25%"' )
+ . '<b>' . _("From") . '</b>';
+ }
+ if ($showsort) {
+ ShowSortButton($sort, $mailbox, 2, 3);
+ }
+ echo "</td>\n";
+ break;
+ case 3: /* date */
+ echo html_tag( 'td' ,'' , 'left', '', 'width="5%" nowrap' )
+ . '<b>' . _("Date") . '</b>';
+ if ($showsort) {
+ ShowSortButton($sort, $mailbox, 0, 1);
+ }
+ echo "</td>\n";
+ break;
+ case 4: /* subject */
+ echo html_tag( 'td' ,'' , 'left', '', '' )
+ . '<b>' . _("Subject") . '</b>';
+ if ($showsort) {
+ ShowSortButton($sort, $mailbox, 4, 5);
+ }
+ echo "</td>\n";
+ break;
+ case 6: /* size */
+ echo html_tag( 'td', '<b>' . _("Size") . '</b>', 'center', '', 'width="5%"' );
+ break;
+ }
+ }
+ echo "</tr>\n";