-
Notifications
You must be signed in to change notification settings - Fork 0
/
fullcalendar.install
82 lines (70 loc) · 2.83 KB
/
fullcalendar.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
// $Id$
/**
* @file
* Install, update and uninstall functions for the fullcalendar module.
*/
/**
* Implementation of hook_requirements().
*/
function fullcalendar_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
$t = get_t();
$status = _fullcalendar_status();
if (!$status['jquery_version']) {
$requirements['fullcalendar_jquery_version'] = array(
'title' => $t('FullCalendar required jQuery version'),
'value' => $t('Between @a and @b', array('@a' => FULLCALENDAR_MIN_JQUERY_VERSION, '@b' => FULLCALENDAR_MAX_JQUERY_VERSION)),
'severity' => REQUIREMENT_ERROR,
'description' => $t('You need to download and install a 6.x-2.x version of the !jquery_update module.', array('!jquery_update' => l(t('jQuery Update'), 'http://drupal.org/project/jquery_update'))),
);
}
if (!$status['jqueryui_version']) {
$requirements['fullcalendar_jqueryui_version'] = array(
'title' => $t('FullCalendar required jQuery UI version'),
'value' => $t('Between @a and @b', array('@a' => FULLCALENDAR_MIN_JQUERYUI_VERSION, '@b' => FULLCALENDAR_MAX_JQUERYUI_VERSION)),
'severity' => REQUIREMENT_ERROR,
'description' => $t('You need to download and install a 6.x-1.x version of the !jquery_ui module.', array('!jquery_ui' => l(t('jQuery UI'), 'http://drupal.org/project/jquery_ui'))),
);
}
if (!$status['fullcalendar_plugin']) {
$requirements['fullcalendar_plugin'] = array(
'title' => $t('FullCalendar plugin'),
'value' => $t('At least @a', array('@a' => FULLCALENDAR_MIN_PLUGIN_VERSION)),
'severity' => REQUIREMENT_ERROR,
'description' => $t('You need to download the !fullcalendar and extract the entire contents of the archive into the %path folder of your server.', array('!fullcalendar' => l(t('FullCalendar plugin'), 'http://arshaw.com/fullcalendar/download'), '%path' => 'sites/all/libraries')),
);
}
else {
$requirements['fullcalendar_plugin'] = array(
'title' => $t('FullCalendar plugin'),
'severity' => REQUIREMENT_OK,
'value' => fullcalendar_get_version(),
);
}
}
return $requirements;
}
/**
* Implementation of hook_install()
*/
function fullcalendar_install() {
fullcalendar_update_6001();
}
/**
* Implementation of hook_uninstall().
*/
function fullcalendar_uninstall() {
variable_del('fullcalendar_path');
variable_del('fullcalendar_compression_type');
}
/**
* Install new date formats
*/
function fullcalendar_update_6001() {
include_once(drupal_get_path('module', 'date') .'/date.install');
date_install_create_format(NULL, t('Fullcalendar (Date Format)'), 'fullcalendar_date_format', 'c');
$ret = array(array('success' => TRUE, 'query' => $module . " additional date format installation successful."));
return $ret;
}