protected $_arrayIndex = null;
/**
- * The location of the last message we were at.
- *
- * @var integer
- */
- protected $_lastArrayIndex = null;
-
- /**
* The array of sorted indices.
*
* @var array
*/
public function getMessageIndex()
{
- return (is_null($this->_arrayIndex) && is_null($this->_lastArrayIndex))
- ? 1
- : $this->_arrayIndex + 1;
+ return is_null($this->_arrayIndex) ? 1 : $this->_arrayIndex + 1;
}
/**
switch ($type) {
case 'offset':
if (!is_null($this->_arrayIndex)) {
- $this->_lastArrayIndex = $this->_arrayIndex;
$this->_arrayIndex += $data;
if (empty($this->_sorted[$this->_arrayIndex])) {
$this->_arrayIndex = null;
break;
case 'uid':
- $this->_arrayIndex = $this->_lastArrayIndex = $this->getArrayIndex($data);
+ $this->_arrayIndex = $this->getArrayIndex($data);
break;
}
}
{
$GLOBALS['actionID'] = $actID;
$GLOBALS['from_message_page'] = true;
- $GLOBALS['startIndex'] = $startIndex;
+ $GLOBALS['start'] = $startIndex;
}
function _moveAfterAction()
case 'delete_message':
case 'undelete_message':
- $imp_message = &IMP_Message::singleton();
if ($actionID == 'undelete_message') {
$imp_message->undelete($indices_array);
} else {
case 'move_message':
case 'copy_message':
if (($targetMbox = Util::getFormData('targetMbox')) !== null) {
- $imp_message = &IMP_Message::singleton();
-
if (Util::getFormData('newMbox', 0) == 1) {
$targetMbox = IMP::folderPref($targetMbox, true);
$newMbox = true;
} else {
$set = true;
}
- $imp_message = &IMP_Message::singleton();
$imp_message->flag(array($flag), $indices_array, $set);
if ($prefs->getValue('mailbox_return')) {
_returnToMailbox($imp_mailbox->getMessageIndex());
case 'strip_all':
case 'strip_attachment':
- $imp_message = &IMP_Message::singleton();
$result = $imp_message->stripPart($indices_array, ($actionID == 'strip_all') ? null : Util::getFormData('imapid'));
if (is_a($result, 'PEAR_Error')) {
$notification->push($result, 'horde.error');
* message array, so we will return to mailbox.php if that is the
* case. */
if (!$imp_mailbox->isValidIndex()) {
- _returnToMailbox($imp_mailbox->getMessageIndex());
+ _returnToMailbox($imp_mailbox->getMessageCount());
require IMP_BASE . '/mailbox.php';
exit;
}