updated some documentation, fixed minor bugs in MIME decoding, made
[squirrelmail.git] / src / read_body.php
index 7ef156042419906e12f9b847789c9c86c80375ce..5b984338c5214a2c0ec9ed58ef54d97af38e2ef4 100644 (file)
    // including header and body
    $message = sqimap_get_message($imapConnection, $passed_id, $mailbox);
 
-   echo "<HTML>";
-   echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
    displayPageHeader($color, $mailbox);
 
    /** translate the subject and mailbox into url-able text **/
-   $url_subj = urlencode(trim(stripslashes($message["HEADER"]["SUBJECT"])));
+   $url_subj = urlencode(trim(stripslashes($message->header->subject)));
    $urlMailbox = urlencode($mailbox);
-   $url_replyto = urlencode($message["HEADER"]["REPLYTO"]);
+   $url_replyto = urlencode($message->header->replyto);
 
-   $url_replytoall   = urlencode($message["HEADER"]["REPLYTO"]);
-   $url_replytoallcc = urlencode(getLineOfAddrs($message["HEADER"]["TO"]) . ", " . getLineOfAddrs($message["HEADER"]["CC"]));
+   $url_replytoall   = urlencode($message->header->replyto);
+   $url_replytoallcc = urlencode(getLineOfAddrs($message->header->to) . ", " . getLineOfAddrs($message->header->cc));
 
-   $dateString = getLongDateString($message["HEADER"]["DATE"]);
+   $dateString = getLongDateString($message->header->date);
+   $ent_num = findDisplayEntity($message);
 
    /** TEXT STRINGS DEFINITIONS **/
    $echo_more = _("more");
@@ -93,7 +92,7 @@
    /** FORMAT THE TO STRING **/
    $i = 0;
    $to_string = "";
-   $to_ary = $message["HEADER"]["TO"];
+   $to_ary = $message->header->to;
    while ($i < count($to_ary)) {
       $to_ary[$i] = htmlspecialchars($to_ary[$i]);
 
    /** FORMAT THE CC STRING **/
    $i = 0;
    $cc_string = "";
-   $cc_ary = $message["HEADER"]["CC"];
+   $cc_ary = $message->header->cc;
    while ($i < count($cc_ary)) {
       $cc_ary[$i] = htmlspecialchars($cc_ary[$i]);
       if ($cc_string)
    }
 
    /** make sure everything will display in HTML format **/
-   $from_name = decodeHeader(htmlspecialchars($message["HEADER"]["FROM"]));
-   $subject = decodeHeader(htmlspecialchars(stripslashes($message["HEADER"]["SUBJECT"])));
+   $from_name = decodeHeader(htmlspecialchars($message->header->from));
+   $subject = decodeHeader(htmlspecialchars(stripslashes($message->header->subject)));
 
    echo "<BR>";
    echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=98% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
    echo "               </SMALL>\n";
    echo "            </TD><TD WIDTH=33% ALIGN=RIGHT>";
    echo "               <SMALL>";
-   echo "               <A HREF=\"compose.php?forward_id=$passed_id&forward_subj=$url_subj&mailbox=$urlMailbox\">";
+   echo "               <A HREF=\"compose.php?forward_id=$passed_id&forward_subj=$url_subj&mailbox=$urlMailbox&ent_num=$ent_num\">";
    echo _("Forward");
    echo "</A>&nbsp;|&nbsp;";
-   echo "               <A HREF=\"compose.php?send_to=$url_replyto&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox\">";
+   echo "               <A HREF=\"compose.php?send_to=$url_replyto&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num\">";
    echo _("Reply");
    echo "</A>&nbsp;|&nbsp;";
-   echo "               <A HREF=\"compose.php?send_to=$url_replytoall&send_to_cc=$url_replytoallcc&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox\">";
+   echo "               <A HREF=\"compose.php?send_to=$url_replytoall&send_to_cc=$url_replytoallcc&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num\">";
    echo _("Reply All");
    echo "</A>&nbsp;&nbsp;";
    echo "               </SMALL>";
    echo "         </TD>\n";
    echo "      </TR>\n";
    /** cc **/
-   if ($message["HEADER"]["CC"][0]) {
+   if ($message->header->cc) {
       echo "      <TR>\n";
       echo "         <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT VALIGN=TOP>\n";
       echo "            Cc:\n";