diff options
author | alecpl <alec@alec.pl> | 2008-11-13 11:05:50 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2008-11-13 11:05:50 +0000 |
commit | 8abda59ce499bc0a68c15e225cae6df9702457f5 (patch) | |
tree | 8ee911f7bb2885f60e4d1eeaf47742ac2db73c1d /program | |
parent | 5b5f741a495406176009f3cd57288e0e76c36aaf (diff) |
- fix: initialize searching when '_action' is not set (when go back from compose)
Diffstat (limited to 'program')
-rw-r--r-- | program/steps/mail/func.inc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index d2bc6a9be..1debf875b 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -56,8 +56,23 @@ if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search // set main env variables, labels and page title if (empty($RCMAIL->action) || $RCMAIL->action == 'list') { + $mbox_name = $IMAP->get_mailbox_name(); + + if (empty($RCMAIL->action)) + { + // initialize searching result if search_filter is used + if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL') + { + $search_request = md5($mbox_name.$_SESSION['search_filter']); + + $IMAP->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, $_SESSION['sort_col']); + $_SESSION['search'][$search_request] = $IMAP->get_search_set(); + $OUTPUT->set_env('search_request', $search_request); + } + } + // set current mailbox in client environment - $OUTPUT->set_env('mailbox', $IMAP->get_mailbox_name()); + $OUTPUT->set_env('mailbox', $mbox_name); $OUTPUT->set_env('quota', $IMAP->get_capability('quota')); $OUTPUT->set_env('delimiter', $IMAP->get_hierarchy_delimiter()); |