* 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');
}
$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);
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':
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;
<?php
/**
- * View a message.
+ * View a message (standard mode).
*
* Copyright 1999-2008 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*
- * @author Chuck Hagenbuch <chuck@horde.org>
- * @author Michael Slusarz <slusarz@horde.org>
+ * @package IMP
+ * @author Chuck Hagenbuch <chuck@horde.org>
+ * @author Michael Slusarz <slusarz@horde.org>
*/
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()