changes for read_body link line - now buttons - more like message index
authorebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 27 Mar 2004 22:25:17 +0000 (22:25 +0000)
committerebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 27 Mar 2004 22:25:17 +0000 (22:25 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6907 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php
src/compose.php
src/delete_message.php
src/read_body.php

index cce333f2d497c2596e7cb14894439053bf9cac9c..35ee5d4aef4715b392706ea191270591d6a5b6b5 100644 (file)
@@ -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) {
                     // 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 '&nbsp;';
                         echo getButton('SUBMIT', 'markFlagged',_("Flag"));
                         echo '&nbsp;';
-                        echo getButton('SUBMIT', 'markUnflagged',_("Unflag"));
-                        echo '&nbsp;';
                     }
                     }
+                    echo getButton('SUBMIT', 'markUnread',_("Un"));
                     echo getButton('SUBMIT', 'markRead',_("Read"));
                     echo '&nbsp;';
                     echo getButton('SUBMIT', 'markRead',_("Read"));
                     echo '&nbsp;';
-                    echo getButton('SUBMIT', 'markUnread',_("Unread"));
-                    echo '&nbsp;';
+
                     echo getButton('SUBMIT', 'attache',_("Forward"));
                     echo '&nbsp;';
                     echo getButton('SUBMIT', 'delete',_("Delete"));
                     echo getButton('SUBMIT', 'attache',_("Forward"));
                     echo '&nbsp;';
                     echo getButton('SUBMIT', 'delete',_("Delete"));
@@ -1054,12 +1053,7 @@ function get_selectall_link($start_msg, $sort, $mailbox) {
                     .  '&amp;what=' . urlencode($what);
         }
         $result .= "\">";
                     .  '&amp;what=' . urlencode($what);
         }
         $result .= "\">";
-
-        if (isset($checkall) && ($checkall == '1')) {
-            $result .= _("Unselect All");
-        } else {
-            $result .= _("Select All");
-        }
+        $result .= _("All");
         $result .= "</A>\n";
     }
 
         $result .= "</A>\n";
     }
 
@@ -1372,8 +1366,13 @@ function getMbxList($imapConnection, $boxes = 0) {
     echo '         </SELECT></TT>&nbsp;';
 }
 
     echo '         </SELECT></TT>&nbsp;';
 }
 
