You are here

function party_primary_fields_edit_field_submit in Party 7

Form submission handler for party_primary_fields_edit_field().

1 string reference to 'party_primary_fields_edit_field_submit'
party_primary_fields_edit_field in ./party.admin.inc
Form constructor for setting primary field sources.

File

./party.admin.inc, line 203
Admin page callback file for the party module.

Code

function party_primary_fields_edit_field_submit(&$form, &$form_state) {

  // Get hold of our variable.
  $primary_fields = variable_get('party_primary_fields', array());

  // Merge in our new values and save.
  $primary_fields[$form['#target']] = $form_state['values']['sources'];
  variable_set('party_primary_fields', $primary_fields);

  // Deal with email specific options.
  if ($form['#target'] == 'email') {
    variable_set('party_ensure_no_dup_emails', (bool) $form_state['values']['party_ensure_no_dup_emails']);
  }
  drupal_set_message(t('Settings for primary field %target saved.', array(
    '%target' => $form['#info']['label'],
  )));
  cache_set('party:primary_fields:fields', NULL);
  $form_state['redirect'] = 'admin/community/party';
}