Commit d8f6da34 authored by acrollet's avatar acrollet

Show all requirements messages

parent 3716c871
<?php
/**
* @file
* Install for Fullcalendar Library module
*/
/**
* Implements hook_requirements().
*/
function fullcalendar_library_requirements($phase) {
if ($phase != 'runtime') {
return [];
}
$return = [];
if (!file_exists(DRUPAL_ROOT . '/libraries/fullcalendar/fullcalendar.min.js')) {
$return['fullcalendar'] = [
'title' => t('Fullcalendar'),
'value' => t('FullCalendar Library loaded via CDN'),
'description' => t('A CDN is being used to load the Fullcalendar library. To use a local copy, <a target="_blank" href="@url">download</a> the library and extract it into the /libraries/fullcalendar folder in your Drupal installation directory.', ['@url' => 'https://fullcalendar.io/download/']),
'severity' => REQUIREMENT_INFO,
];
}
if (!file_exists(DRUPAL_ROOT . '/libraries/fullcalendar-scheduler/scheduler.min.js')) {
$return['fullcalendar_scheduler'] = [
'title' => t('Fullcalendar Scheduler'),
'value' => t('FullCalendar Scheduler Library loaded via CDN'),
'description' => t('A CDN is being used to load the Fullcalendar Scheduler library. To use a local copy, <a target="_blank" href="@url">download</a> the library and extract it into the /libraries/fullcalendar folder in your Drupal installation directory.', ['@url' => 'https://fullcalendar.io/scheduler/']),
'severity' => REQUIREMENT_INFO,
];
}
if (!empty($return)) {
return $return;
}
else {
return [
'fullcalendar' => [
'title' => t('Fullcalendar'),
'value' => t('The FullCalendar, FullCalendar Scheduler and the Moment Library are installed'),
'severity' => REQUIREMENT_OK,
],
];
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment