You are here

public function AdminConfigureForm::submitForm in IP Geolocation Views & Maps 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides ConfigFormBase::submitForm

File

src/Form/AdminConfigureForm.php, line 428

Class

AdminConfigureForm
Pending doc.

Namespace

Drupal\ip_geoloc\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // print_r($form_state->getValues());die();
  $this
    ->config('ip_geoloc.settings')
    ->set('ip_geoloc_auth_method', $form_state
    ->getValue('ip_geoloc_auth_method'))
    ->set('ip_geoloc_apikey', $form_state
    ->getValue('ip_geoloc_apikey'))
    ->set('ip_geoloc_marker_directory', $form_state
    ->getValue('ip_geoloc_marker_directory'))
    ->set('ip_geoloc_client_id', $form_state
    ->getValue('ip_geoloc_client_id'))
    ->set('ip_geoloc_signature', $form_state
    ->getValue('ip_geoloc_signature'))
    ->set('ip_geoloc_marker_anchor_pos', $form_state
    ->getValue('ip_geoloc_marker_anchor_pos'))
    ->set('ip_geoloc_num_location_marker_layers', $form_state
    ->getValue('ip_geoloc_num_location_marker_layers'))
    ->set('ip_geoloc_sync_batch_size', $form_state
    ->getValue('ip_geoloc_sync_batch_size'))
    ->set('ip_geoloc_allow_session_storage', $form_state
    ->getValue('ip_geoloc_allow_session_storage'))
    ->set('ip_geoloc_store_addresses', $form_state
    ->getValue('ip_geoloc_store_addresses'))
    ->set('ip_geoloc_google_to_reverse_geocode', $form_state
    ->getValue('ip_geoloc_google_to_reverse_geocode'))
    ->set('ip_geoloc_location_check_interval', $form_state
    ->getValue('ip_geoloc_location_check_interval'))
    ->set('ip_geoloc_include_pages', $form_state
    ->getValue('ip_geoloc_include_pages'))
    ->set('ip_geoloc_exclude_pages', $form_state
    ->getValue('ip_geoloc_exclude_pages'))
    ->set('ip_geoloc_roles_to_reverse_geocode', $form_state
    ->getValue('ip_geoloc_roles_to_reverse_geocode'))
    ->set('ip_geoloc_smart_ip_as_backup', $form_state
    ->getValue('ip_geoloc_smart_ip_as_backup'))
    ->set('ip_geoloc_throbber_text2', $form_state
    ->getValue('ip_geoloc_throbber_text2'))
    ->set('ip_geoloc_page_refresh', $form_state
    ->getValue('ip_geoloc_page_refresh'))
    ->set('ip_geoloc_debug', $form_state
    ->getValue('ip_geoloc_debug'))
    ->save();
  parent::submitForm($form, $form_state);
}