| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
* Implementation of hook_requirements().
|
| 5 |
*/
|
| 6 |
function html_processor_requirements($phase) {
|
| 7 |
$requirements = array();
|
| 8 |
$t = get_t();
|
| 9 |
switch ($phase) {
|
| 10 |
case 'runtime':
|
| 11 |
if (!html_processor_htmltidy_test($message, $version)) {
|
| 12 |
$requirements['html_processor_htmltidy'] = array(
|
| 13 |
'title' => $t('HTML Tidy'),
|
| 14 |
'description' => $t('Download and install the HTML Tidy binary <a href="http://tidy.sourceforge.net/">http://tidy.sourceforge.net/</a>'),
|
| 15 |
'severity' => $phase == 'install' ? REQUIREMENT_WARNING : REQUIREMENT_ERROR,
|
| 16 |
'value' => $t('Tidy binary not found.'),
|
| 17 |
);
|
| 18 |
}
|
| 19 |
else {
|
| 20 |
$requirements['html_processor_htmltidy'] = array(
|
| 21 |
'title' => $t('HTML Tidy'),
|
| 22 |
'severity' => REQUIREMENT_OK,
|
| 23 |
'value' => $t('HTMLTidy was found <code>%tidy_version</code>', array('%tidy_version' => $version)),
|
| 24 |
);
|
| 25 |
}
|
| 26 |
break;
|
| 27 |
}
|
| 28 |
return $requirements;
|
| 29 |
}
|