]> git.donarmstrong.com Git - roundcube.git/blob - program/steps/mail/folders.inc
Imported Upstream version 0.1~beta2.2~dfsg
[roundcube.git] / program / steps / mail / folders.inc
1 <?php
2
3 /*
4  +-----------------------------------------------------------------------+
5  | program/steps/mail/folders.inc                                        |
6  |                                                                       |
7  | This file is part of the RoundCube Webmail client                     |
8  | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
9  | Licensed under the GNU GPL                                            |
10  |                                                                       |
11  | PURPOSE:                                                              |
12  |   Implement folder operations line EXPUNGE and Clear                  |
13  |                                                                       |
14  +-----------------------------------------------------------------------+
15  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16  +-----------------------------------------------------------------------+
17
18  $Id: folders.inc 232 2006-05-18 15:46:50Z cmcnulty $
19 */
20
21 $REMOTE_REQUEST = TRUE;
22 $mbox_name = $IMAP->get_mailbox_name();
23
24
25 // send EXPUNGE command
26 if ($_action=='expunge')
27   {
28   $success = $IMAP->expunge($_GET['_mbox']);
29
30   // reload message list if current mailbox  
31   if ($success && $_GET['_reload'])
32     {
33     rcube_remote_response('this.clear_message_list();', TRUE);
34     $_action = 'list';
35     return;
36     }
37   else
38     $commands = "// expunged: $success\n";
39   }
40
41 // clear mailbox
42 else if ($_action=='purge')
43   {
44   $success = $IMAP->clear_mailbox($_GET['_mbox']);
45   
46   if ($success && $_GET['_reload'])
47     {
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));
53     }
54   else
55     $commands = "// purged: $success";
56   }
57
58
59
60 rcube_remote_response($commands);
61 ?>