forked from dakala/fullcalendar
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fullcalendar.api.php
110 lines (101 loc) · 2.67 KB
/
fullcalendar.api.php
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
* @file
* Hooks provided by the FullCalendar module.
*/
/**
* @addtogroup hooks
* @{
*/
/**
* Constructs CSS classes for an entity.
*
* @param object $entity
* Object representing the entity.
*
* @return array
* Array of CSS classes.
*/
function hook_fullcalendar_classes($entity) {
// Add the entity type as a class.
return [
$entity->entity_type,
];
}
/**
* Alter the CSS classes for an entity.
*
* @param array $classes
* Array of CSS classes.
* @param object $entity
* Object representing the entity.
*/
function hook_fullcalendar_classes_alter(&$classes, $entity) {
// Remove all classes set by modules.
$classes = [];
}
/**
* Declare that you provide a droppable callback.
*
* Implementing this hook will cause a checkbox to appear on the view settings,
* when checked FullCalendar will search for JS callbacks in the form
* Drupal.fullcalendar.droppableCallbacks.MODULENAME.callback.
*
* @see http://arshaw.com/fullcalendar/docs/dropping/droppable
*/
function hook_fullcalendar_droppable() {
// This hook will never be executed.
return TRUE;
}
/**
* Allows your module to affect the editability of the calendar.
*
* If any module implementing this hook returns FALSE, the value will be set to
* FALSE. Use hook_fullcalendar_editable_alter() to override this if necessary.
*
* @param object $entity
* Object representing the entity.
* @param object $view
* Object representing the view.
*
* @return bool
* A Boolean value dictating whether of not the calendar is editable.
*/
function hook_fullcalendar_editable($entity, $view) {
return TRUE;
}
/**
* Allows your module to forcibly override the editability of the calendar.
*
* @param bool $editable
* A Boolean value dictating whether of not the calendar is editable.
* @param object $entity
* Object representing the entity.
* @param object $view
* Object representing the view.
*/
function hook_fullcalendar_editable_alter(&$editable, $entity, $view) {
$editable = FALSE;
}
/**
* Alter the dates after they're loaded, before they're added for rendering.
*
* @param object $date1
* The start date object.
* @param object $date2
* The end date object.
* @param array $context
* An associative array containing the following key-value pairs:
* - instance: The field instance.
* - entity: The entity object for this date.
* - field: The field info.
*/
function hook_fullcalendar_process_dates_alter(&$date1, &$date2, $context) {
// Always display dates only on one day.
if ($date1->format(DATETIME_DATE_STORAGE_FORMAT) != $date2->format(DATETIME_DATE_STORAGE_FORMAT)) {
$date2 = $date1;
}
}
/**
* @} End of "addtogroup hooks".
*/