<?php
-
/**
* imap_mailbox.php
*
/**
* Mailboxes class
- *
- * FIXME. This class should be extracted and placed in a separate file that
+ *
+ * FIXME. This class should be extracted and placed in a separate file that
* can be included before we start the session. That makes caching of the tree
- * possible. On a refresh mailboxes from left_main.php the only function that
- * should be called is the sqimap_get_status_mbx_tree. In case of subscribe
- * / rename / delete / new we have to create methods for adding/changing the
+ * possible. On a refresh mailboxes from left_main.php the only function that
+ * should be called is the sqimap_get_status_mbx_tree. In case of subscribe
+ * / rename / delete / new we have to create methods for adding/changing the
* mailbox in the mbx_tree without the need for a refresh.
* @package squirrelmail
*/
class mailboxes {
var $mailboxname_full = '', $mailboxname_sub= '', $is_noselect = false, $is_noinferiors = false,
$is_special = false, $is_root = false, $is_inbox = false, $is_sent = false,
- $is_trash = false, $is_draft = false, $mbxs = array(),
+ $is_trash = false, $is_draft = false, $mbxs = array(),
$unseen = false, $total = false;
function addMbx($mbx, $delimiter, $start, $specialfirst) {
} else {
$bcmp = '2' . $b->mailboxname_full;
}
- return strnatcasecmp($acmp, $bcmp);
+ return strnatcasecmp($acmp, $bcmp);
}
function compact_mailboxes_response($ary)
{
/*
* Workaround for mailboxes returned as literal
- * FIXME : Doesn't work if the mailbox name is multiple lines
+ * FIXME : Doesn't work if the mailbox name is multiple lines
* (larger then fgets buffer)
*/
for ($i = 0, $iCnt=count($ary); $i < $iCnt; $i++) {
return( $ret );
}
-/**
+/**
* Check if $subbox is below the specified $parentbox
*/
function isBoxBelow( $subbox, $parentbox ) {
global $delimiter;
- /*
- * Eliminate the obvious mismatch, where the
+ /*
+ * Eliminate the obvious mismatch, where the
* subfolder path is shorter than that of the potential parent
*/
if ( strlen($subbox) < strlen($parentbox) ) {
/**
* Expunge specified message, updated $msgs and $msort
- *
- * Until Marc and I come up with a better way to maintain
- * these stupid arrays, we'll use this wrapper function to
+ *
+ * Until Marc and I come up with a better way to maintain
+ * these stupid arrays, we'll use this wrapper function to
* remove the message with the matching UID .. the order
* won't be changed - the array element for the message
* will just be removed.
*/
function sqimap_mailbox_expunge_dmn($message_id, $aMbxResponse, &$server_sort_array)
{
- global $msgs, $msort, $sort, $imapConnection,
- $mailbox, $auto_expunge,
+ global $msgs, $msort, $sort, $imapConnection,
+ $mailbox, $auto_expunge,
$sort, $allow_server_sort, $thread_sort_messages, $allow_thread_sort,
$username, $data_dir;
$cnt = 0;
}
// Got to grab this out of prefs, since it isn't saved from mailbox_view.php
if ($allow_thread_sort) {
- $thread_sort_messages = getPref($data_dir, $username, "thread_$mailbox",0);
+ $thread_sort_messages = getPref($data_dir, $username, "thread_$mailbox",0);
}
for ($i = 0; $i < count($msort); $i++) {
if ($msgs[$i]['ID'] == $message_id) {
- break;
+ break;
}
}
-
+
if ( isset($msgs) ) {
unset($msgs[$i]);
$msgs = array_values($msgs);
if ( $allow_thread_sort && $thread_sort_messages ) {
$server_sort_array = get_thread_sort($imapConnection);
} elseif ( $allow_server_sort ) {
- if (is_array($server_sort_array)) {
+ if (is_array($server_sort_array)) {
$key = array_search($message_id,$server_sort_array,true);
if ($key !== false) {
unset($server_sort_array[$key]);
} else {
if (preg_match("/PERMANENTFLAGS(.*)/i",$read[$i], $regs)) {
$regs[1]=trim(preg_replace ( array ("/\(/","/\)/","/\]/") ,'', $regs[1])) ;
- $result['PERMANENTFLAGS'] = $regs[1];
+ $result['PERMANENTFLAGS'] = explode(' ',strtolower($regs[1]));
} else if (preg_match("/FLAGS(.*)/i",$read[$i], $regs)) {
$regs[1]=trim(preg_replace ( array ("/\(/","/\)/") ,'', $regs[1])) ;
- $result['FLAGS'] = $regs[1];
+ $result['FLAGS'] = explode(' ',strtolower($regs[1]));
}
}
}
+ if (!isset($result['PERMANENTFLAGS'])) {
+ $result['PERMANENTFLAGS'] = $result['FLAGS'];
+ }
if (preg_match('/^\[(.+)\]/',$message, $regs)) {
- $result['RIGHTS']=$regs[1];
+ $result['RIGHTS']=strtoupper($regs[1]);
}
return $result;
$boxesall[$g]['flags'] = array();
if (isset($line[$g])) {
ereg("\(([^)]*)\)",$line[$g],$regs);
- // FIXME Flags do contain the \ character. \NoSelect \NoInferiors
+ // FIXME Flags do contain the \ character. \NoSelect \NoInferiors
// and $MDNSent <= last one doesn't have the \
// It's better to follow RFC3501 instead of using our own naming.
$flags = trim(strtolower(str_replace('\\', '',$regs[1])));
* \NoSelect and \NoInferiors
* $use_long_format - override folder display preference and always show full folder name.
*/
-function sqimap_mailbox_option_list($imap_stream, $show_selected = 0, $folder_skip = 0, $boxes = 0,
+function sqimap_mailbox_option_list($imap_stream, $show_selected = 0, $folder_skip = 0, $boxes = 0,
$flag = 'noselect', $use_long_format = false ) {
global $username, $data_dir;
$mbox_options = '';
if ($folder_skip != 0 && in_array($box, $folder_skip) ) {
continue;
}
- $lowerbox = strtolower($box);
+ $lowerbox = strtolower($box);
// mailboxes are casesensitive => inbox.sent != inbox.Sent
// nevermind, to many dependencies this should be fixed!
-
+
if (strtolower($box) == 'inbox') { // inbox is special and not casesensitive
$box2 = _("INBOX");
- } else {
+ } else {
switch ($shorten_box_names)
{
case 2: /* delimited, style = 2 */
}
/**
- * Returns sorted mailbox lists in several different ways.
+ * Returns sorted mailbox lists in several different ways.
* See comment on sqimap_mailbox_parse() for info about the returned array.
*/
$lsub = 'LIST (SUBSCRIBED)';
} else {
$lsub = 'LSUB';
- }
-
+ }
+
if ($noselect_fix_enable) {
-
+
$lsub_args = "$lsub \"$folder_prefix\" \"*%\"";
} else {
$lsub_args = "$lsub \"$folder_prefix\" \"*\"";
/* LSUB array */
$lsub_ary = sqimap_run_command ($imap_stream, $lsub_args,
true, $response, $message);
- $lsub_ary = compact_mailboxes_response($lsub_ary);
+ $lsub_ary = compact_mailboxes_response($lsub_ary);
$sorted_lsub_ary = array();
for ($i = 0, $cnt = count($lsub_ary);$i < $cnt; $i++) {
$read = sqimap_run_command ($imap_stream, 'LIST "" ' . sqimap_encode_mailbox_name($mbx),
true, $response, $message);
-
+
$read = compact_mailboxes_response($read);
-
+
if (isset($read[0])) {
$sorted_list_ary[$i] = $read[0];
} else {
if (preg_match("/^\*\s+LSUB.*\s\"?INBOX\"?[^(\/\.)].*$/i",$lsub_ary[$i])) {
$lsub_ary[$i] = strtoupper($lsub_ary[$i]);
// in case of an unsubscribed inbox an imap server can
- // return the inbox in the lsub results with a \NoSelect
+ // return the inbox in the lsub results with a \NoSelect
// flag.
if (!preg_match("/\*\s+LSUB\s+\(.*\\\\NoSelect.*\).*/i",$lsub_ary[$i])) {
$has_inbox = true;
// remove the result and request it again with a list
// response at a later stage.
unset($lsub_ary[$i]);
- // re-index the array otherwise the addition of the LIST
+ // re-index the array otherwise the addition of the LIST
// response will fail in PHP 4.1.2 and probably other older versions
$lsub_ary = array_values($lsub_ary);
}
}
/*
- * Section about removing the last element was removed
+ * Section about removing the last element was removed
* We don't return "* OK" anymore from sqimap_read_data
*/
$mbx = find_mailbox_name($lsub_ary[$i]);
// only do the noselect test if !uw, is checked later. FIX ME see conf.pl setting
- if ($imap_server_type != "uw") {
+ if ($imap_server_type != "uw") {
$noselect = check_is_noselect($lsub_ary[$i]);
$noinferiors = check_is_noinferiors($lsub_ary[$i]);
}
if (substr($mbx, -1) == $delimiter) {
$mbx = substr($mbx, 0, strlen($mbx) - 1);
}
- $sorted_lsub_ary[] = array ('mbx' => $mbx, 'noselect' => $noselect, 'noinferiors' => $noinferiors);
+ $sorted_lsub_ary[] = array ('mbx' => $mbx, 'noselect' => $noselect, 'noinferiors' => $noinferiors);
}
// FIX ME this requires a config setting inside conf.pl instead of checking on server type
if ($imap_server_type == "uw") {
$mbx = stripslashes($aMbx['mbx']);
sqimap_prepare_pipelined_query('LIST "" ' . sqimap_encode_mailbox_name($mbx), $tag, $aQuery, false);
$aTag[$tag] = $mbx;
- }
+ }
$sorted_lsub_ary = array();
// execute all the queries at once
$aResponse = sqimap_run_pipelined_command ($imap_stream, $aQuery, false, $aServerResponse, $aServerMessage);
$mbx = new mailboxes();
$mailbox = $mbx_ary[$i]['mbx'];
- /*
+ /*
sent subfolders messes up using existing code as subfolders
were marked, but the parents were ordered somewhere else in
the list, despite having "special folders at top" option set.
$mbx->is_special |= ($mbx->is_draft = isDraftMailbox($mailbox));
if (!$mbx->is_special)
$mbx->is_special = boolean_hook_function('special_mailbox', $mailbox, 1);
-
+
if (isset($mbx_ary[$i]['unseen'])) {
$mbx->unseen = $mbx_ary[$i]['unseen'];
}
sqimap_tree_to_ref_array($mbx_tree->mbxs[$i],$aMbxs);
}
}
-}
+}
function sqimap_get_status_mbx_tree($imap_stream,&$mbx_tree) {
global $unseen_notify, $unseen_type, $trash_folder,$move_to_trash;
$oMbx =& $aMbxs[$i];
if (strtoupper($oMbx->mailboxname_full) == 'INBOX' ||
($move_to_trash && $oMbx->mailboxname_full == $trash_folder)) {
- if ($unseen_type == 2 ||
+ if ($unseen_type == 2 ||
($oMbx->mailboxname_full == $trash_folder && $move_to_trash)) {
$aStatus = sqimap_status_messages($imap_stream,$oMbx->mailboxname_full);
$oMbx->unseen = $aStatus['UNSEEN'];
}
}
}
- }
-}
+ }
+}
?>
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);
* @return the index of the next valid message from the array
*/
function findNextMessage($passed_id) {
- global $msort, $msgs, $sort,
+ global $msort, $msgs, $sort,
$thread_sort_messages, $allow_server_sort,
$server_sort_array;
if (!is_array($server_sort_array)) {
break;
}
$result = $server_sort_array[$key + 1];
- break;
+ break;
}
}
} else {
* Displays a link to a page where the message is displayed more
* "printer friendly".
* @param string $mailbox Name of current mailbox
- * @param int $passed_id
+ * @param int $passed_id
*/
function printer_friendly_link($mailbox, $passed_id, $passed_ent_id) {
global $javascript_on, $color;
return $result;
}
-function ServerMDNSupport($read) {
- /* escaping $ doesn't work -> \x36 */
- $ret = preg_match('/(\x36MDNSent|\\\\\*)/i', $read);
- return $ret;
+function ServerMDNSupport($aFlags) {
+ /* escaping $ doesn't work -> \x36 */
+ return (array_search('$mdnsent',$aFlags,true) !== false ||
+ array_search('\\*',$aFlags,true) !== false) ? true : false;
+ //$ret = preg_match('/(\x36MDNSent|\\\\\*)/i', $read);
+ //return $ret;
}
function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
- global $username, $attachment_dir,
+ global $username, $attachment_dir,
$version, $attachments, $squirrelmail_language, $default_charset,
$languages, $useSendmail, $domain, $sent_folder,
$popuser, $data_dir, $username;
sprintf( _("Was displayed on %s"), $now );
$special_encoding = '';
- if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
+ if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
$body = $languages[$squirrelmail_language]['XTRA_CODE']('encode', $body);
if (strtolower($default_charset) == 'iso-2022-jp') {
function ToggleMDNflag ($set ,$imapConnection, $mailbox, $passed_id) {
$sg = $set?'+':'-';
$cmd = 'STORE ' . $passed_id . ' ' . $sg . 'FLAGS ($MDNSent)';
- $read = sqimap_run_command ($imapConnection, $cmd, true, $response,
+ $read = sqimap_run_command ($imapConnection, $cmd, true, $response,
$readmessage, TRUE);
}
return $string;
}
-function formatEnvheader($mailbox, $passed_id, $passed_ent_id, $message,
+function formatEnvheader($mailbox, $passed_id, $passed_ent_id, $message,
$color, $FirstTimeSee) {
global $msn_user_support, $default_use_mdn, $default_use_priority,
$show_xmailer_default, $mdn_user_support, $PHP_SELF, $javascript_on,
if ($message->is_mdnsent) {
$env[_("Read receipt")] = _("sent");
} else {
- $env[_("Read receipt")] = _("requested");
- if (!(handleAsSent($mailbox) ||
+ $env[_("Read receipt")] = _("requested");
+ if (!(handleAsSent($mailbox) ||
$message->is_deleted ||
$passed_ent_id)) {
$mdn_url = $PHP_SELF . '&sendreceipt=1';
}
/**
- * Format message toolbar
- *
+ * Format message toolbar
+ *
* @param string $mailbox Name of current mailbox
* @param int $passed_id UID of current message
* @param int $passed_ent_id Id of entity within message
*/
function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_response, $nav_on_top = TRUE) {
global $base_uri, $draft_folder, $where, $what, $color, $sort,
- $startMessage, $PHP_SELF, $save_as_draft,
+ $startMessage, $PHP_SELF, $save_as_draft,
$enable_forward_as_attachment, $imapConnection, $lastTargetMailbox,
$data_dir, $username, $delete_prev_next_display,
$compose_new_win, $javascript_on;
// Only bother with Delete & Prev and Delete & Next IF
// top display is enabled.
- if ( $delete_prev_next_display == 1 ) {
+ if ( $delete_prev_next_display == 1 &&
+ array_search('\\deleted', $mbx_response['PERMANENTFLAGS'],true) !== false) {
$del_prev_link = _("Delete & Prev");
if ($prev >= 0) {
$uri = $base_uri . 'src/read_body.php?passed_id='.$prev.
'&mailbox='.$urlMailbox.'&sort='.$sort.
'&startMessage='.$startMessage.'&show_more=0'.
'&delete_id='.$passed_id;
- $del_prev_link = '<a href="'.$uri.'">'.$del_prev_link.'</a>';
+ $del_prev_link = '<a href="'.$uri.'">'.$del_prev_link.'</a>';
}
$del_next_link = _("Delete & Next");
'&mailbox=' . $urlMailbox .
'&startMessage=' . $startMessage .
(isset($passed_ent_id) ? '&passed_ent_id='.$passed_ent_id : '');
-
- // Start form for reply/reply all/forward..
+
+ // Start form for reply/reply all/forward..
$target = '';
$on_click='';
$method='method="post" ';
$menu_row .= '</form> ';
+ if (array_search('\\deleted', $mbx_response['PERMANENTFLAGS'],true) !== false) {
// Form for deletion
- $delete_url = $base_uri . 'src/delete_message.php?mailbox=' . $urlMailbox;
- $menu_row .= '<form action="'.$delete_url.'" method="post" style="display: inline">';
+ $delete_url = $base_uri . 'src/delete_message.php?mailbox=' . $urlMailbox;
+ $menu_row .= '<form action="'.$delete_url.'" method="post" style="display: inline">';
- if (!(isset($passed_ent_id) && $passed_ent_id)) {
- $menu_row .= addHidden('message', $passed_id);
+ if (!(isset($passed_ent_id) && $passed_ent_id)) {
+ $menu_row .= addHidden('message', $passed_id);
- if ($where && $what) {
- $menu_row .= addHidden('where', $where);
- $menu_row .= addHidden('what', $what);
- } else {
- $menu_row .= addHidden('sort', $sort);
- $menu_row .= addHidden('startMessage', $startMessage);
+ if ($where && $what) {
+ $menu_row .= addHidden('where', $where);
+ $menu_row .= addHidden('what', $what);
+ } else {
+ $menu_row .= addHidden('sort', $sort);
+ $menu_row .= addHidden('startMessage', $startMessage);
+ }
+ $menu_row .= getButton('SUBMIT', 'delete', _("Delete"));
+ $menu_row .= '<input type="checkbox" name="bypass_trash">' . _("Bypass Trash");
}
- $menu_row .= getButton('SUBMIT', 'delete', _("Delete"));
- $menu_row .= '<input type="checkbox" name="bypass_trash">' . _("Bypass Trash");
- }
- else
- $menu_row .= getButton('SUBMIT', 'delete', _("Delete"), '', FALSE) . "\n"; // delete button is disabled
-
- $menu_row .= '</form>';
+ else
+ $menu_row .= getButton('SUBMIT', 'delete', _("Delete"), '', FALSE) . "\n"; // delete button is disabled
+ $menu_row .= '</form>';
+ }
// Add top move link
$menu_row .= '</small></td><td align="right">';
- if ( !(isset($passed_ent_id) && $passed_ent_id) ) {
-
+ if ( !(isset($passed_ent_id) && $passed_ent_id) &&
+ array_search('\\deleted', $mbx_response['PERMANENTFLAGS'],true) !== false) {
+
$current_box = 'mailbox='.$mailbox.'&sort='.$sort.'&startMessage='.$startMessage;
// Set subsequent location based on whether or not there is a 'next' message.
function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
global $base_uri, $where, $what;
-
+
$urlMailbox = urlencode($mailbox);
$urlPassed_id = urlencode($passed_id);
$urlPassed_ent_id = urlencode($passed_ent_id);
-
+
$query_string = 'mailbox=' . $urlMailbox . '&passed_id=' . $urlPassed_id . '&passed_ent_id=' . $urlPassed_ent_id;
-
+
if (!empty($where)) {
$query_string .= '&where=' . urlencode($where);
}
echo ' <tr>' . html_tag( 'td', '<br>'. $messagebody."\n", 'left')
. '</tr>';
echo ' </table>';
-echo ' </td></tr>';
+echo ' </td></tr>';
echo ' </table></td></tr>';
echo ' </table>';
echo ' </td></tr>';
echo ' <table width="100%" cellpadding="1" cellspacing="0" align="center"'.' border="0" bgcolor="'.$color[9].'">';
echo ' <tr><td>';
echo ' <table width="100%" cellpadding="0" cellspacing="0" align="center" border="0" bgcolor="'.$color[4].'">';
- echo ' <tr>' . html_tag( 'td', '', 'left', $color[9] );
+ echo ' <tr>' . html_tag( 'td', '', 'left', $color[9] );
echo ' <b>' . _("Attachments") . ':</b>';
echo ' </td></tr>';
echo ' <tr><td>';
do_hook('read_body_bottom');
do_hook('html_bottom');
sqimap_logout($imapConnection);
-/* sessions are written at the end of the script. it's better to register
+/* sessions are written at the end of the script. it's better to register
them at the end so we avoid double session_register calls */
sqsession_register($messages,'messages');