From 94a4ea5311aebf1025597e41f141825e97acd8a9 Mon Sep 17 00:00:00 2001 From: ebullient Date: Sun, 1 Feb 2004 20:50:03 +0000 Subject: [PATCH] sort was a little.. busted. Should be fixed now git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6483 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mailbox_display.php | 12 ++++++------ src/right_main.php | 14 ++++++-------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 6912f4c5..e7ac00e0 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -467,8 +467,7 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, sqsession_unregister('msgs'); } switch ($mode) { case 'thread': - $id = get_thread_sort($imapConnection); - $msgs = getServerMessages($imapConnection, $start_msg, $show_num, $num_msgs, $id); + $msgs = getThreadMessages($imapConnection, $start_msg, $show_num, $num_msgs); if ($msgs === false) { echo '
' . _("Thread sorting is not supported by your IMAP server.
Please report this to the system administrator."). @@ -481,8 +480,8 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, } break; case 'serversort': - $id = sqimap_get_sort_order($imapConnection, $sort, $mbxresponse); - $msgs = getServerMessages($imapConnection, $start_msg, $show_num, $num_msgs, $id); + $msgs = getServerSortMessages($imapConnection, $start_msg, $show_num, + $num_msgs, $sort, $mbxresponse); if ($msgs === false) { echo '
' . _( "Server-side sorting is not supported by your IMAP server.
Please report this to the system administrator."). @@ -537,7 +536,7 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, @@ -905,8 +904,9 @@ function printHeader($mailbox, $sort, $color, $showsort=true, $start_msg=1) { /* * This function shows the sort button. Isn't this a good comment? */ -function ShowSortButton($sort, $mailbox, $Up, $Down ) { +function ShowSortButton($sort, $mailbox, $Down, $Up ) { global $PHP_SELF; + /* Figure out which image we want to use. */ if ($sort != $Up && $sort != $Down) { $img = 'sort_none.png'; diff --git a/src/right_main.php b/src/right_main.php index 1d3ef5e5..cae88390 100644 --- a/src/right_main.php +++ b/src/right_main.php @@ -100,11 +100,13 @@ else if( isset( $PG_SHOWNUM ) ) { $show_num = $PG_SHOWNUM; } -if (isset($newsort) && $newsort != $sort) { - setPref($data_dir, $username, 'sort', $newsort); -} - +if (isset($newsort) ) { + if ( $newsort != $sort ) + setPref($data_dir, $username, 'sort', $newsort); + $sort = $newsort; + sqsession_register($sort, 'sort'); +} /* If the page has been loaded without a specific mailbox, */ /* send them to the inbox */ @@ -186,10 +188,6 @@ if ( sqgetGlobalVar('just_logged_in', $just_logged_in, SQ_SESSION) ) { } } -if (isset($newsort)) { - $sort = $newsort; - sqsession_register($sort, 'sort'); -} /********************************************************************* * Check to see if we can use cache or not. Currently the only time * -- 2.25.1