This repository has been archived by the owner on Dec 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ViewOptions.ascx.vb
117 lines (91 loc) · 3.7 KB
/
ViewOptions.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
Option Strict On
Option Explicit On
Imports DotNetNuke
Imports DotNetNuke.Common
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Entities.Portals
Imports DotNetNuke.Services.Exceptions
Imports Dotnetnuke.Services.Localization
Imports System.Collections.Generic
Namespace DNNStuff.Favorites
Partial Class ViewOptions
Inherits Entities.Modules.PortalModuleBase
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
MyBase.HelpURL = "http://www.dnnstuff.com/"
End Sub
#End Region
#Region " Page Level"
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
If DNNUtilities.SafeDNNVersion().Major = 5 Then
DNNUtilities.InjectCSS(Me.Page, ResolveUrl("Resources/Support/edit_5.css"))
Else
DNNUtilities.InjectCSS(Me.Page, ResolveUrl("Resources/Support/edit.css"))
End If
Page.ClientScript.RegisterClientScriptInclude(Me.GetType, "yeti", ResolveUrl("resources/support/yetii-min.js"))
If Page.IsPostBack = False Then
LoadSettings()
End If
Catch ex As Exception 'Module failed to load
ProcessModuleLoadException(Me, ex)
End Try
End Sub
Private Sub cmdCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdCancel.Click
Try
ReturnToPage()
Catch ex As Exception 'Module failed to load
ProcessModuleLoadException(Me, ex)
End Try
End Sub
Private Sub cmdUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdUpdate.Click
Try
UpdateSettings()
ReturnToPage()
Catch ex As Exception 'Module failed to load
ProcessModuleLoadException(Me, ex)
End Try
End Sub
Private Sub ReturnToPage()
' synchronize
Entities.Modules.ModuleController.SynchronizeModule(ModuleId)
' Redirect back to the portal home page
Response.Redirect(NavigateURL(), True)
End Sub
#End Region
#Region " Settings"
Private Sub UpdateSettings()
Dim favSettings As New FavoritesSettings(ModuleId)
With favSettings
.Header = txtHeader.Text
.Body = txtBody.Text
.Footer = txtFooter.Text
.Empty = txtEmpty.Text
.Unauthenticated = txtUnathenticated.Text
.UseFullUrl = chkUseFullUrl.Checked
.MaxTitleChars = Convert.ToInt32(txtMaxTitleChars.Text)
End With
End Sub
Private Sub LoadSettings()
Dim favSettings As New FavoritesSettings(ModuleId)
With favSettings
txtHeader.Text = .Header
txtBody.Text = .Body
txtFooter.Text = .Footer
txtEmpty.Text = .Empty
txtUnathenticated.Text = .Unauthenticated
chkUseFullUrl.Checked = .UseFullUrl
txtMaxTitleChars.Text = .MaxTitleChars.ToString
End With
End Sub
#End Region
#Region " Validation"
#End Region
End Class
End Namespace