You are here

function finder_views_finder_fields in Finder 6

Same name and namespace in other branches
  1. 7 modules/finder_views/finder_views.module \finder_views_finder_fields()

Implementation of hook_finder_fields().

See also

hook_finder_fields()

1 call to finder_views_finder_fields()
finder_views_form_finder_admin_edit_alter in modules/finder_views/finder_views.module
Implementation of hook_form_FORM_ID_alter().

File

modules/finder_views/finder_views.module, line 274
The finder views module.

Code

function finder_views_finder_fields($finder, $finder_element_id) {
  if ($view = views_get_view($finder->settings['views']['view'])) {
    views_include('admin');
    $display = $view
      ->add_display('finder_views');
    $view
      ->set_display($display);
    $base_tables = $view
      ->get_base_tables();
    $options = views_fetch_fields(array_keys($base_tables), 'filter');

    // Special case, allow search indexes to work. #1410862
    $options['search_index.word'] = $options['search_index.keys'];
    unset($options['search_index.keys']);
    foreach ($options as $k => $v) {
      $options[$k] = $v['group'] . ': ' . $v['title'];
    }
    return $options;
  }
  return FALSE;
}