From b6da0b76afb5697685c35b8584631294cfc7b12f Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 07 Dec 2011 05:41:15 -0500
Subject: [PATCH] - Remove deprecated global $IMAP variable usage (#1488148)

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

diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index 05ba9d2..42bdf97 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -18,8 +18,8 @@
 $REMOTE_REQUEST = TRUE;
 
 // reset list_page and old search results
-$IMAP->set_page(1);
-$IMAP->set_search_set(NULL);
+$RCMAIL->imap->set_page(1);
+$RCMAIL->imap->set_search_set(NULL);
 $_SESSION['page'] = 1;
 
 // using encodeURI with javascript "should" give us
@@ -107,32 +107,32 @@
 
 // execute IMAP search
 if ($search_str)
-  $IMAP->search($mbox, $search_str, $imap_charset, $_SESSION['sort_col']);
+  $RCMAIL->imap->search($mbox, $search_str, $imap_charset, $_SESSION['sort_col']);
 
 // save search results in session
 if (!is_array($_SESSION['search']))
   $_SESSION['search'] = array();
 
 if ($search_str) {
-  $_SESSION['search'] = $IMAP->get_search_set();
+  $_SESSION['search'] = $RCMAIL->imap->get_search_set();
   $_SESSION['last_text_search'] = $str;
 }
 $_SESSION['search_request'] = $search_request;
 
 
 // Get the headers
-$result_h = $IMAP->list_headers($mbox, 1, $_SESSION['sort_col'], $_SESSION['sort_order']);
-$count = $IMAP->messagecount($mbox, $IMAP->threading ? 'THREADS' : 'ALL');
+$result_h = $RCMAIL->imap->list_headers($mbox, 1, $_SESSION['sort_col'], $_SESSION['sort_order']);
+$count = $RCMAIL->imap->messagecount($mbox, $RCMAIL->imap->threading ? 'THREADS' : 'ALL');
 
 
 // Make sure we got the headers
 if (!empty($result_h)) {
   rcmail_js_message_list($result_h);
   if ($search_str)
-    $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $IMAP->messagecount(NULL, 'ALL')));
+    $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $RCMAIL->imap->messagecount(NULL, 'ALL')));
 }
 // handle IMAP errors (e.g. #1486905)
-else  if ($err_code = $IMAP->get_error_code()) {
+else  if ($err_code = $RCMAIL->imap->get_error_code()) {
   rcmail_display_server_error();
 }
 else {
@@ -142,7 +142,7 @@
 // update message count display
 $OUTPUT->set_env('search_request', $search_str ? $search_request : '');
 $OUTPUT->set_env('messagecount', $count);
-$OUTPUT->set_env('pagecount', ceil($count/$IMAP->page_size));
+$OUTPUT->set_env('pagecount', ceil($count/$RCMAIL->imap->page_size));
 $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count, 1), $mbox);
 $OUTPUT->send();
 

--
Gitblit v1.9.1