Remove unused globals
[squirrelmail.git] / plugins / message_details / message_details_bottom.php
index 29c6d8fec280642f82a95ded926409ed181a4058..3d9e2182bacdf9a0ea4247a6d7825f80022e81c3 100644 (file)
@@ -1,13 +1,16 @@
 <?php
-
-/** Message Source  
+/**
+ * Message Details plugin - bottom frame with message structure and rfc822 body
  *
  * 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$
+ * @author Marc Groot Koerkamp
+ * @copyright Copyright &copy; 2002 Marc Groot Koerkamp, The Netherlands
+ * @copyright Copyright &copy; 2004 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
  * @package plugins
  * @subpackage message_details
  */
@@ -19,8 +22,6 @@ define('SM_PATH','../../');
 require_once(SM_PATH . 'include/validate.php');
 require_once(SM_PATH . 'functions/imap.php');
 require_once(SM_PATH . 'functions/mime.php');
-require_once(SM_PATH . 'config/config.php');
-require_once(SM_PATH . 'functions/prefs.php');
 
 global $color;
 
@@ -31,6 +32,13 @@ sqgetGlobalVar('username', $username, SQ_SESSION);
 sqgetGlobalVar('key', $key, SQ_COOKIE);
 sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
 
+/**
+ * Calculates id of MIME entity
+ * @param string $entString
+ * @param integer $direction
+ * @return string
+ * @access private
+ */
 function CalcEntity($entString, $direction) {
     $result = $entString;
     if ($direction == -1) {
@@ -61,15 +69,19 @@ function CalcEntity($entString, $direction) {
     return ($result);
 }
 
+/**
+ * Returns time in microseconds between selected and current timestamp
+ *
+ * @param array $start see details about array format at http://www.php.net/gettimeofday
+ * @return integer time in microseconds
+ * @access private
+ */
 function returnTime($start) {
  $stop = gettimeofday();
  $timepassed =  1000000 * ($stop['sec'] - $start['sec']) + $stop['usec'] - $start['usec'];
  return $timepassed;
 }
 
-function GetMimeProperties($header) {
-}
-
 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 $read = sqimap_mailbox_select($imapConnection, $mailbox);
 $start = gettimeofday();
@@ -191,7 +203,8 @@ for ($i=1; $i < $count; $i++) {
                 $content_indx++;
                 $content[$content_indx]=array();
                 $content[$content_indx]['ent'] = '<a href="#'."$entStr \">$entStr".'</a>';
-                $pre .= "\n \n".'</div>'."\n \n".'<div class="entheader" id="'.$entStr.'H"><a name="'."$entStr".'"><b><font color="'.$color[2].'">';
+                $pre .= "\n \n".'</div>'."\n \n".'<div class="entheader" id="'.
+                    $entStr.'H"><a name="'."$entStr".'"><b><font color="'.$color[2].'">';
                 $end .= '</font></b>'."\n";
                 $header = true;
                 $mimepart = false;
@@ -290,13 +303,13 @@ echo '<br />'."\n";
 //session_unregister("entities");
 
 if (count($content) > 0) {
-    echo '<h2> Bodystructure </h2>'."\n\n";
+    echo '<h2>'._("Bodystructure")."</h2>\n\n";
     echo '<table border="1" width="98%"><thead>'.
          '<tr bgcolor="'.$color[7].'">'.
-         '<td><b><font color="'.$color[5].'">Entity</font></b></td>'.
-         '<td><b><font color="'.$color[5].'">Content-Type</font></b></td>'.
-         '<td><b><font color="'.$color[5].'">Name</font></b></td>'.
-         '<td><b><font color="'.$color[5].'">Encoding</font></b></td>'.
+         '<td><b><font color="'.$color[5].'">'._("Entity").'</font></b></td>'.
+         '<td><b><font color="'.$color[5].'">'._("Content-Type").'</font></b></td>'.
+         '<td><b><font color="'.$color[5].'">'._("Name").'</font></b></td>'.
+         '<td><b><font color="'.$color[5].'">'._("Encoding").'</font></b></td>'.
          '</tr>'.
          '</thead><tbody>';
     for ($i = 0; $i < count($content);$i++) {
@@ -317,7 +330,7 @@ if (count($content) > 0) {
     }
     echo '</tbody></table><br />'."\n";
 }
-echo '<h2> RFC822 Message body </h2>'."\n\n";
+echo '<h2>'._("RFC822 Message body")."</h2>\n\n";
 echo '<div><div class="header">'."\n\n";
 echo $message_body;
 echo '</div></div></font></code></body></html>';