function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage) {
global $color, $msgs, $msort;
+ global $sent_folder;
+
$msg = $msgs[$key];
$senderName = $msg["FROM"];
if ($msg["FLAG_FLAGGED"] == true) { $flag = "<font color=$color[2]>"; $flag_end = "</font>"; }
if ($msg["FLAG_SEEN"] == false) { $bold = "<b>"; $bold_end = "</b>"; }
- if ($msg["FLAG_ANSWERED"] == true) { $ans = " [A]"; }
+ if ($mailbox == $sent_folder) { $italic = "<i>"; $italic_end = "</i>"; }
echo " <td width=1% align=center><input type=checkbox name=\"msg[$t]\" value=".$msg["ID"]."></TD>\n";
- echo " <td width=30%>$bold$flag$senderName$flag_end$bold_end</td>\n";
+ echo " <td width=30%>$italic$bold$flag$senderName$flag_end$bold_end$italic_end</td>\n";
echo " <td nowrap width=1%><center>$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end</center></td>\n";
- echo " <td width=%>$bold<a href=\"read_body.php?mailbox=$urlMailbox&passed_id=".$msg["ID"]."&startMessage=$startMessage&show_more=0\">$flag$subject$flag_end</a>$ans$bold_end</td>\n";
+ if ($msg["FLAG_ANSWERED"] == true) echo " <td width=1%><b><small>A</small></b></td>";
+ else echo " <td width=1%> </td>";
+ echo " <td width=%>$bold<a href=\"read_body.php?mailbox=$urlMailbox&passed_id=".$msg["ID"]."&startMessage=$startMessage&show_more=0\">$flag$subject$flag_end</a>$bold_end</td>\n";
echo "</tr>\n";
}
**/
function showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color,$show_num, $use_cache) {
global $msgs, $msort;
- include ("../config/config.php");
+ global $sent_folder;
if (!$use_cache) {
if ($numMessages >= 1) {
for ($q = 0; $q < $numMessages; $q++) {
- sqimap_get_small_header ($imapConnection, $q+1, $f, $s, $d);
- $from[$q] = $f;
- $date[$q] = $d;
- $subject[$q] = $s;
+ if ($mailbox == $sent_folder)
+ $hdr = sqimap_get_small_header ($imapConnection, $q+1, true);
+ else
+ $hdr = sqimap_get_small_header ($imapConnection, $q+1, false);
+
+ $from[$q] = $hdr->from;
+ $date[$q] = $hdr->date;
+ $subject[$q] = $hdr->subject;
+
$flags[$q] = sqimap_get_flags ($imapConnection, $q+1);
}
}
// generic function to convert the msgs array into an HTML table
function displayMessageArray($imapConnection, $numMessages, $startMessage, &$msgs, $msort, $mailbox, $sort, $color,$show_num) {
- global $folder_prefix;
+ global $folder_prefix, $sent_folder;
+ global $imapServerAddress;
// do a check to see if the config stuff has already been included or not
- if (!isset($imapServerAddress))
- include("../config/config.php");
+// if (!isset($imapServerAddress))
+// include("../config/config.php");
// if cache isn't already set, do it now
if (!session_is_registered("msgs"))
echo "<CENTER>". _("Viewing messages ") ."<B>$startMessage</B>". _(" to ") ."<B>$endMessage</B> ($numMessages total)</CENTER>\n";
echo "</TD></TR>\n";
} else if ($startMessage == $endMessage) {
- echo "<TR BGCOLOR=\"$color[4]>\"TD>";
+ echo "<TR BGCOLOR=\"$color[4]\"><TD>";
echo "<CENTER>". _("Viewing message ") ."<B>$startMessage</B> ($numMessages ". _("total") .")</CENTER>\n";
echo "</TD></TR>\n";
}
echo "<TR BGCOLOR=\"$color[5]\" ALIGN=\"center\">";
echo " <TD WIDTH=1%><B> </B></TD>";
/** FROM HEADER **/
- echo " <TD WIDTH=30%><B>". _("From") ."</B>";
+ if ($mailbox == $sent_folder)
+ echo " <TD WIDTH=30%><B>". _("To") ."</B>";
+ else
+ echo " <TD WIDTH=30%><B>". _("From") ."</B>";
+
if ($sort == 2)
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";
else if ($sort == 3)
echo " <A HREF=\"right_main.php?newsort=0&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/down_pointer.gif\" BORDER=0></A></TD>\n";
else
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";
+ echo " <TD WIDTH=1%> </TD>\n";
/** SUBJECT HEADER **/
echo " <TD WIDTH=%><B>". _("Subject") ."</B>\n";
if ($sort == 4)
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";
else
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";
+
echo "</TR>";
// loop through and display the info for each message.
$t = 0; // $t is used for the checkbox number
if ($numMessages == 0) { // if there's no messages in this folder
- echo "<TR><TD BGCOLOR=\"$color[4]\" COLSPAN=4><CENTER><BR><B>". _("THIS FOLDER IS EMPTY") ."</B><BR> </CENTER></TD></TR>";
+ echo "<TR><TD BGCOLOR=\"$color[4]\" COLSPAN=5><CENTER><BR><B>". _("THIS FOLDER IS EMPTY") ."</B><BR> </CENTER></TD></TR>";
} else if ($startMessage == $endMessage) { // if there's only one message in the box, handle it different.
$i = $startMessage - 1;
reset($msort);