You are here

public function ContextPopup::getSettingsForm in Geolocation Field 8.2

Same name and namespace in other branches
  1. 8.3 modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ContextPopup.php \Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature\ContextPopup::getSettingsForm()

Provide a generic map settings form array.

Parameters

array $settings: The current map settings.

array $parents: Form specific optional prefix.

Return value

array A form array to be integrated in whatever.

Overrides MapFeatureBase::getSettingsForm

File

modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ContextPopup.php, line 35

Class

ContextPopup
Provides context popup.

Namespace

Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature

Code

public function getSettingsForm(array $settings, array $parents) {
  $settings = $this
    ->getSettings($settings);
  $form = parent::getSettingsForm($settings, $parents);
  $form['content'] = [
    '#type' => 'text_format',
    '#title' => $this
      ->t('Context popup content'),
    '#description' => $this
      ->t('A right click on the map will open a context popup with this content. Tokens supported. Additionally "@lat, @lng" will be replaced dynamically.'),
  ];
  if (!empty($settings['content']['value'])) {
    $form['content']['#default_value'] = $settings['content']['value'];
  }
  if (!empty($settings['content']['format'])) {
    $form['content']['#format'] = $settings['content']['format'];
  }
  return $form;
}