X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders.php;h=9a183392dcd0dd95cac52149c4677fbc62e70415;hb=c3ccfa1912b4ca47279d259bb587ceb293ce5d83;hp=182a1d3cb2e50bd32b4998c7fab75bd92815451f;hpb=f38b7cf06c3343a7fead417d90bd67d291f5dc29;p=squirrelmail.git diff --git a/src/folders.php b/src/folders.php index 182a1d3c..9a183392 100644 --- a/src/folders.php +++ b/src/folders.php @@ -101,12 +101,11 @@ echo html_tag( 'table', '', 'center', '', 'width="70%" cellpadding="4" cellspaci '
'. "\n"; if ($show_contain_subfolders_option) { @@ -135,29 +138,49 @@ echo html_tag( 'tr', ) ."\n"; /** count special folders **/ + +// FIX ME, why not check if the folders are defined IMHO move_to_sent, move_to_trash has nothing todo with it $count_special_folders = 0; $num_max = 1; if (strtolower($imap_server_type) == "courier" || $move_to_trash) { - $num_max++; + $num_max++; } if ($move_to_sent) { - $num_max++; + $num_max++; } if ($save_as_draft) { - $num_max++; + $num_max++; } + +// What if move_to_sent = false and $sent_folder is set? Should it still be skipped? + for ($p = 0, $cnt = count($boxes); $p < $cnt && $count_special_folders < $num_max; $p++) { - if (strtolower($boxes[$p]['unformatted']) == 'inbox') - $count_special_folders++; - else if (strtolower($imap_server_type) == 'courier' && - strtolower($boxes[$p]['unformatted']) == 'inbox.trash') - $count_special_folders++; - else if ($boxes[$p]['unformatted'] == $trash_folder && $trash_folder) - $count_special_folders++; - else if ($boxes[$p]['unformatted'] == $sent_folder && $sent_folder) - $count_special_folders++; - else if ($boxes[$p]['unformatted'] == $draft_folder && $draft_folder) - $count_special_folders++; + switch ($boxes[$p]['unformatted']) + { + case (strtoupper($boxes[$p]['unformatted']) == 'INBOX'): + ++$count_special_folders; + $skip_folders[] = $boxes[$p]['unformatted']; + break; + // FIX ME inbox.trash should be set in conf.pl + case 'inbox.trash': + if (strtolower($imap_server_type) == 'courier') { + ++$count_special_folders; + } + break; + case $trash_folder: + ++$count_special_folders; + $skip_folders[] = $trash_folder; + break; + case $sent_folder: + ++$count_special_folders; + $skip_folders[] = $sent_folder; + break; + case $draft_folder: + ++$count_special_folders; + $skip_folders[] = $draft_folder; + break; + default: break; + } } @@ -173,7 +196,11 @@ if ($count_special_folders < count($boxes)) { . "\n". "\n" . '