farmOS/modules/farm/farm_map/farm_map.install

47 lines
992 B
Plaintext

<?php
/**
* @file
* Farm map install.
*/
/**
* Copy the Google Maps API key into the new configuration variable.
*/
function farm_map_update_7000(&$sandbox) {
// Removed.
}
/**
* Delete the old farm_map_default_base_layer variable.
*/
function farm_map_update_7001(&$sandbox) {
variable_del('farm_map_default_base_layer');
}
/**
* Install new Google Maps module if an API key is saved.
*/
function farm_map_update_7002(&$sandbox) {
$module = 'farm_map_google';
if (variable_get('farm_map_google_api_key', FALSE) && !module_exists($module)) {
module_enable(array($module));
}
}
/**
* Install new Mapbox module if an API key is saved.
*/
function farm_map_update_7003(&$sandbox) {
$module = 'farm_map_mapbox';
if (variable_get('farm_map_mapbox_api_key', FALSE) && !module_exists($module)) {
module_enable(array($module));
}
}
/**
* Delete the old farm_map_show variable.
*/
function farm_map_update_7004(&$sandbox) {
variable_del('farm_map_show');
}