You are here

function getlocations_leaflet_field_formatter_settings_summary in Get Locations 7

Same name and namespace in other branches
  1. 7.2 modules/getlocations_leaflet/getlocations_leaflet.module \getlocations_leaflet_field_formatter_settings_summary()

Implements hook_field_formatter_settings_summary(). Returns a short summary for the current formatter settings of an instance.

If an empty result is returned, the formatter is assumed to have no configurable settings, and no UI will be provided to display a settings form.

The field structure.

Parameters

$instance: The instance structure.

$view_mode: The view mode for which a settings summary is requested.

Return value

A string containing a short summary of the formatter settings.

File

modules/getlocations_leaflet/getlocations_leaflet.module, line 860
getlocations_leaflet.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_leaflet_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $summary = array();
  switch ($display['type']) {
    case 'getlocations_leaflet_map':
      $summary[] = t('Getlocations Leaflet Map Field settings');
      if ($settings['zoomslider']) {
        $summary[] = t('Show zoom slider: Yes');
      }
      elseif ($settings['zoomControl']) {
        $summary[] = t('Show zoom control: Yes');
      }
      if ($settings['layerControl']) {
        $summary[] = t('Show layer control: Yes');
      }
      if ($settings['scaleControl']) {
        $summary[] = t('Show scale: Yes');
      }
      if ($settings['attributionControl']) {
        $summary[] = t('Show attribution: Yes');
      }
      if ($settings['fullscreen']) {
        $summary[] = t('Show fullscreen control: Yes');
      }
      if ($settings['geocoder']) {
        $summary[] = t('Show Geocoder control: Yes');
      }
      if ($settings['markercluster']) {
        $summary[] = t('Enable markercluster: Yes');
      }
      if ($settings['pancontrol']) {
        $summary[] = t('Show Pan control: Yes');
      }
      if ($settings['awesome']) {
        if ($settings['marker_type'] == 'gg') {
          $summary[] = t('Marker type: Getlocations');
        }
        elseif ($settings['marker_type'] == 'fa') {
          $summary[] = t('Marker type: Awesome fonts');
        }
      }
      if ($settings['graticule']) {
        $summary[] = t('Show grid: Yes');
      }
      if ($settings['polygons_enable']) {
        $summary[] = t('Enable polygons: Yes');
        if ($settings['polygons_clickable']) {
          $summary[] = t('Polygons clickable: Yes');
        }
      }
      if ($settings['rectangles_enable']) {
        $summary[] = t('Enable rectangles: Yes');
        if ($settings['rectangles_clickable']) {
          $summary[] = t('Rectangles clickable: Yes');
        }
      }
      if ($settings['circles_enable']) {
        $summary[] = t('Enable circles: Yes');
        if ($settings['circles_clickable']) {
          $summary[] = t('Circles clickable: Yes');
        }
      }
      if ($settings['polylines_enable']) {
        $summary[] = t('Enable polylines: Yes');
        if ($settings['polylines_clickable']) {
          $summary[] = t('Polylines clickable: Yes');
        }
      }
      if ($settings['usermarker']) {
        $summary[] = t('GPS button: Yes');
      }
      if ($settings['bouncemarker']) {
        $summary[] = t('Bounce markers: Yes');
      }
      if ($settings['magnifyingglass']) {
        $summary[] = t('Magnifying Glass: Yes');
      }
      if ($settings['terminator']) {
        $summary[] = t('Day/Night: Yes');
      }
      break;
    case 'getlocations_leaflet_link':
      $summary[] = t('Getlocations Leaflet Link Field settings');
      if ($settings['text_opt']) {
        $summary[] = t('Text options: @a', array(
          '@a' => $settings['text_opt'],
        ));
      }
      if ($settings['text']) {
        $summary[] = t('Text: @a', array(
          '@a' => $settings['text'],
        ));
      }
      break;
  }
  return implode('<br />', $summary);
}