]> git.donarmstrong.com Git - roundcube.git/blob - program/steps/mail/getunread.inc
41d0a6d5b1d05d95fbf09224669ab466d959bdbb
[roundcube.git] / program / steps / mail / getunread.inc
1 <?php
2
3 /*
4  +-----------------------------------------------------------------------+
5  | program/steps/mail/getunread.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  |   Check all mailboxes for unread messages and update GUI              |
13  |                                                                       |
14  +-----------------------------------------------------------------------+
15  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16  +-----------------------------------------------------------------------+
17
18  $Id: getunread.inc 543 2007-04-28 18:07:12Z thomasb $
19
20 */
21
22 $a_folders = $IMAP->list_mailboxes();
23
24 if (!empty($a_folders))
25 {
26   foreach ($a_folders as $mbox_row)
27     $OUTPUT->command('set_unread_count', $mbox_row, $IMAP->messagecount($mbox_row, 'UNSEEN'));
28 }
29
30 $OUTPUT->send();
31 ?>