Tweak a bit, thx to Jonathan
[squirrelmail.git] / src / folders.php
index ebbfe5ba7f269ee707b3e6c88e30041aef1ab158..466e6ef7c4bd80433302122e2d0d00af7fd53bb2 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * folders.php
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Handles all interaction between the user and the other folder
@@ -18,9 +18,7 @@ define('SM_PATH','../');
 
 /* SquirrelMail required files. */
 require_once(SM_PATH . 'include/validate.php');
-require_once(SM_PATH . 'functions/imap_utf7_decode_local.php');
 require_once(SM_PATH . 'functions/imap.php');
-require_once(SM_PATH . 'functions/array.php');
 require_once(SM_PATH . 'functions/plugin.php');
 require_once(SM_PATH . 'functions/html.php');
 
@@ -103,20 +101,24 @@ echo html_tag( 'table', '', 'center', '', 'width="70%" cellpadding="4" cellspaci
      _("as a subfolder of").
      '<BR>'.
      "<TT><SELECT NAME=subfolder>\n";
-if ($default_sub_of_inbox == false) {
+
+$show_selected=0;
+$skip_folders=0;
+$server_type = strtolower($imap_server_type);
+if ( $server_type == 'courier' ) {
+  $show_selected = array('inbox');
+  $skip_folders = array('inbox.trash');
+  if ( $default_folder_prefix == 'INBOX.' ) {
+    array_push($skip_folders, 'inbox');
+  }
+}
+
+if ( $default_sub_of_inbox == false ) {
     echo '<OPTION SELECTED VALUE="">[ '._("None")." ]\n";
 } else {
     echo '<OPTION VALUE="">[ '._("None")." ]\n";
-}
-
-$show_selected = 0;
-if ( $default_sub_of_inbox ) {
     $show_selected = array('inbox');
 }
-$skip_folders = 0;
-if ( strtolower($imap_server_type) == 'courier' ) {
-    $skip_folders = array('inbox.trash');
-}
 
 echo sqimap_mailbox_option_list($imapConnection, $show_selected, $skip_folders, $boxes, 'noinferiors');