-
Notifications
You must be signed in to change notification settings - Fork 41
/
islandora_pdf.install
65 lines (60 loc) · 1.83 KB
/
islandora_pdf.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
<?php
/**
* @file
* islandora_pdf.install
*/
/**
* Implements hook_install().
*
* @see islandora_pdf_islandora_required_objects()
*/
function islandora_pdf_install() {
module_load_include('inc', 'islandora', 'includes/solution_packs');
islandora_install_solution_pack('islandora_pdf');
}
/**
* Implements hook_uninstall().
*/
function islandora_pdf_uninstall() {
module_load_include('inc', 'islandora', 'includes/solution_packs');
islandora_install_solution_pack('islandora_pdf', 'uninstall');
$variables = array(
'islandora_pdf_path_to_pdftotext',
'islandora_pdf_path_to_gs',
'islandora_pdf_allow_text_upload',
'islandora_pdf_create_fulltext',
'islandora_pdf_create_pdfa',
'islandora_pdf_thumbnail_width',
'islandora_pdf_thumbnail_height',
'islandora_pdf_thumbnail_colorspace',
'islandora_pdf_preview_width',
'islandora_pdf_preview_height',
'islandora_pdf_preview_colorspace',
'islandora_pdf_use_duseciecolor',
);
array_walk($variables, 'variable_del');
}
/**
* Maintain existing RGB colorspace profile configuration.
*/
function islandora_pdf_update_7001(&$sandbox) {
variable_set('islandora_pdf_preview_colorspace', 'RGB');
variable_set('islandora_pdf_thumbnail_colorspace', 'RGB');
$t = get_t();
return $t('Set colorspace configuration to RBG to maintain existing profile.');
}
/**
* Set and maintain new dUseCIEColor switch variable.
*/
function islandora_pdf_update_7100(&$sandbox) {
$min_version = "9.11";
$executable = variable_get('islandora_pdf_path_to_gs', '/usr/bin/gs');
$version_command = "$executable --version";
exec($version_command, $installed_version);
if (version_compare($installed_version[0], $min_version, '>=')) {
variable_set('islandora_pdf_use_duseciecolor', FALSE);
}
else {
variable_set('islandora_pdf_use_duseciecolor', TRUE);
}
}