You are here

protected function views_handler_filter_dynamic_fields::remove_combined_fields in Views Dynamic Fields 7

Prune fields to be displayed in the filter and capture combined fields sep.

1 call to views_handler_filter_dynamic_fields::remove_combined_fields()
views_handler_filter_dynamic_fields::init in handlers/views_handler_filter_dynamic_fields.inc
Pre-set the filter fields and combined fields arrays.

File

handlers/views_handler_filter_dynamic_fields.inc, line 75
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

protected function remove_combined_fields($view) {
  $this->combined_fields = array();
  $style_columns = isset($view->display_handler->default_display->options['style_options']['columns']) ? $view->display_handler->default_display->options['style_options']['columns'] : NULL;
  if (is_array($style_columns)) {
    foreach ($style_columns as $key => $name) {
      if (isset($this->view_fields[$key]) && $key != $name) {
        unset($this->view_fields[$key]);

        // The $key field will be acted upon if the $name (parent) field
        // is acted upon by the user.
        $this->combined_fields[$name] = $key;
      }
    }
  }
}