You are here

function PartyDefaultDataSetUIAdd::action_form_submit in Party 8.2

Same name and namespace in other branches
  1. 7 includes/party.data_ui.inc \PartyDefaultDataSetUIAdd::action_form_submit()

Form submission for the action form.

Overrides PartyDataSetActionInterface::action_form_submit

1 method overrides PartyDefaultDataSetUIAdd::action_form_submit()
PartyUserDataSetUIAdd::action_form_submit in modules/party_user/includes/party_user.data_ui.inc
Form submission for the action form.

File

includes/party.data_ui.inc, line 124
Provides default classes for UI actions on data sets.

Class

PartyDefaultDataSetUIAdd
The 'add' action: attach a new entity.

Code

function action_form_submit($form, &$form_state) {

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

  // Attach the entity and save the entity and controller.
  $controller = party_get_crm_controller($party, $data_set['set_name']);
  $controller
    ->attachEntity($form_state['#attached_entity']);
  $controller
    ->save(TRUE);
}