You are here

public function SettingsForm::buildForm in Domain Access 8

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

domain_config_ui/src/Form/SettingsForm.php, line 33

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\domain_config_ui\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('domain_config_ui.settings');
  $form['remember_domain'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Remember domain selection'),
    '#default_value' => $config
      ->get('remember_domain'),
    '#description' => $this
      ->t('Keeps last selected domain when loading new configuration forms.'),
  ];
  $form['pages'] = [
    '#title' => $this
      ->t('Enabled configuration forms'),
    '#type' => 'details',
    '#open' => TRUE,
  ];
  $form['pages']['path_pages'] = [
    '#type' => 'textarea',
    '#rows' => 5,
    '#columns' => 40,
    '#default_value' => $this
      ->standardizePaths($config
      ->get('path_pages')),
    '#description' => $this
      ->t("Specify pages by using their paths. Enter one path per line. Paths must start with /admin. Wildcards (*) are not supported. An example path is /admin/appearance for the Appearance page."),
  ];
  return parent::buildForm($form, $form_state);
}