function geofield_field_formatter_settings_summary in Geofield 7
Same name and namespace in other branches
- 7.2 geofield.formatters.inc \geofield_field_formatter_settings_summary()
Implements hook_field_formatter_settings_summary().
File
- ./
geofield.formatters.inc, line 170 - Drupal field formatter hooks and helper functions.
Code
function geofield_field_formatter_settings_summary($field, $instance, $view_mode) {
$display = $instance['display'][$view_mode];
$settings = $display['settings'];
$summary = array();
$data_options = _geofield_formatter_settings_data_options($display['type']);
// Styles could be lost because of enabled/disabled modules that defines
// their styles in code.
if (!empty($data_options[$settings['data']])) {
$summary[] = t('Data options: @data', array(
'@data' => $data_options[$settings['data']],
));
}
else {
$summary[] = t('No data options set');
}
if ($display['type'] == 'geofield_openlayers' && !empty($settings['map_preset'])) {
$openlayers_presets = openlayers_preset_options();
$summary[] = t('Openlayers Map: @data', array(
'@data' => $openlayers_presets[$settings['map_preset']],
));
}
if ($display['type'] == 'geofield_latlon') {
$format_options = _geofield_formatter_settings_format_options($display['type']);
// Display this setting only if image is linked.
if (isset($format_options[$settings['format']])) {
$summary[] = $format_options[$settings['format']];
}
}
if (!empty($settings['address']) && $settings['address']) {
$summary[] = t('Including reverse-geocoded address');
}
return implode('<br />', $summary);
}