- $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 '</table>'.
- "<table bgcolor=\"$color[9]\" width=\"100%\" border=0 cellpadding=1 cellspacing=1>" .
- "<tr BGCOLOR=\"$color[4]\"><td>" .
- "<table width=\"100%\" BGCOLOR=\"$color[4]\" border=0 cellpadding=1 cellspacing=0><tr><td>$paginator_str</td>".
- "<td align=right>$msg_cnt_str</td></tr></table>".
- "</td></tr>".
- "</table>";
- /** End of message-list table */
+ $thread_link_str ='';
+ }
+ /*
+ * This is the beginning of the message list table.
+ * It wraps around all messages
+ */
+ $safe_name = preg_replace("/[^0-9A-Za-z_]/", '_', $aMailbox['NAME']);
+ $form_name = "FormMsgs" . $safe_name;
+
+ echo '<form name="' . $form_name . '" method="post" action="move_messages.php">' ."\n"
+ . $moveFields;
+?>
+ <table width="100%" cellpadding="1" cellspacing="0" style="border: 1px solid <?php echo $color[0]; ?>">
+ <tr>
+ <td>
+ <table bgcolor="<?php echo $color[4]; ?>" border="0" width="100%" cellpadding="1" cellspacing="0">
+ <tr>
+ <td align="left"><small><?php echo $paginator . $thread_link_str; ?></small></td>
+ <td align="center"></td>
+ <td align="right"><small><?php echo $msg_cnt_str; ?></small></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr width="100%" cellpadding="1" cellspacing="0" border="0" bgcolor="<?php echo $color[0]; ?>">
+ <td>
+ <table border="0" width="100%" cellpadding="1" cellspacing="0">
+ <tr>
+ <td align="left">
+ <small><?php
+
+ // display flag buttons only if supported
+ if ($show_flag_buttons &&
+ array_search('\\flagged',$aMailbox['PERMANENTFLAGS'], true) !== FALSE) {
+ echo getButton('SUBMIT', 'markUnflagged',_("Unflag"));
+ echo getButton('SUBMIT', 'markFlagged',_("Flag"));
+ echo ' ';
+ }
+ if (array_search('\\seen',$aMailbox['PERMANENTFLAGS'], true) !== FALSE) {
+ echo getButton('SUBMIT', 'markUnread',_("Unread"));
+ echo getButton('SUBMIT', 'markRead',_("Read"));
+ echo ' ';
+ }
+
+ echo getButton('SUBMIT', 'attache',_("Forward"));
+ echo ' ';
+ if (array_search('\\deleted',$aMailbox['PERMANENTFLAGS'], true) !== FALSE) {
+ echo getButton('SUBMIT', 'delete',_("Delete"));
+ echo '<input type="checkbox" name="bypass_trash" />' . _("Bypass Trash");
+ echo ' ';
+ }
+ if (!$aMailbox['AUTO_EXPUNGE'] && $aMailbox['RIGHTS'] != 'READ-ONLY') {
+ echo getButton('SUBMIT', 'expungeButton',_("Expunge")) .' ' . _("mailbox") . "\n";
+ echo ' ';
+ }
+ do_hook('mailbox_display_buttons');
+ ?></small>
+ </td>
+ <?php
+ if (array_search('\\deleted',$aMailbox['PERMANENTFLAGS'], true) !== FALSE) {
+ echo '<td align="right">
+ <small>';
+ //echo $thread_link_str; //previous behaviour
+ getMbxList($imapConnection);
+ echo getButton('SUBMIT', 'moveButton',_("Move")) . "\n
+ </small>";
+ }
+ ?>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+
+<?php
+ do_hook('mailbox_form_before');
+}
+
+/**
+* Function to add the last row in a message list, it contains the paginator and info about
+* the number of messages.
+*
+* @param integer $num_msgs number of messages in a mailbox
+* @param string $paginator_str Paginator string [Prev | Next] [ 1 2 3 ... 91 92 94 ] [Show all]
+* @param string $msg_cnt_str Message count string Viewing Messages: 21 to 1861 (20 total)
+*/
+function mail_message_listing_end($num_msgs, $paginator_str, $msg_cnt_str) {
+global $color;
+if ($num_msgs) {
+ /* space between list and footer */
+?>
+<tr><td height="5" bgcolor="<?php echo $color[4]; ?>" colspan="1"></td></tr>
+<tr>
+ <td>
+ <table width="100%" cellpadding="1" cellspacing="0" style="border: 1px solid <?php echo $color[0]; ?>">
+ <tr>
+ <td>
+ <table bgcolor="<?php echo $color[4]; ?>" border="0" width="100%" cellpadding="1" cellspacing="0">
+ <tr>
+ <td align="left"><small><?php echo $paginator_str; ?></small></td>
+ <td align="right"><small><?php echo $msg_cnt_str; ?></small></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+<?php
+}
+ /* End of message-list table */