You are here

function global_filter_get_usable_fields in Views Global Filter 8

Same name and namespace in other branches
  1. 7 global_filter.blocks.inc \global_filter_get_usable_fields()

Retunrs a list of all field filters, indexed by their machine_name.

2 calls to global_filter_get_usable_fields()
global_filter_block_view in ./global_filter.blocks.inc
Implements hook_block_view().
_global_filter_configure_form in ./global_filter.blocks.inc
Generates the filter configuration form for filters in a block.

File

./global_filter.blocks.inc, line 458
global_filter.block.inc

Code

function global_filter_get_usable_fields() {
  $special_fields = array(
    '' => t('- None -'),
  );
  $special_fields[GLOBAL_FILTER_VIEWS_COUNTRY_FIELD] = t('Country name');
  if (module_exists('location')) {
    $special_fields[GLOBAL_FILTER_VIEWS_PROXIMITY_FIELD] = t('Location module: Proximity/Distance');

    // Note: for Geofield the associated real field needs to be selected.
  }
  $special_fields[GLOBAL_FILTER_VIEWS_SEARCH_TERMS_FIELD] = t('Search: Search terms');

  // As in Views.
  if (module_exists('search_api')) {
    $special_fields[GLOBAL_FILTER_VIEWS_SEARCH_API_FULLTEXT] = t('Search API: Fulltext Search');
  }
  $fields = array_merge(global_filter_get_node_properties(), global_filter_get_field_labels());
  asort($fields);
  return array_merge($special_fields, $fields);
}