+ // If Draft folder - create Resume link
+ if (($mailbox == $draft_folder) && ($save_as_draft)) {
+ $new_button = 'smaction_draft';
+ $comp_alt_string = _("Resume Draft");
+ } else if (handleAsSent($mailbox)) {
+ // If in Sent folder, edit as new
+ $new_button = 'smaction_edit_new';
+ $comp_alt_string = _("Edit Message as New");
+ }
+ // Show Alt URI for Draft/Sent
+ if (isset($comp_alt_string))
+ $menu_row .= getButton('SUBMIT', $new_button, $comp_alt_string, $on_click) . "\n";
+
+ $menu_row .= getButton('SUBMIT', 'smaction_reply', _("Reply"), $on_click) . "\n";
+ $menu_row .= getButton('SUBMIT', 'smaction_reply_all', _("Reply All"), $on_click) ."\n";
+ $menu_row .= getButton('SUBMIT', 'smaction_forward', _("Forward"), $on_click);
+ if ($enable_forward_as_attachment)
+ $menu_row .= '<input type="checkbox" name="smaction_attache">' . _("As Attachment") .' '."\n";
+
+ $menu_row .= '</form> ';
+
+ // Form for deletion
+ $delete_url = $base_uri . 'src/delete_message.php?mailbox=' . $urlMailbox;
+ $menu_row .= '<form action="'.$delete_url.'" method="post" style="display: inline">';
+
+ if (!(isset($passed_ent_id) && $passed_ent_id)) {
+ $menu_row .= '<input type="hidden" name="message" value="'.$passed_id.'" />';
+
+ if ($where && $what) {
+ $menu_row .= '<input type="hidden" name="where" value="'.$where.'" />';
+ $menu_row .= '<input type="hidden" name="what" value="'.$what.'" />';
+ } else {
+ $menu_row .= '<input type="hidden" name="sort" value="'.$sort.'" />';
+ $menu_row .= '<input type="hidden" name="startMessage" value="'.$startMessage.'" />';
+ }
+ $menu_row .= getButton('SUBMIT', 'delete', _("Delete"));
+ $menu_row .= '<input type="checkbox" name="bypass_trash">' . _("Bypass Trash");
+ }
+ else
+ $menu_row .= getButton('SUBMIT', 'delete', _("Delete"), '', FALSE) . "\n"; // delete button is disabled
+
+ $menu_row .= '</form>';
+
+
+ // Add top move link
+ $menu_row .= '</small></td><td align="right">';
+ 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.'&';
+ } elseif (isset($prev) && $prev >= 0) {
+ $location = $base_uri . 'src/read_body.php?passed_id='.$prev.'&';
+ } else {
+ $location = $base_uri . 'src/right_main.php?';
+ }
+
+ $menu_row .= '<form action="'.$base_uri.'src/move_messages.php?'.$current_box.'" method="post" style="display: inline">'.
+ '<small><input type="hidden" name="show_more" value="0" />'.
+ '<input type="hidden" name="dmn" value="1" />'.
+ '<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> ';
+
+ $menu_row .= getButton('SUBMIT', 'moveButton',_("Move")) . "\n" . '</form>';
+ }
+ $menu_row .= '</td></tr>';
+
+ // echo rows, with hooks
+ $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";
+ do_hook('read_body_menu_bottom');