-
Notifications
You must be signed in to change notification settings - Fork 1
/
fullcalendar_library.install
48 lines (42 loc) · 1.66 KB
/
fullcalendar_library.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?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,
],
];
}
}