[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] CVS: squirrelmail/functions imap_mailbox.php,1.239,1.240
From:       "Seth E. Randall" <indiri69 () users ! sourceforge ! net>
Date:       2004-09-30 18:08:26
Message-ID: E1CD5Lu-0005T5-HE () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/squirrelmail/squirrelmail/functions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20980/functions

Modified Files:
	imap_mailbox.php 
Log Message:
Do a natural language sort on mailbox names.  Otherwise it shows as all uppercase and then all lowercase

Index: imap_mailbox.php
===================================================================
RCS file: /cvsroot/squirrelmail/squirrelmail/functions/imap_mailbox.php,v
retrieving revision 1.239
retrieving revision 1.240
diff -u -w -r1.239 -r1.240
--- imap_mailbox.php	1 Sep 2004 04:11:20 -0000	1.239
+++ imap_mailbox.php	30 Sep 2004 18:08:23 -0000	1.240
@@ -751,7 +751,6 @@
 function sqimap_mailbox_tree($imap_stream) {
     global $default_folder_prefix, $unseen_notify, $unseen_type;
     if (true) {
-
         global $data_dir, $username, $list_special_folders_first,
                $folder_prefix, $delimiter, $trash_folder, $move_to_trash,
                $imap_server_type;
@@ -847,12 +846,16 @@
            $cnt = count($sorted_lsub_ary);
        }
        $sorted_lsub_ary = array_values($sorted_lsub_ary);
-       array_multisort($sorted_lsub_ary, SORT_ASC, SORT_REGULAR);
+       usort($sorted_lsub_ary, 'mbxSort');
        $boxestree = sqimap_fill_mailbox_tree($sorted_lsub_ary,false,$imap_stream);
        return $boxestree;
     }
 }
 
+function mbxSort($a, $b) {
+    return strnatcasecmp($a['mbx'], $b['mbx']);
+}
+
 function sqimap_fill_mailbox_tree($mbx_ary, $mbxs=false,$imap_stream) {
     global $data_dir, $username, $list_special_folders_first,
            $folder_prefix, $trash_folder, $sent_folder, $draft_folder,



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
--
squirrelmail-cvs mailing list
List Address: squirrelmail-cvs@lists.sourceforge.net
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
http://squirrelmail.org/cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic