configured
[bMailZu.git] / templates / viewmail.template.php
blob2018cd737feb505323bafb99763d62dadedcbf47
1 <?php
2 /**
3 * This file provides output functions for ctrlpnl.php
4 * No data manipulation is done in this file
5 * @author Nick Korbel <lqqkout13@users.sourceforge.net>
6 * @author Adam Moore
7 * @author David Poole <David.Poole@fccc.edu>
8 * @version 03-11-05
9 * @package Templates
11 * Copyright (C) 2003 - 2005 phpScheduleIt
12 * License: GPL, see LICENSE
15 /**
16 * MailMime class
18 include_once('lib/MailMime.class.php');
20 function startMessage() {
22 <table width="100%" border="0" cellpadding="0" cellspacing="0">
23 <tr>
24 <td style="vertical-align:top; width:16%; border:solid 2px #0F93DF; background-color:#FFFFFF;">
25 <table width="100%" border="0" cellspacing="0" cellpadding="0">
26 <tr>
27 <td class="tableTitle" style="background-color:#0F93DF;">
28 <? echo translate('Message'); ?>
29 </td>
30 <td class="tableTitle" style="background-color:#0F93DF;">
31 <div align="right"
32 <a href="javascript: help('msg_view');" class="" style="color: #FFFFFF" onmouseover="javascript: window.status='Help - Message View'; return true;" onmouseout="javascript: window.status=''; return true;">?</a>
33 </div>
34 </td>
35 </tr>
36 </table>
40 function endMessage() {
42 </td>
43 </tr>
44 </table>
48 /**
49 * Print row of message header (From,To,Subject,etc)
50 * $param The mime structure object and the specific header name
52 function MsgPrintHeader($struct,$hdr_list) {
54 foreach ($hdr_list as $hdr) {
55 $header_value = $struct->headers[strtolower($hdr)];
56 if (is_array($header_value)) {
57 $value_array = $header_value;
58 $count = count($value_array);
59 for ($i=0; $i < $count; $i++) {
60 $header_value = $value_array[$i];
61 $displayed_value = $header_value ? htmlspecialchars(trim($header_value)) : '(none)';
62 echo ' <tr>' . "\n"
63 . ' <td class="headerName"><nobr>' . translate($hdr) , ":</nobr></td>" . "\n"
64 . ' <td class="headerValue">' . $displayed_value . '</td>' . "\n"
65 . ' </tr>' . "\n";
67 } else {
68 $displayed_value = $header_value ? htmlspecialchars(trim($header_value)) : '(none)';
69 echo ' <tr>' . "\n"
70 . ' <td class="headerName"><nobr>' . translate($hdr) . ":</nobr></td>" . "\n"
71 . ' <td class="headerValue">' . $displayed_value . '</td>' . "\n"
72 . ' </tr>' . "\n";
77 /**
78 * Print row of optional message headers
79 * $param The mime structure object and the specific header name
81 function MsgPrintHeaderFull($struct,$hdr_list) {
83 foreach ($hdr_list as $hdr) {
84 $header_value = $struct->headers[strtolower($hdr)];
85 if (!$header_value) continue;
86 if (is_array($header_value)) {
87 $value_array = $header_value;
88 $count = count($value_array);
89 for ($i=0; $i < $count; $i++) {
90 $header_value = $value_array[$i];
91 $displayed_value = $header_value ? htmlspecialchars(trim($header_value)) : '(none)';
92 echo ' <tr class="' . getShowHideHeaders('headers') . '">' . "\n"
93 . ' <td class="headerName"><nobr>' . "$hdr:</nobr></td>" . "\n"
94 . ' <td class="headerValue">' . $displayed_value . '</td>' . "\n"
95 . ' </tr>' . "\n";
97 } else {
98 $displayed_value = $header_value ? htmlspecialchars(trim($header_value)) : '(none)';
99 echo ' <tr class="' . getShowHideHeaders('headers') . '">' . "\n"
100 . ' <td class="headerName"><nobr>' . "$hdr:</nobr></td>" . "\n"
101 . ' <td class="headerValue">' . $displayed_value . '</td>' . "\n"
102 . ' </tr>' . "\n";
108 * Print table of message options (Toggle Header, Back to Messages, etc..)
109 * $param none
111 function MsgDisplayOptions($mail_id, $recip_email) {
112 // Double encode needed for javascript pass-through
113 $enc_mail_id = urlencode(urlencode($mail_id));
114 $enc_recip_email = urlencode(urlencode($recip_email));
116 <table class="stdFont" width="100%">
117 <tr>
118 <td align="left">
119 <a href="javascript: history.back();">&#8249;&#8249; <? echo translate('BackMessageIndex'); ?> </a>
120 </td>
121 <td align="right">
122 <a href="javascript: ViewOriginal('<? echo $enc_mail_id ?>','<? echo $enc_recip_email ?>');"> <? echo translate('ViewOriginal'); ?></a>
124 <a href="javascript: void(1);" onclick="showHideFullHeaders('headers');">
125 <? echo translate('ToggleHeaders'); ?></a>
126 </td>
127 </tr>
128 </table>
133 * Print row of original message options (Print, Close, etc..)
134 * $param none
136 function MsgOriginalOptions() {
138 <table width="100%">
139 <tr>
140 <td class="stdFont" align="right">
141 <a href="javascript: window.print();"> <? echo translate('Print'); ?></a>
143 <a href="javascript: window.close();"> <? echo translate('CloseWindow'); ?> </a>
144 </td>
145 </tr>
146 <tr>
147 <td class="stdFont" bgcolor="#FAFAFA">
153 * Print table of message headers (From,To,Subject,etc)
154 * $param The mime structure object
156 function MsgDisplayHeaders($struct) {
158 $headers = array ('From',
159 'To',
160 'Date',
161 'Subject'
164 $headers_full = array ("Received",
165 "Message-ID",
166 "X-Spam-Status",
167 "X-Amavis-Alert"
170 echo '<table id="headers" width="100%" border="0" cellspacing="0" cellpadding="1" align="center" style="border-collapse:collapse">' . "\n";
171 MsgPrintHeader($struct,$headers);
172 MsgPrintHeaderFull($struct,$headers_full);
173 echo '</table>' . "\n";
177 * Print table of message body
178 * $param The mime structure object
180 function MsgDisplayBody($struct) {
181 echo '<table width="100%" border="0" cellspacing="0" cellpadding="1" align="center">';
182 echo ' <tr>';
183 echo ' <td class="stdFont">';
184 MsgParseBody($struct);
185 echo ' <br>';
186 echo ' </td>';
187 echo ' </tr>';
188 echo '</table>';
189 MsgDisplayFooter();
192 /**
193 * Print text of text/plain MIME entity
194 * $param The body of a mime structure object
196 function MsgBodyPlainText($text) {
197 echo nl2br(htmlspecialchars($text));
201 * Print HTML of text/html MIME entity
202 * $param The body of a mime structure object
204 function MsgBodyHtmlText($text) {
205 echo sanitizeHTML($text);
209 * Print list of attachments
210 * $param The body of a mime structure object
212 function MsgDisplayFooter() {
213 // Globals read from MailMime.class.php
214 global $filelist;
215 global $errors;
216 if ( $filelist || $errors ) {
217 // Space before attachment or warning list
218 echo '<br>';
219 echo '<hr>';
220 echo '<table class="stdFont" width="100%" border="0" cellspacing="0" cellpadding="1" align="center">';
221 echo '<tr>';
222 echo ' <td>';
224 if ($filelist) {
225 echo '--Attachments--<br>';
226 foreach ($filelist as $file) {
227 echo $file . '<br>';
230 if ($errors) {
231 echo '<br>--warnings--<br>';
232 foreach (array_keys($errors) as $errmsg) {
233 echo $errmsg . '<br>';
236 echo ' </td>';
237 echo '</tr>';
238 echo '</table>';