From b6da0b76afb5697685c35b8584631294cfc7b12f Mon Sep 17 00:00:00 2001 From: alecpl Date: Wed, 7 Dec 2011 10:41:15 +0000 Subject: - Remove deprecated global $IMAP variable usage (#1488148) --- program/steps/mail/check_recent.inc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'program/steps/mail/check_recent.inc') diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc index ab0d3c818..498bf0ce1 100644 --- a/program/steps/mail/check_recent.inc +++ b/program/steps/mail/check_recent.inc @@ -19,12 +19,12 @@ */ -$current = $IMAP->get_mailbox_name(); +$current = $RCMAIL->imap->get_mailbox_name(); $check_all = !empty($_GET['_refresh']) || (bool)$RCMAIL->config->get('check_all_folders'); // list of folders to check if ($check_all) { - $a_mailboxes = $IMAP->list_mailboxes('', '*', 'mail'); + $a_mailboxes = $RCMAIL->imap->list_mailboxes('', '*', 'mail'); } else { $a_mailboxes = (array) $current; @@ -37,11 +37,11 @@ foreach ($a_mailboxes as $mbox_name) { $is_current = $mbox_name == $current; if ($is_current) { // Synchronize mailbox cache, handle flag changes - $IMAP->mailbox_sync($mbox_name); + $RCMAIL->imap->mailbox_sync($mbox_name); } // Get mailbox status - $status = $IMAP->mailbox_status($mbox_name); + $status = $RCMAIL->imap->mailbox_status($mbox_name); if ($status & 1) { // trigger plugin hook @@ -58,7 +58,7 @@ foreach ($a_mailboxes as $mbox_name) { if ($search_request && isset($_SESSION['search']) && $_SESSION['search_request'] == $search_request ) { - $_SESSION['search'] = $IMAP->refresh_search(); + $_SESSION['search'] = $RCMAIL->imap->refresh_search(); } if (!empty($_GET['_quota'])) @@ -69,27 +69,27 @@ foreach ($a_mailboxes as $mbox_name) { continue; // get overall message count; allow caching because rcube_imap::mailbox_status() did a refresh - $all_count = $IMAP->messagecount(null, $IMAP->threading ? 'THREADS' : 'ALL'); + $all_count = $RCMAIL->imap->messagecount(null, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); // check current page if we're not on the first page - if ($all_count && $IMAP->list_page > 1) { - $remaining = $all_count - $IMAP->page_size * ($IMAP->list_page - 1); + if ($all_count && $RCMAIL->imap->list_page > 1) { + $remaining = $all_count - $RCMAIL->imap->page_size * ($RCMAIL->imap->list_page - 1); if ($remaining <= 0) { - $IMAP->set_page($IMAP->list_page-1); - $_SESSION['page'] = $IMAP->list_page; + $RCMAIL->imap->set_page($RCMAIL->imap->list_page-1); + $_SESSION['page'] = $RCMAIL->imap->list_page; } } $OUTPUT->set_env('messagecount', $all_count); - $OUTPUT->set_env('pagecount', ceil($all_count/$IMAP->page_size)); + $OUTPUT->set_env('pagecount', ceil($all_count/$RCMAIL->imap->page_size)); $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($all_count), $mbox_name); - $OUTPUT->set_env('current_page', $all_count ? $IMAP->list_page : 1); + $OUTPUT->set_env('current_page', $all_count ? $RCMAIL->imap->list_page : 1); // remove old rows (and clear selection if new list is empty) $OUTPUT->command('message_list.clear', $all_count ? false : true); if ($all_count) { - $a_headers = $IMAP->list_headers($mbox_name, null, $_SESSION['sort_col'], $_SESSION['sort_order']); + $a_headers = $RCMAIL->imap->list_headers($mbox_name, null, $_SESSION['sort_col'], $_SESSION['sort_order']); // add message rows rcmail_js_message_list($a_headers, false); // remove messages that don't exists from list selection array -- cgit v1.2.3