From: ebullient Date: Sat, 27 Mar 2004 22:25:17 +0000 (+0000) Subject: changes for read_body link line - now buttons - more like message index X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=98a9cc036b3aa09a5798963754e011c4bdfaf4fc;p=squirrelmail.git changes for read_body link line - now buttons - more like message index git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6907 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index cce333f2..35ee5d4a 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -831,15 +831,14 @@ function mail_message_listing_beginning ($imapConnection, // display flag buttons only if supported if ($show_flag_buttons && $mbxresponse != NULL && strpos($mbxresponse['PERMANENTFLAGS'], '\Flagged') !== FALSE) { + echo getButton('SUBMIT', 'markUnflagged',_("Un")); echo getButton('SUBMIT', 'markFlagged',_("Flag")); echo ' '; - echo getButton('SUBMIT', 'markUnflagged',_("Unflag")); - echo ' '; } + echo getButton('SUBMIT', 'markUnread',_("Un")); echo getButton('SUBMIT', 'markRead',_("Read")); echo ' '; - echo getButton('SUBMIT', 'markUnread',_("Unread")); - echo ' '; + echo getButton('SUBMIT', 'attache',_("Forward")); echo ' '; echo getButton('SUBMIT', 'delete',_("Delete")); @@ -1054,12 +1053,7 @@ function get_selectall_link($start_msg, $sort, $mailbox) { . '&what=' . urlencode($what); } $result .= "\">"; - - if (isset($checkall) && ($checkall == '1')) { - $result .= _("Unselect All"); - } else { - $result .= _("Select All"); - } + $result .= _("All"); $result .= "\n"; } @@ -1372,8 +1366,13 @@ function getMbxList($imapConnection, $boxes = 0) { echo '  '; } -function getButton($type, $name, $value) { - return ''; +function getButton($type, $name, $value, $enabled = TRUE) { + $disabled = ( $enabled ? '' : 'disabled ' ); + return ''; } function getSmallStringCell($string, $align) { diff --git a/src/compose.php b/src/compose.php index 9f97e8bd..4d315296 100644 --- a/src/compose.php +++ b/src/compose.php @@ -47,7 +47,6 @@ sqgetGlobalVar('composesession', $composesession, SQ_SESSION); sqgetGlobalVar('compose_messages', $compose_messages, SQ_SESSION); /** SESSION/POST/GET VARS */ -sqgetGlobalVar('smaction',$action); sqgetGlobalVar('session',$session); sqgetGlobalVar('mailbox',$mailbox); if(!sqgetGlobalVar('identity',$identity)) { @@ -91,6 +90,15 @@ if ( sqgetGlobalVar('return', $temp, SQ_POST) ) { /** GET VARS */ sqgetGlobalVar('attachedmessages', $attachedmessages, SQ_GET); +/** get smaction */ +if ( !sqgetGlobalVar('smaction',$action) ) +{ + if ( sqgetGlobalVar('smaction_reply',$tmp) ) $action = 'reply'; + if ( sqgetGlobalVar('smaction_reply_all',$tmp) ) $action = 'reply_all'; + if ( sqgetGlobalVar('smaction_forward',$tmp) ) $action = 'forward'; + if ( sqgetGlobalVar('smaction_attache',$tmp) ) $action = 'forward_as_attachment'; +} + /* Location (For HTTP 1.1 Header("Location: ...") redirects) */ $location = get_location(); /* Identities (fetch only once) */ diff --git a/src/delete_message.php b/src/delete_message.php index c01eb969..1304aca9 100644 --- a/src/delete_message.php +++ b/src/delete_message.php @@ -25,32 +25,30 @@ sqgetGlobalVar('username', $username, SQ_SESSION); sqgetGlobalVar('key', $key, SQ_COOKIE); sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION); -sqgetGlobalVar('message', $message, SQ_GET); +sqgetGlobalVar('message', $message, SQ_FORM); sqgetGlobalVar('mailbox', $mailbox, SQ_GET); -sqgetGlobalVar('bypass_trash', $bypass_trash, SQ_GET); +sqgetGlobalVar('bypass_trash', $bypass_trash, SQ_FORM); /* end globals */ -if (isset($_GET['saved_draft'])) { - $saved_draft = urlencode($_GET['saved_draft']); +if (sqGetGlobalVar('saved_draft', $tmp, SQ_GET)) { + $saved_draft = urlencode($tmp); } -if (isset($_GET['mail_sent'])) { - $mail_sent = urlencode($_GET['mail_sent']); +if (sqGetGlobalVar('mail_sent', $tmp, SQ_GET)) { + $mail_sent = urlencode($tmp); } -if (isset($_GET['sort'])) { - $sort = (int) $_GET['sort']; +if (sqGetGlobalVar('where', $tmp, SQ_FORM)) { + $where = urlencode($tmp); } - -if (isset($_GET['startMessage'])) { - $startMessage = (int) $_GET['startMessage']; +if (sqGetGlobalVar('what', $tmp, SQ_FORM)) { + $what = urlencode($tmp); } - -if(isset($_GET['where'])) { - $where = urlencode($_GET['where']); +if (sqGetGlobalVar('sort', $tmp, SQ_FORM)) { + $sort = (int) $tmp; } -if(isset($_GET['what'])) { - $what = urlencode($_GET['what']); +if (sqGetGlobalVar('startMessage', $tmp, SQ_FORM)) { + $startMessage = (int) $tmp; } $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); diff --git a/src/read_body.php b/src/read_body.php index d9203819..c4da8d04 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -495,12 +495,6 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp $double_delimiter = '    '; $urlMailbox = urlencode($mailbox); - $comp_uri = 'src/compose.php' . - '?passed_id=' . $passed_id . - '&mailbox=' . $urlMailbox . - '&startMessage=' . $startMessage . - (isset($passed_ent_id)?'&passed_ent_id='.$passed_ent_id:''); - $msgs_url = $base_uri . 'src/'; // BEGIN NAV ROW - PREV/NEXT, DEL PREV/NEXT, LINKS TO INDEX, etc. @@ -620,56 +614,57 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp // BEGIN MENU ROW - DELETE/REPLY/FORWARD/MOVE/etc. $menu_row = ''; + // Start form for reply/reply all/forward.. + $comp_uri = $base_uri.'src/compose.php' . + '?passed_id=' . $passed_id . + '&mailbox=' . $urlMailbox . + '&startMessage=' . $startMessage . + (isset($passed_ent_id) ? '&passed_ent_id='.$passed_ent_id : ''); + $menu_row .= '
'; + // If Draft folder - create Resume link if (($mailbox == $draft_folder) && ($save_as_draft)) { - $comp_alt_uri = $comp_uri . '&smaction=draft'; + $new_button = 'draft'; $comp_alt_string = _("Resume Draft"); } else if (handleAsSent($mailbox)) { // If in Sent folder, edit as new - $comp_alt_uri = $comp_uri . '&smaction=edit_as_new'; + $new_button = 'edit_as_new'; $comp_alt_string = _("Edit Message as New"); } - // Show Alt URI for Draft/Sent - if (isset($comp_alt_uri)) { - $menu_row .= makeComposeLink($comp_alt_uri, $comp_alt_string); - $menu_row .= $topbar_delimiter . "\n"; - } + if (isset($comp_alt_string)) + $menu_row .= getButton('SUBMIT', $new_button, $comp_alt_string) . "\n"; - $comp_action_uri = $comp_uri . '&smaction=reply'; - $menu_row .= makeComposeLink($comp_action_uri, _("Reply")) . "\n"; + $menu_row .= getButton('SUBMIT', 'smaction_reply', _("Reply")); + $menu_row .= ' '.getButton('SUBMIT', 'smaction_reply_all', _("Reply All")); + $menu_row .= ' '.getButton('SUBMIT', 'smaction_forward', _("Forward")); - $comp_action_uri = $comp_uri . '&smaction=reply_all'; - $menu_row .= $topbar_delimiter; - $menu_row .= makeComposeLink($comp_action_uri, _("Reply All")) . "\n"; + if ($enable_forward_as_attachment) + $menu_row .= '' . _("Attachment"); + $menu_row .= ''.'  '; - $comp_action_uri = $comp_uri . '&smaction=forward'; - $menu_row .= $topbar_delimiter; - $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")) . "\n"; - } + // Form for deletion + $delete_url = $base_uri . 'src/delete_message.php?mailbox=' . $urlMailbox; + $menu_row .= '
'; - $delete_link = _("Delete"); if (!(isset($passed_ent_id) && $passed_ent_id)) { - $delete_url = $base_uri . 'src/delete_message.php?mailbox=' . $urlMailbox . - '&message=' . $passed_id . '&'; + $menu_row .= ''; if ($where && $what) { - $delete_url .= 'where=' . urlencode($where) . '&what=' . urlencode($what); + $menu_row .= ''; + $menu_row .= ''; } else { - $delete_url .= 'sort=' . $sort . '&startMessage=' . $startMessage; + $menu_row .= ''; + $menu_row .= ''; } - $delete_link = '' . $delete_link . ''; - $delete_link .= ' (' - ._("Bypass Trash").')'; - + $menu_row .= getButton('SUBMIT', 'delete', _("Delete")); + $menu_row .= '' . _("Bypass Trash"); } - $menu_row .= $topbar_delimiter.$delete_link . "\n"; + else + $menu_row .= getButton('SUBMIT', 'delete', _("Delete"), FALSE) . "\n"; // delete button is disabled + + $menu_row .= '' . "\n"; // Add top move link