- Removed "Include CCs when Forwarding Messages", which had no functionality
whatsoever.
- Added "preselected" query argument to mailbox list.
+ - Make the Message Details plugin actually show the correct entity when
+ viewing details of attached messages.
Version 1.5.1 (branched on 2006-02-12)
--------------------------------------
* @package plugins
* @subpackage message_details
*/
+//FIXME: this file uses HTML extensively and eventually needs to be "templatized" (don't echo HTML directly)
/**
* Include the SquirrelMail initialization file.
if (!empty($md_action)) {
sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+ if (!sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET))
+ $passed_ent_id = 0;
sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
/*
- * add third function argument, if you want to see
+ * change $unformatted to TRUE if you want to see
* message source without formating
*/
- echo get_message_details($mailbox, $passed_id);
+ $unformatted = FALSE;
+ echo get_message_details($mailbox, $passed_id, $passed_ent_id, $unformatted);
}
* Returns actual message details
* @param string $mailbox
* @param string $passed_id
+ * @param string $passed_ent_id
* @param boolean $stripHTML If TRUE, only plain text is returned,
* default is FALSE, wherein output contains
* pretty-HTMLification of message body
* @return string The formatted message details
* @access public
*/
-function get_message_details($mailbox, $passed_id, $stripHTML=FALSE) {
+function get_message_details($mailbox, $passed_id, $passed_ent_id=0, $stripHTML=FALSE) {
global $imapServerAddress, $imapPort, $color,$msgd_8bit_in_hex, $username;
$returnValue = '';
$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
$read = sqimap_mailbox_select($imapConnection, $mailbox);
- $body = sqimap_run_command($imapConnection, "FETCH $passed_id RFC822",true, $response, $readmessage, TRUE);
+ if (!empty($passed_ent_id))
+ $body = sqimap_run_command($imapConnection, "FETCH $passed_id BODY[$passed_ent_id]",true, $response, $readmessage, TRUE);
+ else
+ $body = sqimap_run_command($imapConnection, "FETCH $passed_id RFC822",true, $response, $readmessage, TRUE);
$message_body = '';
$header = false;
$mimepart = false;
sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+if (!sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET))
+ $passed_ent_id = 0;
+//FIXME: Don't echo HTML directly - need to "templatize" this
echo "<frameset rows=\"60, *\" >\n";
-echo '<frame src="message_details_top.php?mailbox=' . urlencode($mailbox) .'&passed_id=' . "$passed_id".
- '" name="top_frame" scrolling="no" noresize="noresize" frameborder="0" />';
-echo '<frame src="message_details_bottom.php?mailbox=' . urlencode($mailbox) .
- '&get_message_details=yes&passed_id=' . "$passed_id" .
- '" name="bottom_frame" frameborder="0" />';
+echo '<frame src="message_details_top.php?mailbox=' . urlencode($mailbox) .'&passed_id=' . $passed_id
+ . '&passed_ent_id=' . $passed_ent_id
+ . '" name="top_frame" scrolling="no" noresize="noresize" frameborder="0" />';
+echo '<frame src="message_details_bottom.php?mailbox=' . urlencode($mailbox)
+ . '&get_message_details=yes&passed_id=' . $passed_id
+ . '&passed_ent_id=' . $passed_ent_id
+ . '" name="bottom_frame" frameborder="0" />';
echo '</frameset>'."\n"."</html>\n";
-?>
\ No newline at end of file
+?>
"</script>\n", FALSE );
sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+if (!sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET))
+ $passed_ent_id = 0;
sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
echo "<body text=\"$color[8]\" bgcolor=\"$color[3]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n" .
addForm(SM_PATH . 'src/download.php', 'GET').
addHidden('mailbox', $mailbox).
addHidden('passed_id', $passed_id).
- addHidden('ent_id', '0').
+ addHidden('ent_id', $passed_ent_id).
addHidden('absolute_dl', 'true').
(checkForJavascript() ?
'<input type="button" value="' . _("Print") . '" onclick="printPopup()" /> '.
* @access private
*/
function show_message_details(&$links) {
- global $passed_id, $mailbox, $ent_num;
+ global $passed_id, $mailbox, $passed_ent_id;
if (strlen(trim($mailbox)) < 1) {
$mailbox = 'INBOX';
}
- $params = '?passed_ent_id=' . $ent_num .
+ $params = '?passed_ent_id=' . $passed_ent_id .
'&mailbox=' . urlencode($mailbox) .
'&passed_id=' . $passed_id;