function twitter_account_list_form_submit in Twitter 7.6
Same name and namespace in other branches
- 6.5 twitter.pages.inc \twitter_account_list_form_submit()
- 6.2 twitter.pages.inc \twitter_account_list_form_submit()
- 6.3 twitter.pages.inc \twitter_account_list_form_submit()
- 6.4 twitter.pages.inc \twitter_account_list_form_submit()
- 7.3 twitter.pages.inc \twitter_account_list_form_submit()
- 7.4 twitter.pages.inc \twitter_account_list_form_submit()
- 7.5 twitter.pages.inc \twitter_account_list_form_submit()
Form submit handler for altering the list of Twitter accounts.
File
- ./
twitter.pages.inc, line 352 - Page callbacks for Twitter module.
Code
function twitter_account_list_form_submit($form, &$form_state) {
$accounts = $form_state['values']['accounts'];
foreach ($accounts as $account) {
$twitter_account = entity_load_single('twitter_account', $account['twitter_uid']);
if (empty($account['delete'])) {
if (!empty($account['import'])) {
$twitter_account->import = $account['import'];
}
if (!empty($account['is_global'])) {
$twitter_account->is_global = $account['is_global'];
}
if (isset($account['mentions'])) {
$twitter_account->mentions = $account['mentions'];
}
twitter_account_save($twitter_account);
}
else {
twitter_account_delete($account['twitter_uid']);
drupal_set_message(t('The Twitter account <em>!account</em> was deleted.', array(
'!account' => $twitter_account->screen_name,
)));
}
}
drupal_set_message(t('The account settings were updated.'));
}