-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCookiecuttrMigrations.cs
65 lines (61 loc) · 4.35 KB
/
CookiecuttrMigrations.cs
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
using Orchard.Data.Migration;
using Orchard.ContentManagement.MetaData;
using Orchard.Core.Contents.Extensions;
using System;
namespace Contrib.CookieCuttr
{
public class CookiecuttrMigrations : DataMigrationImpl
{
public const string cookiemsg = "We use cookies on this website, you can <a href=\"{{cookiePolicyLink}}\" title=\"read about our cookies\">read about them here</a>. To use the website as intended please...";
public const string cookieanalyticsmsg = "We use cookies, just to track visits to our website, we store no personal details. To use the website as intended please...";
public const string acceptmsg = "ACCEPT COOKIES";
public const string declinemsg = "DECLINE COOKIES";
public const string resetmsg = "RESET COOKIES FOR THIS WEBSITE";
public const string whataremsg = "What are Cookies?";
public const string discreetmsg = "Cookies?";
public const string errormsg = "We're sorry, you declined the use of cookies on this website, this feature places cookies in your browser and has therefore been disabled.<br>To continue this functionality please";
public const string whatarecookieslink = "http://www.allaboutcookies.org/";
public int Create()
{
SchemaBuilder.CreateTable("CookieCuttrSettingsPartRecord",
table => table
.ContentPartRecord()
.Column<bool>("cookieNotificationLocationBottom", c => c.WithDefault(false))
.Column<bool>("cookieAnalytics", c => c.WithDefault(true))
.Column<string>("cookieAnalyticsMessage", c => c.WithDefault(cookieanalyticsmsg))
.Column<string>("cookiePolicyLink", c => c.WithDefault(string.Empty))
.Column<bool>("showCookieDeclineButton", c => c.WithDefault(false))
.Column<bool>("showCookieAcceptButton", c => c.WithDefault(true))
.Column<bool>("showCookieResetButton", c => c.WithDefault(false))
.Column<bool>("cookieOverlayEnabled", c => c.WithDefault(false))
.Column<string>("cookieMessage", c => c.WithDefault(cookiemsg))
.Column<string>("cookieWhatAreTheyLink", c => c.WithDefault(whatarecookieslink))
.Column<bool>("cookieCutter", c => c.WithDefault(false))
.Column<string>("cookieErrorMessage", c => c.WithDefault(errormsg))
.Column<string>("cookieDisable", c => c.WithDefault(string.Empty))
.Column<string>("cookieAcceptButtonText", c => c.WithDefault(acceptmsg))
.Column<string>("cookieDeclineButtonText", c => c.WithDefault(declinemsg))
.Column<string>("cookieResetButtonText", c => c.WithDefault(resetmsg))
.Column<string>("cookieWhatAreLinkText", c => c.WithDefault(whataremsg))
.Column<bool>("cookiePolicyPage", c => c.WithDefault(false))
.Column<string>("cookiePolicyPageMessage", c => c.WithDefault(string.Empty))
.Column<bool>("cookieDiscreetLink", c => c.WithDefault(false))
.Column<bool>("cookieDiscreetReset", c => c.WithDefault(false))
.Column<string>("cookieDiscreetLinkText", c => c.WithDefault(discreetmsg))
.Column<string>("cookieDiscreetPosition", c => c.WithDefault("topleft"))
.Column<string>("cookieDomain", c => c.WithDefault(string.Empty))
);
ContentDefinitionManager.AlterPartDefinition("CookiecuttrPart", part => part
.WithDescription("Renders the CookieCuttr plugin."));
ContentDefinitionManager.AlterTypeDefinition("CookiecuttrWidget",
cfg => cfg
.WithPart("WidgetPart")
.WithPart("CommonPart")
.WithPart("IdentityPart")
.WithPart("CookiecuttrPart")
.WithSetting("Stereotype", "Widget")
);
return 1;
}
}
}