You are here

function geofield_map_field_formatter_settings_summary in Geofield 7

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

Implements hook_field_formatter_settings_summary().

File

modules/geofield_map/geofield_map.module, line 125

Code

function geofield_map_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $summary = array();
  if ($settings['geofield_map_width']) {
    $summary[] = t('Width: @w', array(
      '@w' => $settings['geofield_map_width'],
    ));
  }
  if ($settings['geofield_map_height']) {
    $summary[] = t('Height: @h', array(
      '@h' => $settings['geofield_map_height'],
    ));
  }
  if ($settings['geofield_map_zoom']) {
    $summary[] = t('Zoom: @z', array(
      '@z' => $settings['geofield_map_zoom'],
    ));
  }
  if ($settings['geofield_map_controltype']) {
    $summary[] = t('Zoom Control Type: @z', array(
      '@z' => $settings['geofield_map_controltype'],
    ));
  }
  if ($settings['geofield_map_mtc']) {
    $summary[] = t('Map Control Type: @m', array(
      '@m' => $settings['geofield_map_mtc'],
    ));
  }
  if ($settings['geofield_map_pancontrol']) {
    $summary[] = t('Show Pan Control: @yn', array(
      '@yn' => $settings['geofield_map_pancontrol'] ? 'Yes' : 'No',
    ));
  }
  if ($settings['geofield_map_maptype']) {
    $summary[] = t('Default Map Type: @m', array(
      '@m' => $settings['geofield_map_maptype'],
    ));
  }
  if ($settings['geofield_map_scale']) {
    $summary[] = t('Show Scale: @yn', array(
      '@yn' => $settings['geofield_map_scale'] ? 'Yes' : 'No',
    ));
  }
  if ($settings['geofield_map_overview']) {
    $summary[] = t('Overview Map: @yn', array(
      '@yn' => $settings['geofield_map_overview'] ? 'Yes' : 'No',
    ));
  }
  if ($settings['geofield_map_scrollwheel']) {
    $summary[] = t('Scrollwheel: @yn', array(
      '@yn' => $settings['geofield_map_scrollwheel'] ? 'Yes' : 'No',
    ));
  }
  if ($settings['geofield_map_draggable']) {
    $summary[] = t('Draggable: @yn', array(
      '@yn' => $settings['geofield_map_draggable'] ? 'Yes' : 'No',
    ));
  }
  if ($settings['geofield_map_streetview_show']) {
    $summary[] = t('Show streetview button: @yn', array(
      '@yn' => $settings['geofield_map_streetview_show'] ? 'Yes' : 'No',
    ));
  }
  return implode('<br />', $summary);
}