mailbox_display.php 22 KB

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