mailbox_display.php 22 KB

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