You are here

function ip_geoloc_get_display_fields in IP Geolocation Views & Maps 8

Same name and namespace in other branches
  1. 7 views/ip_geoloc_plugin_style.inc \ip_geoloc_get_display_fields()

Implements hook_get_display_fields().

3 calls to ip_geoloc_get_display_fields()
IpGeoLocPluginStyleLeaflet::addClusterDifferentiator in src/Plugin/views/style/IpGeoLocPluginStyleLeaflet.php
Form part definition.
IpGeoLocPluginStyleLeaflet::buildOptionsForm in src/Plugin/views/style/IpGeoLocPluginStyleLeaflet.php
Provide a form to edit options for this plugin.
IpGeoLocViewsPluginStyle::pluginStyleBulkOfForm in src/Services/IpGeoLocViewsPluginStyle.php
The bulk of the plugin style form.

File

./ip_geoloc.module, line 963
IPGV&M is a mapping engine for Views that contain locations of entities and/or visitors. Google Maps, Leaflet and OpenLayers2 maps are all supported and available through this module. Using a number of optional sources IPGV&M also retrieves…

Code

function ip_geoloc_get_display_fields($view_display_handler, $with_table_prefixes = TRUE) {
  $fields = [
    '' => '<' . t('none') . '>',
  ];

  // $field_handlers = $view_display->get_handlers('field');.
  $field_handlers = $view_display_handler->handlers['field'];
  $field_names = $view_display_handler
    ->getFieldLabels();
  foreach ($field_handlers as $field_id => $field_handler) {
    $field_id_ori = $field_id;
    if ($with_table_prefixes && strpos($field_id, 'field_') === FALSE) {

      // Example: 'title' becomes 'node_title'.
      $field_id = $field_handler->table . "_{$field_id}";
    }
    $fields[$field_id] = $field_names[$field_id_ori];
  }
  return $fields;
}