added DELETE for when viewing a message
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 6 Dec 1999 16:31:30 +0000 (16:31 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 6 Dec 1999 16:31:30 +0000 (16:31 +0000)
beautified some of the messages

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

functions/display_messages.php
functions/imap.php
functions/mailbox_display.php
src/left_main.php
src/move_messages.php
src/read_body.php

index 18314c1..4f8fd00 100644 (file)
       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 "         <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 "      <BR>";
       echo "              <A HREF=\"webmail.php?right_frame=right_main.php&sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\" TARGET=_top>";
       echo "              <A HREF=\"webmail.php?right_frame=right_main.php&sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\" TARGET=_top>";
-      echo "              Click here to return to $mailbox";
-      echo "              </A>.";
+      echo "              Click here to return to $mailbox</A>.";
+      echo "      </FONT></CENTER>";
+      echo "   </TD></TR>";
+      echo "</TABLE>";
+    }
+
+    function messages_moved_message($mailbox, $sort, $startMessage) {
+      $urlMailbox = urlencode($mailbox);
+      echo "<BR>";
+      echo "<TABLE COLS=1 WIDTH=70% NOBORDER BGCOLOR=FFFFFF ALIGN=CENTER>";
+      echo "   <TR>";
+      echo "      <TD BGCOLOR=DCDCDC>";
+      echo "         <FONT FACE=\"Arial,Helvetica\"><B><CENTER>Messages Moved</CENTER></B></FONT>";
+      echo "   </TD></TR><TR><TD>";
+      echo "      <CENTER><FONT FACE=\"Arial,Helvetica\"><BR>The selected messages were moved successfully.<BR>\n";
+      echo "      <BR>";
+      echo "              <A HREF=\"webmail.php?right_frame=right_main.php&sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\" TARGET=_top>";
+      echo "              Click here to return to $mailbox</A>.";
+      echo "      </FONT></CENTER>";
+      echo "   </TD></TR>";
+      echo "</TABLE>";
+    }
+
+    function error_message($message, $mailbox, $sort, $startMessage) {
+      $urlMailbox = urlencode($mailbox);
+      echo "<BR>";
+      echo "<TABLE COLS=1 WIDTH=70% NOBORDER BGCOLOR=FFFFFF ALIGN=CENTER>";
+      echo "   <TR>";
+      echo "      <TD BGCOLOR=DCDCDC>";
+      echo "         <FONT FACE=\"Arial,Helvetica\" COLOR=CC0000><B><CENTER>ERROR</CENTER></B></FONT>";
+      echo "   </TD></TR><TR><TD>";
+      echo "      <CENTER><FONT FACE=\"Arial,Helvetica\"><BR>$message<BR>\n";
+      echo "      <BR>";
+      echo "              <A HREF=\"webmail.php?right_frame=right_main.php&sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\" TARGET=_top>";
+      echo "              Click here to return to $mailbox</A>.";
       echo "      </FONT></CENTER>";
       echo "   </TD></TR>";
       echo "</TABLE>";
       echo "      </FONT></CENTER>";
       echo "   </TD></TR>";
       echo "</TABLE>";
index 090f078..e0feecf 100644 (file)
       }
    }
 
       }
    }
 
+   function deleteMessages($imapConnection, $a, $b, $numMessages, $trash_folder, $move_to_trash, $auto_expunge, $mailbox) {
+      /** check if they would like to move it to the trash folder or not */
+      if ($move_to_trash == true) {
+         $success = copyMessages($imapConnection, $a, $b, $trash_folder);
+         if ($success == true)
+            setMessageFlag($imapConnection, $a, $b, "Deleted");
+      } else {
+         setMessageFlag($imapConnection, $a, $b, "Deleted");
+      }
+      if ($auto_expunge == true)
+         expungeBox($imapConnection, $mailbox, $numMessages);
+   }
 ?>
 ?>
