You are here

function ip_geoloc_get_display_fields in IP Geolocation Views & Maps 7

Same name and namespace in other branches
  1. 8 ip_geoloc.module \ip_geoloc_get_display_fields()

Implements hook_get_display_fields().

3 calls to ip_geoloc_get_display_fields()
ip_geoloc_plugin_style_bulk_of_form in views/ip_geoloc_plugin_style.inc
The bulk of the plugin style form.
ip_geoloc_plugin_style_leaflet::options_form in views/ip_geoloc_plugin_style_leaflet.inc
Implements options_form().
ip_geoloc_plugin_style_leaflet::_add_cluster_differentiator in views/ip_geoloc_plugin_style_leaflet.inc

File

views/ip_geoloc_plugin_style.inc, line 1438
ip_geoloc_plugin_style.inc

Code

function ip_geoloc_get_display_fields($view_display, $with_table_prefixes = TRUE, $include_view_args = TRUE) {
  $fields = array(
    '' => '<' . t('none') . '>',
  );
  $field_handlers = $view_display
    ->get_handlers('field');
  $exceptions = array(
    'nid',
    'tid',
    'uid',
  );
  foreach ($field_handlers as $field_id => $field_handler) {
    if ($with_table_prefixes) {
      if ($field_id == 'rid') {

        // See ip_geoloc_plugin_style_render_fields().
        $field_id = 'views_rid';
      }
      elseif (!in_array($field_id, $exceptions) && strpos($field_id, 'field_') === FALSE) {

        // Example: 'title' becomes 'node_title'.
        $field_id = $field_handler->table . "_{$field_id}";
      }
    }
    $fields[$field_id] = $field_handler
      ->ui_name();
  }
  if ($include_view_args) {

    // Add special differentiators: up to 4 View arguments appended to the URL
    for ($i = 1; $i <= 4; $i++) {
      $fields["!{$i}"] = t('View URL argument #@num', array(
        '@num' => $i,
      ));
    }
  }
  return $fields;
}