svncommit
2007-10-15 97a656643866f16289264954be961aa3f314ac20
commit | author | age
4e17e6 1 <?php
T 2 /*
3  +-----------------------------------------------------------------------+
4  | program/steps/mail/mark.inc                                           |
5  |                                                                       |
6  | This file is part of the RoundCube Webmail client                     |
f11541 7  | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
30233b 8  | Licensed under the GNU GPL                                            |
4e17e6 9  |                                                                       |
T 10  | PURPOSE:                                                              |
11  |   Mark the submitted messages with the specified flag                 |
12  |                                                                       |
13  +-----------------------------------------------------------------------+
14  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
15  +-----------------------------------------------------------------------+
16
17  $Id$
18
19 */
20
f11541 21 $a_flags_map = array(
T 22   'undelete' => 'UNDELETED',
23   'delete' => 'DELETED',
24   'read' => 'SEEN',
25   'unread' => 'UNSEEN');
4e17e6 26
8d0758 27 if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_value('_flag', RCUBE_INPUT_POST)))
f11541 28 {
b3ce79 29   $flag = $a_flags_map[$flag] ? $a_flags_map[$flag] : strtoupper($flag);
T 30   $marked = $IMAP->set_flag($uids, $flag);
f11541 31
4cd897 32   if ($marked != -1)
f11541 33   {
c5ac07 34     $mbox_name = $IMAP->get_mailbox_name();
f11541 35     $OUTPUT->command('set_unread_count', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'));
T 36     $OUTPUT->send();
4e17e6 37   }
f11541 38 }
4e17e6 39   
T 40 exit;
41 ?>