You are here

public function ControlGoogleElementBase::getSettingsForm in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlGoogleElementBase.php \Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature\ControlGoogleElementBase::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 ControlElementBase::getSettingsForm

3 calls to ControlGoogleElementBase::getSettingsForm()
ControlDirections::getSettingsForm in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlDirections.php
Provide a generic map settings form array.
ControlGoogleMapType::getSettingsForm in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlGoogleMapType.php
Provide a generic map settings form array.
ControlGoogleZoom::getSettingsForm in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlGoogleZoom.php
Provide a generic map settings form array.
3 methods override ControlGoogleElementBase::getSettingsForm()
ControlDirections::getSettingsForm in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlDirections.php
Provide a generic map settings form array.
ControlGoogleMapType::getSettingsForm in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlGoogleMapType.php
Provide a generic map settings form array.
ControlGoogleZoom::getSettingsForm in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlGoogleZoom.php
Provide a generic map settings form array.

File

modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlGoogleElementBase.php, line 26

Class

ControlGoogleElementBase
Class ControlMapFeatureBase.

Namespace

Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature

Code

public function getSettingsForm(array $settings, array $parents) {
  $form = parent::getSettingsForm($settings, $parents);
  $settings = array_replace_recursive(self::getDefaultSettings(), $settings);
  $form['behavior'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Display behavior'),
    '#options' => [
      'default' => $this
        ->t('Default (Display control at 200px width minimum.)'),
      'always' => $this
        ->t('Always (Display control regardless of map dimensions.)'),
    ],
    '#default_value' => $settings['behavior'],
  ];
  return $form;
}