alecpl
2009-09-17 cbeea3d4d092f6ae2310175a57fe15b43d608b33
program/steps/mail/list.inc
@@ -19,6 +19,10 @@
*/
if (!$OUTPUT->ajax_call) {
  return;
}
// is there a sort type for this request?
if ($sort = get_input_value('_sort', RCUBE_INPUT_GET))
{
@@ -53,11 +57,11 @@
               
// fetch message headers
if ($IMAP->messagecount($mbox_name, 'ALL', !empty($_REQUEST['_refresh'])))
if ($count = $IMAP->messagecount($mbox_name, 'ALL', !empty($_REQUEST['_refresh'])))
  $a_headers = $IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order);
$count = $IMAP->messagecount($mbox_name);
$unseen = $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_REQUEST['_refresh']));
// update mailboxlist
rcmail_send_unread_count($mbox_name, !empty($_REQUEST['_refresh']));
// update message count display
$pages = ceil($count/$IMAP->page_size);
@@ -68,12 +72,15 @@
// add message rows
if (isset($a_headers) && count($a_headers))
{
  rcmail_js_message_list($a_headers);
  if ($search_request)
    $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $count));
}
else if ($search_request)
  $OUTPUT->show_message('searchnomatch', 'notice');
else
  $OUTPUT->show_message('nomessagesfound', 'notice');
// update mailboxlist
$OUTPUT->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX'));
// send response
$OUTPUT->send();