function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox,
$start_msg, $where, $what) {
global $checkall,
- $color, $msgs, $msort, $td_str, $msg,
+ $color, $msgs, $msort, $td_str, $msg,
$default_use_priority,
$message_highlight_list,
$index_order,
else
$bHandleAsSent = $bSentFolder;
// If this is a Sent message, display To address instead of From
- if ($bHandleAsSent)
+ if ($bHandleAsSent)
$msg['FROM'] = $msg['TO'];
// Passing 1 below results in only 1 address being parsed, thus defeating the following code
$msg['FROM'] = parseAddress($msg['FROM']/*,1*/);
$headertest = strtolower(decodeHeader($msg[$match_type], true, false));
if (strstr('^^' . $headertest, $high_val)) {
$hlt_color = $message_highlight_list_part['color'];
- break 3;
+ break 3;
}
break;
}
switch ($index_order_part) {
case 1: /* checkbox */
echo html_tag( 'td',
- addCheckBox("msg[$t]", $checkall, $msg['ID']),
+ addCheckBox("msg[$t]", $checkall, $msg['ID']),
'center',
$hlt_color );
break;
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
- <?php mail_message_listing_beginning($imapConnection, $mbxresponse, $mailbox, $sort,
+ <?php mail_message_listing_beginning($imapConnection, $mbxresponse, $mailbox, $sort,
$msg_cnt_str, $paginator_str, $start_msg); ?>
</td>
</tr>
<table width="100%" cellpadding="1" cellspacing="0" align="center" border="0" bgcolor="<?php echo $color[5]; ?>">
<tr>
<td>
- <?php
+ <?php
printHeader($mailbox, $srt, $color, !$thread_sort_messages, $start_msg);
- displayMessageArray($imapConnection, $num_msgs, $start_msg,
+ displayMessageArray($imapConnection, $num_msgs, $start_msg,
$msort, $mailbox, $sort, $color, $show_num,0,0);
?>
</td>
</tr>
</table>
<?php
- mail_message_listing_end($num_msgs, $paginator_str, $msg_cnt_str, $color);
+ mail_message_listing_end($num_msgs, $paginator_str, $msg_cnt_str, $color);
?>
</td>
</tr>
* To finish the table, you need to do a "</table></table>";
*
* @param mixed $imapConnection
- * @param array $mbxresponse the array with the results of SELECT against the current mailbox
+ * @param array $mbxresponse the array with the results of SELECT against the current mailbox
* @param string $mailbox the current mailbox
* @param mixed $sort the current sorting method (-1 for no sorting available [searches])
* @param mixed $msg_cnt_str
<tr>
<td align="left">
<small><?php
-
+
// display flag buttons only if supported
- if ($show_flag_buttons && $mbxresponse != NULL &&
- strpos($mbxresponse['PERMANENTFLAGS'], '\\Flagged') !== FALSE) {
+ if ($show_flag_buttons && $mbxresponse != NULL &&
+ array_search('\\flagged',$mbxresponse['PERMANENTFLAGS'], true) !== FALSE) {
echo getButton('SUBMIT', 'markUnflagged',_("Unflag"));
echo getButton('SUBMIT', 'markFlagged',_("Flag"));
echo ' ';
}
- echo getButton('SUBMIT', 'markUnread',_("Unread"));
- echo getButton('SUBMIT', 'markRead',_("Read"));
- echo ' ';
+ if (array_search('\\seen',$mbxresponse['PERMANENTFLAGS'], true) !== FALSE) {
+ echo getButton('SUBMIT', 'markUnread',_("Unread"));
+ echo getButton('SUBMIT', 'markRead',_("Read"));
+ echo ' ';
+ }
echo getButton('SUBMIT', 'attache',_("Forward"));
echo ' ';
- echo getButton('SUBMIT', 'delete',_("Delete"));
- echo '<input type="checkbox" name="bypass_trash" />' . _("Bypass Trash");
- echo ' ';
- if (!$auto_expunge) {
+ if (array_search('\\deleted',$mbxresponse['PERMANENTFLAGS'], true) !== FALSE) {
+ echo getButton('SUBMIT', 'delete',_("Delete"));
+ echo '<input type="checkbox" name="bypass_trash" />' . _("Bypass Trash");
+ echo ' ';
+ }
+ if (!$auto_expunge && $mbxresponse['RIGHTS'] != 'READ-ONLY') {
echo getButton('SUBMIT', 'expungeButton',_("Expunge")) .' ' . _("mailbox") . "\n";
echo ' ';
}
do_hook('mailbox_display_buttons');
?></small>
</td>
- <td align="right">
- <small><?php
+ <?php
+ if (array_search('\\deleted',$mbxresponse['PERMANENTFLAGS'], true) !== FALSE) {
+ echo '<td align="right">
+ <small>';
//echo $thread_link_str; //previous behaviour
- getMbxList($imapConnection);
- echo getButton('SUBMIT', 'moveButton',_("Move")) . "\n";
- ?></small>
+ getMbxList($imapConnection);
+ echo getButton('SUBMIT', 'moveButton',_("Move")) . "\n
+ </small>";
+ }
+ ?>
</td>
</tr>
</table>
- </td>
+ </td>
</tr>
</table>
/* space between list and footer */
?>
<tr><td height="5" bgcolor="<?php echo $color[4]; ?>" colspan="1"></td></tr>
- <tr>
+ <tr>
<td>
<table width="100%" cellpadding="1" cellspacing="0" style="border: 1px solid <?php echo $color[0]; ?>">
<tr>
$widths = array(1=>1,2=>25,3=>5,4=>0,5=>1,6=>5);
$subjectwidth = 100;
foreach($index_order as $item) {
- $subjectwidth -= $widths[$item];
+ $subjectwidth -= $widths[$item];
}
foreach ($index_order as $item) {
/* Compute the 'show all' string. */
$all_str = "<a href=\"right_main.php?PG_SHOWALL=1"
. "&use_mailbox_cache=$use&startMessage=1&mailbox=$box\" "
- . ">" . _("Show All") . '</a>';
+ . ">" . _("Show All") . '</a>';
}
$result .= ($pg_str != '' ? $spc . '['.$spc.$pg_str.']' . $spc : '');
* see if this is entities-encoded string
* If so, Iterate through the whole string, find out
* the real number of characters, and if more
- * than $trim_at, substr with an updated trim value.
+ * than $trim_at, substr with an updated trim value.
*/
$trim_val = $trim_at;
$ent_offset = 0;
* FIXME: Undocumented function
*
* @param mixed $imapConnection
- * @param mixed $boxes
+ * @param mixed $boxes
*/
function getMbxList($imapConnection, $boxes = 0) {
global $lastTargetMailbox;
echo ' <small> <tt><select name="targetMailbox">';
- echo sqimap_mailbox_option_list($imapConnection, array(strtolower($lastTargetMailbox)), 0, $boxes);
+ echo sqimap_mailbox_option_list($imapConnection, array(strtolower($lastTargetMailbox)), 0, $boxes);
echo ' </select></tt> ';
}
*/
function handleAsSent($mailbox) {
global $handleAsSent_result;
-
+
/* First check if this is the sent or draft folder. */
$handleAsSent_result = isSentMailbox($mailbox) || isDraftMailbox($mailbox);