-
Notifications
You must be signed in to change notification settings - Fork 7
/
os2web_esdh_provider.install
60 lines (55 loc) · 1.59 KB
/
os2web_esdh_provider.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
<?php
/**
* @file
* Implements install hooks
*/
/**
* Imlpements hook_install().
*/
function os2web_esdh_provider_install() {
// Placeholder.
}
/**
* Implements hook_uninstall().
*/
function os2web_esdh_provider_uninstall() {
// Placeholder.
}
/**
* Implements hook_requirements().
*/
function os2web_esdh_provider_requirements($phase) {
if ($phase !== 'runtime') {
return array();
}
$t = get_t();
$plugins = os2web_esdh_provider_ctools_plugin_type();
$status = $count = count(array_keys($plugins));
foreach (array_keys($plugins) as $plugin) {
if (os2web_esdh_provider_has_api($plugin)) {
$status--;
}
}
if ($status == 0) {
$value = $t('Fully supported.');
$severity = REQUIREMENT_OK;
$desc = $t('All ESDH plugins seems to be working as intended. <a href="admin/config/os2web/esdh_provider">Status</a>');
}
elseif ($status < $count) {
$value = $t('Partial support.');
$severity = REQUIREMENT_WARNING;
$desc = $t('Some ESDH plugins not activated! This can lead to not-working or misleading behavior on the site! <a href="admin/config/os2web/esdh_provider">Check status</a>');
}
else {
$value = $t('Not support.');
$severity = REQUIREMENT_ERROR;
$desc = $t('No ESDH plugins activated! This can lead to not-working or misleading behavior on the site! <a href="admin/config/os2web/esdh_provider">Check status</a>');
}
$requirements['os2web_esdh_provider_plugins'] = array(
'title' => $t('OS2Web ESDH integration.'),
'value' => $value,
'severity' => $severity,
'description' => $desc,
);
return $requirements;
}