index a398605..6e49080 100644 (file)
       echo "<TABLE BGCOLOR=$color_lgray>\n";
       echo "   <TR>\n";
       echo "      <TD WIDTH=30% ALIGN=LEFT>\n";
       echo "<TABLE BGCOLOR=$color_lgray>\n";
       echo "   <TR>\n";
       echo "      <TD WIDTH=30% ALIGN=LEFT>\n";
-      echo "         <NOBR><FONT FACE=\"Arial,Helvetica\"><INPUT TYPE=SUBMIT NAME=\"moveButton\" VALUE=\"Move to:\"></FONT>\n";
+      echo "         <NOBR><FONT FACE=\"Arial,Helvetica\" SIZE=2><INPUT TYPE=SUBMIT NAME=\"moveButton\" VALUE=\"Move to:\">\n";
       echo "         <SELECT NAME=\"targetMailbox\">\n";
       getFolderList($imapConnection, $boxesFormatted, $boxesUnformatted);
       for ($i = 0; $i < count($boxesUnformatted); $i++) {
       echo "         <SELECT NAME=\"targetMailbox\">\n";
       getFolderList($imapConnection, $boxesFormatted, $boxesUnformatted);
       for ($i = 0; $i < count($boxesUnformatted); $i++) {
          if ($use_folder == true)
             echo "         <OPTION VALUE=\"$boxesUnformatted[$i]\">$boxesUnformatted[$i]\n";
       }
          if ($use_folder == true)
             echo "         <OPTION VALUE=\"$boxesUnformatted[$i]\">$boxesUnformatted[$i]\n";
       }
-      echo "         </SELECT></NOBR>\n";
+      echo "         </SELECT></NOBR></FONT>\n";
 
       echo "      </TD>\n";
       echo "      <TD WIDTH=70% ALIGN=RIGHT>\n";
 
       echo "      </TD>\n";
       echo "      <TD WIDTH=70% ALIGN=RIGHT>\n";
-      echo "         <NOBR><FONT FACE=\"Arial,Helvetica\"><INPUT TYPE=SUBMIT VALUE=\"Delete\">&nbsp;checked messages</FONT></NOBR>\n";
+      echo "         <NOBR><FONT FACE=\"Arial,Helvetica\" SIZE=2><INPUT TYPE=SUBMIT VALUE=\"Delete\">&nbsp;checked messages</FONT></NOBR>\n";
       echo "      </TD>";
       echo "   </TR>\n";
 
       echo "      </TD>";
       echo "   </TR>\n";
 
index 086ec08..49043be 100644 (file)
@@ -37,6 +37,7 @@
    include("../config/config.php");
    include("../functions/strings.php");
    include("../functions/imap.php");
    include("../config/config.php");
    include("../functions/strings.php");
    include("../functions/imap.php");
+   include("../functions/mailbox.php");
 
    // open a connection on the imap port (143)
    $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
 
    // open a connection on the imap port (143)
    $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
    echo "<code><FONT FACE=\"Arial,Helvetica\">\n";
    for ($i = 0;$i < count($str); $i++) {
       $mailbox = Chop($str[$i]);
    echo "<code><FONT FACE=\"Arial,Helvetica\">\n";
    for ($i = 0;$i < count($str); $i++) {
       $mailbox = Chop($str[$i]);
+      $mailbox = findMailboxName($mailbox);
+
       // find the quote at the begining of the mailbox name.
       //    i subtract 1 from the strlen so it doesn't find the quote at the end of the mailbox name.
       // find the quote at the begining of the mailbox name.
       //    i subtract 1 from the strlen so it doesn't find the quote at the end of the mailbox name.
-      $mailbox = findMailboxName($mailbox);
       $periodCount = countCharInString($mailbox, ".");
       
       // indent the correct number of spaces.
       $periodCount = countCharInString($mailbox, ".");
       
       // indent the correct number of spaces.
       
       $mailboxURL = urlencode($mailbox);
       echo "<a href=\"right_main.php?sort=0&startMessage=1&mailbox=$mailboxURL\" target=\"right\" style=\"text-decoration:none\"><FONT FACE=\"Arial,Helvetica\">";
       
       $mailboxURL = urlencode($mailbox);
       echo "<a href=\"right_main.php?sort=0&startMessage=1&mailbox=$mailboxURL\" target=\"right\" style=\"text-decoration:none\"><FONT FACE=\"Arial,Helvetica\">";
+      if ($doBold == true)
+         echo "<B>";
       echo readShortMailboxName($mailbox, ".");
       echo readShortMailboxName($mailbox, ".");
+      if ($doBold == true)
+         echo "</B>";
       echo "</FONT></a><br>\n";
    }
    echo "</code></FONT>";
       echo "</FONT></a><br>\n";
    }
    echo "</code></FONT>";
