- more minor UI tweaks
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 13 Jul 2000 10:20:54 +0000 (10:20 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 13 Jul 2000 10:20:54 +0000 (10:20 +0000)
- added headers to saved text messages

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@615 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php
functions/mime.php
src/download.php
src/read_body.php

index 2b331a375cf47371282a502dbe18a4bd7a5b8735..36a6bdeb3c2c9b6c254375c35430cd1df7a7f508 100644 (file)
             continue;
          }   
       }   
+      
       if (!$hlt_color)
          $hlt_color = $color[4];
       
-      echo "   <td width=1% bgcolor=$hlt_color align=center><input type=checkbox name=\"msg[$t]\" value=".$msg["ID"]."></TD>\n";
+      echo "   <td width=1% bgcolor=$hlt_color align=center><input type=checkbox name=\"msg[$t]\" value=".$msg["ID"]."$checked></TD>\n";
       echo "   <td width=30% bgcolor=$hlt_color>$italic$bold$flag$senderName$flag_end$bold_end$italic_end</td>\n";
       echo "   <td nowrap width=1% bgcolor=$hlt_color><center>$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end</center></td>\n";
                if ($msg["FLAG_ANSWERED"] == true) echo "   <td bgcolor=$hlt_color width=1%><b><small>A</small></b></td>";
       $urlMailbox = urlencode($mailbox);
 
       /** This is the beginning of the message list table.  It wraps around all messages */
-      echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=1>";
+      echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0>";
 
       if ($startMessage < $endMessage) {
          echo "<TR BGCOLOR=\"$color[4]\"><TD>";
       echo "<TR><TD BGCOLOR=\"$color[0]\">";
 
       echo "\n\n\n<FORM name=messageList method=post action=\"move_messages.php?msg=$msg&mailbox=$urlMailbox&startMessage=$startMessage\">";
-      echo "<TABLE BGCOLOR=\"$color[0]\" COLS=2 BORDER=0>\n";
+      echo "<TABLE BGCOLOR=\"$color[0]\" COLS=2 BORDER=0 cellpadding=0 cellspacing=0>\n";
       echo "   <TR>\n";
       echo "      <TD WIDTH=60% ALIGN=LEFT>\n";
       echo "         <NOBR><SMALL>". _("Move selected to:") ."</SMALL>";
          echo "<FONT COLOR=\"$color[9]\">Previous</FONT>\n";
          echo "<A HREF=\"right_main.php?use_mailbox_cache=1&startMessage=$nextGroup&mailbox=$urlMailbox\" TARGET=\"right\">" . _("Next") . "</A>\n";
       }
-      echo "</TD></TR></TABLE>"; /** End of message-list table */
-
+      echo "</TD></TR></table>"; /** End of message-list table */
    }
 ?>
index 12ec00e854de5344e2fc1c7cc1a92732d6ae9346..da9fb61c4b763d2bbffe667ed3cced7fd3006980 100644 (file)
 
    /** this function decodes the body depending on the encoding type. **/
    function decodeBody($body, $encoding) {
+      $body = str_replace("\r\n", "\n", $body);
       $encoding = strtolower($encoding);
 
       if ($encoding == "quoted-printable") {
index f5b2ac4640954c7d1f8308d71c5e626fbbda4e70..2231cdcda1b56144745595e8c88831c790005de3 100644 (file)
       switch($type0) {
          case "text":
             $body = decodeBody($body, $header->encoding);
-            #header("Content-type: $type0/$type1; name=\"$filename\"");
             header("Content-type: application/octet-stream; name=\"$filename\"");
             header("Content-Disposition: attachment; filename=\"$filename\"");
+            if ($type1 == "plain") {
+               echo _("Subject") . ": " . decodeHeader(stripslashes($header->subject)) . "\n";
+               echo "   " . _("From") . ": " . decodeHeader(stripslashes($header->from)) . "\n";
+               echo "     " . _("To") . ": " . decodeHeader(stripslashes(getLineOfAddrs($header->to))) . "\n";
+               echo "   " . _("Date") . ": " . getLongDateString($header->date) . "\n\n";
+            }
             echo trim($body);
             break;
          default:
             $body = decodeBody($body, $header->encoding);
             header("Content-type: application/octet-stream; name=\"$filename\"");
-            #header("Content-type: $type0/$type1; name=\"$filename\"");
             header("Content-Disposition: attachment; filename=\"$filename\"");
             echo $body;
             break;
       $body = decodeBody ($body, $header->encoding);
       header("Content-type: $type0/$type1; name=\"$filename\"");
       header("Content-disposition: attachment; filename=\"$filename\"");
+      if ($type0 == "text" && $type1 == "plain") {
+         echo _("Subject") . ": " . decodeHeader(stripslashes($header->subject)) . "\n";
+         echo "   " . _("From") . ": " . decodeHeader(stripslashes($header->from)) . "\n";
+         echo "     " . _("To") . ": " . decodeHeader(stripslashes(getLineOfAddrs($header->to))) . "\n";
+         echo "   " . _("Date") . ": " . getLongDateString($header->date) . "\n\n";
+      }
       echo $body;
    } else {
       switch ($type0) {
index 62efd219055173591ce40b5f1b8a5585af6e7e02..4b7fbc18b4bba61cdd272fa489d76a0ffa3d847f 100644 (file)
@@ -39,7 +39,7 @@
       echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more\">";
       echo ""._("View message") . "</a></b></center></td></tr></table>\n";
       echo "<table width=99% cellpadding=2 cellspacing=0 border=0 align=center>\n";
-      echo "<tr><td><tt>";
+      echo "<tr><td><pre>";
       for ($i=1; $i < count($read)-1; $i++) {
          $read[$i] = htmlspecialchars($read[$i]);
          if (substr($read[$i], 0, 1) != "\t" && 
              substr($read[$i], 0, 1) != "&" && 
              trim($read[$i])) {
             $pre = substr($read[$i], 0, strpos($read[$i], ":"));
-            $read[$i] = str_replace("$pre", "<b>$pre</b>", $read[$i]);
+            $read[$i] = str_replace("$pre", "<b>$pre</b>", decodeHeader($read[$i]));
          }
          echo "$read[$i]";
       }
-      echo "</tt></td></tr></table>\n";
+      echo "</pre></td></tr></table>\n";
       echo "</body></html>";
       exit;
    }