}
// If Sent, prefix with To: but only if not Sent folder
if ($bHandleAsSent ^ $bSentFolder) {
- $senderName = _("To:") . ' ' . $senderName;
- $senderAddress = _("To:") . ' ' . $senderAddress;
+ $senderName = _("To") . ': ' . $senderName;
+ $senderAddress = _("To") . ': ' . $senderAddress;
}
// this is a column property which can apply to multiple columns. Do not use vars for one column
$sSubject = str_replace(' ', ' ', decodeHeader($sSubject));
$subject = processSubject($sSubject, $iIndent);
- echo html_tag( 'tr','','','','VALIGN="top"') . "\n";
+ echo html_tag( 'tr','','','','valign="top"') . "\n";
if (sizeof($index_order)) {
foreach ($index_order as $index_order_part) {
$aRes = get_thread_sort($imapConnection,$aMailbox['SEARCH'][$iSetIndx]);
if ($aRes === false) {
$error = '<b><small><center><font color=red>' .
- _("Thread sorting is not supported by your IMAP server.") . '<br />' .
- _("Please report this to the system administrator.").
- '</center></small></b>';
+ _("Thread sorting is not supported by your IMAP server.") . '<br />' .
+ _("Please contact your system administrator and report this error.") .
+ '</center></small></b>';
$aMailbox['SORT'] -= SQSORT_THREAD;
} else {
$aMailbox['UIDSET'][$iSetIndx] = $aRes[0];
$id = sqimap_get_sort_order($imapConnection, $sSortField, $bDirection, $aMailbox['SEARCH'][$iSetIndx]);
if ($id === false) {
$error = '<b><small><center><font color=red>' .
- _( "Server-side sorting is not supported by your IMAP server.") . '<br />' .
- _("Please report this to the system administrator.").
+ _("Server-side sorting is not supported by your IMAP server.") . '<br />' .
+ _("Please contact your system administrator and report this error.") .
'</center></small></b>';
} else {
$aMailbox['UIDSET'][$iSetIndx] = $id;
$paginator = ' '
) {
global $color, $show_flag_buttons, $PHP_SELF;
- global $lastTargetMailbox;
+ global $lastTargetMailbox, $boxes;
$php_self = $PHP_SELF;
echo '<form name="' . $form_name . '" method="post" action="'.$php_self.'">' ."\n"
. $moveFields;
-
+ $button_str = '';
+ // display flag buttons only if supported
+ if ($show_flag_buttons &&
+ in_array('\\flagged',$aMailbox['PERMANENTFLAGS'], true) ) {
+ $button_str .= getButton('submit', 'markUnflagged', _("Unflag"));
+ $button_str .= getButton('submit', 'markFlagged', _("Flag"));
+ $button_str .= " \n";
+ }
+ if (in_array('\\seen',$aMailbox['PERMANENTFLAGS'], true)) {
+ $button_str .= getButton('submit', 'markUnread', _("Unread"));
+ $button_str .= getButton('submit', 'markRead', _("Read"));
+ $button_str .= " \n";
+ }
+ $button_str .= getButton('submit', 'attache',_("Forward")) .
+ " \n";
+ if (in_array('\\deleted',$aMailbox['PERMANENTFLAGS'], true)) {
+ $button_str .= getButton('submit', 'delete',_("Delete"));
+ $button_str .= '<input type="checkbox" name="bypass_trash" />' . _("Bypass Trash");
+ $button_str .= " \n";
+ }
+ if (!$aMailbox['AUTO_EXPUNGE'] && $aMailbox['RIGHTS'] != 'READ-ONLY') {
+ $button_str .= getButton('submit', 'expungeButton',_("Expunge")) .' ' . _("mailbox") . "\n";
+ $button_str .= ' ';
+ }
?>
<table width="100%" cellpadding="1" cellspacing="0" style="border: 1px solid <?php echo $color[0]; ?>">
<tr>
<td>
<table bgcolor="<?php echo $color[4]; ?>" border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
- <td align="left"><small><?php echo $paginator . $thread_link_str; ?></small></td>
- <td align="center"></td>
- <td align="right"><small><?php echo $msg_cnt_str; ?></small></td>
+ <?php echo html_tag('td', '<small>' . $paginator . $thread_link_str . '</small>', 'left') . "\n"; ?>
+ <?php echo html_tag('td', '', 'center') . "\n"; ?>
+ <?php echo html_tag('td', '<small>' . $msg_cnt_str . '</small>', 'right') . "\n"; ?>
</tr>
</table>
</td>
<td>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
- <td align="left">
- <small><?php
-
- // display flag buttons only if supported
- if ($show_flag_buttons &&
- in_array('\\flagged',$aMailbox['PERMANENTFLAGS'], true) ) {
- echo getButton('SUBMIT', 'markUnflagged',_("Unflag"));
- echo getButton('SUBMIT', 'markFlagged',_("Flag"));
- echo ' ';
- }
- if (in_array('\\seen',$aMailbox['PERMANENTFLAGS'], true)) {
- echo getButton('SUBMIT', 'markUnread',_("Unread"));
- echo getButton('SUBMIT', 'markRead',_("Read"));
- echo ' ';
- }
-
- echo getButton('SUBMIT', 'attache',_("Forward"));
- echo ' ';
- if (in_array('\\deleted',$aMailbox['PERMANENTFLAGS'], true)) {
- echo getButton('SUBMIT', 'delete',_("Delete"));
- echo '<input type="checkbox" name="bypass_trash" />' . _("Bypass Trash");
- echo ' ';
- }
- if (!$aMailbox['AUTO_EXPUNGE'] && $aMailbox['RIGHTS'] != 'READ-ONLY') {
- echo getButton('SUBMIT', 'expungeButton',_("Expunge")) .' ' . _("mailbox") . "\n";
- echo ' ';
- }
- do_hook('mailbox_display_buttons');
- ?></small>
+ <?php echo html_tag('td', '', 'left') . "\n"; ?>
+ <small>
+ <?php echo $button_str; ?>
+ <?php do_hook('mailbox_display_buttons'); ?>
+ </small>
</td>
<?php
if (in_array('\\deleted',$aMailbox['PERMANENTFLAGS'], true)) {
- echo '<td align="right">
- <small>';
- echo ' <small> <tt><select name="targetMailbox">';
- echo sqimap_mailbox_option_list($imapConnection, array(strtolower($lastTargetMailbox)), 0, $boxes);
- echo ' </select></tt> ';
- echo getButton('SUBMIT', 'moveButton',_("Move")) . "\n
- </small>";
+ ?>
+ <?php echo html_tag('td', '', 'right'); ?>
+ <small> <tt>
+ <select name="targetMailbox">
+ <?php echo sqimap_mailbox_option_list($imapConnection, array(strtolower($lastTargetMailbox)), 0, $boxes); ?>
+ </select></tt>
+ <?php echo getButton('submit', 'moveButton',_("Move")); ?>
+ </small>
+ <?php
}
?>
</td>
</td>
</tr>
</table>
-
<?php
do_hook('mailbox_form_before');
}
<td>
<table bgcolor="<?php echo $color[4]; ?>" border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
- <td align="left"><small><?php echo $paginator_str; ?></small></td>
- <td align="right"><small><?php echo $msg_cnt_str; ?></small></td>
+ <?php echo html_tag('td', '<small>' . $paginator_str . '</small>', 'left'); ?>
+ <?php echo html_tag('td', '<small>' . $msg_cnt_str . '</small>', 'right'); ?>
</tr>
</table>
</td>
$result = sprintf(_("Viewing Messages: %s to %s (%s total)"),
'<b>'.$start_msg.'</b>', '<b>'.$end_msg.'</b>', $num_msgs);
} else if ($start_msg == $end_msg) {
- $result = sprintf(_("Viewing Message: %s (1 total)"), '<b>'.$start_msg.'</b>');
+ $result = sprintf(_("Viewing Message: %s (%s total)"), '<b>'.$start_msg.'</b>', $num_msgs);
} else {
$result = '<br />';
}
/**
* This function computes the paginator string.
*
-* @param string $box
-* @param integer $start_msg
-* @param integer $end_msg
-* @param integer $num_msgs // total number of messages
-* @param integer $limit // number of messages to show on one page
-* @param integer $sort
+* @param string $box mailbox name
+* @param integer $iOffset offset in total number of messages
+* @param integer $iTotal total number of messages
+* @param integer $iLimit maximum number of messages to show on a page
+* @param bool $bShowAll show all messages at once (non paginate mode)
+* @return string $result paginate string with links to pages
*/
-//function get_paginator_str($box, $start_msg, $end_msg, $num_msgs,
-// $show_num, $sort) {
function get_paginator_str($box, $iOffset, $iTotal, $iLimit, $bShowAll) {
-
- global $username, $data_dir, $color;
+ global $username, $data_dir;
sqgetGlobalVar('PHP_SELF',$php_self,SQ_SERVER);
/* Initialize paginator string chunks. */
return $subject;
if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
- function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
- return $languages[$squirrelmail_language]['XTRA_CODE']('strimwidth', $subject, $trim_val);
+ function_exists($languages[$squirrelmail_language]['XTRA_CODE'] . '_strimwidth')) {
+ return call_user_func($languages[$squirrelmail_language]['XTRA_CODE'] . '_strimwidth', $subject, $trim_val);
}
return substr_replace($subject, '...', $trim_val);
$aDeleted = array();
foreach ($aUpdatedMsgs as $iUid => $aMsg) {
if (isset($aMsg['FLAGS'])) {
- $aMailbox['MSG_HEADERS'][$iUid]['FLAGS'] = $aMsg['FLAGS'];
+ /**
+ * Only update the cached headers if the header is
+ * cached.
+ */
+ if (isset($aMailbox['MSG_HEADERS'][$iUid])) {
+ $aMailbox['MSG_HEADERS'][$iUid]['FLAGS'] = $aMsg['FLAGS'];
+ }
/**
* Count the messages with the \Delete flag set so we can determine
* if the number of expunged messages equals the number of flagged
unset($aMailbox['MSG_HEADERS'][$iUid]);
}
$aMailbox['UIDSET'][$aMailbox['SETINDEX']] = array_keys($aUidSetDummy);
- // update EXISTS info
- $aMailbox['EXISTS'] -= $iExpungedMessages;
}
}
+ // update EXISTS info
+ if ($iExpungedMessages) {
+ $aMailbox['EXISTS'] -= (int) $iExpungedMessages;
+ }
// Change the startMessage number if the mailbox was changed
if (($aMailbox['PAGEOFFSET']+$iExpungedMessages-1) >= $aMailbox['EXISTS']) {
$aMailbox['PAGEOFFSET'] = ($aMailbox['PAGEOFFSET'] > $aMailbox['LIMIT']) ?
return $composesession;
}
-?>
+// vim: et ts=4
+?>
\ No newline at end of file