}
if ($prefs->isDirty('subscribe') || $prefs->isDirty('tree_view')) {
- $imp_folder = IMP_Folder::singleton();
- $imp_folder->clearFlistCache();
- $imaptree = IMP_Imap_Tree::singleton();
- $imaptree->init();
+ $this->_mailboxesChanged();
}
if ($prefs->isDirty('mail_domain')) {
*/
protected function _prefsAccountsManagement()
{
+ $success = false;
$vars = Horde_Variables::getDefaultVariables();
switch ($vars->accounts_action) {
'username' => $vars->accounts_username
));
$GLOBALS['notification']->push(sprintf(_("Account \"%s\" added."), $vars->accounts_server), 'horde.success');
+
+ $success = true;
}
break;
$tmp = $imp_accounts->getAccount($vars->accounts_data);
if ($imp_accounts->deleteAccount($vars->accounts_data)) {
$GLOBALS['notification']->push(sprintf(_("Account \"%s\" deleted."), $tmp['server']), 'horde.success');
+ $success = true;
}
break;
}
+
+ if ($success) {
+ $this->_mailboxesChanged();
+ }
}
/**
return;
}
- $imp_folder = IMP_Folder::singleton();
- $imp_folder->clearFlistCache();
- $imaptree = IMP_Imap_Tree::singleton();
- $imaptree->init();
+ $this->_mailboxesChanged();
$GLOBALS['imp_search']->initialize(true);
}
return $credentials;
}
+ /* Helper methods. */
+
+ /**
+ * Run tasks when the mailbox list has changed.
+ */
+ protected function _mailboxesChanged()
+ {
+ $imp_folder = IMP_Folder::singleton();
+ $imp_folder->clearFlistCache();
+ $imaptree = IMP_Imap_Tree::singleton();
+ $imaptree->init();
+ }
+
}