You are here

public function AdminToolbarToolsSettingsForm::buildForm in Admin Toolbar 8.2

Same name and namespace in other branches
  1. 3.x admin_toolbar_tools/src/Form/AdminToolbarToolsSettingsForm.php \Drupal\admin_toolbar_tools\Form\AdminToolbarToolsSettingsForm::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

admin_toolbar_tools/src/Form/AdminToolbarToolsSettingsForm.php, line 79

Class

AdminToolbarToolsSettingsForm
Class AdminToolbarToolsSettingsForm.

Namespace

Drupal\admin_toolbar_tools\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('admin_toolbar_tools.settings');
  $form['max_bundle_number'] = [
    '#type' => 'number',
    '#title' => $this
      ->t('Maximum number of bundle sub-menus to display'),
    '#description' => $this
      ->t('Loading a large number of items can cause performance issues.'),
    '#default_value' => $config
      ->get('max_bundle_number'),
  ];
  $form['hoverintent_functionality'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Enable/Disable the hoverintent functionality'),
    '#description' => $this
      ->t('Check it if you want to enable the hoverintent feature.'),
    '#default_value' => $config
      ->get('hoverintent_functionality'),
  ];
  return parent::buildForm($form, $form_state);
}