-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflipbook.install
51 lines (44 loc) · 1.38 KB
/
flipbook.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
<?php
/**
* @file
* Install, update, and uninstall functionality for flipbook.
*/
/**
* Implements hook_requirements().
*/
function flipbook_requirements($phase) {
$requirements = array();
$t = get_t();
// Check to see if the flipbook library is available.
if ($phase == 'runtime') {
$library = libraries_detect('flipbook');
if ($library['installed']) {
$version = explode('.', $library['version']);
if ($version[0] == FLIPBOOK_COMPATIBLE_MAJOR_VERSION) {
$requirements['flipbook'] = array(
'value' => $library['version'],
'severity' => REQUIREMENT_OK,
);
}
else {
$requirements['flipbook'] = array(
'value' => $library['version'],
'description' => $t('Incompatible version detected. The flipbook
library version must be from the %version.x branch.',
array('%version' => FLIPBOOK_COMPATIBLE_MAJOR_VERSION)),
'severity' => REQUIREMENT_WARNING,
);
}
}
else {
$requirements['flipbook'] = array(
'value' => $t('Flipbook library not found.'),
'description' => $t('The flipbook library could not be detected.
Please consult the README.md for installation instructions.'),
'severity' => REQUIREMENT_ERROR,
);
}
$requirements['flipbook']['title'] = $t('Flipbook');
}
return $requirements;
}