You are here

function twitter_account_list_form_submit in Twitter 7.5

Same name and namespace in other branches
  1. 6.5 twitter.pages.inc \twitter_account_list_form_submit()
  2. 6.2 twitter.pages.inc \twitter_account_list_form_submit()
  3. 6.3 twitter.pages.inc \twitter_account_list_form_submit()
  4. 6.4 twitter.pages.inc \twitter_account_list_form_submit()
  5. 7.6 twitter.pages.inc \twitter_account_list_form_submit()
  6. 7.3 twitter.pages.inc \twitter_account_list_form_submit()
  7. 7.4 twitter.pages.inc \twitter_account_list_form_submit()

Form submit handler for altering the list of Twitter accounts.

File

./twitter.pages.inc, line 348
Page callbacks for Twitter module.

Code

function twitter_account_list_form_submit($form, &$form_state) {
  $accounts = $form_state['values']['accounts'];
  foreach ($accounts as $account) {
    if (empty($account['delete'])) {
      twitter_account_save($account);
    }
    else {
      $twitter_account = twitter_account_load($account['id']);
      twitter_account_delete($account['id']);
      drupal_set_message(t('The Twitter account <em>!account</em> was deleted.', array(
        '!account' => $twitter_account->screen_name,
      )));
    }
  }
  drupal_set_message(t('The Twitter account settings were updated.'));
}