-
Notifications
You must be signed in to change notification settings - Fork 57
/
islandora_scholar.install
168 lines (159 loc) · 7.02 KB
/
islandora_scholar.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
/**
* @file
* Install hooks for this module.
*/
/**
* Implements hook_install().
*
* @see islandora_book_islandora_required_objects()
*/
function islandora_scholar_install() {
module_load_include('inc', 'islandora', 'includes/solution_packs');
islandora_install_solution_pack('islandora_scholar');
}
/**
* Implements hook_uninstall().
*/
function islandora_scholar_uninstall() {
module_load_include('inc', 'islandora', 'includes/solution_packs');
islandora_install_solution_pack('islandora_scholar', 'uninstall');
$variables = array(
'islandora_scholar_use_standard_metadata_display',
'islandora_scholar_users_choose_display_csl',
'islandora_scholar_specify_document_versions',
'islandora_scholar_document_versions',
'islandora_scholar_specify_use_permissions',
'islandora_scholar_use_permissions',
'islandora_scholar_romeo_enable',
'islandora_scholar_thumbnail_width',
'islandora_scholar_thumbnail_height',
'islandora_scholar_thumbnail_colorspace',
'islandora_scholar_path_to_pdftotext',
'islandora_scholar_preview_width',
'islandora_scholar_preview_height',
'islandora_scholar_preview_colorspace',
'islandora_scholar_issn_cache_time',
'islandora_scholar_romeo_key',
'islandora_scholar_romeo_url',
'islandora_scholar_romeo_cache_time',
'islandora_scholar_create_fulltext',
'islandora_scholar_preview_density',
'islandora_scholar_google_scholar_metatags_enabled',
'islandora_scholar_google_scholar_search_enabled',
'islandora_scholar_google_scholar_primary_search_xpath',
'islandora_scholar_google_scholar_default_search_xpath',
'islandora_scholar_library_catalog_search_enabled',
'islandora_scholar_library_catalog_search_URL',
'islandora_scholar_library_catalog_search_params',
'islandora_scholar_library_catalog_primary_search_xpath',
'islandora_scholar_library_catalog_default_search_xpath',
'islandora_scholar_xpaths_abstract',
'islandora_scholar_xpaths_authors_xpath',
'islandora_scholar_xpaths_call-number',
'islandora_scholar_xpaths_collection-title',
'islandora_scholar_xpaths_container-title',
'islandora_scholar_xpaths_created_date',
'islandora_scholar_xpaths_dateCaptured',
'islandora_scholar_xpaths_date_issued',
'islandora_scholar_xpaths_degree_grantor',
'islandora_scholar_xpaths_department',
'islandora_scholar_xpaths_DOI',
'islandora_scholar_xpaths_edition',
'islandora_scholar_xpaths_embargo_date',
'islandora_scholar_xpaths_enabled',
'islandora_scholar_xpaths_end_page',
'islandora_scholar_xpaths_event',
'islandora_scholar_xpaths_event_place',
'islandora_scholar_xpaths_event_place_property',
'islandora_scholar_xpaths_event_property',
'islandora_scholar_xpaths_family',
'islandora_scholar_xpaths_genre',
'islandora_scholar_xpaths_given',
'islandora_scholar_xpaths_host_title',
'islandora_scholar_xpaths_ISBN',
'islandora_scholar_xpaths_issn',
'islandora_scholar_xpaths_issue',
'islandora_scholar_xpaths_local_author',
'islandora_scholar_xpaths_local_collection-editor',
'islandora_scholar_xpaths_local_container-author',
'islandora_scholar_xpaths_note',
'islandora_scholar_xpaths_number',
'islandora_scholar_xpaths_number-nihmsid',
'islandora_scholar_xpaths_number-pmcid',
'islandora_scholar_xpaths_number-pmid',
'islandora_scholar_xpaths_online_date',
'islandora_scholar_xpaths_origin_date',
'islandora_scholar_xpaths_pages',
'islandora_scholar_xpaths_part_date',
'islandora_scholar_xpaths_publisher',
'islandora_scholar_xpaths_publisher-place',
'islandora_scholar_xpaths_related_date',
'islandora_scholar_xpaths_role_term',
'islandora_scholar_xpaths_season',
'islandora_scholar_xpaths_start_page',
'islandora_scholar_xpaths_title',
'islandora_scholar_xpaths_title_nonsort',
'islandora_scholar_xpaths_title_subtitle',
'islandora_scholar_xpaths_title_sub_title',
'islandora_scholar_xpaths_types',
'islandora_scholar_xpaths_types_local_auth',
'islandora_scholar_xpaths_type_marcgt',
'islandora_scholar_xpaths_type_marcgt_host_titles',
'islandora_scholar_xpaths_type_marcgt_related',
'islandora_scholar_xpaths_URL',
'islandora_scholar_xpaths_volume',
);
array_walk($variables, 'variable_del');
}
/**
* Print and log a message about updating derivative PDFs.
*/
function islandora_scholar_update_7100(&$sandbox) {
drupal_set_message(filter_xss(t('Existing citations with PDF datastreams should have derivatives created for them via Drush. Please consult the !url for further information.',
array(
'!url' => l(t('README'), 'https://github.com/islandora/islandora_scholar/blob/7.x/README.md', array('absolute' => TRUE)),
)
)));
watchdog('islandora_scholar', 'Existing citations with PDF datastreams should have derivatives created for them via Drush.', array(), WATCHDOG_NOTICE, l(t('README'), 'https://github.com/islandora/islandora_scholar/blob/7.x/README.md', array('external' => TRUE)));
}
/**
* Print and log a message about possible lost physicalDescription data.
*/
function islandora_scholar_update_7101(&$sandbox) {
drupal_set_message(filter_xss(t('Existing mods:physicalDescription fields with an @authority="local" may become hidden with this update. Please consult the !url for further information.',
array(
'!url' => l(t('ticket'), 'https://jira.duraspace.org/browse/ISLANDORA-1350', array('absolute' => TRUE)),
)
)));
watchdog('islandora_scholar', 'Existing mods:physicalDescription fields with an @authority="local" may become hidden with this update.', array(), WATCHDOG_NOTICE, l(t('ISLANDORA-1350'), 'https://jira.duraspace.org/browse/ISLANDORA-1350', array('external' => TRUE)));
}
/**
* Print out a message informing about the change in permissions.
*/
function islandora_scholar_update_7102(&$sandbox) {
return t('The permission to administer the Islandora Scholar module has been changed to "Administer site configuration"; roles that could previously access Islandora Scholar management pages via the "Use the administration pages and help" permission will no longer be able to do so. Permissions may need to be reviewed.');
}
/**
* Maintain existing RGB colorspace profile configuration.
*/
function islandora_scholar_update_7103(&$sandbox) {
variable_set('islandora_scholar_preview_colorspace', 'RGB');
variable_set('islandora_scholar_thumbnail_colorspace', 'RGB');
$t = get_t();
return $t('Set colorspace configuration to RBG to maintain existing profile.');
}
/**
* Disable Islandora Google Scholar if it is currently enabled, since logic now lives in Islandora Scholar
*/
function islandora_scholar_update_7104(&$sandbox) {
$module = array('islandora_google_scholar');
if (module_exists($module[0])) {
module_disable($module, FALSE);
}
db_delete('system')
->condition('name', $module, 'IN')
->condition('type', 'module')
->execute();
return t('The Islandora Google Scholar submodule has been removed, and its functionality has been moved into the main Islandora Scholar module.');
}