";
- $count_special_folders = 0;
- for ($i = 0; $i < count($special_folders); $i++) {
- for ($p = 0; $p < count($special_folders); $p++) {
- if ($boxes[$i]["unformatted"] == $special_folders[$p]) {
- $count_special_folders++;
- }
- }
- }
-
- if ($count_special_folders < count($boxes)) {
- echo " |
\n";
+
+echo html_tag( 'tr',
+ html_tag( 'td', ' ', 'left', $color[4] )
+ ) ."\n";
+
+/** count special folders **/
+$count_special_folders = 0;
+$num_max = 1;
+if (strtolower($imap_server_type) == "courier" || $move_to_trash) {
+ $num_max++;
+}
+if ($move_to_sent) {
+ $num_max++;
+}
+if ($save_as_draft) {
+ $num_max++;
+}
+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++;
+}
+
+
+/** RENAMING FOLDERS **/
+echo html_tag( 'tr',
+ html_tag( 'td', '