function getlocations_mapquest_field_formatter_settings_summary in Get Locations 7
Same name and namespace in other branches
- 7.2 modules/getlocations_mapquest/getlocations_mapquest.module \getlocations_mapquest_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_mapquest/ getlocations_mapquest.module, line 502 - getlocations_mapquest.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
Code
function getlocations_mapquest_field_formatter_settings_summary($field, $instance, $view_mode) {
$display = $instance['display'][$view_mode];
$settings = $display['settings'];
$summary = array();
switch ($display['type']) {
case 'getlocations_mapquest_map':
$summary[] = t('Getlocations Mapquest Map Field settings');
if ($settings['zoomControl'] != 'none') {
$summary[] = t('Zoom control type: !t', array(
'!t' => $settings['zoomControl'] == 'small' ? 'Small' : 'Large',
));
}
if ($settings['layerControl']) {
$summary[] = t('Show layer control: Yes');
}
if ($settings['overview']) {
$summary[] = t('Show Overview: Yes');
}
if ($settings['trafficControl']) {
$summary[] = t('Show traffic control: Yes');
}
if ($settings['drawingControl']) {
$summary[] = t('Show drawing control: Yes');
}
if ($settings['geolocationControl']) {
$summary[] = t('Show geolocation control: Yes');
}
break;
case 'getlocations_mapquest_link':
$summary[] = t('Getlocations Mapquest 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);
}