geolocation_google_maps_demo.install in Geolocation Field 8.2
Same filename and directory in other branches
Geolocation demo setup.
File
modules/geolocation_google_maps/modules/geolocation_google_maps_demo/geolocation_google_maps_demo.installView source
<?php
/**
* @file
* Geolocation demo setup.
*/
/**
* Implements hook_install().
*/
function geolocation_google_maps_demo_install() {
/** @var \Drupal\Core\Config\Config $config */
$config = \Drupal::service('config.factory')
->getEditable('geolocation_google_maps.settings');
if (empty($config
->get('google_map_api_key'))) {
$config
->set('google_map_api_key', 'AIzaSyChy7jQvcJpTpIiupQhq4wacdVzdum3hvc')
->save();
}
}
/**
* Implements hook_uninstall().
*/
function geolocation_google_maps_demo_uninstall() {
/** @var \Drupal\Core\Config\Config $config */
$config = \Drupal::service('config.factory')
->getEditable('geolocation_google_maps.settings');
if ($config
->get('google_map_api_key') == 'AIzaSyChy7jQvcJpTpIiupQhq4wacdVzdum3hvc') {
$config
->set('google_map_api_key', '')
->save();
}
}
Functions
Name | Description |
---|---|
geolocation_google_maps_demo_install | Implements hook_install(). |
geolocation_google_maps_demo_uninstall | Implements hook_uninstall(). |