You are here

function geolocation_address_field_widget_settings_summary_alter in Geolocation Field 8.2

Same name and namespace in other branches
  1. 8.3 modules/geolocation_address/geolocation_address.module \geolocation_address_field_widget_settings_summary_alter()

Implements hook_field_widget_settings_summary_alter().

File

modules/geolocation_address/geolocation_address.module, line 314
Provide address integration where due.

Code

function geolocation_address_field_widget_settings_summary_alter(&$summary, $context) {

  /** @var \Drupal\geolocation\Plugin\Field\FieldWidget\GeolocationMapWidgetBase $widget */
  $widget = $context['widget'];
  if (!$widget instanceof GeolocationMapWidgetBase) {
    return;
  }
  $settings = $widget
    ->getThirdPartySettings('geolocation_address');
  if (!empty($settings['enable'])) {
    $summary[] = t('Syncing with %field address field', [
      '%field' => $settings['address_field'],
    ]);
  }
}