From de80e95e61d4a179a0d41ac4512c83818f3243ef Mon Sep 17 00:00:00 2001 From: lkehresman Date: Mon, 6 Dec 1999 16:31:30 +0000 Subject: [PATCH] added DELETE for when viewing a message 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 | 38 ++++++++++++++++++++++++++++++++-- functions/imap.php | 12 +++++++++++ functions/mailbox_display.php | 6 +++--- src/left_main.php | 8 ++++++- src/move_messages.php | 18 ++++------------ src/read_body.php | 3 +++ 6 files changed, 65 insertions(+), 20 deletions(-) diff --git a/functions/display_messages.php b/functions/display_messages.php index 18314c1d..4f8fd008 100644 --- a/functions/display_messages.php +++ b/functions/display_messages.php @@ -56,9 +56,43 @@ echo "
Messages Deleted
"; echo " "; echo "

The selected messages were deleted successfully.
\n"; + echo "
"; echo " "; - echo " Click here to return to $mailbox"; - echo " ."; + echo " Click here to return to $mailbox."; + echo "
"; + echo " "; + echo ""; + } + + function messages_moved_message($mailbox, $sort, $startMessage) { + $urlMailbox = urlencode($mailbox); + echo "
"; + echo ""; + echo " "; + echo " "; + echo "
"; + echo "
Messages Moved
"; + echo "
"; + echo "

The selected messages were moved successfully.
\n"; + echo "
"; + echo " "; + echo " Click here to return to $mailbox."; + echo "
"; + echo "
"; + } + + function error_message($message, $mailbox, $sort, $startMessage) { + $urlMailbox = urlencode($mailbox); + echo "
"; + echo ""; + echo " "; + echo " "; echo "
"; + echo "
ERROR
"; + echo "
"; + echo "

$message
\n"; + echo "
"; + echo " "; + echo " Click here to return to $mailbox."; echo "
"; echo "
"; diff --git a/functions/imap.php b/functions/imap.php index 090f078e..e0feecfd 100644 --- a/functions/imap.php +++ b/functions/imap.php @@ -82,4 +82,16 @@ } } + 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); + } ?> diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index a3986057..6e49080e 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -192,7 +192,7 @@ echo "\n"; echo " \n"; echo " \n"; echo " "; echo " \n"; diff --git a/src/left_main.php b/src/left_main.php index 086ec082..49043be1 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -37,6 +37,7 @@ 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); @@ -51,9 +52,10 @@ echo "\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. - $mailbox = findMailboxName($mailbox); $periodCount = countCharInString($mailbox, "."); // indent the correct number of spaces. @@ -62,7 +64,11 @@ $mailboxURL = urlencode($mailbox); echo ""; + if ($doBold == true) + echo ""; echo readShortMailboxName($mailbox, "."); + if ($doBold == true) + echo ""; echo "
\n"; } echo "
"; diff --git a/src/move_messages.php b/src/move_messages.php index 13cfcfa6..36e966b1 100644 --- a/src/move_messages.php +++ b/src/move_messages.php @@ -47,20 +47,11 @@ // 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++; } - if ($auto_expunge == true) - expungeBox($imapConnection, $mailbox, $numMessages); messages_deleted_message($mailbox, $sort, $startMessage); } else { echo "

No messages selected.
"; @@ -86,11 +77,10 @@ } if ($auto_expunge == true) expungeBox($imapConnection, $mailbox, $numMessages); - - echo "Messages are moved.
"; + + messages_moved_message($mailbox, $sort, $startMessage); } else { - echo "\n


\n"; - echo "
No messages selected.
\n"; + error_message("No messages were selected.", $mailbox, $sort, $startMessage); } } diff --git a/src/read_body.php b/src/read_body.php index e8bb590b..84f78557 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -26,7 +26,10 @@ echo "
"; echo "
\n"; - echo " \n"; + echo " \n"; echo " \n"; + echo " \n"; echo " \n"; - echo "  checked messages\n"; + echo "  checked messages\n"; echo "
\n"; echo " "; echo "
"; + echo " "; echo " Message List  "; + echo " Delete  "; + echo " "; echo "
"; echo " \n"; -- 2.25.1