This repository has been archived by the owner on Feb 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
application.cfc
114 lines (68 loc) · 2.99 KB
/
application.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
component extends="framework.one" accessors="true" {
this.name="bs-4-cf-362";
this.applicationManagement = true;
this.sessionManagement = true;
variables.framework = {
home = "docs.home", // For PlumaCMS, change this to wiki.home or main.home aka login OR wiki.home
baseURL = 'useCGIScriptName',
defaultItem = "home",
generateSES = true,
SESomitIndex = false
};
variables.framework.routes = [
// PlumaCMS
{ "backups/delete/:id" = "backups/delete/slug/:id"},
{ "backups/edit/:id" = "backups/edit/slug/:id"},
{ "backups/restore/:id" = "backups/restore/slug/:id"},
{ "components" = "theme/components" },
{ "edit/:id" = "pages/edit/slug/:id" },
{ "edit" = "pages/edit" },
{ "filedelete" = "pages/delete" },
{ "logout" = "login/logout" },
{ "pages/home" = "pages/home" },
{ "wiki/:id" = "wiki/home/slug/:id" },
// documentation
{ "common" = "docs/common" },
{ "theme" = "theme/home" },
{ "bootswatch/:id" = "bootswatch/home/bootswatch/:id" }
];
function setupApplication() {
application.initialized = now();
local.objAppFile = fileopen(expandpath('./Application.cfc'), 'read');
application.GSVERSION = "Version 3.3.7.#right(year(local.objAppFile.lastmodified), 2)#.#month(local.objAppFile.lastmodified)#.#day(local.objAppFile.lastmodified)#";
fileclose(objAppFile);
// Common variables and paths
application.GSAUTHOR = "James Mohler and Web World Inc";
application.GSSITE_FULL_NAME = "PlumaCMS";
application.GSSITE_LINK_BACK_URL = "https://github.com/jmohler1970";
application.GSROOTPATH = getdirectoryfrompath(getBaseTemplatePath());
application.GSBACKUPSPATH = application.GSROOTPATH & "backups/";
application.GSDATAPATH = application.GSROOTPATH & "data/";
application.GSDATAOTHERPATH = application.GSROOTPATH & "data/other/";
application.GSTHUMBNAILPATH = application.GSROOTPATH & "data/thumbs/";
application.GSDATAPAGESPATH = application.GSROOTPATH & "data/pages/";
application.GSDATAUPLOADPATH = application.GSROOTPATH & "data/uploads/";
application.GSUSERSPATH = application.GSROOTPATH & "data/users/";
// End Pluma
// Support for complicated variables. This used to have to be in FW/1
application.objFormUtilities = new framework.formUtilities();
application.GSConfig = new model.services.settings().getWebsite();
invoke("vendor.tags.bootstrap.bootstrap", "setupApplication");
} // end setupApplication
function setupSession() {
session.authenticated = false;
session.bootswatch = "default";
}
function setupRequest() {
invoke("vendor.tags.bootstrap.bootstrap", "setupRequest");
} // end setupRequest
function after() {
if ( isDefined('form') ) rc.Append(application.objFormUtilities.buildFormCollections(form));
if(rc.keyExists("lang")) {
application.lang = rc.lang;
}
if(rc.keyExists("bootswatch") and rc.bootswatch != "assets") {
session.bootswatch = rc.bootswatch;
}
}
}