forked from DNNCommunity/DNN.Events
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEventSettings.ascx.vb
1573 lines (1356 loc) · 80.5 KB
/
EventSettings.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
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'
' DotNetNuke® - http://www.dnnsoftware.com
' Copyright (c) 2002-2013
' by DNNCorp
'
' 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
Imports System.Web
Imports System.Web.UI.WebControls
Imports DotNetNuke.Entities.Tabs
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Web.UI.WebControls.Extensions
Namespace DotNetNuke.Modules.Events
<DNNtc.ModuleControlProperties("EventSettings", "Event Settings", DNNtc.ControlType.View, "https://dnnevents.codeplex.com/documentation", True, True)> _
Partial Class EventSettings
Inherits EventBase
#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 "Private Data"
Private ReadOnly _objCtlMasterEvent As New EventMasterController
#End Region
#Region "Help Methods"
' If adding new Setting also see 'SetDefaultModuleSettings' method in EventInfoHelper Class
''' <summary>
''' Load current settings into the controls from the modulesettings
''' </summary>
''' <remarks></remarks>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load, Me.Load
If Security.PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName.ToString) Or _
IsSettingsEditor() Then
Else
Response.Redirect(GetSocialNavigateUrl(), True)
End If
' Set the selected theme
SetTheme(pnlEventsModuleSettings)
' Do we have to load the settings?
If Not Page.IsPostBack Then
LoadSettings()
End If
' Add the javascript to the page
AddJavaScript()
End Sub
Private Sub LoadSettings()
Dim availableFields As New ArrayList
Dim selectedFields As New ArrayList
' Create Lists and Schedule - they should always exist
Dim objEventController As New EventController
objEventController.CreateListsAndSchedule()
'Set text and tooltip from resourcefile
chkMonthAllowed.Text = Localization.GetString("Month", LocalResourceFile)
chkWeekAllowed.Text = Localization.GetString("Week", LocalResourceFile)
chkListAllowed.Text = Localization.GetString("List", LocalResourceFile)
cmdAdd.ToolTip = Localization.GetString("Add", LocalResourceFile)
cmdAddAll.ToolTip = Localization.GetString("AddAll", LocalResourceFile)
cmdRemove.ToolTip = Localization.GetString("Remove", LocalResourceFile)
cmdRemoveAll.ToolTip = Localization.GetString("RemoveAll", LocalResourceFile)
cmdAddCals.ToolTip = Localization.GetString("AddCals", LocalResourceFile)
cmdAddAllCals.ToolTip = Localization.GetString("AddAllCals", LocalResourceFile)
cmdRemoveCals.ToolTip = Localization.GetString("RemoveCals", LocalResourceFile)
cmdRemoveAllCals.ToolTip = Localization.GetString("RemoveAllCals", LocalResourceFile)
chkIconMonthPrio.Text = Localization.GetString("Priority", LocalResourceFile)
imgIconMonthPrioHigh.AlternateText = Localization.GetString("HighPrio", LocalResourceFile)
imgIconMonthPrioLow.AlternateText = Localization.GetString("LowPrio", LocalResourceFile)
chkIconMonthRec.Text = Localization.GetString("Recurring", LocalResourceFile)
imgIconMonthRec.AlternateText = Localization.GetString("RecurringEvent", LocalResourceFile)
chkIconMonthReminder.Text = Localization.GetString("Reminder", LocalResourceFile)
imgIconMonthReminder.AlternateText = Localization.GetString("ReminderEnabled", LocalResourceFile)
chkIconMonthEnroll.Text = Localization.GetString("Enroll", LocalResourceFile)
imgIconMonthEnroll.AlternateText = Localization.GetString("EnrollEnabled", LocalResourceFile)
chkIconWeekPrio.Text = Localization.GetString("Priority", LocalResourceFile)
imgIconWEEKPrioHigh.AlternateText = Localization.GetString("HighPrio", LocalResourceFile)
imgIconWeekPrioLow.AlternateText = Localization.GetString("LowPrio", LocalResourceFile)
chkIconWeekRec.Text = Localization.GetString("Recurring", LocalResourceFile)
imgIconWeekRec.AlternateText = Localization.GetString("RecurringEvent", LocalResourceFile)
chkIconWeekReminder.Text = Localization.GetString("Reminder", LocalResourceFile)
imgIconWeekReminder.AlternateText = Localization.GetString("ReminderEnabled", LocalResourceFile)
chkIconWeekEnroll.Text = Localization.GetString("Enroll", LocalResourceFile)
imgIconWeekEnroll.AlternateText = Localization.GetString("EnrollEnabled", LocalResourceFile)
chkIconListPrio.Text = Localization.GetString("Priority", LocalResourceFile)
imgIconListPrioHigh.AlternateText = Localization.GetString("HighPrio", LocalResourceFile)
imgIconListPrioLow.AlternateText = Localization.GetString("LowPrio", LocalResourceFile)
chkIconListRec.Text = Localization.GetString("Recurring", LocalResourceFile)
imgIconListRec.AlternateText = Localization.GetString("RecurringEvent", LocalResourceFile)
chkIconListReminder.Text = Localization.GetString("Reminder", LocalResourceFile)
imgIconListReminder.AlternateText = Localization.GetString("ReminderEnabled", LocalResourceFile)
chkIconListEnroll.Text = Localization.GetString("Enroll", LocalResourceFile)
imgIconListEnroll.AlternateText = Localization.GetString("EnrollEnabled", LocalResourceFile)
cmdUpdateTemplate.Text = Localization.GetString("cmdUpdateTemplate", LocalResourceFile)
rbThemeStandard.Text = Localization.GetString("rbThemeStandard", LocalResourceFile)
rbThemeCustom.Text = Localization.GetString("rbThemeCustom", LocalResourceFile)
ddlModuleCategories.EmptyMessage = Localization.GetString("NoCategories", LocalResourceFile)
ddlModuleCategories.Localization.AllItemsCheckedString = Localization.GetString("AllCategories", LocalResourceFile)
ddlModuleCategories.Localization.CheckAllString = Localization.GetString("SelectAllCategories", LocalResourceFile)
ddlModuleLocations.EmptyMessage = Localization.GetString("NoLocations", LocalResourceFile)
ddlModuleLocations.Localization.AllItemsCheckedString = Localization.GetString("AllLocations", LocalResourceFile)
ddlModuleLocations.Localization.CheckAllString = Localization.GetString("SelectAllLocations", LocalResourceFile)
'Add templates link
' lnkTemplatesHelp.HRef = AddSkinContainerControls(EditUrl("", "", "TemplateHelp", "dnnprintmode=true"), "?")
lnkTemplatesHelp.HRef = AddSkinContainerControls(NavigateURL(TabId, PortalSettings, "", "mid=" & ModuleId, "ctl=TemplateHelp", "ShowNav=False", "dnnprintmode=true"), "?")
lnkTemplatesHelp.InnerText = Localization.GetString("TemplatesHelp", LocalResourceFile)
'Support for Time Interval Dropdown
Dim ctlLists As New Lists.ListController
Dim colThreadStatus As Generic.IEnumerable(Of Lists.ListEntryInfo) = ctlLists.GetListEntryInfoItems("TimeInterval")
ddlTimeInterval.Items.Clear()
For Each entry As Lists.ListEntryInfo In colThreadStatus
ddlTimeInterval.Items.Add(entry.Value)
Next
ddlTimeInterval.Items.FindByValue(Settings.Timeinterval).Selected = True
' Set Dropdown TimeZone
cboTimeZone.DataBind(Settings.TimeZoneId)
chkEnableEventTimeZones.Checked = Settings.EnableEventTimeZones
BindToEnum(GetType(EventModuleSettings.TimeZones), ddlPrimaryTimeZone)
ddlPrimaryTimeZone.Items.FindByValue(CType(Settings.PrimaryTimeZone, String)).Selected = True
BindToEnum(GetType(EventModuleSettings.TimeZones), ddlSecondaryTimeZone)
ddlSecondaryTimeZone.Items.FindByValue(CType(Settings.SecondaryTimeZone, String)).Selected = True
chkToolTipMonth.Checked = Settings.Eventtooltipmonth
chkToolTipWeek.Checked = Settings.Eventtooltipweek
chkToolTipDay.Checked = Settings.Eventtooltipday
chkToolTipList.Checked = Settings.Eventtooltiplist
txtTooltipLength.Text = Settings.Eventtooltiplength.ToString
chkImageEnabled.Checked = Settings.Eventimage
txtMaxThumbHeight.Text = Settings.MaxThumbHeight.ToString
txtMaxThumbWidth.Text = Settings.MaxThumbWidth.ToString
chkMonthCellEvents.Checked = True
If Settings.Monthcellnoevents Then
chkMonthCellEvents.Checked = False
End If
chkAddSubModuleName.Checked = Settings.Addsubmodulename
chkEnforceSubCalPerms.Checked = Settings.Enforcesubcalperms
BindToEnum(GetType(EventModuleSettings.DisplayCategories), ddlEnableCategories)
ddlEnableCategories.Items.FindByValue(CType(Settings.Enablecategories, String)).Selected = True
chkRestrictCategories.Checked = Settings.Restrictcategories
BindToEnum(GetType(EventModuleSettings.DisplayLocations), ddlEnableLocations)
ddlEnableLocations.Items.FindByValue(CType(Settings.Enablelocations, String)).Selected = True
chkRestrictLocations.Checked = Settings.Restrictlocations
chkEnableContainerSkin.Checked = Settings.Enablecontainerskin
chkEventDetailNewPage.Checked = Settings.Eventdetailnewpage
chkEnableEnrollPopup.Checked = Settings.Enableenrollpopup
chkEventImageMonth.Checked = Settings.EventImageMonth
chkEventImageWeek.Checked = Settings.EventImageWeek
chkEventDayNewPage.Checked = Settings.Eventdaynewpage
chkFullTimeScale.Checked = Settings.Fulltimescale
chkCollapseRecurring.Checked = Settings.Collapserecurring
chkIncludeEndValue.Checked = Settings.Includeendvalue
chkShowValueMarks.Checked = Settings.Showvaluemarks
chkEnableSEO.Checked = Settings.EnableSEO
txtSEODescriptionLength.Text = Settings.SEODescriptionLength.ToString
chkEnableSitemap.Checked = Settings.EnableSitemap
txtSitemapPriority.Text = Settings.SiteMapPriority.ToString
txtSitemapDaysBefore.Text = Settings.SiteMapDaysBefore.ToString
txtSitemapDaysAfter.Text = Settings.SiteMapDaysAfter.ToString
chkiCalOnIconBar.Checked = Settings.IcalOnIconBar
chkiCalEmailEnable.Checked = Settings.IcalEmailEnable
chkiCalURLinLocation.Checked = Settings.IcalURLInLocation
chkiCalIncludeCalname.Checked = Settings.IcalIncludeCalname
txtiCalDaysBefore.Text = Settings.IcalDaysBefore.ToString
txtiCalDaysAfter.Text = Settings.IcalDaysAfter.ToString
txtiCalURLAppend.Text = Settings.IcalURLAppend
ctliCalDefaultImage.FileFilter = glbImageFileTypes
ctliCalDefaultImage.Url = ""
chkiCalDisplayImage.Checked = False
If Settings.IcalDefaultImage <> "" Then
ctliCalDefaultImage.Url = Mid(Settings.IcalDefaultImage, 7)
chkiCalDisplayImage.Checked = True
End If
If ctliCalDefaultImage.Url.StartsWith("FileID=") Then
Dim fileId As Integer = Integer.Parse(ctliCalDefaultImage.Url.Substring(7))
Dim objFileInfo As Services.FileSystem.IFileInfo = Services.FileSystem.FileManager.Instance.GetFile(fileId)
If Not objFileInfo Is Nothing Then
ctliCalDefaultImage.Url = objFileInfo.Folder & objFileInfo.FileName
Else
ctliCalDefaultImage.Url = ""
End If
End If
Dim socialGroupId As Integer = GetUrlGroupId()
Dim socialGroupStr As String = ""
If socialGroupId > 0 Then
socialGroupStr = "&groupid=" & socialGroupId.ToString
End If
lbliCalURL.Text = AddHTTP(PortalSettings.PortalAlias.HTTPAlias & "/DesktopModules/Events/EventVCal.aspx?ItemID=0&Mid=" & ModuleId & "&tabid=" & TabId & socialGroupStr)
' Set Up Themes
LoadThemes()
txtPayPalURL.Text = Settings.Paypalurl
chkEnableEventNav.Checked = True
If Settings.DisableEventnav Then
chkEnableEventNav.Checked = False
End If
chkAllowRecurring.Checked = Settings.Allowreoccurring
txtMaxRecurrences.Text = Settings.Maxrecurrences.ToString
chkEventNotify.Checked = Settings.Eventnotify
chkDetailPageAllowed.Checked = Settings.DetailPageAllowed
chkEnrollmentPageAllowed.Checked = Settings.EnrollmentPageAllowed
txtEnrollmentPageDefaultURL.Text = Settings.EnrollmentPageDefaultUrl
chkNotifyAnon.Checked = Settings.Notifyanon
chkSendReminderDefault.Checked = Settings.Sendreminderdefault
rblNewEventEmail.Items(0).Selected = True
Select Case Settings.Neweventemails
Case "Subscribe"
rblNewEventEmail.Items(1).Selected = True
Case "Role"
rblNewEventEmail.Items(2).Selected = True
End Select
LoadNewEventEmailRoles(Settings.Neweventemailrole)
chkNewPerEventEmail.Checked = Settings.Newpereventemail
ddlDefaultView.Items.Clear()
ddlDefaultView.Items.Add(New ListItem(Localization.GetString("Month", LocalResourceFile), "EventMonth.ascx"))
ddlDefaultView.Items.Add(New ListItem(Localization.GetString("Week", LocalResourceFile), "EventWeek.ascx"))
ddlDefaultView.Items.Add(New ListItem(Localization.GetString("List", LocalResourceFile), "EventList.ascx"))
ddlDefaultView.Items.FindByValue(Settings.DefaultView).Selected = True
chkMonthAllowed.Checked = Settings.MonthAllowed
chkWeekAllowed.Checked = Settings.WeekAllowed
chkListAllowed.Checked = Settings.ListAllowed
chkEnableSearch.Checked = Settings.Eventsearch
chkPreventConflicts.Checked = Settings.Preventconflicts
chkLocationConflict.Checked = Settings.Locationconflict
chkShowEventsAlways.Checked = Settings.ShowEventsAlways
chkTimeInTitle.Checked = Settings.Timeintitle
chkMonthDaySelect.Checked = Settings.Monthdayselect
chkEventSignup.Checked = Settings.Eventsignup
chkEventSignupAllowPaid.Checked = Settings.Eventsignupallowpaid
chkDefaultEnrollView.Checked = Settings.Eventdefaultenrollview
chkHideFullEnroll.Checked = Settings.Eventhidefullenroll()
txtMaxNoEnrolees.Text = Settings.Maxnoenrolees.ToString
txtCancelDays.Text = Settings.Enrolcanceldays.ToString
chkFridayWeekend.Checked = Settings.Fridayweekend
chkModerateAll.Checked = Settings.Moderateall
chkTZDisplay.Checked = Settings.Tzdisplay
chkListViewUseTime.Checked = Settings.ListViewUseTime
txtPayPalAccount.Text = Settings.Paypalaccount
If txtPayPalAccount.Text.Length = 0 Then
txtPayPalAccount.Text = PortalSettings.Email
End If
txtReminderFrom.Text = Settings.Reminderfrom
If txtReminderFrom.Text.Length = 0 Then
txtReminderFrom.Text = PortalSettings.Email
End If
txtStandardEmail.Text = Settings.StandardEmail
If txtStandardEmail.Text.Length = 0 Then
txtStandardEmail.Text = PortalSettings.Email
End If
BindSubEvents()
BindAvailableEvents()
chkMasterEvent.Checked = Settings.MasterEvent
Enable_Disable_Cals()
chkIconMonthPrio.Checked = Settings.IconMonthPrio
chkIconWeekPrio.Checked = Settings.IconWeekPrio
chkIconListPrio.Checked = Settings.IconListPrio
chkIconMonthRec.Checked = Settings.IconMonthRec
chkIconWeekRec.Checked = Settings.IconMonthRec
chkIconListRec.Checked = Settings.IconListRec
chkIconMonthReminder.Checked = Settings.IconMonthReminder
chkIconWeekReminder.Checked = Settings.IconWeekReminder
chkIconListReminder.Checked = Settings.IconListReminder
chkIconMonthEnroll.Checked = Settings.IconMonthEnroll
chkIconWeekEnroll.Checked = Settings.IconWeekEnroll
chkIconListEnroll.Checked = Settings.IconListEnroll
txtPrivateMessage.Text = Settings.PrivateMessage
Dim columnNo As Integer
For columnNo = 1 To 13
Dim columnAcronym As String = GetListColumnAcronym(columnNo)
Dim columnName As String = GetListColumnName(columnAcronym)
If Settings.EventsListFields.LastIndexOf(columnAcronym, StringComparison.Ordinal) > -1 Then
selectedFields.Add(columnName)
Else
availableFields.Add(columnName)
End If
Next
lstAvailable.DataSource = availableFields
lstAvailable.DataBind()
Sort(lstAvailable)
lstAssigned.DataSource = selectedFields
lstAssigned.DataBind()
Sort(lstAssigned)
If Settings.EventsListSelectType = rblSelectionTypeDays.Value Then
rblSelectionTypeDays.Checked = True
rblSelectionTypeEvents.Checked = False
Else
rblSelectionTypeDays.Checked = False
rblSelectionTypeEvents.Checked = True
End If
If Settings.ListViewGrid Then
rblListViewGrid.Items(0).Selected = True
Else
rblListViewGrid.Items(1).Selected = True
End If
chkListViewTable.Checked = Settings.ListViewTable
txtRptColumns.Text = Settings.RptColumns.ToString
txtRptRows.Text = Settings.RptRows.ToString
' Do we have to display the EventsList header?
If Settings.EventsListShowHeader <> "No" Then
rblShowHeader.Items(0).Selected = True
Else
rblShowHeader.Items(1).Selected = True
End If
txtDaysBefore.Text = Settings.EventsListBeforeDays.ToString
txtDaysAfter.Text = Settings.EventsListAfterDays.ToString
txtNumEvents.Text = Settings.EventsListNumEvents.ToString
txtEventDays.Text = Settings.EventsListEventDays.ToString
chkRestrictCategoriesToTimeFrame.Checked = Settings.RestrictCategoriesToTimeFrame
chkRestrictLocationsToTimeFrame.Checked = Settings.RestrictLocationsToTimeFrame
chkCustomField1.Checked = Settings.EventsCustomField1
chkCustomField2.Checked = Settings.EventsCustomField2
ddlPageSize.Items.FindByValue(CStr(Settings.EventsListPageSize)).Selected = True
ddlListSortedFieldDirection.Items.Clear()
ddlListSortedFieldDirection.Items.Add(New ListItem(Localization.GetString("Asc", LocalResourceFile), "ASC"))
ddlListSortedFieldDirection.Items.Add(New ListItem(Localization.GetString("Desc", LocalResourceFile), "DESC"))
ddlListSortedFieldDirection.Items.FindByValue(Settings.EventsListSortDirection).Selected = True
ddlListDefaultColumn.Items.Clear()
ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortEventID", LocalResourceFile), "EventID"))
ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortEventDateBegin", LocalResourceFile), "EventDateBegin"))
ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortEventDateEnd", LocalResourceFile), "EventDateEnd"))
ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortEventName", LocalResourceFile), "EventName"))
ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortDuration", LocalResourceFile), "Duration"))
ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortCategoryName", LocalResourceFile), "CategoryName"))
ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortCustomField1", LocalResourceFile), "CustomField1"))
ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortCustomField2", LocalResourceFile), "CustomField2"))
ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortDescription", LocalResourceFile), "Description"))
ddlListDefaultColumn.Items.Add(New ListItem(Localization.GetString("SortLocationName", LocalResourceFile), "LocationName"))
ddlListDefaultColumn.Items.FindByValue(Settings.EventsListSortColumn).Selected = True
ddlWeekStart.Items.Clear()
ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Default.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Default).ToString))
ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Monday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Monday).ToString))
ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Tuesday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Tuesday).ToString))
ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Wednesday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Wednesday).ToString))
ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Thursday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Thursday).ToString))
ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Friday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Friday).ToString))
ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Saturday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Saturday).ToString))
ddlWeekStart.Items.Add(New ListItem(System.Web.UI.WebControls.FirstDayOfWeek.Sunday.ToString, CInt(System.Web.UI.WebControls.FirstDayOfWeek.Sunday).ToString))
ddlWeekStart.Items.FindByValue(CInt(Settings.WeekStart).ToString).Selected = True
If Settings.EnrollEditFields.LastIndexOf("01", StringComparison.Ordinal) > -1 Then
rblEnUserEdit.Checked = True
ElseIf Settings.EnrollViewFields.LastIndexOf("01", StringComparison.Ordinal) > -1 Then
rblEnUserView.Checked = True
ElseIf Settings.EnrollAnonFields.LastIndexOf("01", StringComparison.Ordinal) > -1 Then
rblEnUserAnon.Checked = True
Else
rblEnUserNone.Checked = True
End If
If Settings.EnrollEditFields.LastIndexOf("02", StringComparison.Ordinal) > -1 Then
rblEnDispEdit.Checked = True
ElseIf Settings.EnrollViewFields.LastIndexOf("02", StringComparison.Ordinal) > -1 Then
rblEnDispView.Checked = True
ElseIf Settings.EnrollAnonFields.LastIndexOf("02", StringComparison.Ordinal) > -1 Then
rblEnDispAnon.Checked = True
Else
rblEnDispNone.Checked = True
End If
If Settings.EnrollEditFields.LastIndexOf("03", StringComparison.Ordinal) > -1 Then
rblEnEmailEdit.Checked = True
ElseIf Settings.EnrollViewFields.LastIndexOf("03", StringComparison.Ordinal) > -1 Then
rblEnEmailView.Checked = True
ElseIf Settings.EnrollAnonFields.LastIndexOf("03", StringComparison.Ordinal) > -1 Then
rblEnEmailAnon.Checked = True
Else
rblEnEmailNone.Checked = True
End If
If Settings.EnrollEditFields.LastIndexOf("04", StringComparison.Ordinal) > -1 Then
rblEnPhoneEdit.Checked = True
ElseIf Settings.EnrollViewFields.LastIndexOf("04", StringComparison.Ordinal) > -1 Then
rblEnPhoneView.Checked = True
ElseIf Settings.EnrollAnonFields.LastIndexOf("04", StringComparison.Ordinal) > -1 Then
rblEnPhoneAnon.Checked = True
Else
rblEnPhoneNone.Checked = True
End If
If Settings.EnrollEditFields.LastIndexOf("05", StringComparison.Ordinal) > -1 Then
rblEnApproveEdit.Checked = True
ElseIf Settings.EnrollViewFields.LastIndexOf("05", StringComparison.Ordinal) > -1 Then
rblEnApproveView.Checked = True
ElseIf Settings.EnrollAnonFields.LastIndexOf("05", StringComparison.Ordinal) > -1 Then
rblEnApproveAnon.Checked = True
Else
rblEnApproveNone.Checked = True
End If
If Settings.EnrollEditFields.LastIndexOf("06", StringComparison.Ordinal) > -1 Then
rblEnNoEdit.Checked = True
ElseIf Settings.EnrollViewFields.LastIndexOf("06", StringComparison.Ordinal) > -1 Then
rblEnNoView.Checked = True
ElseIf Settings.EnrollAnonFields.LastIndexOf("06", StringComparison.Ordinal) > -1 Then
rblEnNoAnon.Checked = True
Else
rblEnNoNone.Checked = True
End If
chkRSSEnable.Checked = Settings.RSSEnable
ddlRSSDateField.Items.Clear()
ddlRSSDateField.Items.Add(New ListItem(Localization.GetString("UpdatedDate", LocalResourceFile), "UPDATEDDATE"))
ddlRSSDateField.Items.Add(New ListItem(Localization.GetString("CreationDate", LocalResourceFile), "CREATIONDATE"))
ddlRSSDateField.Items.Add(New ListItem(Localization.GetString("EventDate", LocalResourceFile), "EVENTDATE"))
ddlRSSDateField.Items.FindByValue(Settings.RSSDateField).Selected = True
txtRSSDays.Text = Settings.RSSDays.ToString
txtRSSTitle.Text = Settings.RSSTitle
txtRSSDesc.Text = Settings.RSSDesc
txtExpireEvents.Text = Settings.Expireevents
chkExportOwnerEmail.Checked = Settings.Exportowneremail
chkExportAnonOwnerEmail.Checked = Settings.Exportanonowneremail
chkOwnerChangeAllowed.Checked = Settings.Ownerchangeallowed
txtFBAdmins.Text = Settings.FBAdmins
txtFBAppID.Text = Settings.FBAppID
Select Case Settings.IconBar
Case "BOTTOM"
rblIconBar.Items(1).Selected = True
Case "NONE"
rblIconBar.Items(2).Selected = True
Case Else
rblIconBar.Items(0).Selected = True
End Select
Select Case Settings.HTMLEmail
Case "auto"
rblHTMLEmail.Items(1).Selected = True
Case "text"
rblHTMLEmail.Items(2).Selected = True
Case Else
rblHTMLEmail.Items(0).Selected = True
End Select
chkEnrollMessageApproved.Checked = Settings.SendEnrollMessageApproved
chkEnrollMessageWaiting.Checked = Settings.SendEnrollMessageWaiting
chkEnrollMessageDenied.Checked = Settings.SendEnrollMessageDenied
chkEnrollMessageAdded.Checked = Settings.SendEnrollMessageAdded
chkEnrollMessageDeleted.Checked = Settings.SendEnrollMessageDeleted
chkEnrollMessagePaying.Checked = Settings.SendEnrollMessagePaying
chkEnrollMessagePending.Checked = Settings.SendEnrollMessagePending
chkEnrollMessagePaid.Checked = Settings.SendEnrollMessagePaid
chkEnrollMessageIncorrect.Checked = Settings.SendEnrollMessageIncorrect
chkEnrollMessageCancelled.Checked = Settings.SendEnrollMessageCancelled
chkAllowAnonEnroll.Checked = Settings.AllowAnonEnroll
BindToEnum(GetType(EventModuleSettings.SocialModule), ddlSocialGroupModule)
ddlSocialGroupModule.Items.FindByValue(CType(Settings.SocialGroupModule, String)).Selected = True
chkSocialUserPrivate.Checked = Settings.SocialUserPrivate
BindToEnum(GetType(EventModuleSettings.SocialGroupPrivacy), ddlSocialGroupSecurity)
ddlSocialGroupSecurity.Items.FindByValue(CType(Settings.SocialGroupSecurity, String)).Selected = True
ddlEnrolListSortDirection.Items.Clear()
ddlEnrolListSortDirection.Items.Add(New ListItem(Localization.GetString("Asc", LocalResourceFile), "0"))
ddlEnrolListSortDirection.Items.Add(New ListItem(Localization.GetString("Desc", LocalResourceFile), "1"))
ddlEnrolListSortDirection.Items.FindByValue(CInt(Settings.EnrolListSortDirection).ToString).Selected = True
txtEnrolListDaysBefore.Text = Settings.EnrolListDaysBefore.ToString
txtEnrolListDaysAfter.Text = Settings.EnrolListDaysAfter.ToString
chkJournalIntegration.Checked = Settings.JournalIntegration
LoadCategories()
LoadLocations()
LoadTemplates()
End Sub
Private Sub AddJavaScript()
'Add the external Validation.js to the Page
Const csname As String = "ExtValidationScriptFile"
Dim cstype As Type = Reflection.MethodBase.GetCurrentMethod().GetType()
Dim cstext As String = "<script src=""" & ResolveUrl("~/DesktopModules/Events/Scripts/Validation.js") & """ type=""text/javascript""></script>"
If Not Page.ClientScript.IsClientScriptBlockRegistered(csname) Then
Page.ClientScript.RegisterClientScriptBlock(cstype, csname, cstext, False)
End If
' Add javascript actions where required and build startup script
Dim script As String
Dim cstext2 As String = ""
cstext2 += "<script type=""text/javascript"">"
cstext2 += "EventSettingsStartupScript = function() {"
script = "disableactivate('" & ddlDefaultView.ClientID & "','" & chkMonthAllowed.ClientID & "','" & chkWeekAllowed.ClientID & "','" & chkListAllowed.ClientID & "');"
cstext2 += script
ddlDefaultView.Attributes.Add("onchange", script)
script = "disableControl('" & chkPreventConflicts.ClientID & "',false, '" + chkLocationConflict.ClientID + "');"
cstext2 += script
chkPreventConflicts.InputAttributes.Add("onclick", script)
script = "disableControl('" & chkMonthCellEvents.ClientID & "',true, '" + chkEventDayNewPage.ClientID + "');"
script += "disableControl('" & chkMonthCellEvents.ClientID & "',false, '" + chkMonthDaySelect.ClientID + "');"
script += "disableControl('" & chkMonthCellEvents.ClientID & "',false, '" + chkTimeInTitle.ClientID + "');"
script += "disableControl('" & chkMonthCellEvents.ClientID & "',false, '" + chkEventImageMonth.ClientID + "');"
script += "disableControl('" & chkMonthCellEvents.ClientID & "',false, '" + chkIconMonthPrio.ClientID + "');"
script += "disableControl('" & chkMonthCellEvents.ClientID & "',false, '" + chkIconMonthRec.ClientID + "');"
script += "disableControl('" & chkMonthCellEvents.ClientID & "',false, '" + chkIconMonthReminder.ClientID + "');"
script += "disableControl('" & chkMonthCellEvents.ClientID & "',false, '" + chkIconMonthEnroll.ClientID + "');"
cstext2 += script
chkMonthCellEvents.InputAttributes.Add("onclick", script)
script = "disableRbl('" & rblListViewGrid.ClientID & "', 'Repeater', '" + chkListViewTable.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Repeater', '" + txtRptColumns.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Repeater', '" + txtRptRows.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Grid', '" + rblShowHeader.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Grid', '" + lstAvailable.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Grid', '" + cmdAdd.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Grid', '" + cmdRemove.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Grid', '" + cmdAddAll.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Grid', '" + cmdRemoveAll.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Grid', '" + lstAssigned.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Grid', '" + ddlPageSize.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Grid', '" + chkIconListEnroll.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Grid', '" + chkIconListPrio.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Grid', '" + chkIconListRec.ClientID + "');"
script += "disableRbl('" & rblListViewGrid.ClientID & "', 'Grid', '" + chkIconListReminder.ClientID + "');"
cstext2 += script
rblListViewGrid.Attributes.Add("onclick", script)
script = "CheckBoxFalse('" & chkIncludeEndValue.ClientID & "', true, '" + chkShowValueMarks.ClientID + "');"
cstext2 += script
chkIncludeEndValue.InputAttributes.Add("onclick", script)
script = "disablelistsettings('" & rblSelectionTypeDays.ClientID & "',true,'" + txtDaysBefore.ClientID + "','" + txtDaysAfter.ClientID + "','" + txtNumEvents.ClientID + "','" + txtEventDays.ClientID + "');"
cstext2 += script
rblSelectionTypeDays.Attributes.Add("onclick", script)
script = "disablelistsettings('" & rblSelectionTypeEvents.ClientID & "',false,'" + txtDaysBefore.ClientID + "','" + txtDaysAfter.ClientID + "','" + txtNumEvents.ClientID + "','" + txtEventDays.ClientID + "');"
cstext2 += script
rblSelectionTypeEvents.Attributes.Add("onclick", script)
script = "showTbl('" + chkEventNotify.ClientID + "','" + divEventNotify.ClientID + "');"
cstext2 += script
chkEventNotify.InputAttributes.Add("onclick", script)
script = "showTbl('" + chkRSSEnable.ClientID + "','" + divRSSEnable.ClientID + "');"
cstext2 += script
chkRSSEnable.InputAttributes.Add("onclick", script)
script = "showTbl('" + chkImageEnabled.ClientID + "','" + diviCalEventImage.ClientID + "'); showTbl('" + chkImageEnabled.ClientID + "','" + divImageEnabled.ClientID + "');"
cstext2 += script
chkImageEnabled.InputAttributes.Add("onclick", script)
script = "showTbl('" + chkiCalDisplayImage.ClientID + "','" + diviCalDisplayImage.ClientID + "');"
cstext2 += script
chkiCalDisplayImage.InputAttributes.Add("onclick", script)
script = "disableControl('" & chkExportOwnerEmail.ClientID & "',false, '" + chkExportAnonOwnerEmail.ClientID + "');"
cstext2 += script
chkExportOwnerEmail.InputAttributes.Add("onclick", script)
script = "disableDDL('" & ddlSocialGroupModule.ClientID & "','" & CInt(EventModuleSettings.SocialModule.UserProfile).ToString & "','" + chkSocialUserPrivate.ClientID + "');"
cstext2 += script
ddlSocialGroupModule.Attributes.Add("onclick", script)
If Settings.SocialGroupModule = EventModuleSettings.SocialModule.No Then
script = "disableRbl('" & rblNewEventEmail.ClientID & "', 'Role', '" + ddNewEventEmailRoles.ClientID + "');"
cstext2 += script
rblNewEventEmail.Attributes.Add("onclick", script)
End If
If Settings.SocialGroupModule <> EventModuleSettings.SocialModule.UserProfile Then
script = "showTbl('" + chkEventSignup.ClientID + "','" + divEventSignup.ClientID + "');"
cstext2 += script
chkEventSignup.InputAttributes.Add("onclick", script)
script = "showTbl('" + chkEventSignupAllowPaid.ClientID + "','" + divEventSignupAllowPaid.ClientID + "');"
cstext2 += script
chkEventSignupAllowPaid.InputAttributes.Add("onclick", script)
script = "showTbl('" + chkEnableSEO.ClientID + "','" + divSEOEnable.ClientID + "');"
cstext2 += script
chkEnableSEO.InputAttributes.Add("onclick", script)
script = "showTbl('" + chkEnableSitemap.ClientID + "','" + divSitemapEnable.ClientID + "');"
cstext2 += script
chkEnableSitemap.InputAttributes.Add("onclick", script)
End If
cstext2 += "};"
cstext2 += "EventSettingsStartupScript();"
cstext2 += "Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EventEndRequestHandler);"
cstext2 += "function EventEndRequestHandler(sender, args) { EventSettingsStartupScript(); }"
cstext2 += "</script>"
' Register the startup script
Const csname2 As String = "EventSettingsStartupScript"
Dim cstype2 As Type = Reflection.MethodBase.GetCurrentMethod().GetType()
If Not Page.ClientScript.IsStartupScriptRegistered(csname2) Then
Page.ClientScript.RegisterStartupScript(cstype2, csname2, cstext2, False)
End If
End Sub
Private Sub BindToEnum(enumType As Type, ByVal ddl As System.Web.UI.WebControls.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), LocalResourceFile), CStr(CInt(values.GetValue(i)))))
Next
' return the dictionary to be bound to
End Sub
Private Function GetListColumnName(ByVal columnAcronym As String) As String
Select Case columnAcronym
Case "EB"
Return "01 - " & Localization.GetString("EditButton", LocalResourceFile)
Case "BD"
Return "02 - " & Localization.GetString("BeginDateTime", LocalResourceFile)
Case "ED"
Return "03 - " & Localization.GetString("EndDateTime", LocalResourceFile)
Case "EN"
Return "04 - " & Localization.GetString("EventName", LocalResourceFile)
Case "IM"
Return "05 - " & Localization.GetString("Image", LocalResourceFile)
Case "DU"
Return "06 - " & Localization.GetString("Duration", LocalResourceFile)
Case "CA"
Return "07 - " & Localization.GetString("Category", LocalResourceFile)
Case "LO"
Return "08 - " & Localization.GetString("Location", LocalResourceFile)
Case "C1"
Return "09 - " & Localization.GetString("CustomField1", LocalResourceFile)
Case "C2"
Return "10 - " & Localization.GetString("CustomField2", LocalResourceFile)
Case "DE"
Return "11 - " & Localization.GetString("Description", LocalResourceFile)
Case "RT"
Return "12 - " & Localization.GetString("RecurText", LocalResourceFile)
Case "RU"
Return "13 - " & Localization.GetString("RecurUntil", LocalResourceFile)
Case Else
Return ""
End Select
End Function
Private Function GetListColumnAcronym(ByVal columnNo As Integer) As String
Select Case columnNo
Case 1
Return "EB"
Case 2
Return "BD"
Case 3
Return "ED"
Case 4
Return "EN"
Case 5
Return "IM"
Case 6
Return "DU"
Case 7
Return "CA"
Case 8
Return "LO"
Case 9
Return "C1"
Case 10
Return "C2"
Case 11
Return "DE"
Case 12
Return "RT"
Case 13
Return "RU"
Case Else
Return ""
End Select
End Function
''' <summary>
''' Fill the themelist based on selection for default or custom skins
''' </summary>
''' <remarks></remarks>
Private Sub LoadThemes()
Try
Const moduleThemesDirectoryPath As String = "/DesktopModules/Events/Themes"
'Clear list
ddlThemeStandard.Items.Clear()
ddlThemeCustom.Items.Clear()
'Add javascript to enable/disable ddl's
rbThemeCustom.Attributes.Add("onclick", String.Format("{0}.disabled='disabled';{1}.disabled=''", ddlThemeStandard.ClientID, ddlThemeCustom.ClientID))
rbThemeStandard.Attributes.Add("onclick", String.Format("{0}.disabled='disabled';{1}.disabled=''", ddlThemeCustom.ClientID, ddlThemeStandard.ClientID))
'Get the settings
Dim themeSettings As New ThemeSetting
If themeSettings.ValidateSetting(Settings.EventTheme) = False Then
themeSettings.ReadSetting(Settings.EventThemeDefault, PortalId)
ElseIf Settings.EventTheme <> "" Then
themeSettings.ReadSetting(Settings.EventTheme, PortalId)
End If
Select Case themeSettings.SettingType
Case ThemeSetting.ThemeSettingTypeEnum.CustomTheme
rbThemeCustom.Checked = True
Case ThemeSetting.ThemeSettingTypeEnum.DefaultTheme
rbThemeStandard.Checked = True
End Select
'Is default or custom selected
Dim moduleThemesDirectory As String = ApplicationPath & moduleThemesDirectoryPath
Dim serverThemesDirectory As String = Server.MapPath(moduleThemesDirectory)
Dim themeDirectories() As String = IO.Directory.GetDirectories(serverThemesDirectory)
Dim themeDirectory As String
For Each themeDirectory In themeDirectories
Dim dirparts() As String = themeDirectory.Split("\"c)
ddlThemeStandard.Items.Add(New ListItem(dirparts(dirparts.Length - 1), dirparts(dirparts.Length - 1)))
Next
If themeSettings.SettingType = ThemeSetting.ThemeSettingTypeEnum.DefaultTheme Then
If Not ddlThemeStandard.Items.FindByText(themeSettings.ThemeName) Is Nothing Then
ddlThemeStandard.Items.FindByText(themeSettings.ThemeName).Selected = True
End If
Else
ddlThemeStandard.Attributes.Add("disabled", "disabled")
End If
'Add custom event theme's
Dim pc As New Entities.Portals.PortalController
With pc.GetPortal(PortalId)
Dim eventSkinPath As String = String.Format("{0}\DNNEvents\Themes", .HomeDirectoryMapPath)
If Not IO.Directory.Exists(eventSkinPath) Then
IO.Directory.CreateDirectory(eventSkinPath)
End If
For Each d As String In IO.Directory.GetDirectories(eventSkinPath)
ddlThemeCustom.Items.Add(New ListItem(New IO.DirectoryInfo(d).Name, New IO.DirectoryInfo(d).Name))
Next
If ddlThemeCustom.Items.Count = 0 Then
rbThemeCustom.Enabled = False
End If
End With
If themeSettings.SettingType = ThemeSetting.ThemeSettingTypeEnum.CustomTheme Then
If Not ddlThemeCustom.Items.FindByText(themeSettings.ThemeName) Is Nothing Then
ddlThemeCustom.Items.FindByText(themeSettings.ThemeName).Selected = True
End If
Else
ddlThemeCustom.Attributes.Add("disabled", "disabled")
End If
Catch ex As Exception
Debug.Write(ex.ToString)
End Try
End Sub
Private Sub LoadTemplates()
ddlTemplates.Items.Clear()
Dim t As Type = Settings.Templates.GetType
Dim p As Reflection.PropertyInfo
For Each p In t.GetProperties
ddlTemplates.Items.Add(New ListItem(Localization.GetString(p.Name + "Name", LocalResourceFile), p.Name))
Next
ddlTemplates.Items.FindByValue("EventDetailsTemplate").Selected = True
txtEventTemplate.Text = Settings.Templates.GetTemplate(ddlTemplates.SelectedValue)
lblTemplateUpdated.Visible = False
End Sub
Private Sub LoadNewEventEmailRoles(ByVal roleID As Integer)
Dim objRoles As New Security.Roles.RoleController
ddNewEventEmailRoles.DataSource = objRoles.GetPortalRoles(PortalId)
ddNewEventEmailRoles.DataTextField = "RoleName"
ddNewEventEmailRoles.DataValueField = "RoleID"
ddNewEventEmailRoles.DataBind()
If roleID < 0 Or ddNewEventEmailRoles.Items.FindByValue(CType(roleID, String)) Is Nothing Then
Try
ddNewEventEmailRoles.Items.FindByValue(PortalSettings.RegisteredRoleId.ToString).Selected() = True
Catch
End Try
Else
ddNewEventEmailRoles.Items.FindByValue(CType(roleID, String)).Selected = True
End If
End Sub
Private Sub LoadCategories()
ddlModuleCategories.Items.Clear()
Dim ctrlEventCategories As New EventCategoryController
Dim lstCategories As ArrayList = ctrlEventCategories.EventsCategoryList(PortalId)
ddlModuleCategories.DataSource = lstCategories
ddlModuleCategories.DataBind()
If Settings.ModuleCategoriesSelected = EventModuleSettings.CategoriesSelected.Some Then
For Each moduleCategory As String In Settings.ModuleCategoryIDs
For Each item As Telerik.Web.UI.RadComboBoxItem In ddlModuleCategories.Items
If item.Value = moduleCategory Then
item.Checked = True
End If
Next
Next
ElseIf Settings.ModuleCategoriesSelected = EventModuleSettings.CategoriesSelected.All Then
For Each item As Telerik.Web.UI.RadComboBoxItem In ddlModuleCategories.Items
item.Checked = True
Next
End If
End Sub
Private Sub LoadLocations()
ddlModuleLocations.Items.Clear()
Dim ctrlEventLocations As New EventLocationController
Dim lstLocations As ArrayList = ctrlEventLocations.EventsLocationList(PortalId)
ddlModuleLocations.DataSource = lstLocations
ddlModuleLocations.DataBind()
If Settings.ModuleLocationsSelected = EventModuleSettings.LocationsSelected.Some Then
For Each moduleLocation As String In Settings.ModuleLocationIDs
For Each item As Telerik.Web.UI.RadComboBoxItem In ddlModuleLocations.Items
If item.Value = moduleLocation Then
item.Checked = True
End If
Next
Next
ElseIf Settings.ModuleLocationsSelected = EventModuleSettings.LocationsSelected.All Then
For Each item As Telerik.Web.UI.RadComboBoxItem In ddlModuleLocations.Items
item.Checked = True
Next
End If
End Sub
''' <summary>
''' Take all settings and write them back to the database
''' </summary>
''' <remarks></remarks>
Private Sub UpdateSettings()
Dim emSettings As New EventModuleSettings(ModuleId, LocalResourceFile)
Try
emSettings.Timeinterval = ddlTimeInterval.SelectedValue.Trim.ToString()
emSettings.TimeZoneId = cboTimeZone.SelectedValue
emSettings.EnableEventTimeZones = chkEnableEventTimeZones.Checked
emSettings.PrimaryTimeZone = CType(ddlPrimaryTimeZone.SelectedValue, EventModuleSettings.TimeZones)
emSettings.SecondaryTimeZone = CType(ddlSecondaryTimeZone.SelectedValue, EventModuleSettings.TimeZones)
emSettings.Eventtooltipmonth = chkToolTipMonth.Checked
emSettings.Eventtooltipweek = chkToolTipWeek.Checked
emSettings.Eventtooltipday = chkToolTipDay.Checked
emSettings.Eventtooltiplist = chkToolTipList.Checked
emSettings.Eventtooltiplength = CInt(txtTooltipLength.Text)
If chkMonthCellEvents.Checked Then
emSettings.Monthcellnoevents = False
Else
emSettings.Monthcellnoevents = True
End If
emSettings.Enablecategories = CType(ddlEnableCategories.SelectedValue, EventModuleSettings.DisplayCategories)
emSettings.Restrictcategories = chkRestrictCategories.Checked
emSettings.Enablelocations = CType(ddlEnableLocations.SelectedValue, EventModuleSettings.DisplayLocations)
emSettings.Restrictlocations = chkRestrictLocations.Checked
emSettings.Enablecontainerskin = chkEnableContainerSkin.Checked
emSettings.Eventdetailnewpage = chkEventDetailNewPage.Checked
emSettings.Enableenrollpopup = chkEnableEnrollPopup.Checked
emSettings.Eventdaynewpage = chkEventDayNewPage.Checked
emSettings.EventImageMonth = chkEventImageMonth.Checked
emSettings.EventImageWeek = chkEventImageWeek.Checked
emSettings.Eventnotify = chkEventNotify.Checked
emSettings.DetailPageAllowed = chkDetailPageAllowed.Checked
emSettings.EnrollmentPageAllowed = chkEnrollmentPageAllowed.Checked
emSettings.EnrollmentPageDefaultUrl = txtEnrollmentPageDefaultURL.Text
emSettings.Notifyanon = chkNotifyAnon.Checked
emSettings.Sendreminderdefault = chkSendReminderDefault.Checked
emSettings.Neweventemails = rblNewEventEmail.SelectedValue
emSettings.Neweventemailrole = CInt(ddNewEventEmailRoles.SelectedValue)
emSettings.Newpereventemail = chkNewPerEventEmail.Checked
emSettings.Tzdisplay = chkTZDisplay.Checked
emSettings.Paypalurl = txtPayPalURL.Text
If chkEnableEventNav.Checked Then
emSettings.DisableEventnav = False
Else
emSettings.DisableEventnav = True
End If
emSettings.Fulltimescale = chkFullTimeScale.Checked
emSettings.Collapserecurring = chkCollapseRecurring.Checked
emSettings.Includeendvalue = chkIncludeEndValue.Checked
emSettings.Showvaluemarks = chkShowValueMarks.Checked
emSettings.Eventimage = chkImageEnabled.Checked
emSettings.MaxThumbHeight = CInt(txtMaxThumbHeight.Text)
emSettings.MaxThumbWidth = CInt(txtMaxThumbWidth.Text)
emSettings.Allowreoccurring = chkAllowRecurring.Checked
emSettings.Maxrecurrences = txtMaxRecurrences.Text
emSettings.Eventsearch = chkEnableSearch.Checked
emSettings.Addsubmodulename = chkAddSubModuleName.Checked
emSettings.Enforcesubcalperms = chkEnforceSubCalPerms.Checked
emSettings.Preventconflicts = chkPreventConflicts.Checked
emSettings.Locationconflict = chkLocationConflict.Checked
emSettings.ShowEventsAlways = chkShowEventsAlways.Checked
emSettings.Timeintitle = chkTimeInTitle.Checked
emSettings.Monthdayselect = chkMonthDaySelect.Checked
emSettings.MasterEvent = chkMasterEvent.Checked
emSettings.Eventsignup = chkEventSignup.Checked
emSettings.Eventsignupallowpaid = chkEventSignupAllowPaid.Checked
emSettings.Eventdefaultenrollview = chkDefaultEnrollView.Checked
emSettings.Eventhidefullenroll() = chkHideFullEnroll.Checked
emSettings.Maxnoenrolees = CInt(txtMaxNoEnrolees.Text)
emSettings.Enrolcanceldays = CInt(txtCancelDays.Text)
emSettings.Fridayweekend = chkFridayWeekend.Checked
emSettings.Moderateall = chkModerateAll.Checked
emSettings.Paypalaccount = txtPayPalAccount.Text
emSettings.Reminderfrom = txtReminderFrom.Text
emSettings.StandardEmail = txtStandardEmail.Text
emSettings.EventsCustomField1 = chkCustomField1.Checked
emSettings.EventsCustomField2 = chkCustomField2.Checked
emSettings.DefaultView = ddlDefaultView.SelectedItem.Value
emSettings.EventsListPageSize = CInt(ddlPageSize.SelectedItem.Value)
emSettings.EventsListSortDirection = ddlListSortedFieldDirection.SelectedItem.Value
emSettings.EventsListSortColumn = ddlListDefaultColumn.SelectedItem.Value
emSettings.RSSEnable = chkRSSEnable.Checked
emSettings.RSSDateField = ddlRSSDateField.SelectedItem.Value
emSettings.RSSDays = CInt(txtRSSDays.Text)
emSettings.RSSTitle = txtRSSTitle.Text
emSettings.RSSDesc = txtRSSDesc.Text
emSettings.Expireevents = txtExpireEvents.Text
emSettings.Exportowneremail = chkExportOwnerEmail.Checked
emSettings.Exportanonowneremail = chkExportAnonOwnerEmail.Checked
emSettings.Ownerchangeallowed = chkOwnerChangeAllowed.Checked
emSettings.IconMonthPrio = chkIconMonthPrio.Checked
emSettings.IconMonthRec = chkIconMonthRec.Checked
emSettings.IconMonthReminder = chkIconMonthReminder.Checked
emSettings.IconMonthEnroll = chkIconMonthEnroll.Checked
emSettings.IconWeekPrio = chkIconWeekPrio.Checked