You are here

public function GeoPhpGeocodeFormatter::settingsSummary in Geocoder 8.2

Same name and namespace in other branches
  1. 8.3 modules/geocoder_geofield/src/Plugin/Field/FieldFormatter/GeoPhpGeocodeFormatter.php \Drupal\geocoder_geofield\Plugin\Field\FieldFormatter\GeoPhpGeocodeFormatter::settingsSummary()

Returns a short summary for the current formatter settings.

If an empty result is returned, a UI can still be provided to display a settings form in case the formatter has configurable settings.

Return value

string[] A short summary of the formatter settings.

Overrides FileGeocodeFormatter::settingsSummary

File

modules/geocoder_geofield/src/Plugin/Field/FieldFormatter/GeoPhpGeocodeFormatter.php, line 178

Class

GeoPhpGeocodeFormatter
Abstract implementation of the GeoPhp Wrapper formatter for File fields.

Namespace

Drupal\geocoder_geofield\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  $adapters = $this->geoPhpWrapper
    ->getAdapterMap();
  $adapter = $this
    ->getSetting('adapter');
  $summary['intro'] = $this->pluginDefinition['description'];
  $summary['plugins'] = t('Geocoder plugin(s): @formatterPlugin', [
    '@formatterPlugin' => $this->formatterPlugin,
  ]);
  $summary['adapter'] = t('Output format: @format', [
    '@format' => !empty($adapter) ? $adapters[$adapter] : $this
      ->t('Not set'),
  ]);
  return $summary;
}