function imagelightbox_requirements in ImageLightbox 8
Same name and namespace in other branches
- 2.0.x imagelightbox.install \imagelightbox_requirements()
Implements hook_requirements().
File
- ./
imagelightbox.install, line 11 - Install functions for the imagelightbox module.
Code
function imagelightbox_requirements($phase) {
$requirements = [];
if ($phase == 'runtime') {
if (!file_exists('libraries/imagelightbox/imagelightbox.js') && !file_exists('modules/imagelightbox/libraries/imagelightbox.js')) {
$requirements['imagelightbox_library'] = [
'title' => t('ImageLightBox library'),
'value' => t('Not found'),
'severity' => REQUIREMENT_ERROR,
'description' => t('You need to install the imagelightbox library by executing the drush command "drush imagelightbox-download" or "drush ilb-dl". If you wish to manualy install the latest imagelightbox.js, download the <a href=":library_url">imagelightbox library</a> and extract the archive to the <em>libraries/imagelightbox</em> directory on your server.', [
':library_url' => 'https://github.com/osvaldasvalutis/imageLightbox.js',
]),
];
}
}
return $requirements;
}