From: Michael M Slusarz Date: Wed, 14 Oct 2009 16:09:02 +0000 (-0600) Subject: Add IMP_UI_Message::returnToMailbox(). X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=838d5feb3d9f7636ad865b4a1efb7195a8cfa9c9;p=horde.git Add IMP_UI_Message::returnToMailbox(). --- diff --git a/imp/lib/UI/Message.php b/imp/lib/UI/Message.php index fd7344ed6..a4a19e04f 100644 --- a/imp/lib/UI/Message.php +++ b/imp/lib/UI/Message.php @@ -453,4 +453,16 @@ class IMP_UI_Message return Horde_Text_Filter::filter(IMP::filterText($subject), 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null, 'callback' => null)); } + /** + * Redirect to mailbox after deleting a message? + * + * @return boolean Return to mailbox? + */ + public function moveAfterAction() + { + return (($_SESSION['imp']['protocol'] != 'pop') && + !IMP::hideDeletedMsgs($GLOBALS['imp_mbox']['mailbox']) && + !$GLOBALS['prefs']->getValue('use_trash')); + } + } diff --git a/imp/message.php b/imp/message.php index a96390840..38572e32f 100644 --- a/imp/message.php +++ b/imp/message.php @@ -19,12 +19,6 @@ function _returnToMailbox($startIndex = null, $actID = null) $GLOBALS['start'] = $startIndex; } -function _moveAfterAction() -{ - return (($_SESSION['imp']['protocol'] != 'pop') && - !IMP::hideDeletedMsgs($GLOBALS['imp_mbox']['mailbox']) && - !$GLOBALS['prefs']->getValue('use_trash')); -} require_once dirname(__FILE__) . '/lib/Application.php'; new IMP_Application(array('init' => true)); @@ -78,6 +72,7 @@ $mailbox_name = $index_array['mailbox']; $indices_array = array($mailbox_name => array($index)); $imp_flags = IMP_Imap_Flags::singleton(); +$imp_ui = new IMP_UI_Message(); switch ($actionID) { case 'blacklist': @@ -101,7 +96,7 @@ case 'undelete_message': require IMP_BASE . '/mailbox.php'; exit; } - if (_moveAfterAction()) { + if ($imp_ui->moveAfterAction()) { $imp_mailbox->setIndex(1, 'offset'); } } @@ -130,7 +125,7 @@ case 'notspam_report': $action = str_replace('_report', '', $actionID); switch (IMP_Spam::reportSpam($indices_array, $action)) { case 1: - if (_moveAfterAction()) { + if ($imp_ui->moveAfterAction()) { $imp_mailbox->setIndex(1, 'offset'); } break; @@ -232,9 +227,6 @@ $msgindex = $imp_mailbox->getMessageIndex(); $message_url = Horde::applicationUrl('message.php'); $self_link = Horde_Util::addParameter(IMP::generateIMPUrl('message.php', $imp_mbox['mailbox'], $index, $mailbox_name), array('start' => $msgindex, 'message_token' => $message_token)); -/* Create the IMP_UI_Message:: object. */ -$imp_ui = new IMP_UI_Message(); - /* Develop the list of headers to display. */ $basic_headers = $imp_ui->basicHeaders(); $display_headers = $msgAddresses = array();