59177427 |
1 | <?php |
7c1b84d9 |
2 | |
3302d0d4 |
3 | /** |
a09387f4 |
4 | ** mailbox_display.php |
3302d0d4 |
5 | ** |
6 | ** This contains functions that display mailbox information, such as the |
7 | ** table row that has sender, date, subject, etc... |
8 | ** |
9 | **/ |
a4c2cd49 |
10 | |
266fe275 |
11 | $mailbox_display_php = true; |
d068c0ec |
12 | |
1809bad8 |
13 | function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage, $where, $what) { |
af9404d7 |
14 | global $color, $msgs, $msort; |
f9b3e5d9 |
15 | global $sent_folder; |
9d157cec |
16 | global $message_highlight_list; |
8e265988 |
17 | global $index_order; |
cbdc5621 |
18 | |
0d455368 |
19 | $msg = $msgs[$key]; |
d92b6f31 |
20 | |
c36ed9cf |
21 | $senderName = sqimap_find_displayable_name($msg["FROM"]); |
05207a68 |
22 | $urlMailbox = urlencode($mailbox); |
7aaa81fc |
23 | $subject = trim($msg["SUBJECT"]); |
8fca0a65 |
24 | if ($subject == "") |
25 | $subject = _("(no subject)"); |
26 | |
926da13e |
27 | echo "<TR>\n"; |
7151188f |
28 | |
29 | if ($msg["FLAG_FLAGGED"] == true) { $flag = "<font color=$color[2]>"; $flag_end = "</font>"; } |
30 | if ($msg["FLAG_SEEN"] == false) { $bold = "<b>"; $bold_end = "</b>"; } |
0d455368 |
31 | if ($mailbox == $sent_folder) { $italic = "<i>"; $italic_end = "</i>"; } |
7151188f |
32 | |
9d157cec |
33 | for ($i=0; $i < count($message_highlight_list); $i++) { |
d059be8f |
34 | if (trim($message_highlight_list[$i]["value"]) != "") { |
35 | if ($message_highlight_list[$i]["match_type"] == "to_cc") { |
a2790a61 |
36 | if (strpos("^^".strtolower($msg["TO"]), strtolower($message_highlight_list[$i]["value"])) || strpos("^^".strtolower($msg["CC"]), strtolower($message_highlight_list[$i]["value"]))) { |
d059be8f |
37 | $hlt_color = $message_highlight_list[$i]["color"]; |
38 | continue; |
39 | } |
a2790a61 |
40 | } else if (strpos("^^".strtolower($msg[strtoupper($message_highlight_list[$i]["match_type"])]),strtolower($message_highlight_list[$i]["value"]))) { |
1195c340 |
41 | $hlt_color = $message_highlight_list[$i]["color"]; |
42 | continue; |
d059be8f |
43 | } |
44 | } |
9d157cec |
45 | } |
623332f3 |
46 | |
9d157cec |
47 | if (!$hlt_color) |
48 | $hlt_color = $color[4]; |
1809bad8 |
49 | |
50 | if ($where && $what) { |
51 | $search_stuff = "&where=".urlencode($where)."&what=".urlencode($what); |
52 | } |
d76f6440 |
53 | |
8e265988 |
54 | for ($i=1; $i <= count($index_order); $i++) { |
55 | switch ($index_order[$i]) { |
56 | case 1: # checkbox |
57 | echo " <td width=1% bgcolor=$hlt_color align=center><input type=checkbox name=\"msg[$t]\" value=".$msg["ID"]."$checked></TD>\n"; |
58 | break; |
59 | case 2: # from |
60 | echo " <td width=30% bgcolor=$hlt_color>$italic$bold$flag$senderName$flag_end$bold_end$italic_end</td>\n"; |
61 | break; |
62 | case 3: # date |
63 | echo " <td nowrap width=1% bgcolor=$hlt_color><center>$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end</center></td>\n"; |
64 | break; |
65 | case 4: # subject |
66 | echo " <td bgcolor=$hlt_color>$bold<a href=\"read_body.php?mailbox=$urlMailbox&passed_id=".$msg["ID"]."&startMessage=$startMessage&show_more=0$search_stuff\">$flag$subject$flag_end</a>$bold_end</td>\n"; |
67 | break; |
68 | case 5: # flags |
9db5f5fc |
69 | $stuff = false; |
fd0a282a |
70 | echo " <td bgcolor=$hlt_color width=1% nowrap><b><small>\n"; |
9db5f5fc |
71 | if ($msg["FLAG_ANSWERED"] == true) { |
72 | echo "A\n"; |
73 | $stuff = true; |
74 | } |
75 | if ($msg["TYPE0"] == "multipart") { |
76 | echo "+\n"; |
77 | $stuff = true; |
78 | } |
79 | if (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) { |
80 | echo "<font color=$color[1]>!</font>\n"; |
81 | $stuff = true; |
82 | } |
f9b3e5d9 |
83 | if ($msg["FLAG_DELETED"]) { |
84 | echo "<font color=\"$color[1]\">D</font>\n"; |
85 | $stuff = true; |
86 | } |
87 | |
9db5f5fc |
88 | if (!$stuff) echo " \n"; |
89 | echo "</small></b></td>\n"; |
8e265988 |
90 | break; |
91 | case 6: # size |
6e7468f6 |
92 | echo " <td bgcolor=$hlt_color width=1%>$bold".show_readable_size($msg['SIZE'])."$bold_end</td>\n"; |
8e265988 |
93 | break; |
94 | } |
95 | } |
96 | |
7151188f |
97 | |
98 | echo "</tr>\n"; |
926da13e |
99 | } |
100 | |
101 | /** |
102 | ** This function loops through a group of messages in the mailbox and shows them |
103 | **/ |
5b6ae78a |
104 | function showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color,$show_num, $use_cache) { |
105 | global $msgs, $msort; |
f9b3e5d9 |
106 | global $sent_folder; |
9d157cec |
107 | global $message_highlight_list; |
a3432f47 |
108 | global $auto_expunge; |
109 | |
0d455368 |
110 | sqimap_mailbox_expunge($imapConnection, $mailbox); |
111 | sqimap_mailbox_select($imapConnection, $mailbox); |
61a4ac35 |
112 | |
5b6ae78a |
113 | if (!$use_cache) { |
0d455368 |
114 | // if it's sorted |
5b6ae78a |
115 | if ($numMessages >= 1) { |
0d455368 |
116 | if ($sort < 6) { |
117 | for ($q = 0; $q < $numMessages; $q++) { |
118 | if($mailbox == $sent_folder) |
119 | $hdr = sqimap_get_small_header ($imapConnection, $q+1, true); |
120 | else |
121 | $hdr = sqimap_get_small_header ($imapConnection, $q+1, false); |
122 | |
123 | $from[$q] = $hdr->from; |
124 | $date[$q] = $hdr->date; |
125 | $subject[$q] = $hdr->subject; |
126 | $to[$q] = $hdr->to; |
127 | $priority[$q] = $hdr->priority; |
128 | $cc[$q] = $hdr->cc; |
129 | $size[$q] = $hdr->size; |
130 | $type[$q] = $hdr->type0; |
131 | $flags[$q] = sqimap_get_flags ($imapConnection, $q+1); |
a3d65705 |
132 | $id[$q] = $q + 1; |
0d455368 |
133 | } |
134 | } else { |
135 | // if it's not sorted |
136 | if ($startMessage + ($show_num - 1) < $numMessages) { |
137 | $endMessage = $startMessage + ($show_num-1); |
138 | } else { |
139 | $endMessage = $numMessages; |
140 | } |
141 | |
142 | if ($endMessage < $startMessage) { |
143 | $startMessage = $startMessage - $show_num; |
144 | if ($startMessage < 1) |
145 | $startMessage = 1; |
146 | } |
147 | |
a3d65705 |
148 | |
149 | $real_startMessage = $numMessages - $startMessage + 1; |
150 | $real_endMessage = $numMessages - $startMessage - $show_num; |
151 | |
152 | $j = 0; |
153 | for ($q = $real_startMessage; $q >= $real_endMessage; $q--) { |
0d455368 |
154 | if($mailbox == $sent_folder) |
155 | $hdr = sqimap_get_small_header ($imapConnection, $q, true); |
156 | else |
157 | $hdr = sqimap_get_small_header ($imapConnection, $q, false); |
158 | |
159 | $from[$j] = $hdr->from; |
160 | $date[$j] = $hdr->date; |
161 | $subject[$j] = $hdr->subject; |
162 | $to[$j] = $hdr->to; |
163 | $priority[$j] = $hdr->priority; |
164 | $cc[$j] = $hdr->cc; |
165 | $size[$j] = $hdr->size; |
166 | $type[$j] = $hdr->type0; |
167 | $flags[$j] = sqimap_get_flags ($imapConnection, $q); |
a3d65705 |
168 | $id[$j] = $q; |
0d455368 |
169 | $j++; |
170 | } |
171 | } |
5b6ae78a |
172 | } |
173 | |
174 | $j = 0; |
0d455368 |
175 | if ($sort == 6) { |
176 | $end = $startMessage + $show_num - 1; |
177 | } else { |
178 | $end = $numMessages; |
179 | } |
180 | while ($j < $end) { |
5b6ae78a |
181 | $date[$j] = ereg_replace(" ", " ", $date[$j]); |
182 | $tmpdate = explode(" ", trim($date[$j])); |
0d455368 |
183 | |
5b6ae78a |
184 | $messages[$j]["TIME_STAMP"] = getTimeStamp($tmpdate); |
185 | $messages[$j]["DATE_STRING"] = getDateString($messages[$j]["TIME_STAMP"]); |
a3d65705 |
186 | $messages[$j]["ID"] = $id[$j]; |
5b6ae78a |
187 | $messages[$j]["FROM"] = decodeHeader($from[$j]); |
e9f8ea4e |
188 | $messages[$j]["FROM-SORT"] = strtolower(sqimap_find_displayable_name(decodeHeader($from[$j]))); |
5b6ae78a |
189 | $messages[$j]["SUBJECT"] = decodeHeader($subject[$j]); |
e9f8ea4e |
190 | $messages[$j]["SUBJECT-SORT"] = strtolower(decodeHeader($subject[$j])); |
3e69e88b |
191 | $messages[$j]["TO"] = decodeHeader($to[$j]); |
0d455368 |
192 | $messages[$j]["PRIORITY"] = $priority[$j]; |
1195c340 |
193 | $messages[$j]["CC"] = $cc[$j]; |
fde32e3f |
194 | $messages[$j]["SIZE"] = $size[$j]; |
9db5f5fc |
195 | $messages[$j]["TYPE0"] = $type[$j]; |
e9f8ea4e |
196 | |
197 | # fix SUBJECT-SORT to remove Re: |
0d455368 |
198 | $re_abbr = # Add more here! |
199 | "vedr|sv|" . # Danish |
200 | "re|aw"; # English |
201 | if (eregi("^($re_abbr):[ ]*(.*)$", $messages[$j]['SUBJECT-SORT'], $regs)) |
202 | $messages[$j]['SUBJECT-SORT'] = $regs[2]; |
5b6ae78a |
203 | |
204 | $num = 0; |
205 | while ($num < count($flags[$j])) { |
206 | if ($flags[$j][$num] == "Deleted") { |
207 | $messages[$j]["FLAG_DELETED"] = true; |
208 | } |
f9b3e5d9 |
209 | elseif ($flags[$j][$num] == "Answered") { |
5b6ae78a |
210 | $messages[$j]["FLAG_ANSWERED"] = true; |
211 | } |
f9b3e5d9 |
212 | elseif ($flags[$j][$num] == "Seen") { |
5b6ae78a |
213 | $messages[$j]["FLAG_SEEN"] = true; |
214 | } |
f9b3e5d9 |
215 | elseif ($flags[$j][$num] == "Flagged") { |
5b6ae78a |
216 | $messages[$j]["FLAG_FLAGGED"] = true; |
217 | } |
218 | $num++; |
7151188f |
219 | } |
5b6ae78a |
220 | $j++; |
3302d0d4 |
221 | } |
f9b3e5d9 |
222 | |
223 | /* Only ignore messages flagged as deleted if we are using a |
224 | * trash folder or auto_expunge */ |
0d455368 |
225 | if (($move_to_trash || $auto_expunge) && $sort != 6) |
f9b3e5d9 |
226 | { |
227 | /** Find and remove the ones that are deleted */ |
228 | $i = 0; |
229 | $j = 0; |
230 | while ($j < $numMessages) { |
231 | if ($messages[$j]["FLAG_DELETED"] == true) { |
232 | $j++; |
233 | continue; |
234 | } |
235 | $msgs[$i] = $messages[$j]; |
236 | |
237 | $i++; |
5b6ae78a |
238 | $j++; |
5b6ae78a |
239 | } |
f9b3e5d9 |
240 | $numMessages = $i; |
0d455368 |
241 | } else { |
242 | $msgs = $messages; |
5b10f02a |
243 | } |
5b6ae78a |
244 | } |
926da13e |
245 | |
4c2d69ac |
246 | // There's gotta be messages in the array for it to sort them. |
f9b3e5d9 |
247 | if ($numMessages > 0 && ! $use_cache) { |
0e919368 |
248 | /** 0 = Date (up) 4 = Subject (up) |
249 | ** 1 = Date (dn) 5 = Subject (dn) |
250 | ** 2 = Name (up) |
251 | ** 3 = Name (dn) |
252 | **/ |
09856735 |
253 | session_unregister("msgs"); |
1c292c82 |
254 | if (($sort == 0) || ($sort == 1)) |
255 | $msort = array_cleave ($msgs, "TIME_STAMP"); |
256 | if (($sort == 2) || ($sort == 3)) |
e9f8ea4e |
257 | $msort = array_cleave ($msgs, "FROM-SORT"); |
1c292c82 |
258 | if (($sort == 4) || ($sort == 5)) |
e9f8ea4e |
259 | $msort = array_cleave ($msgs, "SUBJECT-SORT"); |
0d455368 |
260 | if ($sort == 6) |
261 | $msort = $msgs; |
262 | |
263 | if ($sort < 6) { |
264 | if($sort % 2) { |
265 | asort($msort); |
266 | } else { |
267 | arsort($msort); |
268 | } |
0e919368 |
269 | } |
5b6ae78a |
270 | session_register("msort"); |
4c2d69ac |
271 | } |
5b6ae78a |
272 | displayMessageArray($imapConnection, $numMessages, $startMessage, $msgs, $msort, $mailbox, $sort, $color,$show_num); |
09856735 |
273 | session_register("msgs"); |
9f2215a1 |
274 | } |
275 | |
276 | // generic function to convert the msgs array into an HTML table |
5b6ae78a |
277 | function displayMessageArray($imapConnection, $numMessages, $startMessage, &$msgs, $msort, $mailbox, $sort, $color,$show_num) { |
cbdc5621 |
278 | global $folder_prefix, $sent_folder; |
f9b3e5d9 |
279 | global $imapServerAddress; |
8e265988 |
280 | global $index_order; |
8e9e8afa |
281 | |
9f2215a1 |
282 | // if cache isn't already set, do it now |
90033b64 |
283 | if (!session_is_registered("msgs")) |
284 | session_register("msgs"); |
5b6ae78a |
285 | if (!session_is_registered("msort")) |
286 | session_register("msort"); |
90033b64 |
287 | |
8442ac08 |
288 | |
9c83f905 |
289 | if ($startMessage + ($show_num - 1) < $numMessages) { |
290 | $endMessage = $startMessage + ($show_num-1); |
926da13e |
291 | } else { |
926da13e |
292 | $endMessage = $numMessages; |
293 | } |
8442ac08 |
294 | |
295 | if ($endMessage < $startMessage) { |
296 | $startMessage = $startMessage - $show_num; |
297 | if ($startMessage < 1) |
298 | $startMessage = 1; |
299 | } |
300 | |
9c83f905 |
301 | $nextGroup = $startMessage + $show_num; |
302 | $prevGroup = $startMessage - $show_num; |
20db5033 |
303 | $urlMailbox = urlencode($mailbox); |
926da13e |
304 | |
6b638171 |
305 | do_hook("mailbox_index_before"); |
926da13e |
306 | |
14eb705c |
307 | $Message = ''; |
0d1b4832 |
308 | if ($startMessage < $endMessage) { |
14eb705c |
309 | $Message = _("Viewing messages") ." <B>$startMessage</B> ". _("to") ." <B>$endMessage</B> ($numMessages " . _("total") . ")\n"; |
f9b3e5d9 |
310 | } elseif ($startMessage == $endMessage) { |
14eb705c |
311 | $Message = _("Viewing message") ." <B>$startMessage</B> ($numMessages " . _("total") . ")\n"; |
0d1b4832 |
312 | } |
26b6c99c |
313 | |
14eb705c |
314 | $More = ''; |
0d455368 |
315 | if ($sort == 6) { |
316 | $use = 0; |
317 | } else { |
318 | $use = 1; |
319 | } |
5b10f02a |
320 | if (($nextGroup <= $numMessages) && ($prevGroup >= 0)) { |
0d455368 |
321 | $More = "<A HREF=\"right_main.php?use_mailbox_cache=$use&startMessage=$prevGroup&mailbox=$urlMailbox\" TARGET=\"right\">". _("Previous") ."</A> | \n"; |
322 | $More .= "<A HREF=\"right_main.php?use_mailbox_cache=$use&&startMessage=$nextGroup&mailbox=$urlMailbox\" TARGET=\"right\">". _("Next") ."</A>\n"; |
926da13e |
323 | } |
f9b3e5d9 |
324 | elseif (($nextGroup > $numMessages) && ($prevGroup >= 0)) { |
0d455368 |
325 | $More = "<A HREF=\"right_main.php?use_mailbox_cache=$use&startMessage=$prevGroup&mailbox=$urlMailbox\" TARGET=\"right\">". _("Previous") ."</A> | \n"; |
14eb705c |
326 | $More .= "<FONT COLOR=\"$color[9]\">"._("Next")."</FONT>\n"; |
3302d0d4 |
327 | } |
f9b3e5d9 |
328 | elseif (($nextGroup <= $numMessages) && ($prevGroup < 0)) { |
14eb705c |
329 | $More = "<FONT COLOR=\"$color[9]\">"._("Previous")."</FONT> | \n"; |
0d455368 |
330 | $More .= "<A HREF=\"right_main.php?use_mailbox_cache=$use&startMessage=$nextGroup&mailbox=$urlMailbox\" TARGET=\"right\">". _("Next") ."</A>\n"; |
14eb705c |
331 | } |
332 | |
333 | mail_message_listing_beginning($imapConnection, |
334 | "move_messages.php?msg=$msg&mailbox=$urlMailbox&startMessage=$startMessage", |
335 | $mailbox, $sort, $Message, $More); |
336 | |
a3d65705 |
337 | if ($sort == 6) |
338 | $endVar = $show_num; |
339 | else |
340 | $endVar = $endMessage + 1; |
14eb705c |
341 | |
342 | // loop through and display the info for each message. |
343 | $t = 0; // $t is used for the checkbox number |
344 | if ($numMessages == 0) { // if there's no messages in this folder |
345 | echo "<TR><TD BGCOLOR=\"$color[4]\" COLSPAN=" . count($index_order); |
346 | echo "><CENTER><BR><B>". _("THIS FOLDER IS EMPTY") ."</B><BR> </CENTER></TD></TR>"; |
f9b3e5d9 |
347 | } elseif ($startMessage == $endMessage) { // if there's only one message in the box, handle it different. |
a3d65705 |
348 | if ($sort != 6) |
349 | $i = $startMessage; |
350 | else |
351 | $i = 1; |
14eb705c |
352 | reset($msort); |
353 | do { |
354 | $key = key($msort); |
355 | next($msort); |
356 | $k++; |
357 | } while (isset ($key) && ($k < $i)); |
358 | printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage, 0, 0); |
359 | } else { |
a3d65705 |
360 | if ($sort != 6) |
361 | $i = $startMessage; |
362 | else |
363 | $i = 1; |
14eb705c |
364 | reset($msort); |
365 | do { |
366 | $key = key($msort); |
367 | next($msort); |
368 | $k++; |
369 | } while (isset ($key) && ($k < $i)); |
370 | |
0d455368 |
371 | do { |
14eb705c |
372 | printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage, 0, 0); |
373 | $key = key($msort); |
374 | $t++; |
375 | $i++; |
376 | next($msort); |
a3d65705 |
377 | } while ($i < $endVar); |
14eb705c |
378 | } |
379 | echo "</TABLE>"; |
380 | |
381 | echo "</td></tr>\n"; |
382 | |
383 | if ($More) |
384 | { |
385 | echo "<TR BGCOLOR=\"$color[4]\"><TD>$More</td></tr>\n"; |
386 | } |
387 | echo "</table>"; /** End of message-list table */ |
388 | |
389 | do_hook("mailbox_index_after"); |
390 | } |
391 | |
392 | /* Displays the standard message list header. |
393 | * To finish the table, you need to do a "</table></table>"; |
394 | * $moveURL is the URL to submit the delete/move form to |
395 | * $mailbox is the current mailbox |
396 | * $sort is the current sorting method (-1 for no sorting available [searches]) |
397 | * $Message is a message that is centered on top of the list |
398 | * $More is a second line that is left aligned |
399 | */ |
400 | function mail_message_listing_beginning($imapConnection, $moveURL, |
401 | $mailbox = '', $sort = -1, $Message = '', $More = '') |
402 | { |
f9b3e5d9 |
403 | global $color, $index_order, $auto_expunge, $move_to_trash; |
14eb705c |
404 | |
405 | /** This is the beginning of the message list table. It wraps around all messages */ |
406 | echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0>"; |
407 | |
408 | if ($Message) |
409 | { |
410 | echo "<TR BGCOLOR=\"$color[4]\"><TD align=center>$Message</td></tr>\n"; |
411 | } |
412 | |
413 | if ($More) |
414 | { |
415 | echo "<TR BGCOLOR=\"$color[4]\"><TD>$More</td></tr>\n"; |
926da13e |
416 | } |
417 | |
68347a84 |
418 | /** The delete and move options */ |
f8f9bed9 |
419 | echo "<TR><TD BGCOLOR=\"$color[0]\">"; |
ed4332d1 |
420 | |
14eb705c |
421 | echo "\n\n\n<FORM name=messageList method=post action=\"$moveURL\">\n"; |
4f313fcf |
422 | echo "<TABLE BGCOLOR=\"$color[0]\" COLS=2 BORDER=0 cellpadding=0 cellspacing=0 width=100%>\n"; |
ed4332d1 |
423 | echo " <TR>\n"; |
98fe1e9f |
424 | echo " <TD WIDTH=60% ALIGN=LEFT VALIGN=CENTER>\n"; |
aae41ae9 |
425 | echo " <NOBR><SMALL>". _("Move selected to:") ."</SMALL>"; |
7ce342dc |
426 | echo " <TT><SMALL><SELECT NAME=\"targetMailbox\">"; |
427 | |
9f2215a1 |
428 | $boxes = sqimap_mailbox_list($imapConnection); |
7ce342dc |
429 | for ($i = 0; $i < count($boxes); $i++) { |
14eb705c |
430 | if ($boxes[$i]["flags"][0] != "noselect" && |
431 | $boxes[$i]["flags"][1] != "noselect" && |
432 | $boxes[$i]["flags"][2] != "noselect") { |
433 | $box = $boxes[$i]["unformatted"]; |
434 | $box2 = replace_spaces($boxes[$i]["formatted"]); |
435 | echo " <OPTION VALUE=\"$box\">$box2</option>\n"; |
0d455368 |
436 | } |
dd88d31f |
437 | } |
7ce342dc |
438 | echo " </SELECT></SMALL></TT>"; |
aae41ae9 |
439 | echo " <SMALL><INPUT TYPE=SUBMIT NAME=\"moveButton\" VALUE=\"". _("Move") ."\"></SMALL></NOBR>\n"; |
ed4332d1 |
440 | echo " </TD>\n"; |
7ce342dc |
441 | echo " <TD WIDTH=40% ALIGN=RIGHT>\n"; |
f9b3e5d9 |
442 | if (! $move_to_trash && ! $auto_expunge) { |
443 | echo " <NOBR><SMALL><INPUT TYPE=SUBMIT NAME=\"expungeButton\" VALUE=\"". _("Expunge") ."\"> ". _("mailbox") ."</SMALL></NOBR> \n"; |
444 | } |
aae41ae9 |
445 | echo " <NOBR><SMALL><INPUT TYPE=SUBMIT VALUE=\"". _("Delete") ."\"> ". _("checked messages") ."</SMALL></NOBR>\n"; |
14eb705c |
446 | echo " </TD>\n"; |
ed4332d1 |
447 | echo " </TR>\n"; |
448 | |
70b455e0 |
449 | echo "</TABLE>\n"; |
450 | do_hook("mailbox_form_before"); |
aa4c3749 |
451 | echo "</TD></TR>"; |
452 | |
f8f9bed9 |
453 | echo "<TR><TD BGCOLOR=\"$color[0]\">"; |
98fe1e9f |
454 | echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=1 BGCOLOR=\"$color[0]\">"; |
f8f9bed9 |
455 | echo "<TR BGCOLOR=\"$color[5]\" ALIGN=\"center\">"; |
be8e07f8 |
456 | |
74bb7ddc |
457 | $urlMailbox=urlencode($mailbox); |
458 | |
14eb705c |
459 | // Print the headers |
8e265988 |
460 | for ($i=1; $i <= count($index_order); $i++) { |
461 | switch ($index_order[$i]) { |
462 | case 1: # checkbox |
14eb705c |
463 | case 5: # flags |
8e265988 |
464 | echo " <TD WIDTH=1%><B> </B></TD>"; |
465 | break; |
14eb705c |
466 | |
8e265988 |
467 | case 2: # from |
14eb705c |
468 | if ($mailbox == $sent_folder) |
469 | echo " <TD WIDTH=30%><B>". _("To") ."</B>"; |
470 | else |
0d455368 |
471 | echo " <TD WIDTH=30%><B>". _("From") ."</B>"; |
8e265988 |
472 | |
473 | if ($sort == 2) |
474 | echo " <A HREF=\"right_main.php?newsort=3&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/up_pointer.gif\" BORDER=0></A></TD>\n"; |
f9b3e5d9 |
475 | elseif ($sort == 3) |
8e265988 |
476 | echo " <A HREF=\"right_main.php?newsort=2&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/down_pointer.gif\" BORDER=0></A></TD>\n"; |
f9b3e5d9 |
477 | elseif ($sort != -1) |
8e265988 |
478 | echo " <A HREF=\"right_main.php?newsort=3&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/sort_none.gif\" BORDER=0></A></TD>\n"; |
479 | break; |
14eb705c |
480 | |
8e265988 |
481 | case 3: # date |
482 | echo " <TD nowrap WIDTH=1%><B>". _("Date") ."</B>"; |
483 | if ($sort == 0) |
484 | echo " <A HREF=\"right_main.php?newsort=1&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/up_pointer.gif\" BORDER=0></A></TD>\n"; |
f9b3e5d9 |
485 | elseif ($sort == 1) |
0d455368 |
486 | echo " <A HREF=\"right_main.php?newsort=6&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/down_pointer.gif\" BORDER=0></A></TD>\n"; |
487 | elseif ($sort == 6) |
488 | echo " <A HREF=\"right_main.php?newsort=0&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/sort_none.gif\" BORDER=0></A></TD>\n"; |
f9b3e5d9 |
489 | elseif ($sort != -1) |
8e265988 |
490 | echo " <A HREF=\"right_main.php?newsort=0&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/sort_none.gif\" BORDER=0></A></TD>\n"; |
491 | break; |
14eb705c |
492 | |
8e265988 |
493 | case 4: # subject |
494 | echo " <TD WIDTH=%><B>". _("Subject") ."</B>\n"; |
495 | if ($sort == 4) |
496 | echo " <A HREF=\"right_main.php?newsort=5&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/up_pointer.gif\" BORDER=0></A></TD>\n"; |
f9b3e5d9 |
497 | elseif ($sort == 5) |
8e265988 |
498 | echo " <A HREF=\"right_main.php?newsort=4&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/down_pointer.gif\" BORDER=0></A></TD>\n"; |
f9b3e5d9 |
499 | elseif ($sort != -1) |
8e265988 |
500 | echo " <A HREF=\"right_main.php?newsort=5&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/sort_none.gif\" BORDER=0></A></TD>\n"; |
501 | break; |
14eb705c |
502 | |
8e265988 |
503 | case 6: # size |
fde32e3f |
504 | echo " <TD WIDTH=1%><b>" . _("Size")."</b></TD>\n"; |
8e265988 |
505 | break; |
506 | } |
507 | } |
14eb705c |
508 | echo "</TR>\n"; |
3302d0d4 |
509 | } |
26b6c99c |
510 | ?> |