You are here

function PartyUserDataSetUIAdd::action_form_submit in Party 8.2

Same name and namespace in other branches
  1. 7 modules/party_user/includes/party_user.data_ui.inc \PartyUserDataSetUIAdd::action_form_submit()

Form submission for the action form.

Overrides PartyDefaultDataSetUIAdd::action_form_submit

File

modules/party_user/includes/party_user.data_ui.inc, line 98
Provides classes for UI actions on the user data set.

Class

PartyUserDataSetUIAdd
The 'add' action: add a new user.

Code

function action_form_submit($form, &$form_state) {

  // Get the original form parameters.
  list($party, $data_set, $action, $eid) = $form_state['build_info']['args'];

  // Attempt to load a user from the given input.
  $account = $form_state['user'];
  if ($account->uid != 0) {

    // Attach the user entity to the party.
    $data_set_controller = party_get_crm_controller($party, $data_set['set_name']);
    $data_set_controller
      ->attachEntity($account);
    $data_set_controller
      ->save();
  }
}