You are here

protected function Selective::valueForm in Views Selective Filters 8

Options form subform for setting options.

This should be overridden by all child classes and it must define $form['value']

Overrides InOperator::valueForm

See also

buildOptionsForm()

File

src/Plugin/views/filter/Selective.php, line 104

Class

Selective
Views filter handler for selective values.

Namespace

Drupal\views_selective_filters\Plugin\views\filter

Code

protected function valueForm(&$form, FormStateInterface $form_state) {
  $this
    ->getValueOptions();

  // If you call parent::valueForm() and $this->valueOptions
  // is not an array, an exception is thrown.
  if (isset($this->valueOptions) && is_array($this->valueOptions)) {
    parent::valueForm($form, $form_state);
  }

  // Avoid the 'illegal values' Form API error.
  $form['value']['#validated'] = TRUE;

  // Add behaviour for ajax block refresh.
  // Don't do this if the view is being executed
  // to obtain selective values.
  // if (empty($this->view->selective_oids)) {
  //   $form['#attached']['js'][] = drupal_get_path('module', 'views_filters_selective') . '/js/attachBehaviours.js';
  // }.
}