You are here

public function FilterPluginBase::buildOptionsForm in Views (for Drupal 7) 8.3

Provide the basic form which calls through to subforms. If overridden, it is best to call through to the parent, or to at least make sure all of the functions in this form are called.

Overrides HandlerBase::buildOptionsForm

2 calls to FilterPluginBase::buildOptionsForm()
Combine::buildOptionsForm in lib/Drupal/views/Plugin/views/filter/Combine.php
Provide the basic form which calls through to subforms. If overridden, it is best to call through to the parent, or to at least make sure all of the functions in this form are called.
FilterTest::buildOptionsForm in tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/filter/FilterTest.php
Overrides Drupal\views\Plugin\views\row\RowPluginBase::buildOptionsForm().
3 methods override FilterPluginBase::buildOptionsForm()
Broken::buildOptionsForm in lib/Drupal/views/Plugin/views/filter/Broken.php
Provide the basic form which calls through to subforms. If overridden, it is best to call through to the parent, or to at least make sure all of the functions in this form are called.
Combine::buildOptionsForm in lib/Drupal/views/Plugin/views/filter/Combine.php
Provide the basic form which calls through to subforms. If overridden, it is best to call through to the parent, or to at least make sure all of the functions in this form are called.
FilterTest::buildOptionsForm in tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/filter/FilterTest.php
Overrides Drupal\views\Plugin\views\row\RowPluginBase::buildOptionsForm().

File

lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php, line 192
Definition of Drupal\views\Plugin\views\filter\FilterPluginBase.

Class

FilterPluginBase
Base class for filters.

Namespace

Drupal\views\Plugin\views\filter

Code

public function buildOptionsForm(&$form, &$form_state) {
  parent::buildOptionsForm($form, $form_state);
  if ($this
    ->canExpose()) {
    $this
      ->showExposeButton($form, $form_state);
  }
  if ($this
    ->can_build_group()) {
    $this
      ->show_build_group_button($form, $form_state);
  }
  $form['clear_markup_start'] = array(
    '#markup' => '<div class="clearfix">',
  );
  if ($this
    ->isAGroup()) {
    if ($this
      ->can_build_group()) {
      $form['clear_markup_start'] = array(
        '#markup' => '<div class="clearfix">',
      );

      // Render the build group form.
      $this
        ->show_build_group_form($form, $form_state);
      $form['clear_markup_end'] = array(
        '#markup' => '</div>',
      );
    }
  }
  else {

    // Add the subform from operator_form().
    $this
      ->show_operator_form($form, $form_state);

    // Add the subform from value_form().
    $this
      ->show_value_form($form, $form_state);
    $form['clear_markup_end'] = array(
      '#markup' => '</div>',
    );
    if ($this
      ->canExpose()) {

      // Add the subform from buildExposeForm().
      $this
        ->showExposeForm($form, $form_state);
    }
  }
}