A lot of code optimization with regard to deleting and creating folders.
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 29 Nov 1999 19:32:39 +0000 (19:32 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 29 Nov 1999 19:32:39 +0000 (19:32 +0000)
Also, emptying trash refreshes the folder list.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@41 7612ce4b-ef26-0410-bec9-ea0150e637f0

config/config.php
functions/display_messages.php
src/empty_trash.php
src/folders.php
src/webmail.php

index 4cbbb46..36bd5d8 100644 (file)
@@ -37,11 +37,10 @@ $auto_expunge = true;
    folders can.  A couple of examples would be "INBOX.Trash", "INBOX.Drafts".  We have
    them set to Netscape's default mailboxes, but this obviously can be changed.
    To add one, just add a new number to the array.
-
-   NOTE:   INBOX is handled separately.  Do not put it in this list
 */
-$special_folders[0] = $trash_folder;
-$special_folders[1] = "INBOX.Sent";
-$special_folders[2] = "INBOX.Drafts";
-$special_folders[3] = "INBOX.Templates";
+$special_folders[0] = "INBOX";
+$special_folders[1] = $trash_folder;
+$special_folders[2] = "INBOX.Sent";
+$special_folders[3] = "INBOX.Drafts";
+$special_folders[4] = "INBOX.Templates";
 ?>
index 6fb1800..bebc98b 100644 (file)
@@ -57,7 +57,7 @@
       echo "         <FONT FACE=\"Arial,Helvetica\"><B><CENTER>Messages Deleted</CENTER></B></FONT>";
       echo "   </TD></TR><TR><TD>";
       echo "      <CENTER><FONT FACE=\"Arial,Helvetica\"><BR>The selected messages were deleted successfully.<BR>\n";
-      echo "              <A HREF=\"right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\" TARGET=\"right\">";
+      echo "              <A HREF=\"webmail.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\" TARGET=_top>";
       echo "              Click here to return to $mailbox";
       echo "              </A>.";
       echo "      </FONT></CENTER>";
index bc554d6..ea38697 100644 (file)
          removeFolder($imapConnection, $thisfolder);
       }
    }
-   // Log out this session
-   fputs($imapConnection, "1 logout");
 
+   selectMailbox($imapConnection, $trash_folder, $numMessages);
    echo "<HTML><BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">";
    displayPageHeader($mailbox);
-
-   messages_deleted_message("INBOX", $sort, $startMessage);
+   messages_deleted_message($trash_folder, $sort, $startMessage);
+   fputs($imapConnection, "1 logout");
 ?>
index d453630..128399b 100644 (file)
    for ($i = 0; $i < count($boxesUnformatted); $i++) {
       $use_folder = true;
       for ($p = 0; $p < count($special_folders); $p++) {
-         if (substr($boxesUnformatted[$i], 0, strlen($special_folders[$p])) == $special_folders[$p]) {
+         if ($boxesUnformatted[$i] == $special_folders[$p]) {
             $use_folder = false;
          }
       }
-      if ($boxesUnformatted[$i] == "INBOX")
-         $use_folder = false;
 
       if ($use_folder == true)
          echo "<OPTION>$boxesUnformatted[$i]\n";
index 380e0cf..6970e47 100644 (file)
 OM-USA WebMail
 </TITLE>
 <FRAMESET COLS="200, *" NORESIZE BORDER=0>
-   <FRAME SRC="left_main.php" NAME="left">
-   <FRAME SRC="right_main.php" NAME="right">
+
+/**
+    There are two ways to call webmail.php
+    1.  webmail.php
+         - this just loads the default entry screen.
+    2.  webmail.php?sort=X&startMessage=X&mailbox=XXXX
+         - This loads the frames starting at the given values.
+
+    This was done to create a pure HTML way of refreshing the folder list since
+    we would like to use as little Javascript as possible.
+**/
+<?
+   if (strlen($mailbox) > 0) {
+      $urlMailbox = urlencode($mailbox);
+      echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
+      echo "<FRAME SRC=\"right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage\" NAME=\"right\">";
+   } else {
+      echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
+      echo "<FRAME SRC=\"right_main.php\" NAME=\"right\">";
+   }
+?>
 </FRAMESET>
 </HEAD></HTML>