You are here

public function SocialGroupSettings::buildForm in Open Social 8.8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_group/src/Form/SocialGroupSettings.php \Drupal\social_group\Form\SocialGroupSettings::buildForm()
  2. 8 modules/social_features/social_group/src/Form/SocialGroupSettings.php \Drupal\social_group\Form\SocialGroupSettings::buildForm()
  3. 8.2 modules/social_features/social_group/src/Form/SocialGroupSettings.php \Drupal\social_group\Form\SocialGroupSettings::buildForm()
  4. 8.3 modules/social_features/social_group/src/Form/SocialGroupSettings.php \Drupal\social_group\Form\SocialGroupSettings::buildForm()
  5. 8.4 modules/social_features/social_group/src/Form/SocialGroupSettings.php \Drupal\social_group\Form\SocialGroupSettings::buildForm()
  6. 8.5 modules/social_features/social_group/src/Form/SocialGroupSettings.php \Drupal\social_group\Form\SocialGroupSettings::buildForm()
  7. 8.6 modules/social_features/social_group/src/Form/SocialGroupSettings.php \Drupal\social_group\Form\SocialGroupSettings::buildForm()
  8. 8.7 modules/social_features/social_group/src/Form/SocialGroupSettings.php \Drupal\social_group\Form\SocialGroupSettings::buildForm()
  9. 10.3.x modules/social_features/social_group/src/Form/SocialGroupSettings.php \Drupal\social_group\Form\SocialGroupSettings::buildForm()
  10. 10.0.x modules/social_features/social_group/src/Form/SocialGroupSettings.php \Drupal\social_group\Form\SocialGroupSettings::buildForm()
  11. 10.1.x modules/social_features/social_group/src/Form/SocialGroupSettings.php \Drupal\social_group\Form\SocialGroupSettings::buildForm()
  12. 10.2.x modules/social_features/social_group/src/Form/SocialGroupSettings.php \Drupal\social_group\Form\SocialGroupSettings::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

modules/social_features/social_group/src/Form/SocialGroupSettings.php, line 36

Class

SocialGroupSettings
Class SocialGroupSettings.

Namespace

Drupal\social_group\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('social_group.settings');
  $form['allow_group_selection_in_node'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Allow logged-in users to change or remove a group when editing content'),
    '#description' => $this
      ->t('When checked, logged-in users can also move content to or out of a group after the content is created. Users can only move content to a group the author is a member of.'),
    '#default_value' => $config
      ->get('allow_group_selection_in_node'),
  ];
  $form['default_hero'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('The default hero image.'),
    '#description' => $this
      ->t('The default hero size used on this platform. Only applicable when logged-in users cannot choose a different hero size on each group.'),
    '#default_value' => $config
      ->get('default_hero'),
    '#options' => $this
      ->getCropTypes(),
  ];
  return parent::buildForm($form, $form_state);
}