You are here

public function views_handler_filter_dynamic_fields::init in Views Dynamic Fields 7

Pre-set the filter fields and combined fields arrays.

Overrides views_handler_filter::init

See also

\views\handler\views_handler_filter::init()

File

handlers/views_handler_filter_dynamic_fields.inc, line 61
Views dynamic fields filter handler.

Class

views_handler_filter_dynamic_fields
Simple filter to pick and choose the fields to show in the view.

Code

public function init(&$view, &$options) {
  parent::init($view, $options);
  $this->view_fields = $view
    ->get_items('field');
  $this
    ->remove_combined_fields($view);

  // Select all fields by default when setting up a new filter.
  $this->options['filterable_fields'] = empty($this->options['filterable_fields']) ? array_keys($this->view_fields) : $this->options['filterable_fields'];
}