4 +-----------------------------------------------------------------------+
5 | program/steps/mail/folders.inc |
7 | This file is part of the RoundCube Webmail client |
8 | Copyright (C) 2005, RoundCube Dev. - Switzerland |
9 | Licensed under the GNU GPL |
12 | Implement folder operations line EXPUNGE and Clear |
14 +-----------------------------------------------------------------------+
15 | Author: Thomas Bruederli <roundcube@gmail.com> |
16 +-----------------------------------------------------------------------+
18 $Id: folders.inc 232 2006-05-18 15:46:50Z cmcnulty $
21 $REMOTE_REQUEST = TRUE;
22 $mbox_name = $IMAP->get_mailbox_name();
25 // send EXPUNGE command
26 if ($_action=='expunge')
28 $success = $IMAP->expunge($_GET['_mbox']);
30 // reload message list if current mailbox
31 if ($success && $_GET['_reload'])
33 rcube_remote_response('this.clear_message_list();', TRUE);
38 $commands = "// expunged: $success\n";
42 else if ($_action=='purge')
44 $success = $IMAP->clear_mailbox($_GET['_mbox']);
46 if ($success && $_GET['_reload'])
48 $commands = "this.clear_message_list();\n";
49 $commands .= "this.set_env('messagecount', 0);\n";
50 $commands .= "this.set_env('pagecount', 0);\n";
51 $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text());
52 $commands .= sprintf("this.set_unread_count('%s', 0);\n", addslashes($mbox_name));
55 $commands = "// purged: $success";
60 rcube_remote_response($commands);