function fix_sort_array () {
global $username, $data_dir, $allow_server_sort, $allow_thread_sort,
- $mailbox, $imapConnection, $sort;
- if ($allow_server_sort == true) {
- $mbxresponse = sqimap_mailbox_select($imapConnection, $mailbox);
- $server_sort_array = sqimap_get_sort_order($imapConnection, $sort, $mbxresponse);
- }
- $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);
- }
+ $mailbox, $imapConnection, $sort, $uid_support, $mbx_response;
+ switch (true) {
+ case ($allow_thread_sort && $thread_sort_messages):
+ $server_sort_array = get_thread_sort($imapConnection);
+ break;
+ case ($allow_server_sort):
+ $server_sort_array = sqimap_get_sort_order($imapConnection, $sort, $mbx_response);
+ break;
+ case ($uid_support):
+ $server_sort_array = sqimap_get_php_sort_order($imapConnecion, $mbx_response);
+ break;
+ default:
+ break;
+ }
}
/*
function delete_move_expunge_from_all($id) {
global $msgs, $msort, $sort, $imapConnection, $mailbox;
- // delete_move_show_msg_array();
-
+// delete_move_show_msg_array();
$delAt = -1;
for ($i = 0; $i < count($msort); $i++) {
if ($msgs[$i]['ID'] == $id) {
$delAt = $i;
} elseif ($msgs[$i]['ID'] > $id) {
- $msgs[$i]['ID']--;
+ if (!$uid_support) {
+ $msgs[$i]['ID']--;
+ }
}
}
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;
+ $imapConnection, $auto_expunge, $move_to_trash, $mbx_response,
+ $uid_support;
if (!(($where && $what) || ($currentArrayIndex == -1))) {
$next = findNextMessage();
- $prev = findPreviousMessage();
+ $prev = findPreviousMessage($mbx_response['EXISTS']);
$prev_if_del = $prev;
$next_if_del = $next;
- if ($auto_expunge || $move_to_trash) {
+ if (!$uid_support && ($auto_expunge || $move_to_trash)) {
if ($prev_if_del > $passed_id) {
$prev_if_del--;
}
/* Base is illegal within documents
* $location = get_location();
* echo "<base href=\"$location/\">" . */
- echo html_tag( 'table', '', '', '', 'cellspacing="0" width="100%" border="0" cellpadding="2"' ) .
- html_tag( 'tr' ) .
- html_tag( 'td', '', 'center', $color[9], 'width="100%"' ) .
- '<small>';
+ echo '<table cellspacing=0 width="100%" border=0 cellpadding=2>'.
+ '<tr>'.
+ "<td bgcolor=\"$color[9]\" width=\"100%\" align=center><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 html_tag( 'tr' ) .
- html_tag( 'td', '', 'center', $color[9], 'width="100%"' ) .
+ echo '<tr>'.
+ "<td bgcolor=\"$color[9]\" width=\"100%\" align=\"center\">".
'<form action="read_body.php" method="post"><small>'.
"<input type=\"hidden\" name=\"passed_id\" value=\"$next\">".
"<input type=\"hidden\" name=\"mailbox\" value=\"".urldecode($urlMailbox)."\">".
$urlMailbox, $sort, $startMessage, $delete_id, $move_id,
$imapConnection;
- echo html_tag( 'tr' ) .
- html_tag( 'td', '', 'center', $color[9], 'width="100%"' ) .
+ echo '<tr>' .
+ "<td bgcolor=\"$color[9]\" width=\"100%\" align=\"center\">".
'<form action="right_main.php" method="post"><small>' .
"<input type=\"hidden\" name=\"mailbox\" value=\"".urldecode($urlMailbox)."\">".
"<input type=\"hidden\" name=\"sort\" value=\"$sort\">".
$delete_move_next_t, $delete_move_next_formATtop,
$delete_move_next_b, $delete_move_next_formATbottom;
- 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';
+ echo "<tr><td align=right valign=top>\n".
+ _("Delete/Move/Next Buttons:") . "</td>\n".
+ "<td><input type=checkbox name=delete_move_next_ti";
if ($delete_move_next_t == 'on') {
echo " checked";