-function getButton($type, $name, $value) {
-    return '<INPUT TYPE="'.$type.'" NAME="'.$name.'" VALUE="'.$value . '" style="padding: 0px; margin: 0px">';
+function getButton($type, $name, $value, $enabled = TRUE) {
+    $disabled = ( $enabled ? '' : 'disabled ' );
+    return '<INPUT '.$disabled.
+               'TYPE="'.$type.
+             '" NAME="'.$name.
+            '" VALUE="'.$value .
+            '" style="padding: 0px; margin: 0px">';
 }
 
 function getSmallStringCell($string, $align) {
 }
 
 function getSmallStringCell($string, $align) {
index 9f97e8bdc71f656c19e78e3d61c1c1e2ef89c610..4d315296a99f05a73aa4add006e7e36fdbae46e0 100644 (file)
@@ -47,7 +47,6 @@ sqgetGlobalVar('composesession',    $composesession,    SQ_SESSION);
 sqgetGlobalVar('compose_messages',  $compose_messages,  SQ_SESSION);
 
 /** SESSION/POST/GET VARS */
 sqgetGlobalVar('compose_messages',  $compose_messages,  SQ_SESSION);
 
 /** SESSION/POST/GET VARS */
-sqgetGlobalVar('smaction',$action);
 sqgetGlobalVar('session',$session);
 sqgetGlobalVar('mailbox',$mailbox);
 if(!sqgetGlobalVar('identity',$identity)) {
 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 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) */
 /* Location (For HTTP 1.1 Header("Location: ...") redirects) */
 $location = get_location();
 /* Identities (fetch only once) */
index c01eb969014935b7763ae7bb11e98e14531f7f66..1304aca9ed2608e07a643ff56d6698cb6165f712 100644 (file)
@@ -25,32 +25,30 @@ sqgetGlobalVar('username', $username, SQ_SESSION);
 sqgetGlobalVar('key', $key, SQ_COOKIE);
 sqgetGlobalVar('onetimepad', $onetimepad, 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('mailbox', $mailbox, SQ_GET);
 
-sqgetGlobalVar('bypass_trash', $bypass_trash, SQ_GET);
+sqgetGlobalVar('bypass_trash', $bypass_trash, SQ_FORM);
 
 /* end globals */
 
 
 /* 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);
 }
 
 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
index d9203819a10e7ea560c795f9842df9cca7dacbe9..c4da8d04bf391049eba7720e6196b82c6fd9b86a 100644 (file)
@@ -495,12 +495,6 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp
     $double_delimiter = '&nbsp;&nbsp;&nbsp;&nbsp;';
     $urlMailbox = urlencode($mailbox);
 
     $double_delimiter = '&nbsp;&nbsp;&nbsp;&nbsp;';
     $urlMailbox = urlencode($mailbox);
 
-    $comp_uri = 'src/compose.php' .
-                '?passed_id=' . $passed_id .
-                '&amp;mailbox=' . $urlMailbox .
-                '&amp;startMessage=' . $startMessage .
-                 (isset($passed_ent_id)?'&amp;passed_ent_id='.$passed_ent_id:'');
-
     $msgs_url = $base_uri . 'src/';
 
     // BEGIN NAV ROW - PREV/NEXT, DEL PREV/NEXT, LINKS TO INDEX, etc.
     $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 = '<tr bgcolor="'.$color[9].'"><td><small>';
 
     // BEGIN MENU ROW - DELETE/REPLY/FORWARD/MOVE/etc.
     $menu_row = '<tr bgcolor="'.$color[9].'"><td><small>';
 
+    // Start form for reply/reply all/forward.. 
+    $comp_uri = $base_uri.'src/compose.php' .
+                '?passed_id=' . $passed_id .
+                '&amp;mailbox=' . $urlMailbox .
+                '&amp;startMessage=' . $startMessage .
+                 (isset($passed_ent_id) ? '&amp;passed_ent_id='.$passed_ent_id : '');
+    $menu_row .= '<form action="'.$comp_uri.'" method="post"><small>';
+
     // If Draft folder - create Resume link
     if (($mailbox == $draft_folder) && ($save_as_draft)) {
     // If Draft folder - create Resume link
     if (($mailbox == $draft_folder) && ($save_as_draft)) {
-        $comp_alt_uri = $comp_uri . '&amp;smaction=draft';
+        $new_button = 'draft';
         $comp_alt_string = _("Resume Draft");
     } else if (handleAsSent($mailbox)) {
     // If in Sent folder, edit as new
         $comp_alt_string = _("Resume Draft");
     } else if (handleAsSent($mailbox)) {
     // If in Sent folder, edit as new
-        $comp_alt_uri = $comp_uri . '&amp;smaction=edit_as_new';
+        $new_button = 'edit_as_new';
         $comp_alt_string = _("Edit Message as New");
     }
         $comp_alt_string = _("Edit Message as New");
     }
-
     // Show Alt URI for Draft/Sent
     // 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 . '&amp;smaction=reply';
-    $menu_row .= makeComposeLink($comp_action_uri, _("Reply")) . "\n";
+    $menu_row .= getButton('SUBMIT', 'smaction_reply', _("Reply"));
+    $menu_row .= '&nbsp;'.getButton('SUBMIT', 'smaction_reply_all', _("Reply All"));
+    $menu_row .= '&nbsp;'.getButton('SUBMIT', 'smaction_forward', _("Forward"));
 
 
-    $comp_action_uri = $comp_uri . '&amp;smaction=reply_all';
-    $menu_row .= $topbar_delimiter;
-    $menu_row .= makeComposeLink($comp_action_uri, _("Reply All")) . "\n";
+    if ($enable_forward_as_attachment)
+        $menu_row .= '<input type="checkbox" name="smaction_attache">' . _("Attachment");
 
 
+    $menu_row .= '</form>'.'&nbsp;&nbsp;';
 
 
-    $comp_action_uri = $comp_uri . '&amp;smaction=forward';
-    $menu_row .= $topbar_delimiter;
-    $menu_row .= makeComposeLink($comp_action_uri, _("Forward")) . "\n";
-
-    if ($enable_forward_as_attachment) {
-        $comp_action_uri = $comp_uri . '&amp;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 .= '<form action="'.$delete_url.'" method="post" style="display: inline"><small>';
 
 
-    $delete_link = _("Delete");
     if (!(isset($passed_ent_id) && $passed_ent_id)) {
     if (!(isset($passed_ent_id) && $passed_ent_id)) {
-        $delete_url = $base_uri . 'src/delete_message.php?mailbox=' . $urlMailbox .
-                  '&amp;message=' . $passed_id . '&amp;';
+        $menu_row .= '<input type="hidden" name="message" value="'.$passed_id.'" />';
 
         if ($where && $what) {
 
         if ($where && $what) {
-            $delete_url .= 'where=' . urlencode($where) . '&amp;what=' . urlencode($what);
+            $menu_row .= '<input type="hidden" name="where" value="'.$where.'" />';
+            $menu_row .= '<input type="hidden" name="what" value="'.$what.'" />';
         } else {
         } else {
-            $delete_url .= 'sort=' . $sort . '&amp;startMessage=' . $startMessage;
+            $menu_row .= '<input type="hidden" name="sort" value="'.$sort.'" />';
+            $menu_row .= '<input type="hidden" name="startMessage" value="'.$startMessage.'" />';
         }
         }
-        $delete_link = '<a href="' . $delete_url . '">' . $delete_link . '</a>';
-        $delete_link .= '&nbsp;(<a href="' . $delete_url.'&amp;bypass_trash=1">'
-                        ._("Bypass Trash").'</a>)';
-        
+        $menu_row .= getButton('SUBMIT', 'delete', _("Delete"));
+        $menu_row .= '<input type="checkbox" name="bypass_trash">' . _("Bypass Trash");
     }
     }
-    $menu_row .= $topbar_delimiter.$delete_link . "\n";
+    else
+      $menu_row .= getButton('SUBMIT', 'delete', _("Delete"), FALSE) . "\n"; // delete button is disabled
+
+    $menu_row .= '</form>' . "\n";
 
 
     // Add top move link
 
 
     // Add top move link