* $Message is a message that is centered on top of the list
* $More is a second line that is left aligned
*/
+
function mail_message_listing_beginning ($imapConnection, $moveURL,
$mailbox = '', $sort = -1,
$msg_cnt_str = '',
$start_msg = 1) {
global $color, $index_order, $auto_expunge, $move_to_trash, $base_uri,
$checkall, $sent_folder, $draft_folder, $thread_sort_messages,
- $allow_thread_sort, $allow_server_sort, $server_sort_order;
+ $allow_thread_sort, $allow_server_sort, $server_sort_order,
+ $lastTargetMailbox;
+
$urlMailbox = urlencode($mailbox);
/*
if( $box2 == 'INBOX' ) {
$box2 = _("INBOX");
}
- echo " <OPTION VALUE=\"$box\">$box2</option>\n";
+ if ($lastTargetMailbox == $box) {
+ echo " <OPTION VALUE=\"$box\" SELECTED>$box2</OPTION>\n";
+ }
+ else {
+ echo " <OPTION VALUE=\"$box\">$box2</OPTION>\n";
+ }
}
}
echo ' </SELECT></TT> '
function attachSelectedMessages($msg, $imapConnection) {
- global $mailbox, $username, $attachment_dir, $attachments, $identity, $data_dir, $composesession;
+ global $mailbox, $username, $attachment_dir, $attachments, $identity, $data_dir, $composesession, $lastTargetMailbox;
if (!isset($attachments)) {
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
sqimap_mailbox_select($imapConnection, $mailbox);
+/* remember changes to mailbox setting */
+if (!isset($lastTargetMailbox)) {
+ $lastTargetMailbox = 'INBOX';
+}
+if ($targetMailbox != $lastTargetMailbox) {
+ $lastTargetMailbox = $targetMailbox;
+ session_register('lastTargetMailbox');
+}
+
// expunge-on-demand if user isn't using move_to_trash or auto_expunge
if(isset($expungeButton)) {
sqimap_mailbox_expunge($imapConnection, $mailbox, true);