function fontawesome_requirements in Font Awesome Icons 7
Same name and namespace in other branches
- 8.2 fontawesome.install \fontawesome_requirements()
- 8 fontawesome.install \fontawesome_requirements()
- 7.3 fontawesome.install \fontawesome_requirements()
- 7.2 fontawesome.install \fontawesome_requirements()
Implements hook_requirements().
File
- ./
fontawesome.install, line 11 - Requirements page for Font Awesome.
Code
function fontawesome_requirements($phase) {
$requirements = array();
// Report the version of Font Awesome.
if ($phase == 'runtime') {
// Make sure Libraries is loaded before loading Font Awesome.
drupal_load('module', 'libraries');
$fontawesome = libraries_detect('fontawesome');
$requirements['fontawesome'] = array(
'title' => $fontawesome['name'],
'severity' => $fontawesome['installed'] ? REQUIREMENT_OK : REQUIREMENT_WARNING,
'value' => $fontawesome['installed'] ? $fontawesome['version'] : $fontawesome['error message'],
);
}
return $requirements;
}