* @author Adam Moore * @author David Poole * @version 03-11-05 * @package Templates * * Copyright (C) 2003 - 2005 phpScheduleIt * License: GPL, see LICENSE */ /** * MailMime class */ include_once('lib/MailMime.class.php'); function startMessage() { ?>
?
headers[strtolower($hdr)]; if (is_array($header_value)) { $value_array = $header_value; $count = count($value_array); for ($i=0; $i < $count; $i++) { $header_value = $value_array[$i]; $displayed_value = $header_value ? htmlspecialchars(trim($header_value)) : '(none)'; echo ' ' . "\n" . ' ' . translate($hdr) , ":" . "\n" . ' ' . $displayed_value . '' . "\n" . ' ' . "\n"; } } else { $displayed_value = $header_value ? htmlspecialchars(trim($header_value)) : '(none)'; echo ' ' . "\n" . ' ' . translate($hdr) . ":" . "\n" . ' ' . $displayed_value . '' . "\n" . ' ' . "\n"; } } } /** * Print row of optional message headers * $param The mime structure object and the specific header name */ function MsgPrintHeaderFull($struct,$hdr_list) { foreach ($hdr_list as $hdr) { $header_value = $struct->headers[strtolower($hdr)]; if (!$header_value) continue; if (is_array($header_value)) { $value_array = $header_value; $count = count($value_array); for ($i=0; $i < $count; $i++) { $header_value = $value_array[$i]; $displayed_value = $header_value ? htmlspecialchars(trim($header_value)) : '(none)'; echo ' ' . "\n" . ' ' . "$hdr:" . "\n" . ' ' . $displayed_value . '' . "\n" . ' ' . "\n"; } } else { $displayed_value = $header_value ? htmlspecialchars(trim($header_value)) : '(none)'; echo ' ' . "\n" . ' ' . "$hdr:" . "\n" . ' ' . $displayed_value . '' . "\n" . ' ' . "\n"; } } } /** * Print table of message options (Toggle Header, Back to Messages, etc..) * $param none */ function MsgDisplayOptions($mail_id, $recip_email) { // Double encode needed for javascript pass-through $enc_mail_id = urlencode(urlencode($mail_id)); $enc_recip_email = urlencode(urlencode($recip_email)); ?>
‹‹ |
|
' . "\n"; MsgPrintHeader($struct,$headers); MsgPrintHeaderFull($struct,$headers_full); echo '
' . "\n"; } /** * Print table of message body * $param The mime structure object */ function MsgDisplayBody($struct) { echo ''; echo ' '; echo ' '; echo ' '; echo '
'; MsgParseBody($struct); echo '
'; echo '
'; MsgDisplayFooter(); } /** * Print text of text/plain MIME entity * $param The body of a mime structure object */ function MsgBodyPlainText($text) { echo nl2br(htmlspecialchars($text)); } /** * Print HTML of text/html MIME entity * $param The body of a mime structure object */ function MsgBodyHtmlText($text) { echo sanitizeHTML($text); } /** * Print list of attachments * $param The body of a mime structure object */ function MsgDisplayFooter() { // Globals read from MailMime.class.php global $filelist; global $errors; if ( $filelist || $errors ) { // Space before attachment or warning list echo '
'; echo '
'; echo ''; echo ''; echo ' '; echo ''; echo '
'; if ($filelist) { echo '--Attachments--
'; foreach ($filelist as $file) { echo $file . '
'; } } if ($errors) { echo '
--warnings--
'; foreach (array_keys($errors) as $errmsg) { echo $errmsg . '
'; } } echo '
'; } }