function PartyUserDataSetUIAdd::action_form_submit in Party 7
Same name and namespace in other branches
- 8.2 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.
$party
->getDataSetController($data_set['set_name'])
->attachEntity($account)
->save();
}
}