Changeset 4390 in subversion


Ignore:
Timestamp:
Jan 4, 2011 12:21:34 PM (2 years ago)
Author:
thomasb
Message:

Simplify archive plugin: trigger move-to-folder client side, only showing one confirmation message

Location:
trunk/plugins/archive
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/archive/archive.js

    r4086 r4390  
    99    return; 
    1010   
    11   var uids = rcmail.env.uid ? rcmail.env.uid : rcmail.message_list.get_selection().join(','), 
    12     lock = rcmail.set_busy(true, 'loading'); 
    13  
    14   rcmail.http_post('plugin.archive', '_uid='+uids+'&_mbox='+urlencode(rcmail.env.mailbox), lock); 
     11  if (rcmail.env.mailbox != rcmail.env.archive_folder) 
     12    rcmail.command('moveto', rcmail.env.archive_folder); 
    1513} 
    1614 
  • trunk/plugins/archive/archive.php

    r3841 r4390  
    1717  { 
    1818    $rcmail = rcmail::get_instance(); 
    19  
    20     $this->register_action('plugin.archive', array($this, 'request_action')); 
    2119 
    2220    // There is no "Archived flags" 
     
    8179      if ($item['id'] == $folder) { 
    8280        $list[$idx]['name'] = $new_name; 
    83         return true; 
     81        return true; 
    8482      } else if (!empty($item['folders'])) 
    8583        if ($this->_mod_folder_name($list[$idx]['folders'], $folder, $new_name)) 
    86           return true; 
     84        return true; 
    8785    } 
    8886    return false; 
    89   } 
    90  
    91   function request_action() 
    92   { 
    93     $this->add_texts('localization'); 
    94      
    95     $uids = get_input_value('_uid', RCUBE_INPUT_POST); 
    96     $mbox = get_input_value('_mbox', RCUBE_INPUT_POST); 
    97      
    98     $rcmail = rcmail::get_instance(); 
    99      
    100     // There is no "Archive flags", but I left this line in case it may be useful 
    101     // $rcmail->imap->set_flag($uids, 'ARCHIVE'); 
    102      
    103     if (($archive_mbox = $rcmail->config->get('archive_mbox')) && $mbox != $archive_mbox) { 
    104       $rcmail->output->command('move_messages', $archive_mbox); 
    105       $rcmail->output->command('display_message', $this->gettext('archived'), 'confirmation'); 
    106     } 
    107      
    108     $rcmail->output->send(); 
    10987  } 
    11088 
Note: See TracChangeset for help on using the changeset viewer.