diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-04-10 10:49:10 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-04-10 10:49:10 +0200 |
commit | 8d34b9dce335883c0190e9e98232ce7b48a7b9c5 (patch) | |
tree | a60d851737bfd4c4fd0f73d0146c6bcd87518372 /program/steps | |
parent | eddaf0b5f68c9863181b62db33bc468d38071e8a (diff) |
Refactored storage properties setting
Diffstat (limited to 'program/steps')
-rw-r--r-- | program/steps/mail/func.inc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index f711da3e1..c123fe84a 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -24,16 +24,15 @@ $RCMAIL->storage_init(); // set imap properties and session vars -if (strlen(trim($mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true)))) { - $RCMAIL->storage->set_folder(($_SESSION['mbox'] = $mbox)); +if (!strlen($mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true))) { + $mbox = strlen($_SESSION['mbox']) ? $_SESSION['mbox'] : 'INBOX'; } -else if ($RCMAIL->storage) { - $_SESSION['mbox'] = $RCMAIL->storage->get_folder(); +if (!($page = intval($_GET['_page']))) { + $page = $_SESSION['page'] ? $_SESSION['page'] : 1; } -if (!empty($_GET['_page'])) { - $RCMAIL->storage->set_page(($_SESSION['page'] = intval($_GET['_page']))); -} +$RCMAIL->storage->set_folder($_SESSION['mbox'] = $mbox); +$RCMAIL->storage->set_page($_SESSION['page'] = $page); $a_threading = $RCMAIL->config->get('message_threading', array()); $message_sort_col = $RCMAIL->config->get('message_sort_col'); |