From b8bcca7033b3d10eb7da4b7a1f9987ee9e25a45b Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 30 Jun 2014 06:26:15 -0400
Subject: [PATCH] Display quota information for current folder not INBOX only (#1487993)

---
 program/steps/mail/list.inc |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/program/steps/mail/list.inc b/program/steps/mail/list.inc
index 496c951..2dcc40d 100644
--- a/program/steps/mail/list.inc
+++ b/program/steps/mail/list.inc
@@ -68,6 +68,8 @@
 
     $OUTPUT->set_env('search_request', $search_request);
     $OUTPUT->set_env('search_filter', $_SESSION['search_filter']);
+
+    $multifolder = is_a($_SESSION['search'][1], 'rcube_result_multifolder');
 }
 
 // fetch message headers
@@ -96,12 +98,13 @@
 
 // update message count display
 $pages  = ceil($count/$RCMAIL->storage->get_pagesize());
+$page   = $count ? $RCMAIL->storage->get_page() : 1;
 $exists = $RCMAIL->storage->count($mbox_name, 'EXISTS', true);
 
 $OUTPUT->set_env('messagecount', $count);
 $OUTPUT->set_env('pagecount', $pages);
 $OUTPUT->set_env('threading', $threading);
-$OUTPUT->set_env('current_page', $count ? $RCMAIL->storage->get_page() : 1);
+$OUTPUT->set_env('current_page', $page);
 $OUTPUT->set_env('exists', $exists);
 $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count), $mbox_name);
 
@@ -143,5 +146,9 @@
     $OUTPUT->command('set_trash_count', $exists);
 }
 
+if ($page == 1) {
+    $OUTPUT->command('set_quota', $RCMAIL->quota_content(null, $multifolder ? 'INBOX' : $mbox_name));
+}
+
 // send response
 $OUTPUT->send();

--
Gitblit v1.9.1