You are here

function group_options_form_submit in Group 7

Options form submit callback.

1 string reference to 'group_options_form_submit'
group_options_form in admin/group.inc
Builds the group administration options.

File

admin/group.inc, line 180
Group overview admin UI.

Code

function group_options_form_submit($form, &$form_state) {
  $operations = module_invoke_all('group_operations');
  $operation = $operations[$form_state['values']['operation']];

  // Get all selected groups.
  $gids = array_filter($form_state['values']['groups']);

  // Build the arguments for the operation callback.
  $args = array(
    $gids,
  );
  if (isset($operation['callback arguments'])) {
    $args = array_merge($args, $operation['callback arguments']);
  }
  if (empty($operation['form callback'])) {
    call_user_func_array($operation['callback'], $args);
  }
  else {

    // Pass the operation form details.
    $form_state['rebuild_info']['callback'] = $operation['callback'];
    $form_state['rebuild_info']['args'] = $args;

    // We need to rebuild the form to be able to show the operation form.
    $form_state['rebuild'] = TRUE;
  }
}