elevatezoomplus-8.x-1.x-dev/elevatezoomplus.install
elevatezoomplus.install
<?php
/**
* @file
* Installation actions for ElevateZoomPlus.
*/
/**
* Implements hook_requirements().
*/
function elevatezoomplus_requirements($phase) {
if ($phase != 'runtime') {
return [];
}
$requirements = [];
// ElevateZoomPlus library.
$names = ['elevatezoom-plus', 'ez-plus'];
$path = blazy()->getLibrariesPath($names);
$exists = FALSE;
if ($path && is_dir($path)) {
$exists = is_file($path . '/src/jquery.ez-plus.js');
}
$requirements['elevatezoomplus_library'] = [
'title' => t('ElevateZoom Plus library'),
'description' => $exists ? '' : t('The <a href=":url">ElevateZoom Plus library</a> should be installed at <strong>/libraries/elevatezoom-plus/src/jquery.ez-plus.js</strong>, or any path supported by libraries.module if installed. Check out file or folder permissions if troubled.', [':url' => 'https://github.com/igorlino/elevatezoom-plus']),
'severity' => $exists ? REQUIREMENT_OK : REQUIREMENT_ERROR,
'value' => $exists ? t('Installed') : t('Not installed'),
];
return $requirements;
}
