commit | author | age
|
15a9d1
|
1 |
<?php |
T |
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$ |
|
19 |
*/ |
|
20 |
|
|
21 |
$REMOTE_REQUEST = TRUE; |
c5ac07
|
22 |
$mbox_name = $IMAP->get_mailbox_name(); |
15a9d1
|
23 |
|
T |
24 |
|
|
25 |
// send EXPUNGE command |
|
26 |
if ($_action=='expunge') |
|
27 |
{ |
5e3512
|
28 |
$success = $IMAP->expunge($_GET['_mbox']); |
15a9d1
|
29 |
|
T |
30 |
// reload message list if current mailbox |
|
31 |
if ($success && $_GET['_reload']) |
|
32 |
{ |
d64c2e
|
33 |
rcube_remote_response('this.message_list.clear();', TRUE); |
15a9d1
|
34 |
$_action = 'list'; |
T |
35 |
return; |
|
36 |
} |
|
37 |
else |
|
38 |
$commands = "// expunged: $success\n"; |
|
39 |
} |
|
40 |
|
|
41 |
// clear mailbox |
|
42 |
else if ($_action=='purge') |
|
43 |
{ |
5e3512
|
44 |
$success = $IMAP->clear_mailbox($_GET['_mbox']); |
15a9d1
|
45 |
|
T |
46 |
if ($success && $_GET['_reload']) |
|
47 |
{ |
d64c2e
|
48 |
$commands = "this.message_list.clear();\n"; |
5e3512
|
49 |
$commands .= "this.set_env('messagecount', 0);\n"; |
15a9d1
|
50 |
$commands .= "this.set_env('pagecount', 0);\n"; |
T |
51 |
$commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text()); |
c5ac07
|
52 |
$commands .= sprintf("this.set_unread_count('%s', 0);\n", addslashes($mbox_name)); |
15a9d1
|
53 |
} |
T |
54 |
else |
|
55 |
$commands = "// purged: $success"; |
|
56 |
} |
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
rcube_remote_response($commands); |
|
61 |
?> |