sort was a little.. busted.
authorebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 1 Feb 2004 20:50:03 +0000 (20:50 +0000)
committerebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 1 Feb 2004 20:50:03 +0000 (20:50 +0000)
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
src/right_main.php

index 6912f4c550fde705fb21534bf1c1bba32b042386..e7ac00e06c0520cc32be72388bc6e6ae03d84982 100644 (file)
@@ -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 '<b><small><center><font color=red>' .
                          _("Thread sorting is not supported by your IMAP server.<br>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 '<b><small><center><font color=red>' .
                          _( "Server-side sorting is not supported by your IMAP server.<br>Please report this to the system administrator.").
@@ -537,7 +536,7 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs,
               <tr>
                 <td>
                   <?php 
-                    printHeader($mailbox, $sort, $color, !$thread_sort_messages, $start_msg);
+                    printHeader($mailbox, $srt, $color, !$thread_sort_messages, $start_msg);
                     displayMessageArray($imapConnection, $num_msgs, $start_msg, 
                                                $msort, $mailbox, $sort, $color, $show_num,0,0);
                   ?>
@@ -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';
index 1d3ef5e53f0001beda0be67ca1edb1e5aa5d88af..cae88390e5f75301bc42f01f4ce9e18f9cbbd043 100644 (file)
@@ -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  *