<?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 © 2002 Marc Groot Koerkamp, The Netherlands
+ * @copyright Copyright © 2004 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
* @package plugins
* @subpackage message_details
*/
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;
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) {
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();
} else if ($messageheader) {
if ($header) {
$header=false;
- $end = "\n \n".'</div>'."\n \n".'<div class="ent_body" ID="'.$entStr.'B">'."\n \n";
+ $end = "\n \n".'</div>'."\n \n".'<div class="ent_body" id="'.$entStr.'B">'."\n \n";
}
$mimepart = -$header;
$bnd_end = false;
} else {
if ($header) {
$pre = '';
- $end = "\n \n".'</div>'."\n \n".'<div class="ent_body" ID="'.$entStr.'B">'."\n \n";
+ $end = "\n \n".'</div>'."\n \n".'<div class="ent_body" id="'.$entStr.'B">'."\n \n";
}
$header = false;
$mimepart=true;
$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;
//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++) {
}
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>';