$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';
} // end fn SendDownloadHeaders
-?>
\ No newline at end of file
+?>
$body = '';
if ($ent_ar[0] != '') {
for ($i = 0; $i < count($ent_ar); $i++) {
- $body .= formatBody($imapConnection, $message, $color, $wrap_at, $ent_ar[$i], $passed_id, $mailbox);
+ $body .= formatBody($imapConnection, $message, $color, $wrap_at, $ent_ar[$i], $passed_id, $mailbox, TRUE);
$body .= '<hr style="height: 1px;" />';
}
$hookResults = do_hook('message_body', $body);
/* headers (we use table because translations are not all the same width) */
html_tag( 'table', '', 'center', '', 'cellspacing="0" cellpadding="0" border="0" width="100%"' ) .
html_tag( 'tr',
- html_tag( 'td', _("From").' ', 'left' ,'','valign="top"') .
+ html_tag( 'td', '<b>'._("From").':</b> ', 'left' ,'','valign="top"') .
html_tag( 'td', $from, 'left' )
) . "\n" .
html_tag( 'tr',
- html_tag( 'td', _("Subject").' ', 'left','','valign="top"' ) .
+ html_tag( 'td', '<b>'._("Subject").':</b> ', 'left','','valign="top"' ) .
html_tag( 'td', $subject, 'left' )
) . "\n" .
html_tag( 'tr',
- html_tag( 'td', _("Date").' ', 'left' ) .
+ html_tag( 'td', '<b>'._("Date").':</b> ', 'left' ) .
html_tag( 'td', htmlspecialchars($date), 'left' )
) . "\n" .
html_tag( 'tr',
- html_tag( 'td', _("To").' ', 'left','','valign="top"' ) .
+ html_tag( 'td', '<b>'._("To").':</b> ', 'left','','valign="top"' ) .
html_tag( 'td', $to, 'left' )
) . "\n";
if ( strlen($cc) > 0 ) { /* only show Cc: if it's there... */
echo html_tag( 'tr',
- html_tag( 'td', _("Cc").' ', 'left','','valign="top"' ) .
+ html_tag( 'td', '<b>'._("Cc").':</b> ', 'left','','valign="top"' ) .
html_tag( 'td', $cc, 'left' )
);
}
} /* end pf_clean_string() function */
/* --end pf-specific functions */
-?>
\ No newline at end of file
+?>