You are here

public function ContainerTrait::roleFieldset in GoogleTagManager 8

Fieldset builder for the container settings form.

2 calls to ContainerTrait::roleFieldset()
ContainerForm::form in src/Form/ContainerForm.php
Gets the actual form array to be built.
SettingsForm::buildForm in src/Form/SettingsForm.php
Form constructor.

File

src/Form/ContainerTrait.php, line 152

Class

ContainerTrait
Defines shared routines for the container and settings forms.

Namespace

Drupal\google_tag\Form

Code

public function roleFieldset(FormStateInterface &$form_state) {
  $fieldset_title = $this
    ->t('User role');
  $singular = 'role';
  $plural = 'roles';
  $options = array_map(function ($role) {
    return $role
      ->label();
  }, user_roles());
  $config = compact([
    'fieldset_title',
    'singular',
    'plural',
    'options',
  ]);
  return $this
    ->genericFieldset($config, $form_state);
}