summaryrefslogtreecommitdiff
path: root/program/steps/mail/search.inc
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-06-30 12:26:15 +0200
committerAleksander Machniak <alec@alec.pl>2014-06-30 12:26:15 +0200
commitb8bcca7033b3d10eb7da4b7a1f9987ee9e25a45b (patch)
tree4d587c1a4b6f238a5e4ad2721a482346060ad482 /program/steps/mail/search.inc
parent789a7b5fd5986b4815837bbbaa27c2d95030ce0c (diff)
Display quota information for current folder not INBOX only (#1487993)
Diffstat (limited to 'program/steps/mail/search.inc')
-rw-r--r--program/steps/mail/search.inc16
1 files changed, 12 insertions, 4 deletions
diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index 4aa22e14b..b50593480 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -127,8 +127,9 @@ if ($search_str) {
}
else if ($scope == 'sub') {
$mboxes = $RCMAIL->storage->list_folders_subscribed($mbox, '*', 'mail');
- if ($mbox != 'INBOX' && $mboxes[0] == 'INBOX')
+ if ($mbox != 'INBOX' && $mboxes[0] == 'INBOX') {
array_shift($mboxes);
+ }
}
$result = $RCMAIL->storage->search($mboxes, $search_str, $imap_charset, $sort_column);
@@ -144,7 +145,7 @@ if ($search_str) {
$_SESSION['last_text_search'] = $str;
}
$_SESSION['search_request'] = $search_request;
-$_SESSION['search_scope'] = $scope;
+$_SESSION['search_scope'] = $scope;
// Get the headers
@@ -181,10 +182,13 @@ else if ($result->incomplete) {
else {
$OUTPUT->show_message('searchnomatch', 'notice');
$OUTPUT->set_env('multifolder_listing', (bool)$result->multi);
- if ($result->multi && $scope == 'all')
+ if ($result->multi && $scope == 'all') {
$OUTPUT->command('select_folder', '');
+ }
}
+$OUTPUT->set_pagetitle($RCMAIL->gettext(array('name' => 'searchfor', 'vars' => array('q' => $str))));
+
// update message count display
$OUTPUT->set_env('search_request', $search_str ? $search_request : '');
$OUTPUT->set_env('search_filter', $_SESSION['search_filter']);
@@ -193,5 +197,9 @@ $OUTPUT->set_env('messagecount', $count);
$OUTPUT->set_env('pagecount', ceil($count/$RCMAIL->storage->get_pagesize()));
$OUTPUT->set_env('exists', $mbox === null ? 0 : $RCMAIL->storage->count($mbox, 'EXISTS'));
$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count, 1), $mbox);
-$OUTPUT->set_pagetitle($RCMAIL->gettext(array('name' => 'searchfor', 'vars' => array('q' => $str))));
+
+if (!$result->incomplete) {
+ $OUTPUT->command('set_quota', $RCMAIL->quota_content(null, $result->multi ? 'INBOX' : $mbox));
+}
+
$OUTPUT->send();