You are here

function social_event_field_group_form_process_build_alter in Open Social 10.2.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_event/social_event.module \social_event_field_group_form_process_build_alter()

Implements hook_field_group_form_process_build_alter().

File

modules/social_features/social_event/social_event.module, line 1250
The Social event module.

Code

function social_event_field_group_form_process_build_alter(array &$element, FormStateInterface $form_state, &$complete_form) {
  if ($field_group =& $element['group_enrollment_methods']) {
    $field_group['#states']['visible'] = [
      ':input[name="field_event_enable_enrollment[value]"]' => [
        'checked' => TRUE,
      ],
    ];
    $field_group['#title'] = '';
  }
  $event_settings = \Drupal::config('social_event.settings');
  if (isset($element['group_enrollment']) && $event_settings
    ->get('disable_event_enroll')) {
    $element['group_enrollment']['#access'] = FALSE;
  }
}