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