DMN now remembers the last target mailbox to match up with the rest of SM
authorjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 8 Mar 2003 04:41:35 +0000 (04:41 +0000)
committerjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 8 Mar 2003 04:41:35 +0000 (04:41 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4618 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/delete_move_next/setup.php

index 67083da..da52c45 100644 (file)
@@ -218,8 +218,13 @@ function delete_move_next_read($currloc) {
 }
 
 function get_move_target_list() {
-    global $imapConnection;
-    echo sqimap_mailbox_option_list($imapConnection);
+    global $imapConnection, $lastTargetMailbox;
+    if (isset($lastTargetMailbox) && !empty($lastTargetMailbox)) {
+        echo sqimap_mailbox_option_list($imapConnection, array(strtolower($lastTargetMailbox)));
+    }
+    else {
+        echo sqimap_mailbox_option_list($imapConnection);
+    }
 }
 
 function delete_move_next_moveNextForm($next) {
@@ -292,7 +297,7 @@ function delete_move_next_delete() {
 }
 
 function delete_move_next_move() {
-    global $imapConnection, $mailbox, $auto_expunge;
+    global $imapConnection, $mailbox, $auto_expunge, $lastTargetMailbox;
 
     if ( !check_php_version(4,1) ) {
         global $_POST;
@@ -309,6 +314,11 @@ function delete_move_next_move() {
         delete_move_expunge_from_all($move_id);
         // sqimap_mailbox_expunge($imapConnection, $mailbox, true);
     }
+
+    if ($targetMailbox != $lastTargetMailbox) {
+        $lastTargetMailbox = $targetMailbox;
+        sqsession_register('lastTargetMailbox' , $lastTargetMailbox);
+    }
 }
 
 function delete_move_next_display_inside() {