-
Notifications
You must be signed in to change notification settings - Fork 2
/
Settings.ascx.vb
122 lines (96 loc) · 5.77 KB
/
Settings.ascx.vb
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
Imports DotNetNuke
Imports DotNetNuke.Services.Exceptions
' --- Copyright (c) notice DnnConsulting.nl ---
' Copyright (c) 2014 DnnConsulting.nl. www.DnnConsulting.nl. BSD License.
' Author: G. M. Barlow
' ------------------------------------------------------------------------
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
' ------------------------------------------------------------------------
' This copyright notice may NOT be removed, obscured or modified without written consent from the author.
' --- End copyright notice ---
Public Class Settings
Inherits SettingsBase
#Region "Base Method Implementations"
Public Overrides Sub LoadSettings()
Try
If (Page.IsPostBack = False) Then
If (Settings.Contains("HelperType")) Then
If Settings("HelperType") = "tabs" Then
ddlHelperType.SelectedValue = Settings("HelperType").ToString()
ClearPanels(pnlTabs)
End If
If Settings("HelperType") = "accordion" Then
ddlHelperType.SelectedValue = Settings("HelperType").ToString()
ClearPanels(pnlTabs)
End If
If Settings("HelperType") = "carousel" Then
ddlHelperType.SelectedValue = Settings("HelperType").ToString()
ClearPanels(pnlCarousel)
End If
If Settings("HelperType") = "buttongroup" Then
ddlHelperType.SelectedValue = Settings("HelperType").ToString()
ClearPanels(pnlButtonGroup)
End If
If Settings("HelperType") = "flipper" Then
ddlHelperType.SelectedValue = Settings("HelperType").ToString()
ClearPanels(pnlFlipper)
End If
End If
If (Settings.Contains("HelperTabFade")) Then chkUseTabFade.Checked = CBool(Settings("HelperTabFade"))
If (Settings.Contains("HelperTabType")) Then rdoTabType.SelectedValue = Settings("HelperTabType").ToString
If (Settings.Contains("HelperCarouselCaptions")) Then chkShowCarCaptions.Checked = CBool(Settings("HelperCarouselCaptions"))
If (Settings.Contains("HelperCarouselInterval")) Then txtCarInterval.Text = Settings("HelperCarouselInterval").ToString
If (Settings.Contains("HelperCarouselNav")) Then chkCarShowCarNav.Checked = CBool(Settings("HelperCarouselNav"))
If (Settings.Contains("HelperCarouselStretch")) Then chkCarStretch.Checked = CBool(Settings("HelperCarouselStretch"))
If (Settings.Contains("HelperButtonsStack")) Then chkVert.Checked = CBool(Settings("HelperButtonsStack"))
If (Settings.Contains("HelperButtonsJustify")) Then chkJustify.Checked = CBool(Settings("HelperButtonsJustify"))
If (Settings.Contains("HelperButtonSize")) Then ddlBtnSize.SelectedValue = Settings("HelperButtonSize")
If (Settings.Contains("HelperButtonStyle")) Then ddlBtnStyle.SelectedValue = Settings("HelperButtonStyle")
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Public Overrides Sub UpdateSettings()
Try
Dim objModules As New Entities.Modules.ModuleController
objModules.UpdateModuleSetting(ModuleId, "HelperType", ddlHelperType.SelectedValue)
objModules.UpdateModuleSetting(ModuleId, "HelperTabFade", chkUseTabFade.Checked)
objModules.UpdateModuleSetting(ModuleId, "HelperTabType", rdoTabType.SelectedValue)
objModules.UpdateModuleSetting(ModuleId, "HelperCarouselCaptions", chkShowCarCaptions.Checked)
objModules.UpdateModuleSetting(ModuleId, "HelperCarouselInterval", txtCarInterval.Text.Trim)
objModules.UpdateModuleSetting(ModuleId, "HelperCarouselNav", chkCarShowCarNav.Checked)
objModules.UpdateModuleSetting(ModuleId, "HelperCarouselStretch", chkCarStretch.Checked)
objModules.UpdateModuleSetting(ModuleId, "HelperButtonsStack", chkVert.Checked)
objModules.UpdateModuleSetting(ModuleId, "HelperButtonsJustify", chkJustify.Checked)
objModules.UpdateModuleSetting(ModuleId, "HelperButtonSize", ddlBtnSize.SelectedValue)
objModules.UpdateModuleSetting(ModuleId, "HelperButtonStyle", ddlBtnStyle.SelectedValue)
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
#End Region
Private Sub ddlHelperType_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlHelperType.SelectedIndexChanged
Select Case LCase(ddlHelperType.SelectedValue)
Case "tabs"
ClearPanels(pnlTabs)
Case "accordion"
ClearPanels(pnlAccordion)
Case "carousel"
ClearPanels(pnlCarousel)
Case "buttongroup"
ClearPanels(pnlButtonGroup)
End Select
End Sub
Private Sub ClearPanels(pnl As Panel)
pnlTabs.Visible = False
pnlAccordion.Visible = False
pnlCarousel.Visible = False
pnlButtonGroup.Visible = False
pnl.Visible = True
End Sub
End Class