forked from DNNCommunity/DNN.Feedback
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Settings.ascx.vb
521 lines (451 loc) · 27.5 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
'
' DotNetNuke® - http://www.dotnetnuke.com
' Copyright (c) 2002-2010
' by DotNetNuke Corporation
'
' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in all copies or substantial portions
' of the Software.
'
' 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.
'
Imports System.Web.UI.WebControls
Imports System.Text
Namespace DotNetNuke.Modules.Feedback
''' -----------------------------------------------------------------------------
''' <summary>
''' The Settings ModuleSettingsBase is used to manage the settings for the Feedback Module
''' </summary>
''' <remarks>
''' </remarks>
''' <history>
''' [cnurse] 11/11/2004 created
''' </history>
''' -----------------------------------------------------------------------------
Partial Public Class Settings
Inherits Entities.Modules.ModuleSettingsBase
#Region "Private Members"
Private ReadOnly _requiredText As String = Localization.GetString("Required", Configuration.SharedResources)
Private ReadOnly _optionalText As String = Localization.GetString("Optional", Configuration.SharedResources)
Private ReadOnly _hiddenText As String = Localization.GetString("Hidden", Configuration.SharedResources)
Private _myConfiguration As Configuration
#End Region
#Region "Private Properties"
Private ReadOnly Property MyConfiguration() As Configuration
Get
If _myConfiguration Is Nothing Then
_myConfiguration = New Configuration(ModuleId, Settings)
End If
Return _myConfiguration
End Get
End Property
#End Region
#Region "Base Method Implementations"
''' -----------------------------------------------------------------------------
''' <summary>
''' LoadSettings loads the settings from the Database and displays them
''' </summary>
''' <remarks>
''' </remarks>
''' <history>
''' [cnurse] 11/11/2004 created
''' </history>
''' -----------------------------------------------------------------------------
Public Overrides Sub LoadSettings()
Dim li As ListItem
Try
If Not Page.IsPostBack Then
'bind the orphaned data grid and set visibility of orphaned data row
divOrphanedData.Visible = False
If DotNetNuke.Security.Permissions.ModulePermissionController.CanAdminModule(ModuleConfiguration) Then
Dim objFeedbackController As New FeedbackController
Dim orphanedData As Generic.Dictionary(Of String, Integer) = objFeedbackController.GetOrphanedData()
If orphanedData.Count > 0 Then
divOrphanedData.Visible = True
Localization.LocalizeDataGrid(dgOrphanedData, LocalResourceFile)
dgOrphanedData.DataSource = orphanedData
dgOrphanedData.DataBind()
UI.Utilities.ClientAPI.AddButtonConfirm(cmdDeleteOrphanedData, Localization.GetString("DeleteOrphanedDataConfirm", LocalResourceFile))
End If
End If
'bind the categories from the Feedback lists table
Dim oLists As New FeedbackController
Dim categoryList As ArrayList = oLists.GetFeedbackList(False, PortalId, -1, FeedbackList.Type.Category, True, ModuleId, False)
Dim subjectList As ArrayList = oLists.GetFeedbackList(False, PortalId, -1, FeedbackList.Type.Subject, True, ModuleId, False)
With cboCategory
.DataSource = categoryList
.DataTextField = "Name"
.DataValueField = "ListID"
.DataBind()
End With
'Load the moderation category here too
With cblModerationCategories
.DataSource = categoryList
.DataTextField = "Name"
.DataValueField = "ListID"
.DataBind()
End With
'Load the unmoderated status drop down list
BindUnmoderatedStatusList()
With cboSubject
.DataSource = subjectList
.DataTextField = "Name"
.DataValueField = "ListID"
.DataBind()
End With
BindRedirectTabs()
BindFieldVisibility(rblEmailField)
BindFieldVisibility2(rblEmailConfirmField)
BindFieldVisibility(rblNameField)
BindFieldVisibility(rblMessageField)
BindFieldVisibility(rblStreetField)
BindFieldVisibility(rblCityField)
BindFieldVisibility(rblRegionField)
BindFieldVisibility(rblCountryField)
BindFieldVisibility(rblPostalCodeField)
BindFieldVisibility(rblTelephoneField)
'Add the defaults
cboCategory.Items.Insert(0, New ListItem(Localization.GetString("NoneSelected", Configuration.SharedResources), ""))
cboSubject.Items.Insert(0, New ListItem(Localization.GetString("NoneSelected", Configuration.SharedResources), ""))
'get the settings
chkCategoryMailto.Checked = MyConfiguration.CategoryAsSendTo
chkCategory.Checked = MyConfiguration.CategorySelect
chkCategoryReq.Checked = MyConfiguration.CategoryRequired
'SM check whether categories have been setup or else disable the checkboxes for subjects and categories.
If cboCategory.Items.Count = 1 Then
chkCategory.Enabled = False
chkCategoryMailto.Enabled = False
chkCategory.Checked = False
chkCategoryMailto.Checked = False
Else
cboCategory.SelectedIndex = cboCategory.Items.IndexOf(cboCategory.Items.FindByValue(MyConfiguration.Category))
End If
txtSendFrom.Text = MyConfiguration.SendFrom
txtSendTo.Text = MyConfiguration.SendTo
Dim selectedRoleNames As New ArrayList
For Each roleName As String In MyConfiguration.SendToRoles.Split(";"c)
selectedRoleNames.Add(roleName)
Next
dgSelectedRoles.SelectedRoleNames = selectedRoleNames
rblLabelDisplay.SelectedValue = CInt(MyConfiguration.LabelDisplayPosition).ToString
txtWidth.Text = MyConfiguration.Width.ToString.Replace("px", "")
txtrows.Text = MyConfiguration.Rows.ToString
txtMaxMessage.Text = MyConfiguration.MaxMessage.ToString
rblSubjectEditField.SelectedValue = CInt(MyConfiguration.SubjectFieldType).ToString
If subjectList.Count > 1 Then
rblSubjectEditField.Items(0).Enabled = True
cboSubject.SelectedIndex = cboSubject.Items.IndexOf(cboSubject.Items.FindByValue(MyConfiguration.Subject))
Else
If rblSubjectEditField.SelectedValue = "1" Then
rblSubjectEditField.SelectedValue = "2"
End If
rblSubjectEditField.Items(0).Enabled = False
End If
chkSendCopy.Checked = MyConfiguration.SendCopy
If chkSendCopy.Checked Then
chkOptout.Enabled = True
chkOptout.Checked = MyConfiguration.OptOut
Else
chkOptout.Checked = False
chkOptout.Enabled = False
End If
chkModerated.Checked = MyConfiguration.Moderated
chkModerationAdminEmails.Checked = MyConfiguration.ModerationEmailsToAdmins
chkEmailOnly.Checked = MyConfiguration.EmailOnly
ddlModerationPageSize.Items.FindByValue(CStr(MyConfiguration.ModerationPageSize)).Selected = True
chkSendWhenPublished.Checked = MyConfiguration.SendWhenPublished
rblScope.SelectedValue = CInt(MyConfiguration.Scope).ToString
chkAsync.Checked = MyConfiguration.SendAsync
rblCaptchaVisibility.SelectedValue = CInt(MyConfiguration.CaptchaVisibility).ToString
chkCaptchaAudio.Checked = MyConfiguration.CaptchaAudio
chkCaptchaCase.Checked = MyConfiguration.CaptchaCase
BindToEnum(GetType(Telerik.Web.UI.CaptchaLineNoiseLevel), ddlCaptchaLineNoise)
ddlCaptchaLineNoise.Items.FindByValue(CType(MyConfiguration.CaptchaLineNoise, String)).Selected = True
BindToEnum(GetType(Telerik.Web.UI.CaptchaBackgroundNoiseLevel), ddlCaptchaBackgroundNoise)
ddlCaptchaBackgroundNoise.Items.FindByValue(CType(MyConfiguration.CaptchaBackgroundNoise, String)).Selected = True
rblRepeatSubmissionFilter.SelectedValue = CInt(MyConfiguration.RepeatSubmissionFilter).ToString
txtMinSubmissionInteval.Text = MyConfiguration.RepeatSubmissionInteval.ToString
chkDuplicateSubmission.Checked = MyConfiguration.DuplicateSubmission
li = ddlRedirectTabOnSubmission.Items.FindByValue(MyConfiguration.RedirectTabOnSubmission.ToString)
If li Is Nothing Then
ddlRedirectTabOnSubmission.SelectedValue = "-1"
Else
ddlRedirectTabOnSubmission.SelectedIndex = ddlRedirectTabOnSubmission.Items.IndexOf(li)
End If
LoadRequiredVisibilitySetting(rblEmailField, MyConfiguration.EmailFieldVisibility)
LoadRequiredVisibilitySetting2(rblEmailConfirmField, MyConfiguration.EmailConfirmFieldVisibility)
LoadRequiredVisibilitySetting(rblNameField, MyConfiguration.NameFieldVisibility)
LoadRequiredVisibilitySetting(rblMessageField, MyConfiguration.MessageFieldVisibility)
LoadRequiredVisibilitySetting(rblStreetField, MyConfiguration.StreetFieldVisibility)
LoadRequiredVisibilitySetting(rblCityField, MyConfiguration.CityFieldVisibility)
LoadRequiredVisibilitySetting(rblRegionField, MyConfiguration.RegionFieldVisibility)
LoadRequiredVisibilitySetting(rblCountryField, MyConfiguration.CountryFieldVisibility)
LoadRequiredVisibilitySetting(rblPostalCodeField, MyConfiguration.PostalCodeFieldVisibility)
LoadRequiredVisibilitySetting(rblTelephoneField, MyConfiguration.TelephoneFieldVisibility)
If chkModerated.Checked Then
divSendWhenPublished.Visible = True
divModerationCategories.Visible = True
For Each listId As String In MyConfiguration.ModeratedCategories.Split(";"c)
li = cblModerationCategories.Items.FindByValue(listId)
If li IsNot Nothing Then
li.Selected = True
End If
Next
ddlUnmoderatedStatus.SelectedValue = CInt(MyConfiguration.UnmoderatedStatus).ToString
divEmailOnly.Visible = False
Else
cblModerationCategories.ClearSelection()
ddlUnmoderatedStatus.SelectedValue = CInt(FeedbackInfo.FeedbackStatusType.StatusPublic).ToString
divSendWhenPublished.Visible = False
divModerationCategories.Visible = False
divUnmoderatedStatus.Visible = False
divEmailOnly.Visible = True
End If
txtEmailRegex.Text = MyConfiguration.EmailRegex
txtPostalCodeRegex.Text = MyConfiguration.PostalCodeRegex
txtTelephoneRegex.Text = MyConfiguration.TelephoneRegex
txtPrintTemplate.Text = MyConfiguration.PrintTemplate
rblPrintAction.SelectedValue = CInt(MyConfiguration.PrintAction).ToString
chkCleanupPending.Checked = MyConfiguration.CleanupPending
chkCleanupPrivate.Checked = MyConfiguration.CleanupPrivate
chkCleanupPublished.Checked = MyConfiguration.CleanupPublished
chkCleanupArchived.Checked = MyConfiguration.CleanupArchived
chkCleanupSpam.Checked = MyConfiguration.CleanupSpam
txtCleanupDaysBefore.Text = MyConfiguration.CleanupDaysBefore.ToString
txtCleanupMaxEntries.Text = MyConfiguration.CleanupMaxEntries.ToString
chkAkismetEnable.Checked = MyConfiguration.AkismetEnable
txtAkismetKey.Text = MyConfiguration.AkismetKey
chkAkismetSendModerator.Checked = MyConfiguration.AkismetSendModerator
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
''' -----------------------------------------------------------------------------
''' <summary>
''' UpdateSettings saves the modified settings to the Database
''' </summary>
''' <remarks>
''' </remarks>
''' <history>
''' [cnurse] 11/11/2004 created
''' </history>
''' -----------------------------------------------------------------------------
Public Overrides Sub UpdateSettings()
Try
If Page.IsValid Then
Dim sb As StringBuilder
With MyConfiguration
.SendFrom = txtSendFrom.Text
.SendTo = txtSendTo.Text
sb = New StringBuilder
For Each roleName As String In dgSelectedRoles.SelectedRoleNames
sb.Append(roleName)
sb.Append(";")
Next
If sb.Length > 0 Then sb.Length -= 1 'remove trailing semi-colon
.SendToRoles = sb.ToString
.LabelDisplayPosition = CType(rblLabelDisplay.SelectedValue, Configuration.LabelDisplayPositions)
.Width = Unit.Parse(txtWidth.Text)
.Rows = Integer.Parse(txtrows.Text)
.MaxMessage = Integer.Parse(txtMaxMessage.Text)
.Subject = cboSubject.SelectedItem.Value
.SubjectFieldType = CType(rblSubjectEditField.SelectedValue, Configuration.SubjectFieldTypes)
.SendCopy = chkSendCopy.Checked
.OptOut = chkOptout.Checked
.Moderated = chkModerated.Checked
.ModerationEmailsToAdmins = chkModerationAdminEmails.Checked
.Scope = CType(rblScope.SelectedValue, Configuration.Scopes)
.SendAsync = chkAsync.Checked
.CategoryAsSendTo = chkCategoryMailto.Checked
.CategorySelect = chkCategory.Checked
.CategoryRequired = chkCategoryReq.Checked
.Category = cboCategory.SelectedValue
sb = New StringBuilder
For Each li As ListItem In cblModerationCategories.Items
If li.Selected Then
sb.Append(li.Value)
sb.Append(";")
End If
Next
If sb.Length > 0 Then sb.Length -= 1 'remove trailing semi-colon
.ModeratedCategories = sb.ToString
.UnmoderatedStatus = CType(ddlUnmoderatedStatus.SelectedValue, FeedbackInfo.FeedbackStatusType)
.EmailOnly = chkEmailOnly.Checked
.ModerationPageSize = CInt(ddlModerationPageSize.SelectedItem.Value)
.SendWhenPublished = chkSendWhenPublished.Checked
.CaptchaVisibility = CType(rblCaptchaVisibility.SelectedValue, Configuration.CaptchaVisibilities)
.CaptchaAudio = chkCaptchaAudio.Checked
.CaptchaCase = chkCaptchaCase.Checked
.CaptchaLineNoise = CType(ddlCaptchaLineNoise.SelectedValue, Telerik.Web.UI.CaptchaLineNoiseLevel)
.CaptchaBackgroundNoise = CType(ddlCaptchaLineNoise.SelectedValue, Telerik.Web.UI.CaptchaBackgroundNoiseLevel)
.RepeatSubmissionFilter = CType(rblRepeatSubmissionFilter.SelectedValue, Configuration.RepeatSubmissionFilters)
.RepeatSubmissionInteval = Integer.Parse(txtMinSubmissionInteval.Text)
.DuplicateSubmission = chkDuplicateSubmission.Checked
.RedirectTabOnSubmission = CType(ddlRedirectTabOnSubmission.SelectedValue, Integer)
.EmailFieldVisibility = CType(rblEmailField.SelectedValue, Configuration.FieldVisibility)
.EmailConfirmFieldVisibility = CType(rblEmailConfirmField.SelectedValue, Configuration.FieldVisibility2)
.NameFieldVisibility = CType(rblNameField.SelectedValue, Configuration.FieldVisibility)
.MessageFieldVisibility = CType(rblMessageField.SelectedValue, Configuration.FieldVisibility)
.StreetFieldVisibility = CType(rblStreetField.SelectedValue, Configuration.FieldVisibility)
.CityFieldVisibility = CType(rblCityField.SelectedValue, Configuration.FieldVisibility)
.RegionFieldVisibility = CType(rblRegionField.SelectedValue, Configuration.FieldVisibility)
.CountryFieldVisibility = CType(rblCountryField.SelectedValue, Configuration.FieldVisibility)
.PostalCodeFieldVisibility = CType(rblPostalCodeField.SelectedValue, Configuration.FieldVisibility)
.TelephoneFieldVisibility = CType(rblTelephoneField.SelectedValue, Configuration.FieldVisibility)
.EmailRegex = txtEmailRegex.Text
.PostalCodeRegex = txtPostalCodeRegex.Text
.TelephoneRegex = txtTelephoneRegex.Text
.PrintTemplate = txtPrintTemplate.Text
.PrintAction = CType(rblPrintAction.SelectedValue, Configuration.PrintActions)
.CleanupPending = chkCleanupPending.Checked
.CleanupPrivate = chkCleanupPrivate.Checked
.CleanupPublished = chkCleanupPublished.Checked
.CleanupArchived = chkCleanupArchived.Checked
.CleanupSpam = chkCleanupSpam.Checked
.CleanupDaysBefore = CInt(txtCleanupDaysBefore.Text)
.CleanupMaxEntries = CInt(txtCleanupMaxEntries.Text)
.AkismetEnable = chkAkismetEnable.Checked
.AkismetKey = txtAkismetKey.Text
.AkismetSendModerator = chkAkismetSendModerator.Checked
.SaveSettings()
End With
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Private Sub BindRedirectTabs()
Dim portalTabs As Generic.List(Of Entities.Tabs.TabInfo) = Entities.Tabs.TabController.GetPortalTabs(PortalId, TabId, True, True)
With ddlRedirectTabOnSubmission
.DataTextField = "TabName"
.DataValueField = "TabId"
.DataSource = portalTabs
.DataBind()
End With
End Sub
Private Sub BindFieldVisibility(ByVal rbl As RadioButtonList)
With rbl.Items
.Add(New ListItem(_requiredText, "1"))
.Add(New ListItem(_optionalText, "2"))
.Add(New ListItem(_hiddenText, "3"))
End With
End Sub
Private Sub BindFieldVisibility2(ByVal rbl As RadioButtonList)
With rbl.Items
.Add(New ListItem(_requiredText, "1"))
.Add(New ListItem(_hiddenText, "2"))
End With
End Sub
Private Sub BindUnmoderatedStatusList()
For Each v As Integer In [Enum].GetValues(GetType(FeedbackInfo.FeedbackStatusType))
If [Enum].GetName(GetType(FeedbackInfo.FeedbackStatusType), v) <> "StatusSpam" Then
ddlUnmoderatedStatus.Items.Add(New ListItem(Localization.GetString([Enum].GetName(GetType(FeedbackInfo.FeedbackStatusType), v), Configuration.SharedResources), v.ToString))
End If
Next
End Sub
Private Sub LoadRequiredVisibilitySetting(ByVal rbl As RadioButtonList, ByVal visibility As Configuration.FieldVisibility)
rbl.SelectedValue = CInt(visibility).ToString
End Sub
Private Sub LoadRequiredVisibilitySetting2(ByVal rbl As RadioButtonList, ByVal visibility As Configuration.FieldVisibility2)
rbl.SelectedValue = CInt(visibility).ToString
End Sub
Public Sub BindToEnum(enumType As Type, ByVal ddl As DropDownList)
' get the names from the enumeration
Dim names As String() = [Enum].GetNames(enumType)
' get the values from the enumeration
Dim values As Array = [Enum].GetValues(enumType)
' turn it into a hash table
ddl.Items.Clear()
For i As Integer = 0 To names.Length - 1
' note the cast to integer here is important
' otherwise we'll just get the enum string back again
ddl.Items.Add(New ListItem(Localization.GetString(names(i), Configuration.SharedResources), CStr(CInt(values.GetValue(i)))))
Next
' return the dictionary to be bound to
End Sub
#End Region
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
#Region "Event Handlers"
Private Sub chkModerated_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkModerated.CheckedChanged
If chkModerated.Checked Then
divModerationCategories.Visible = True
For Each itm As ListItem In cblModerationCategories.Items
itm.Selected = True
Next
divSendWhenPublished.Visible = True
divUnmoderatedStatus.Visible = True
ddlUnmoderatedStatus.SelectedValue = CInt(FeedbackInfo.FeedbackStatusType.StatusPublic).ToString
divEmailOnly.Visible = False
chkEmailOnly.Checked = False
Else
cblModerationCategories.ClearSelection()
ddlUnmoderatedStatus.SelectedValue = CInt(FeedbackInfo.FeedbackStatusType.StatusPublic).ToString
divSendWhenPublished.Visible = False
divModerationCategories.Visible = False
divUnmoderatedStatus.Visible = False
divEmailOnly.Visible = True
End If
End Sub
Private Sub chkSendCopy_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkSendCopy.CheckedChanged
If chkSendCopy.Checked Then
chkOptout.Checked = True
chkOptout.Enabled = True
Else
chkOptout.Checked = False
chkOptout.Enabled = False
End If
End Sub
Private Sub btnResetEmailRegex_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnResetEmailRegex.Click
txtEmailRegex.Text = MyConfiguration.DefaultEMailRegex
End Sub
Private Sub btnResetPostalCodeRegex_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnResetPostalCodeRegex.Click
txtPostalCodeRegex.Text = Configuration.DefaultPostalCodeRegex
End Sub
Private Sub btnResetTelephoneRegex_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnResetTelephoneRegex.Click
txtTelephoneRegex.Text = Configuration.DefaultTelephoneRegex
End Sub
Private Sub btnLoadDefaultPrintTemplate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnLoadDefaultPrintTemplate.Click
txtPrintTemplate.Text = MyConfiguration.DefaultPrintTemplate
End Sub
Private Sub cmdDeleteOrphanedData_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdDeleteOrphanedData.Click
Dim objFeedbackController As New FeedbackController
objFeedbackController.DeleteOrphanedData()
divOrphanedData.Visible = False
End Sub
Private Sub valCategory_ServerValidate(source As Object, args As ServerValidateEventArgs) Handles valCategory.ServerValidate
If ((chkCategory.Checked OrElse chkCategoryMailto.Checked) AndAlso (cboCategory.Items.Count = 1)) Then
args.IsValid = False
End If
End Sub
Private Sub valCategoryMailto_ServerValidate(source As Object, args As ServerValidateEventArgs) Handles valCategoryMailto.ServerValidate
If (chkCategoryMailto.Checked AndAlso Not (chkCategory.Checked OrElse cboCategory.SelectedValue <> "")) Then
args.IsValid = False
End If
End Sub
Private Sub valAkismetKey_ServerValidate(source As Object, args As ServerValidateEventArgs) Handles valAkismetKey.ServerValidate
If chkAkismetEnable.Checked Then
Dim akismetApi As New Akismet(txtAkismetKey.Text, NavigateURL())
args.IsValid = akismetApi.VerifyKey()
End If
End Sub
#End Region
End Class
End Namespace