From 623332f32b08cf1c191ec38db8e349421f9296f8 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Thu, 13 Jul 2000 10:20:54 +0000 Subject: [PATCH] - more minor UI tweaks - 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 | 10 +++++----- functions/mime.php | 1 + src/download.php | 14 ++++++++++++-- src/read_body.php | 6 +++--- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 2b331a37..36a6bdeb 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -37,10 +37,11 @@ continue; } } + if (!$hlt_color) $hlt_color = $color[4]; - echo " \n"; + echo " \n"; echo " $italic$bold$flag$senderName$flag_end$bold_end$italic_end\n"; echo "
$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end
\n"; if ($msg["FLAG_ANSWERED"] == true) echo " A"; @@ -186,7 +187,7 @@ $urlMailbox = urlencode($mailbox); /** This is the beginning of the message list table. It wraps around all messages */ - echo ""; + echo "
"; if ($startMessage < $endMessage) { echo "
"; @@ -217,7 +218,7 @@ echo "
"; echo "\n\n\n
"; - echo "\n"; + echo "
\n"; echo " \n"; echo "
\n"; echo " ". _("Move selected to:") .""; @@ -328,7 +329,6 @@ echo "Previous\n"; echo "" . _("Next") . "\n"; } - echo "
"; /** End of message-list table */ - + echo "
"; /** End of message-list table */ } ?> diff --git a/functions/mime.php b/functions/mime.php index 12ec00e8..da9fb61c 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -494,6 +494,7 @@ /** 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") { diff --git a/src/download.php b/src/download.php index f5b2ac46..2231cdcd 100644 --- a/src/download.php +++ b/src/download.php @@ -95,15 +95,19 @@ 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; @@ -112,6 +116,12 @@ $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) { diff --git a/src/read_body.php b/src/read_body.php index 62efd219..4b7fbc18 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -39,7 +39,7 @@ echo ""; echo ""._("View message") . "\n"; echo "\n"; - echo "
"; + echo "
";
       for ($i=1; $i < count($read)-1; $i++) {
          $read[$i] = htmlspecialchars($read[$i]);
          if (substr($read[$i], 0, 1) != "\t" && 
@@ -47,11 +47,11 @@
              substr($read[$i], 0, 1) != "&" && 
              trim($read[$i])) {
             $pre = substr($read[$i], 0, strpos($read[$i], ":"));
-            $read[$i] = str_replace("$pre", "$pre", $read[$i]);
+            $read[$i] = str_replace("$pre", "$pre", decodeHeader($read[$i]));
          }
          echo "$read[$i]";
       }
-      echo "
\n"; + echo "\n"; echo ""; exit; } -- 2.25.1