source: subversion/trunk/roundcubemail/program/steps/mail/list.inc @ 3

Last change on this file since 3 was 3, checked in by roundcube, 8 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1<?php
2
3/*
4 +-----------------------------------------------------------------------+
5 | program/steps/mail/list.inc                                           |
6 |                                                                       |
7 | This file is part of the RoundCube Webmail client                     |
8 | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
9 | All rights reserved.                                                  |
10 |                                                                       |
11 | PURPOSE:                                                              |
12 |   Send message list to client (as remote response)                    |
13 |                                                                       |
14 +-----------------------------------------------------------------------+
15 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16 +-----------------------------------------------------------------------+
17
18 $Id$
19
20*/
21
22$REMOTE_REQUEST = TRUE;
23
24$count = $IMAP->messagecount();
25
26// update message count display
27$pages = ceil($count/$IMAP->page_size);
28$commands = sprintf("this.set_env('messagecount', %d);\n", $count);
29$commands .= sprintf("this.set_env('pagecount', %d);\n", $pages);
30$commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text());
31
32// update mailboxlist
33$mbox = $IMAP->get_mailbox_name();
34$commands .= sprintf("this.set_unread_count('%s', %d);\n", $mbox, $IMAP->messagecount($mbox, 'UNSEEN'));
35
36
37// add message rows
38if ($count)
39  {
40  $a_headers = $IMAP->list_headers($mbox);
41  $commands .= rcmail_js_message_list($a_headers);
42  }
43
44 
45// send response
46rcube_remote_response($commands);
47
48exit;
49?>
Note: See TracBrowser for help on using the repository browser.