-
Brandon Bergren authoredBrandon Bergren authored
gmap.install 1.57 KiB
<?php
// $Id$
/**
* @file
* GMap install file
*/
/**
* Implementation of hook_uninstall().
*/
function gmap_uninstall() {
variable_del('gmap_method');
variable_del('gmap_wms');
variable_del('gmap_default');
variable_del('gmap_mm_type');
variable_del('gmap_load_zoom_plugin');
variable_del('gmap_markermanager');
variable_del('gmap_markerfiles');
variable_del('gmap_node_markers');
variable_del('googlemap_api_key');
}
/**
* Updates from 5.x-1.0alpha1 to 5.x-1.0.
* Do some tidying up of the settings.
*/
function gmap_update_5000() {
$ret = array();
$d = variable_get('gmap_default', array());
// Add the previous implicit baselayers back in.
if (!isset($d['baselayers'])) {
$d['baselayers'] = array(
// Default map type
'maptype' => isset($d['maptype']) ? $d['maptype'] : 'Map',
'Map' => 1,
'Satellite' => 1,
'Hybrid' => 1,
'Physical' => 0,
);
}
// Default maptype was moved into baselayers.
unset($d['maptype']);
// Determine the map type control that was in use.
if (!isset($d['mtc'])) {
// User had the notype behavior flag set.
if (!empty($d['behavior']['notype'])) {
$d['mtc'] = 'none';
}
else {
$d['mtc'] = 'standard';
}
}
// notype is gone, mtc is more generic.
if (isset($d['behavior']['notype'])) {
unset($d['behavior']['notype']);
}
variable_set('gmap_default', $d);
return $ret;
}
/**
* Post 5.x-1.0beta2 update 1.
* We added a menu callback, force a rebuild.
*/
function gmap_update_5001() {
$ret = array();
menu_rebuild();
return $ret;
}