Fixed some bugs in folder deleting
[squirrelmail.git] / src / folders.php
index e51d47e90f42c604398b46568433d189e2de8994..7b9c99bb206d5972f84714c9fc1eb63b0d57a7a8 100644 (file)
@@ -1,9 +1,14 @@
 <?
-   include("../config/config.php");
-   include("../functions/strings.php");
-   include("../functions/page_header.php");
-   include("../functions/imap.php");
-   include("../functions/array.php");
+   if (!isset($config_php))
+      include("../config/config.php");
+   if (!isset($strings_php))
+      include("../functions/strings.php");
+   if (!isset($page_header_php))
+      include("../functions/page_header.php");
+   if (!isset($imap_php))
+      include("../functions/imap.php");
+   if (!isset($array_php))
+      include("../functions/array.php");
 
    include("../src/load_prefs.php");
 
@@ -40,7 +45,7 @@
          }
       }
       if ($use_folder == true) {
-         $box = $boxes[$i]["unformatted"];
+         $box = $boxes[$i]["unformatted-dm"];
          $box2 = replace_spaces($boxes[$i]["formatted"]);
          echo "         <OPTION VALUE=\"$box\">$box2\n";
       }
       echo "<OPTION>[ None ]\n";
 
    for ($i = 0; $i < count($boxes); $i++) {
-      if (($boxes[$i]["unformatted"] == $special_folders[0]) && ($default_sub_of_inbox == true)) {
-         $box = $boxes[$i]["unformatted"];
-         $box2 = replace_spaces($boxes[$i]["formatted"]);
-         echo "<OPTION SELECTED VALUE=\"$box\">$box2\n";
-      } else {
-         $box = $boxes[$i]["unformatted"];
-         $box2 = replace_spaces($boxes[$i]["formatted"]);
-         echo "<OPTION VALUE=\"$box\">$box2\n";
+      for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) {
+         if ($boxes[$i]["flags"][$j] != "noinferiors") {
+            if (($boxes[$i]["unformatted"] == $special_folders[0]) && ($default_sub_of_inbox == true)) {
+               $box = $boxes[$i]["unformatted"];
+               $box2 = replace_spaces($boxes[$i]["formatted"]);
+               echo "<OPTION SELECTED VALUE=\"$box\">$box2\n";
+            } else {
+               $box = $boxes[$i]["unformatted"];
+               $box2 = replace_spaces($boxes[$i]["formatted"]);
+               echo "<OPTION VALUE=\"$box\">$box2\n";
+            }
+         }   
       }
    }
    echo "</SELECT></TT><BR>\n";