summaryrefslogtreecommitdiff
path: root/program/include
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/include
parent789a7b5fd5986b4815837bbbaa27c2d95030ce0c (diff)
Display quota information for current folder not INBOX only (#1487993)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcmail.php30
1 files changed, 22 insertions, 8 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 54d0d88e6..b105eb892 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -1678,9 +1678,9 @@ class rcmail extends rcube
}
- public function quota_content($attrib = null)
+ public function quota_content($attrib = null, $folder = null)
{
- $quota = $this->storage->get_quota();
+ $quota = $this->storage->get_quota($folder);
$quota = $this->plugins->exec_hook('quota', $quota);
$quota_result = (array) $quota;
@@ -1748,6 +1748,10 @@ class rcmail extends rcube
unset($quota_result['all']);
}
+ if ($folder !== null && $folder !== '') {
+ $quota_result['folder'] = $folder;
+ }
+
return $quota_result;
}
@@ -2170,11 +2174,13 @@ class rcmail extends rcube
/**
* Returns message UID(s) and IMAP folder(s) from GET/POST data
*
- * @param string UID value to decode
- * @param string Default mailbox value (if not encoded in UIDs)
+ * @param string UID value to decode
+ * @param string Default mailbox value (if not encoded in UIDs)
+ * @param bool Will be set to True if multi-folder request
+ *
* @return array List of message UIDs per folder
*/
- public static function get_uids($uids = null, $mbox = null)
+ public static function get_uids($uids = null, $mbox = null, &$is_multifolder = false)
{
// message UID (or comma-separated list of IDs) is provided in
// the form of <ID>-<MBOX>[,<ID>-<MBOX>]*
@@ -2191,6 +2197,7 @@ class rcmail extends rcube
// special case: *
if ($_uid == '*' && is_object($_SESSION['search'][1]) && $_SESSION['search'][1]->multi) {
+ $is_multifolder = true;
// extract the full list of UIDs per folder from the search set
foreach ($_SESSION['search'][1]->sets as $subset) {
$mbox = $subset->get_parameters('MAILBOX');
@@ -2204,12 +2211,19 @@ class rcmail extends rcube
// create a per-folder UIDs array
foreach ((array)$_uid as $uid) {
list($uid, $mbox) = explode('-', $uid, 2);
- if (!strlen($mbox))
+ if (!strlen($mbox)) {
$mbox = $_mbox;
- if ($uid == '*')
+ }
+ else {
+ $is_multifolder = true;
+ }
+
+ if ($uid == '*') {
$result[$mbox] = $uid;
- else
+ }
+ else {
$result[$mbox][] = $uid;
+ }
}
}