You are here

public function views_handler_filter_selective::value_form in Views Selective Filters 7

Options form subform for setting options.

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

Overrides views_handler_filter_in_operator::value_form

See also

options_form()

File

./views_handler_filter_selective.inc, line 74
Views Filter Selective Handler Overrides.

Class

views_handler_filter_selective
Views filter handler for selective values.

Code

public function value_form(&$form, &$form_state) {
  $this
    ->get_value_options();

  // If you call parent::value_form() and $this->value_options
  // is not an array, an exception is thrown.
  if (isset($this->value_options) && is_array($this->value_options)) {
    parent::value_form($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';
  }
}