From: Michael M Slusarz Date: Sun, 4 Jan 2009 08:08:08 +0000 (-0700) Subject: Nits X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f28885d24554154a9d50a505c746e289fa45f92c;p=horde.git Nits --- diff --git a/imp/mailbox.php b/imp/mailbox.php index 4410fee39..3fd639c33 100644 --- a/imp/mailbox.php +++ b/imp/mailbox.php @@ -81,7 +81,7 @@ if (!$search_mbox) { * set: $actionID, $start. */ $mailbox_url = Horde::applicationUrl('mailbox.php'); $mailbox_imp_url = IMP::generateIMPUrl('mailbox.php', $imp_mbox['mailbox']); -if (!isset($from_message_page)) { +if (!Util::nonInputVar('from_message_page')) { $actionID = Util::getFormData('actionID'); $start = Util::getFormData('start'); } @@ -104,7 +104,7 @@ $do_filter = false; $open_compose_window = null; /* Run through the action handlers */ -if ($actionID && $actionID != 'message_missing') { +if ($actionID != 'message_missing') { $result = IMP::checkRequestToken('imp.mailbox', Util::getFormData('mailbox_token')); if (is_a($result, 'PEAR_Error')) { $notification->push($result); @@ -125,17 +125,21 @@ case 'change_sort': break; case 'blacklist': + $imp_filter = new IMP_Filter(); + $imp_filter->blacklistMessage($indices); + break; + case 'whitelist': $imp_filter = new IMP_Filter(); - ($actionID == 'blacklist') - ? $imp_filter->blacklistMessage($indices) - : $imp_filter->whitelistMessage($indices); + $imp_filter->whitelistMessage($indices); break; case 'spam_report': + IMP_Spam::reportSpam($indices, 'spam'); + break; + case 'notspam_report': - $action = str_replace('_report', '', $actionID); - IMP_Spam::reportSpam($indices, $action); + IMP_Spam::reportSpam($indices, 'notspam'); break; case 'message_missing': @@ -150,12 +154,16 @@ case 'fwd_digest': break; case 'delete_messages': + if (!empty($indices)) { + $imp_message = &IMP_Message::singleton(); + $imp_message->delete($indices); + } + break; + case 'undelete_messages': if (!empty($indices)) { $imp_message = &IMP_Message::singleton(); - ($actionID == 'delete_messages') - ? $imp_message->delete($indices) - : $imp_message->undelete($indices); + $imp_message->undelete($indices); } break; diff --git a/imp/message.php b/imp/message.php index fb475a4af..4dc448344 100644 --- a/imp/message.php +++ b/imp/message.php @@ -1,30 +1,22 @@ - * @author Michael Slusarz + * @package IMP + * @author Chuck Hagenbuch + * @author Michael Slusarz */ function _returnToMailbox($startIndex = null, $actID = null) { - global $actionID, $from_message_page, $start; - - $actionID = null; - $from_message_page = true; - $start = null; - - if (!is_null($startIndex)) { - $start = $startIndex; - } - if (!is_null($actID)) { - $actionID = $actID; - } + $GLOBALS['actionID'] = $actID; + $GLOBALS['from_message_page'] = true; + $GLOBALS['startIndex'] = $startIndex; } function _moveAfterAction()