forked from Islandora-Labs/islandora_simple_map
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathislandora_simple_map.install
74 lines (69 loc) · 2.2 KB
/
islandora_simple_map.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* @file
* This file contains all install related hooks.
*/
/**
* Implements hook_uninstall().
*/
function islandora_simple_map_uninstall() {
$variables = array(
'islandora_simple_map_xpath',
'islandora_simple_map_iframe_width',
'islandora_simple_map_iframe_height',
'islandora_simple_map_zoom',
'islandora_simple_map_collapsed',
'islandora_simple_map_use_gmaps_api',
'islandora_simple_map_google_maps_api_key',
'islandora_simple_map_disable_scroll',
'islandora_simple_map_disable_page_display',
'islandora_simple_map_coordinate_delimiter',
'islandora_simple_map_coordinate_solr_field',
'islandora_simple_map_use_solr',
'islandora_simple_map_collection_maps',
'islandora_simple_map_collection_maps_cache',
);
array_walk($variables, 'variable_del');
}
/**
* Implements hook_schema().
*/
function islandora_simple_map_schema() {
$schema['islandora_simple_map_collections_map'] = array(
'description' => 'Collections displaying a map',
'fields' => array(
'pid' => array(
'description' => 'The object PID to use',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'title' => array(
'description' => 'Collection title for reference',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
),
'primary key' => array('pid'),
);
return $schema;
}
/**
* Install new database table for collection maps.
*/
function islandora_simple_map_update_7100() {
if (!db_table_exists('islandora_simple_map_collections_map')) {
$schema = islandora_simple_map_schema();
db_create_table('islandora_simple_map_collections_map', $schema['islandora_simple_map_collections_map']);
}
}
/**
* Correct variable names and remove old variables.
*/
function islandora_simple_map_update_7101() {
variable_set('islandora_simple_map_disable_scroll', variable_get('islandora_simple_maps_disable_scroll', FALSE));
variable_set('islandora_simple_map_disable_page_display', variable_get('islandora_simple_maps_disable_page_display', FALSE));
variable_del('islandora_simple_maps_disable_scroll');
variable_del('islandora_simple_maps_disable_page_display');
}