You are here

public function ClientLocation::getSettingsForm in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 src/Plugin/geolocation/LocationInput/ClientLocation.php \Drupal\geolocation\Plugin\geolocation\LocationInput\ClientLocation::getSettingsForm()

Settings form by ID and context.

Parameters

int $center_option_id: LocationInput option ID.

array $settings: The current option settings.

mixed $context: Current context.

Return value

array A form array to be integrated in whatever.

Overrides LocationInputBase::getSettingsForm

File

src/Plugin/geolocation/LocationInput/ClientLocation.php, line 34

Class

ClientLocation
Location based proximity center.

Namespace

Drupal\geolocation\Plugin\geolocation\LocationInput

Code

public function getSettingsForm($option_id = NULL, array $settings = [], $context = NULL) {
  $settings = $this
    ->getSettings($settings);
  $form = parent::getSettingsForm($option_id, $settings, $context);
  $form['auto_submit'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Auto-submit form'),
    '#default_value' => $settings['auto_submit'],
    '#description' => $this
      ->t('Only triggers if location could be set'),
  ];
  $form['hide_form'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Hide coordinates form'),
    '#default_value' => $settings['hide_form'],
  ];
  $form['#description'] = $this
    ->t('Location will be set if it is empty and client location is available. This requires a https connection.');
  return $form;
}