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