public function ExposedFormPluginBase::buildOptionsForm

Provide a form to edit options for this plugin.

Overrides PluginBase::buildOptionsForm

1 call to ExposedFormPluginBase::buildOptionsForm()
InputRequired::buildOptionsForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/exposed_form/InputRequired.php
Provide a form to edit options for this plugin.
1 method overrides ExposedFormPluginBase::buildOptionsForm()
InputRequired::buildOptionsForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/exposed_form/InputRequired.php
Provide a form to edit options for this plugin.

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php, line 59
Definition of Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase.

Class

ExposedFormPluginBase
The base plugin to handle exposed filter forms.

Namespace

Drupal\views\Plugin\views\exposed_form

Code

public function buildOptionsForm(&$form, &$form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['submit_button'] = array(
    '#type' => 'textfield',
    '#title' => t('Submit button text'),
    '#description' => t('Text to display in the submit button of the exposed form.'),
    '#default_value' => $this->options['submit_button'],
    '#required' => TRUE,
  );
  $form['reset_button'] = array(
    '#type' => 'checkbox',
    '#title' => t('Include reset button'),
    '#description' => t('If checked the exposed form will provide a button to reset all the applied exposed filters'),
    '#default_value' => $this->options['reset_button'],
  );
  $form['reset_button_label'] = array(
    '#type' => 'textfield',
    '#title' => t('Reset button label'),
    '#description' => t('Text to display in the reset button of the exposed form.'),
    '#default_value' => $this->options['reset_button_label'],
    '#required' => TRUE,
    '#states' => array(
      'invisible' => array(
        'input[name="exposed_form_options[reset_button]"]' => array(
          'checked' => FALSE,
        ),
      ),
    ),
  );
  $form['exposed_sorts_label'] = array(
    '#type' => 'textfield',
    '#title' => t('Exposed sorts label'),
    '#description' => t('Text to display as the label of the exposed sort select box.'),
    '#default_value' => $this->options['exposed_sorts_label'],
    '#required' => TRUE,
  );
  $form['expose_sort_order'] = array(
    '#type' => 'checkbox',
    '#title' => t('Expose sort order'),
    '#description' => t('Allow the user to choose the sort order. If sort order is not exposed, the sort criteria settings for each sort will determine its order.'),
    '#default_value' => $this->options['expose_sort_order'],
  );
  $form['sort_asc_label'] = array(
    '#type' => 'textfield',
    '#title' => t('Ascending'),
    '#description' => t('Text to use when exposed sort is ordered ascending.'),
    '#default_value' => $this->options['sort_asc_label'],
    '#required' => TRUE,
    '#states' => array(
      'visible' => array(
        'input[name="exposed_form_options[expose_sort_order]"]' => array(
          'checked' => TRUE,
        ),
      ),
    ),
  );
  $form['sort_desc_label'] = array(
    '#type' => 'textfield',
    '#title' => t('Descending'),
    '#description' => t('Text to use when exposed sort is ordered descending.'),
    '#default_value' => $this->options['sort_desc_label'],
    '#required' => TRUE,
    '#states' => array(
      'visible' => array(
        'input[name="exposed_form_options[expose_sort_order]"]' => array(
          'checked' => TRUE,
        ),
      ),
    ),
  );
}