You are here

public function TaxonomyManagerAdmin::buildForm in Taxonomy Manager 8

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

src/Form/TaxonomyManagerAdmin.php, line 23

Class

TaxonomyManagerAdmin
Managing the advanced options for the taxonomy_manager module.

Namespace

Drupal\taxonomy_manager\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('taxonomy_manager.settings');
  $form['taxonomy_manager_disable_mouseover'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Disable mouse-over effect for terms (weights and direct link)'),
    '#default_value' => $config
      ->get('taxonomy_manager_disable_mouseover'),
    '#description' => $this
      ->t('Disabling this feature speeds up the Taxonomy Manager'),
  ];
  $form['taxonomy_manager_pager_tree_page_size'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Pager count'),
    '#options' => [
      25 => 25,
      50 => 50,
      75 => 75,
      100 => 100,
      150 => 150,
      200 => 200,
      250 => 250,
      300 => 300,
      400 => 400,
      500 => 500,
      1000 => 1000,
      2500 => 2500,
      5000 => 5000,
      10000 => 10000,
    ],
    '#default_value' => $config
      ->get('taxonomy_manager_pager_tree_page_size'),
    '#description' => $this
      ->t('Select how many terms should be listed on one page. Huge page counts can slow down the Taxonomy Manager'),
  ];
  return parent::buildForm($form, $form_state);
}