From 8edc9f311601497e52345b435e0d6f74d87604b6 Mon Sep 17 00:00:00 2001 From: alex-brainstorm Date: Fri, 22 Aug 2003 01:28:16 +0000 Subject: [PATCH] advanced_tree: sort mailboxes naturally, handle special folders the same as in oldway (subs and hook) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5545 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_mailbox.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index 1a957656..18af1782 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -79,8 +79,7 @@ function sortSpecialMbx($a, $b) { } else { $bcmp = '2' . $b->mailboxname_full; } - if ($acmp == $bcmp) return 0; - return ($acmp > $bcmp) ? 1: -1; + return user_strcasecmp($acmp, $bcmp); } function compact_mailboxes_response($ary) @@ -836,7 +835,7 @@ function sqimap_fill_mailbox_tree($mbx_ary, $mbxs=false,$imap_stream) { the list, despite having "special folders at top" option set. Need a better method than this. */ - +/* if ($mailbox == 'INBOX') { $mbx->is_special = true; } elseif (stristr($trash_folder , $mailbox)) { @@ -851,7 +850,7 @@ function sqimap_fill_mailbox_tree($mbx_ary, $mbxs=false,$imap_stream) { case 'INBOX': $mbx->is_inbox = true; $mbx->is_special = true; - $mbx_ary[$i]['noselect'] = false; + $mbx_ary[$i]['noselect'] = false; break; case $trash_folder: $mbx->is_trash = true; @@ -866,6 +865,13 @@ function sqimap_fill_mailbox_tree($mbx_ary, $mbxs=false,$imap_stream) { $mbx->is_special = true; break; } +*/ + $mbx->is_special |= ($mbx->is_inbox = (strtoupper($mailbox) == 'INBOX')); + $mbx->is_special |= ($mbx->is_trash = isTrashMailbox($mailbox)); + $mbx->is_special |= ($mbx->is_sent = isSentMailbox($mailbox)); + $mbx->is_special |= ($mbx->is_draft = isDraftMailbox($mailbox)); + if (!$mbx->is_special) + $mbx->is_special = do_hook_function('special_mailbox', $mailbox); if (isset($mbx_ary[$i]['unseen'])) { $mbx->unseen = $mbx_ary[$i]['unseen']; -- 2.25.1