index 13cfcfa..36e966b 100644 (file)
          //    loop because we never increment j.  so check to see if msg[0] is set or not to fix this.
          while ($j < count($msg)) {
             if ($msg[$i]) {
          //    loop because we never increment j.  so check to see if msg[0] is set or not to fix this.
          while ($j < count($msg)) {
             if ($msg[$i]) {
-               /** check if they would like to move it to the trash folder or not */
-               if ($move_to_trash == true) {
-                  $success = copyMessages($imapConnection, $msg[$i], $msg[$i], $trash_folder);
-                  if ($success == true)
-                     setMessageFlag($imapConnection, $msg[$i], $msg[$i], "Deleted");
-               } else {
-                  setMessageFlag($imapConnection, $msg[$i], "Deleted");
-               }
+               deleteMessages($imapConnection, $msg[$i], $msg[$i], $numMessages, $trash_folder, $move_to_trash, $auto_expunge, $mailbox);
                $j++;
             }
             $i++;
          }
                $j++;
             }
             $i++;
          }
-         if ($auto_expunge == true)
-            expungeBox($imapConnection, $mailbox, $numMessages);
          messages_deleted_message($mailbox, $sort, $startMessage);
       } else {
          echo "<BR><BR><CENTER>No messages selected.</CENTER>";
          messages_deleted_message($mailbox, $sort, $startMessage);
       } else {
          echo "<BR><BR><CENTER>No messages selected.</CENTER>";
          }
          if ($auto_expunge == true)
             expungeBox($imapConnection, $mailbox, $numMessages);
          }
          if ($auto_expunge == true)
             expungeBox($imapConnection, $mailbox, $numMessages);
-         echo "Messages are moved.<br>";
+
+         messages_moved_message($mailbox, $sort, $startMessage);
       } else {
       } else {
-         echo "\n<BR><BR><BR>\n";
-         echo "<CENTER>No messages selected.</CENTER>\n";
+         error_message("No messages were selected.", $mailbox, $sort, $startMessage);
       }
    }
 
       }
    }
 
index e8bb590..84f7855 100644 (file)
    echo "<BR>";
    echo "<TABLE COLS=1 WIDTH=95% BORDER=0 ALIGN=CENTER CELLPADDING=2>\n";
    echo "   <TR><TD BGCOLOR=DCDCDC WIDTH=100%>";
    echo "<BR>";
    echo "<TABLE COLS=1 WIDTH=95% BORDER=0 ALIGN=CENTER CELLPADDING=2>\n";
    echo "   <TR><TD BGCOLOR=DCDCDC WIDTH=100%>";
+   echo "      <FONT FACE=\"Arial,Helvetica\" SIZE=2>";
    echo "      <A HREF=\"right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">Message List</A>&nbsp;&nbsp;";
    echo "      <A HREF=\"right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">Message List</A>&nbsp;&nbsp;";
+   echo "      <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&sort=$sort&startMessage=1\">Delete</A>&nbsp;&nbsp;";
+   echo "      </FONT>";
    echo "   </TD></TR>";
    echo "   <TR><TD BGCOLOR=FFFFFF WIDTH=100%>";
    echo "   <TABLE COLS=2 WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=2>\n";
    echo "   </TD></TR>";
    echo "   <TR><TD BGCOLOR=FFFFFF WIDTH=100%>";
    echo "   <TABLE COLS=2 WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=2>\n";