}
+/* fixes the sort_array for the prev_del/next_del links when
+ * using server side sorting or thread sorting
+ */
+
+function fix_sort_array () {
+ global $username, $data_dir, $allow_server_sort, $allow_thread_sort,
+ $mailbox, $imapConnection, $sort;
+ if ($allow_server_sort == true) {
+ $server_sort_array = sqimap_get_sort_order($imapConnection, $sort);
+ }
+ $thread_sort_messages = getPref($username, $data_dir, "thread_$mailbox");
+ if ($allow_thread_sort == true && $thread_sort_messages == 1) {
+ $server_sort_array = get_thread_sort($imapConnection);
+ }
+}
+
/*
* Warning: this function relies on the internal representation of
* of the message cache for the current mailbox. As such, it is fragile
* perhaps even as inline code to sqimap_mailbox_expunge(). In the
* meantime, you have been warned. [alane@geeksrus.net 2001/05/06]
*/
+
function delete_move_del_arr_elem($arr, $index) {
$tmp = array();
$lim = count($arr);
if ($delete_id) {
delete_move_next_delete();
+ fix_sort_array();
} elseif ($move_id) {
delete_move_next_move();
+ fix_sort_array();
}
}
global $delete_move_next_formATtop, $delete_move_next_formATbottom,
$color, $where, $what, $currentArrayIndex, $passed_id,
$urlMailbox, $sort, $startMessage, $delete_id, $move_id,
- $imapConnection, $auto_expunge, $move_to_trash, $server_sort_array,
- $allow_thread_sort, $allow_server_sort, $thread_sort_messages;
+ $imapConnection, $auto_expunge, $move_to_trash;
if (!(($where && $what) || ($currentArrayIndex == -1))) {
- if ($allow_server_sort == true) {
- $server_sort_array = sqimap_get_sort_order($imapConnection, $sort);
- }
- if ($allow_thread_sort == true && $thread_sort_messages == 1) {
- $server_sort_array = get_thread_sort($imapConnection);
- }
$next = findNextMessage();
$prev = findPreviousMessage();
$prev_if_del = $prev;
/* Base is illegal within documents
* $location = get_location();
* echo "<base href=\"$location/\">" . */
- echo '<table cellspacing=0 width="100%" border=0 cellpadding=2>'.
- '<tr>'.
- "<td bgcolor=\"$color[9]\" width=\"100%\" align=center><small>";
+ echo html_tag( 'table', '', '', '', 'cellspacing="0" width="100%" border="0" cellpadding="2"' ) .
+ html_tag( 'tr' ) .
+ html_tag( 'td', '', 'center', $color[9], 'width="100%"' ) .
+ '<small>';
if ($prev > 0) {
echo "<a href=\"read_body.php?passed_id=$prev&mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage&show_more=0\">" . _("Previous") . "</A> | \n";
$urlMailbox, $sort, $startMessage, $delete_id, $move_id,
$imapConnection;
- echo '<tr>'.
- "<td bgcolor=\"$color[9]\" width=\"100%\" align=\"center\">".
+ echo html_tag( 'tr' ) .
+ html_tag( 'td', '', 'center', $color[9], 'width="100%"' ) .
'<form action="read_body.php" method="post"><small>'.
"<input type=\"hidden\" name=\"passed_id\" value=\"$next\">".
- "<input type=\"hidden\" name=\"mailbox\" value=\"$urlMailbox\">".
+ "<input type=\"hidden\" name=\"mailbox\" value=\"".urldecode($urlMailbox)."\">".
"<input type=\"hidden\" name=\"sort\" value=\"$sort\">".
"<input type=\"hidden\" name=\"startMessage\" value=\"$startMessage\">".
"<input type=\"hidden\" name=\"show_more\" value=\"0\">".
$urlMailbox, $sort, $startMessage, $delete_id, $move_id,
$imapConnection;
- echo '<tr>' .
- "<td bgcolor=\"$color[9]\" width=\"100%\" align=\"center\">".
+ echo html_tag( 'tr' ) .
+ html_tag( 'td', '', 'center', $color[9], 'width="100%"' ) .
'<form action="right_main.php" method="post"><small>' .
- "<input type=\"hidden\" name=\"mailbox\" value=\"$urlMailbox\">".
+ "<input type=\"hidden\" name=\"mailbox\" value=\"".urldecode($urlMailbox)."\">".
"<input type=\"hidden\" name=\"sort\" value=\"$sort\">".
"<input type=\"hidden\" name=\"startMessage\" value=\"$startMessage\">".
"<input type=\"hidden\" name=\"move_id\" value=\"$passed_id\">".
$delete_move_next_t, $delete_move_next_formATtop,
$delete_move_next_b, $delete_move_next_formATbottom;
- echo "<tr><td align=right valign=top>\n".
- _("Delete/Move/Next Buttons:") . "</td>\n".
- "<td><input type=checkbox name=delete_move_next_ti";
+ echo html_tag( 'tr' ) .
+ html_tag( 'td', _("Delete/Move/Next Buttons:"), 'right', '', 'valign="top"' ) . "\n" .
+ html_tag( 'td', '', 'left' ) .
+ '<input type=checkbox name=delete_move_next_ti';
if ($delete_move_next_t == 'on') {
echo " checked";