Incorrect columns were passed through calcfetchColumns with as result the
[squirrelmail.git] / src / read_body.php
index bd9ce69bbf9e516966e994db4508f6c127a0f5fd..dd379b2bf6bf5445540118a038a088367bea5150 100644 (file)
@@ -681,7 +681,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
 }
 
 function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
-    global $base_uri, $where, $what;
+    global $base_uri, $where, $what, $download_and_unsafe_link;
 
     $urlMailbox = urlencode($mailbox);
     $urlPassed_id = urlencode($passed_id);
@@ -708,6 +708,12 @@ function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
     $s .= ' | ' .
           printer_friendly_link($mailbox, $passed_id, $passed_ent_id);
     echo $s;
+
+    /* Output the download and/or unsafe images link/-s, if any. */
+    if ($download_and_unsafe_link) {
+       echo $download_and_unsafe_link;
+    }
+
     do_hook("read_body_header_right");
     $s = "</small></td>\n" .
          "</tr>\n";
@@ -821,6 +827,7 @@ $aMailbox = sqm_api_mailbox_select($imapConnection, $iAccount, $mailbox,array('s
 /**
  * Replace From => To  in case it concerns a draft or sent folder
  */
+$aColumns = array();
 if (($mailbox == $sent_folder || $mailbox == $draft_folder) &&
     !in_array(SQM_COL_TO,$index_order)) {
     $aNewOrder = array(); // nice var name ;)
@@ -828,11 +835,12 @@ if (($mailbox == $sent_folder || $mailbox == $draft_folder) &&
         if ($iCol == SQM_COL_FROM) {
             $iCol = SQM_COL_TO;
         }
-        $aNewOrder[] = $iCol;
+        $aColumns[$iCol] = array();
    }
-   $aColumns = $aNewOrder;
 } else {
-   $aColumns = $index_order;
+   foreach ($index_order as $iCol) {
+       $aColumns[$iCol] = array();
+   }
 }
 
 $aProps = array(
@@ -917,8 +925,6 @@ if (isset($passed_ent_id) && $passed_ent_id) {
 }
 $header = $message->header;
 
-$header = $message->header;
-
 
 /****************************************/
 /* Block for handling incoming url vars */