- fixed and improved wordWrap
[squirrelmail.git] / src / folders.php
index db48ce95b952dd8083103128274d4eeaf71fca4a..66d62164c8c8fd0abb0732c26ff7bf410fa3c865 100644 (file)
@@ -22,6 +22,8 @@
       include("../functions/imap.php");
    if (!isset($array_php))
       include("../functions/array.php");
+   if (!isset($plugin_php))
+      include("../functions/plugin.php");
 
    include("../src/load_prefs.php");
 
@@ -73,6 +75,7 @@
    echo "</CENTER>";
    echo "</BODY></HTML>";
        
+   sqimap_logout($imapConnection);
    exit;
    }
 
@@ -92,9 +95,9 @@
            if (!sqimap_mailbox_exists ($imapConnection, $trash_folder)){
            echo _("Create Trash") . "<INPUT TYPE=checkbox NAME=trash_create value=true><br>\n";
            echo "<INPUT TYPE=submit VALUE=Create>";
-           echo "</FORM></TD></TR>\n";
            }
        }
+       echo "</FORM></TD></TR></TABLE>n";
    }
 
    /** DELETING FOLDERS **/
    echo _("Create Folder");
    echo "</TD></TR>";
    echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
-   echo "<FORM ACTION=\"folders_create.php\" METHOD=\"POST\">\n";
+   echo "<FORM NAME=cf ACTION=\"folders_create.php\" METHOD=\"POST\">\n";
    echo "<INPUT TYPE=TEXT SIZE=25 NAME=folder_name><BR>\n";
    echo _("as a subfolder of");
    echo "<BR>";
 
    for ($i = 0; $i < count($boxes); $i++) {
       if (count($boxes[$i]["flags"]) > 0) {
+         $noinf = false;
          for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) {
-            if ($boxes[$i]["flags"][$j] != "noinferiors") {
-               if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($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";
-               }
-            }   
+            if ($boxes[$i]["flags"][$j] == "noinferiors") {
+               $noinf = true;
+               continue;
+            }
          }    
+         if ($noinf == false) {
+            if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($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";
+            }
+         }
       } else {
          if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($default_sub_of_inbox == true)) {
             $box = $boxes[$i]["unformatted"];
       echo _("No folders were found to subscribe to!") . "</td></tr></table>";
    }
 
+   do_hook("folders_bottom");
    sqimap_logout($imapConnection);
 ?>
 </BODY></HTML>