zurb_twentytwenty.install in ZURB TwentyTwenty 8
File
zurb_twentytwenty.install
View source
<?php
use Drupal\Core\Url;
use Drupal\Core\Link;
function zurb_twentytwenty_requirements($phase) {
$requirements = array();
switch ($phase) {
case 'install':
case 'runtime':
$file_exists = file_exists(DRUPAL_ROOT . '/libraries/twentytwenty/js/jquery.twentytwenty.js');
if ($file_exists) {
$message = t('Zurb TwentyTwenty plugin detected in %path', [
'%path' => '/libraries/twentytwenty.',
]);
}
else {
$message = t('The Zurb TwentyTwenty plugin was not found. Please <a href=":repository_url" target="_blank">download it</a> into the libraries folder in the root (/libraries/twentytwenty).', [
':repository_url' => 'https://github.com/zurb/twentytwenty',
]);
}
$requirements['zurb_twentytwenty'] = [
'title' => t('ZURB TwentyTwenty Plugin'),
'value' => $message,
'severity' => $file_exists ? REQUIREMENT_OK : REQUIREMENT_ERROR,
];
break;
}
return $requirements;
}