Added support for using Squirrelmail without frames
[squirrelmail.git] / plugins / message_details / message_details_bottom.php
index e028ee2121ae6d9c18a18b8180c5be7bbdc982f3..08a8b0e43116474c91a29d0b805c5b892bfc6800 100644 (file)
@@ -1,17 +1,19 @@
 <?php
 
 /** Message Source  
-*
-* Plugin to view the RFC822 raw message output and the bodystructure of a message
-*
-* Copyright (c) 2002 Marc Groot Koerkamp, The Netherlands
-* Licensed under the GNU GPL. For full terms see the file COPYING.
-* 
-* $Id$
-**/
+ *
+ * Plugin to view the RFC822 raw message output and the bodystructure of a message
+ *
+ * Copyright (c) 2002 Marc Groot Koerkamp, The Netherlands
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ * 
+ * $Id$
+ * @package plugins
+ * @subpackage message_details
+ */
 
-chdir('..');
-define('SM_PATH','../');
+/** @ignore */
+define('SM_PATH','../../');
 
 /* SquirrelMail required files. */
 require_once(SM_PATH . 'include/validate.php');
@@ -22,18 +24,25 @@ require_once(SM_PATH . 'functions/prefs.php');
 
 global $color, $uid_support;
 
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
+
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
+
 function CalcEntity($entString, $direction) {
     $result = $entString;
     if ($direction == -1) {
-         $pos = strrpos($entString,'.');
-         $result = substr($entString,0,$pos);
+        $pos = strrpos($entString,'.');
+        $result = substr($entString,0,$pos);
     }
 
     switch ($direction) {
        case 0:
           $pos = strrpos($entString,'.');
           if ($pos === false) {
-            $entString++;
+         $entString++;
             $result= $entString;
           } 
          else {
@@ -252,10 +261,6 @@ $xtra = <<<ECHO
 
 .entheader {
   display:inline;
-  margin-bottom:1em;
-  padding-bottom:1em;
-  border-style: solid none solid none;
-  border-width:0.1em;
   width:99%;
 }
 //-->
@@ -266,9 +271,12 @@ ECHO;
 
 displayHtmlHeader( _("Message Details"), $xtra, FALSE );
 /* body */
-echo '<body><code>'."\n";
+echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n";
+echo '<code>'."\n";
 echo '<font face = "monospace">'."\n";
 echo '<BR>'."\n";
+
+
 //session_register("entities");
 //$keys = array_keys($entities);
 //$start = gettimeofday();
@@ -301,11 +309,11 @@ if (count($content) > 0) {
        echo '</td><td>';
        if (isset($content[$i]['name'])) {
            echo $content[$i]['name'];
-       } else echo '&nbsp';
+       } else echo '&nbsp;';
        echo '</td><td>';
        if (isset($content[$i]['encoding'])) {
            echo $content[$i]['encoding'];
-       } else echo '&nbsp';
+       } else echo '&nbsp;';
        echo '</td></tr>'."\n";
     }
     echo '</tbody></table><br>'."\n";