forked from sachatrauwaen/OpenContent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EditSettings.ascx.cs
102 lines (85 loc) · 2.91 KB
/
EditSettings.ascx.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
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
#region Copyright
//
// Copyright (c) 2015
// by Satrabel
//
#endregion
#region Using Statements
using System;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Common;
using Satrabel.OpenContent.Components;
using Satrabel.OpenContent.Components.Alpaca;
using DotNetNuke.Services.Localization;
#endregion
namespace Satrabel.OpenContent
{
public partial class EditSettings : PortalModuleBase
{
#region Event Handlers
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
hlCancel.NavigateUrl = Globals.NavigateURL();
cmdSave.NavigateUrl = Globals.NavigateURL();
var settings = ModuleContext.OpenContentSettings();
if (settings.TemplateAvailable)
{
AlpacaEngine alpaca = new AlpacaEngine(Page, ModuleContext, settings.TemplateDir.FolderPath, settings.TemplateKey.ShortKey);
alpaca.RegisterAll();
}
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!Page.IsPostBack)
{
//var settings = ModuleContext.OpenContentSettings();
//scriptList.Items.AddRange(OpenContentUtils.GetTemplatesFiles(PortalSettings, ModuleId, settings.Template, "OpenContent", (settings.IsOtherModule ? settings.Template.Uri() : null)).ToArray());
}
}
protected void cmdSave_Click(object sender, EventArgs e)
{
/*
ModuleController mc = new ModuleController();
mc.UpdateModuleSetting(ModuleId, "template", OpenContentUtils.SetTemplateFolder(scriptList.SelectedValue));
mc.UpdateModuleSetting(ModuleId, "data", HiddenField.Value);
Response.Redirect(Globals.NavigateURL(), true);
*/
//DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, "Update Successful", DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.GreenSuccess);
}
protected void cmdCancel_Click(object sender, EventArgs e)
{
}
#endregion
public string CurrentCulture
{
get
{
return LocaleController.Instance.GetCurrentLocale(PortalId).Code;
}
}
public string DefaultCulture
{
get
{
return LocaleController.Instance.GetDefaultLocale(PortalId).Code;
}
}
public string NumberDecimalSeparator
{
get
{
return LocaleController.Instance.GetCurrentLocale(PortalId).Culture.NumberFormat.NumberDecimalSeparator;
}
}
public string AlpacaCulture
{
get
{
string cultureCode = LocaleController.Instance.GetCurrentLocale(PortalId).Code;
return AlpacaEngine.AlpacaCulture(cultureCode);
}
}
}
}