Netscape compatibility
[squirrelmail.git] / src / folders_delete.php
index 7cbea84f3b12ba48c5bd1643fae16a958042b92d..140d1400f8befea3acbffb9adea3302e1b6ffa69 100644 (file)
     **  $Id$
     **/
 
-   include('../src/validate.php');
-   include("../functions/page_header.php");
-   include("../functions/imap.php");
-   include("../functions/array.php");
-   include("../functions/tree.php");
-   include("../src/load_prefs.php");
+   require_once('../src/validate.php');
+   require_once('../functions/imap.php');
+   require_once('../functions/array.php');
+   require_once('../functions/tree.php');
 
    /*
    *  Incoming values:
@@ -25,9 +23,9 @@
    
    $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    $boxes = sqimap_mailbox_list ($imap_stream);
-   $dm = sqimap_get_delimiter($imap_stream);
+   global $delimiter;
    
-   if (substr($mailbox, -1) == $dm)
+   if (substr($mailbox, -1) == $delimiter)
       $mailbox_no_dm = substr($mailbox, 0, strlen($mailbox) - 1); 
    else
       $mailbox_no_dm = $mailbox;
@@ -69,7 +67,7 @@
    //    on the end of the $mailbox string, and compare to that.
    $j = 0;
    for ($i = 0;$i < count($boxes);$i++) {
-      if (substr($boxes[$i]["unformatted"], 0, strlen($mailbox_no_dm . $dm)) == ($mailbox_no_dm . $dm)) {
+      if (substr($boxes[$i]["unformatted"], 0, strlen($mailbox_no_dm . $delimiter)) == ($mailbox_no_dm . $delimiter)) {
          addChildNodeToTree($boxes[$i]["unformatted"], $boxes[$i]["unformatted-dm"], $foldersTree);
       }
    }
@@ -77,7 +75,7 @@
 
    /** Lets start removing the folders and messages **/
    if (($move_to_trash == true) && ($can_move_to_trash == true)) { /** if they wish to move messages to the trash **/
-      walkTreeInPostOrderCreatingFoldersUnderTrash(0, $imap_stream, $foldersTree, $dm, $mailbox);
+      walkTreeInPostOrderCreatingFoldersUnderTrash(0, $imap_stream, $foldersTree, $mailbox);
       walkTreeInPreOrderDeleteFolders(0, $imap_stream, $foldersTree);
    } else { /** if they do NOT wish to move messages to the trash (or cannot)**/
       walkTreeInPreOrderDeleteFolders(0, $imap_stream, $foldersTree);