-
Notifications
You must be signed in to change notification settings - Fork 2
/
ModuleConfig.cfc
129 lines (109 loc) · 3.65 KB
/
ModuleConfig.cfc
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/**
********************************************************************************
Copyright 2017 Full Calendar by Mark Skelton and Computer Know How, LLC
www.compknowhow.com
********************************************************************************
Author: Mark Skelton
Description: Creates Full Calendar calendars
*/
component {
// Module Properties
this.title = "Full Calendar";
this.author = "Computer Know How, LLC";
this.webURL = "http://www.compknowhow.com";
this.description = "Creates Full Calendar calendars";
this.version = "1.1";
// If true, looks for views in the parent first, if not found, then in the module. Else vice-versa
this.viewParentLookup = true;
// If true, looks for layouts in the parent first, if not found, then in module. Else vice-versa
this.layoutParentLookup = true;
// Module Entry Point
this.entryPoint = "fullCalendar";
function configure(){
// full calendar global settings
settings = {
googleCalendarApiKey = "",
nextPrevButtons = true,
todayButton = true,
dateButton = true,
monthButton = true,
weekButton = true,
dayButton = true,
agendaButton = true,
defaultView = "month",
showLegend = false,
nowIndicator = false,
navLinks = false,
openGCalEvents = false,
newTab = true,
includeJquery = false,
useTooltips = true,
hideJqueryAlert = false,
eventColor = "",
eventTextColor = "",
refreshButton = false
};
// SES Routes
routes = [
// Convention Route
{pattern="/:handler/:action?"}
];
// Interceptors
interceptors = [
{ class="#moduleMapping#.interceptors.includes", name="includes@FullCalendar" },
{ class="#moduleMapping#.interceptors.request", properties={ entryPoint="cbadmin" }, name="request@fullCalendar" }
];
}
/**
* Fired when the module is registered and activated.
*/
function onLoad(){
var menuService = controller.getWireBox().getInstance("AdminMenuService@cb");
var settingService = controller.getWireBox().getInstance("SettingService@cb");
// Add menu contribution
menuService.addSubMenu(topMenu=menuService.MODULES,
name="fullCalendar",
label="Full Calendar",
href="fullCalendar/calendar");
// Flush the settings cache so our new settings are reflected
settingService.flushSettingsCache();
}
/**
* Fired when the module is activated by ContentBox
*/
function onActivate(){
var settingService = controller.getWireBox().getInstance("SettingService@cb");
// Store default settings
var findArgs = {name="fullcalendar"};
var setting = settingService.findWhere(criteria=findArgs);
if(isNull(setting)){
var args = {name="fullcalendar", value=serializeJSON(settings)};
var fullCalendarSettings = settingService.new(properties=args);
settingService.save(fullCalendarSettings);
}
// Flush the settings cache so our new settings are reflected
settingService.flushSettingsCache();
}
/**
* Fired when the module is unregistered and unloaded
*/
function onUnload(){
var settingService = controller.getWireBox().getInstance("SettingService@cb");
var menuService = controller.getWireBox().getInstance("AdminMenuService@cb");
// Remove menu contribution
menuService.removeSubMenu(topMenu=menuService.MODULES, name="FullCalendar");
}
/**
* Fired when the module is deactivated by ContentBox
*/
function onDeactivate(){
var settingService = controller.getWireBox().getInstance("SettingService@cb");
var args = {name="fullcalendar"};
var setting = settingService.findWhere(criteria=args);
if(!isNull(setting)){
settingService.delete(setting);
}
// Flush the settings cache so our new settings are reflected
settingService.flushSettingsCache();
}
}