1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Install file for Highlight JS library.
|
6 |
|
|
*
|
7 |
|
|
* @author Juned Kazi
|
8 |
|
|
*/
|
9 |
|
|
|
10 |
|
|
/**
|
11 |
|
|
* Implements hook_requirements().
|
12 |
|
|
*/
|
13 |
|
|
function highlight_js_requirements($phase) {
|
14 |
|
|
$requirements = array();
|
15 |
|
|
|
16 |
|
|
switch ($phase) {
|
17 |
|
|
case 'runtime':
|
18 |
|
|
// Check to make sure the highlight.js library is available.
|
19 |
|
|
$library = libraries_detect('highlightjs');
|
20 |
|
|
$requirements['highlightjs'] = array(
|
21 |
|
|
'title' => t('Highlight.js'),
|
22 |
|
|
'value' => $library['installed'] ? t('Installed') : t('Not installed'),
|
23 |
|
|
'description' => isset($library['error message']) ? $library['error message'] : '',
|
24 |
|
|
'severity' => $library['installed'] ? REQUIREMENT_OK : REQUIREMENT_ERROR,
|
25 |
|
|
);
|
26 |
|
|
break;
|
27 |
|
|
}
|
28 |
|
|
return $requirements;
|
29 |
|
|
}
|
30 |
|
|
|
31 |
|
|
/**
|
32 |
|
|
* Implementation of hook_uninstall().
|
33 |
|
|
*/
|
34 |
|
|
function highlight_js_uninstall() {
|
35 |
|
|
variable_del('highlightjs_style');
|
36 |
|
|
} |