-
Notifications
You must be signed in to change notification settings - Fork 0
/
layers3drop.install
38 lines (33 loc) · 1.18 KB
/
layers3drop.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
<?php
/**
* @file
* Install functions for layers3d.
*/
/**
* Implements hook_requirements().
*/
function layers3drop_requirements($phase) {
$requirements = array();
$t = get_t();
if ($phase == 'runtime') {
$library = libraries_detect('layers3d');
$error_type = isset($library['error']) ? drupal_ucfirst($library['error']) : '';
$error_message = isset($library['error message']) ? $library['error message'] : '';
if (empty($library['installed'])) {
$requirements['layers3d_library'] = array(
'title' => $t('layers3d plugin'),
'value' => $t('@e', array('@e' => $error_type)),
'description' => $t('!error You need to download the !layers3d, extract the archive and place the layers3d directory in the %path directory on your server.', array('!error' => $error_message, '!layers3d' => l($t('layers3d plugin'), $library['download url']), '%path' => 'sites/all/libraries')),
'severity' => REQUIREMENT_ERROR,
);
}
else {
$requirements['layers3d_library'] = array(
'title' => $t('layers3d plugin'),
'value' => $library['version'],
'severity' => REQUIREMENT_OK,
);
}
}
return $requirements;
}