<?php
-
/**
* read_body.php
*
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 1999-2004 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This file is used for reading the msgs array and displaying
global $base_uri, $draft_folder, $where, $what, $color, $sort,
$startMessage, $PHP_SELF, $save_as_draft, $uid_support,
$enable_forward_as_attachment, $imapConnection, $lastTargetMailbox,
- $data_dir, $username;
+ $data_dir, $username, $delete_prev_next_display;
$topbar_delimiter = ' | ';
$double_delimiter = ' ';
// Only bother with Delete & Prev and Delete & Next IF
// we have UID support, and top display is enabled.
- $delete_prev_next_display = getPref($data_dir, $username, 'delete_prev_next_display', 1);
if ( $uid_support && $delete_prev_next_display == 1 ) {
$del_prev_link = _("Delete & Prev");
if ($prev >= 0) {
// Show Alt URI for Draft/Sent
if (isset($comp_alt_uri)) {
- $menu_row .= $topbar_delimiter;
$menu_row .= makeComposeLink($comp_alt_uri, $comp_alt_string);
- $menu_row .= $topbar_delimiter;
+ $menu_row .= $topbar_delimiter . "\n";
}
$comp_action_uri = $comp_uri . '&smaction=reply';
- $menu_row .= makeComposeLink($comp_action_uri, _("Reply"));
+ $menu_row .= makeComposeLink($comp_action_uri, _("Reply")) . "\n";
$comp_action_uri = $comp_uri . '&smaction=reply_all';
$menu_row .= $topbar_delimiter;
- $menu_row .= makeComposeLink($comp_action_uri, _("Reply All"));
+ $menu_row .= makeComposeLink($comp_action_uri, _("Reply All")) . "\n";
$comp_action_uri = $comp_uri . '&smaction=forward';
$menu_row .= $topbar_delimiter;
- $menu_row .= makeComposeLink($comp_action_uri, _("Forward"));
+ $menu_row .= makeComposeLink($comp_action_uri, _("Forward")) . "\n";
if ($enable_forward_as_attachment) {
$comp_action_uri = $comp_uri . '&smaction=forward_as_attachment';
$menu_row .= $topbar_delimiter;
- $menu_row .= makeComposeLink($comp_action_uri, _("Forward as Attachment"));
+ $menu_row .= makeComposeLink($comp_action_uri, _("Forward as Attachment")) . "\n";
}
$delete_link = _("Delete");
._("Bypass Trash").'</a>)';
}
- $menu_row .= $topbar_delimiter.$delete_link;
+ $menu_row .= $topbar_delimiter.$delete_link . "\n";
// Add top move link
$menu_row .= '</small></td><td align="right">';
- if (!(isset($passed_ent_id) && $passed_ent_id)) {
- $menu_row .= '<form action="read_body.php?mailbox='.$mailbox.'&sort='.$sort.'&startMessage='.$startMessage.'&passed_id='.$next.'" method="post">'.
+ if ( !(isset($passed_ent_id) && $passed_ent_id) ) {
+
+ $current_box = 'mailbox='.$mailbox.'&sort='.$sort.'&startMessage='.$startMessage;
+
+ // Set subsequent location based on whether or not there is a 'next' message.
+ if ( isset($next) && $next >= 0 ) {
+ $location = $base_uri . 'src/read_body.php?passed_id='.$next.'&';
+ } else {
+ $location = $base_uri . 'src/right_main.php?';
+ }
+
+ $menu_row .= '<form action="'.$base_uri.'src/move_messages.php?'.$current_box.'" method="post">'.
'<small><input type="hidden" name="show_more" value="0" />'.
- '<input type="hidden" name="move_id" value="'.$passed_id.'" />'._("Move to:") .
+ '<input type="hidden" name="location" value="'.$location.$current_box.'" />'.
+ '<input type="hidden" name="msg[0]" value="'.$passed_id.'" />'._("Move to:") .
'<select name="targetMailbox" style="padding: 0px; margin: 0px">';
+
if (isset($lastTargetMailbox) && !empty($lastTargetMailbox)) {
$menu_row .= sqimap_mailbox_option_list($imapConnection, array(strtolower($lastTargetMailbox)));
} else {
$menu_row .= sqimap_mailbox_option_list($imapConnection);
}
- $menu_row .= '</select> '.
- '<input type="submit" value="' . _("Move") . '" style="padding: 0px; margin: 0px"/>'.
- '</small></form>';
+ $menu_row .= '</select> ';
+
+ $menu_row .= getButton('SUBMIT', 'moveButton',_("Move")) . "\n" . '</form>';
}
$menu_row .= '</td></tr>';
// echo rows, with hooks
- do_hook('read_body_menu_top');
+ $ret = do_hook_function('read_body_menu_top', array($nav_row, $menu_row));
+ if (is_array($ret)) {
+ if (isset($ret[0]) && !empty($ret[0])) {
+ $nav_row = $ret[0];
+ }
+ if (isset($ret[1]) && !empty($ret[1])) {
+ $menu_row = $ret[1];
+ }
+ }
echo '<table width="100%" cellpadding="3" cellspacing="0" align="center" border="0">';
echo $nav_on_top ? $nav_row . $menu_row : $menu_row . $nav_row;
echo '</table>'."\n";
sqimap_mailbox_expunge_dmn($delete_id);
}
-/**
- * Process Move from delete-move-next
- * but only if move_id and target_mailbox were set
- */
-if ( sqgetGlobalVar('move_id', $move_id, SQ_POST) &&
- sqgetGlobalVar('targetMailbox', $targetMailbox, SQ_POST) ) {
- // Move message
- sqimap_messages_copy($imapConnection, $move_id, $move_id, $targetMailbox);
- sqimap_messages_flag($imapConnection, $move_id, $move_id, 'Deleted', true);
-
- sqimap_mailbox_expunge_dmn($move_id);
-
- if ($targetMailbox != $lastTargetMailbox) {
- $lastTargetMailbox = $targetMailbox;
- sqsession_register('lastTargetMailbox' , $lastTargetMailbox);
- }
-}
-
-
/**
* $message contains all information about the message
* including header and body