From 5e35126796f14e0910a007972779d96fd49e1789 Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 25 Jan 2006 22:56:53 +0000 Subject: Added folder purge function and some checks --- program/steps/addressbook/func.inc | 3 +++ program/steps/mail/check_recent.inc | 4 ++-- program/steps/mail/folders.inc | 8 ++++---- program/steps/mail/func.inc | 3 +++ 4 files changed, 12 insertions(+), 6 deletions(-) (limited to 'program/steps') diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index f7993c9bc..6d3e95ea2 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -91,6 +91,9 @@ function rcmail_contacts_list($attrib) $OUTPUT->add_script($javascript); + // add some labels to client + rcube_add_label('deletecontactconfirm'); + return $out; } diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc index fbf8871f9..3d0ceb2a9 100644 --- a/program/steps/mail/check_recent.inc +++ b/program/steps/mail/check_recent.inc @@ -22,10 +22,10 @@ $REMOTE_REQUEST = TRUE; $mbox = $IMAP->get_mailbox_name(); -if ($recent_count = $IMAP->messagecount(NULL, 'RECENT')) +if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE)) { $count = $IMAP->messagecount(); - $unread_count = $IMAP->messagecount(NULL, 'UNSEEN'); + $unread_count = $IMAP->messagecount(NULL, 'UNSEEN', TRUE); $commands = sprintf("this.set_unread_count('%s', %d, true);\n", addslashes($mbox), $unread_count); $commands .= sprintf("this.set_env('messagecount', %d);\n", $count); diff --git a/program/steps/mail/folders.inc b/program/steps/mail/folders.inc index e1730ef93..5a22b7e72 100644 --- a/program/steps/mail/folders.inc +++ b/program/steps/mail/folders.inc @@ -16,7 +16,6 @@ +-----------------------------------------------------------------------+ $Id$ - */ $REMOTE_REQUEST = TRUE; @@ -26,7 +25,7 @@ $mbox = $IMAP->get_mailbox_name(); // send EXPUNGE command if ($_action=='expunge') { - $success = $IMAP->expunge(); + $success = $IMAP->expunge($_GET['_mbox']); // reload message list if current mailbox if ($success && $_GET['_reload']) @@ -42,11 +41,12 @@ if ($_action=='expunge') // clear mailbox else if ($_action=='purge') { - $success = $IMAP->clear_mailbox(); + $success = $IMAP->clear_mailbox($_GET['_mbox']); if ($success && $_GET['_reload']) { - $commands = "this.set_env('messagecount', 0);\n"; + $commands = "this.clear_message_list();\n"; + $commands .= "this.set_env('messagecount', 0);\n"; $commands .= "this.set_env('pagecount', 0);\n"; $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text()); $commands .= sprintf("this.set_unread_count('%s', 0);\n", addslashes($mbox)); diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 4f84e2065..8e0178d7a 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -66,6 +66,9 @@ function rcmail_mailbox_list($attrib) global $IMAP, $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $COMM_PATH; static $s_added_script = FALSE; static $a_mailboxes; + + // add some labels to client + rcube_add_label('purgefolderconfirm'); // $mboxlist_start = rcube_timer(); -- cgit v1.2.3