public function handleActions() { // WPLA()->logger->debug("handleActions()"); // save accounts if ($this->requestAction() == 'wpla_add_account') { $this->newAccount(); } // update account details from amazon if ($this->requestAction() == 'update_account') { $this->updateAccount($_REQUEST['amazon_account']); } // delete account if ($this->requestAction() == 'delete_account') { $account = new WPLA_AmazonAccount($_REQUEST['amazon_account']); $account->delete(); $this->showMessage(__('Account has been deleted.', 'wpla')); } // enable account if ($this->requestAction() == 'enable_account') { $account = new WPLA_AmazonAccount($_REQUEST['amazon_account']); $account->active = 1; $account->update(); $this->showMessage(__('Account has been enabled.', 'wpla')); } // disable account if ($this->requestAction() == 'disable_account') { $account = new WPLA_AmazonAccount($_REQUEST['amazon_account']); $account->active = 0; $account->update(); $this->showMessage(__('Account has been disabled.', 'wpla')); } // set default account if ($this->requestAction() == 'make_default') { update_option('wpla_default_account_id', $_REQUEST['amazon_account']); } }