/**
* mime.php
*
- * Copyright (c) 1999-2004 The SquirrelMail Project Team
+ * Copyright (c) 1999-2005 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This contains the functions necessary to detect and decode MIME
$body = '<pre>' . implode("\n", $body_ary) . '</pre>';
}
-/* This returns a parsed string called $body. That string can then
+/**
+ * This returns a parsed string called $body. That string can then
* be displayed as the actual message in the HTML. It contains
* everything needed, including HTML Tags, Attachments at the
* bottom, etc.
+ * @param clean Do not output stuff that's irrelevant for the printable version.
*/
-function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $mailbox='INBOX') {
+function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $mailbox='INBOX', $clean=FALSE) {
/* This if statement checks for the entity to show as the
* primary message. To add more of them, just put them in the
* order that is their priority.
translateText($body, $wrap_at,
$body_message->header->getParameter('charset'));
}
+
+ // if this is the clean display (i.e. printer friendly), stop here.
+ if ( $clean ) {
+ return $body;
+ }
+
$link = 'passed_id=' . $id . '&ent_id='.$ent_num.
'&mailbox=' . $urlmailbox .'&sort=' . $sort .
'&startMessage=' . $startMessage . '&show_more=0';
/**
* This function edits the style definition to make them friendly and
- * usable in squirrelmail.
+ * usable in SquirrelMail.
*
* @param $message the message object
* @param $id the message id
// version
//set all the Cache Control Headers for IE
if ($isIE) {
- $filename=urlencode($filename);
+ $filename=rawurlencode($filename);
header ("Pragma: public");
header ("Cache-Control: no-store, max-age=0, no-cache, must-revalidate"); # HTTP/1.1
header ("Cache-Control: post-check=0, pre-check=0", false);