You are here

function drupagram_account_list_form_submit in Drupagram 7

Same name and namespace in other branches
  1. 6 drupagram.pages.inc \drupagram_account_list_form_submit()

@todo Please document this function.

See also

http://drupal.org/node/1354

File

./drupagram.pages.inc, line 187
Drupagram admin page callaback functions.

Code

function drupagram_account_list_form_submit($form, &$form_state) {
  $accounts = $form_state['values']['accounts'];
  foreach ($accounts as $account) {
    if (empty($account['delete'])) {
      drupagram_account_save($account);
      drupal_set_message(t('The Instagram account settings were updated.'));
    }
    else {
      drupagram_account_delete($account['id']);
      drupal_set_message(t('The Instagram account was deleted.'));
    }
  }
}