forked from ventrian/News-Articles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathucViewOptions.ascx.vb
executable file
·1995 lines (1525 loc) · 101 KB
/
ucViewOptions.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
'
' News Articles for DotNetNuke - http://www.dotnetnuke.com
' Copyright (c) 2002-2007
' by Ventrian ( [email protected] ) ( http://www.ventrian.com )
'
Imports System.IO
Imports System.Linq
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Security.Roles
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Imports Ventrian.NewsArticles.Components.Types
Imports DotNetNuke.Services.FileSystem
Imports DotNetNuke.Entities.Portals
Imports DotNetNuke.Entities.Tabs
Imports DotNetNuke.Entities.Users
Imports Ventrian.NewsArticles.Base
Namespace Ventrian.NewsArticles
Partial Public Class ucViewOptions
Inherits NewsArticleModuleBase
'''<summary>
'''ctlWatermarkImage control.
'''</summary>
'''<remarks>
'''Auto-generated field.
'''To modify move field declaration from designer file to code-behind file.
'''</remarks>
Protected WithEvents ctlWatermarkImage As DotNetNuke.UI.UserControls.UrlControl
#Region " Private Methods "
Public Class ListItemComparer
Implements IComparer(Of ListItem)
Public Function Compare(ByVal x As ListItem, ByVal y As ListItem) As Integer _
Implements IComparer(Of ListItem).Compare
Dim c As New CaseInsensitiveComparer
Return c.Compare(x.Text, y.Text)
End Function
End Class
Public Shared Sub SortDropDown(ByVal cbo As DropDownList)
Dim lstListItems As New List(Of ListItem)
For Each li As ListItem In cbo.Items
lstListItems.Add(li)
Next
lstListItems.Sort(New ListItemComparer)
cbo.Items.Clear()
cbo.Items.AddRange(lstListItems.ToArray)
End Sub
#Region " Private Methods - Load Types/Dropdowns "
Private Sub BindRoleGroups()
Dim objRole As New RoleController
drpSecurityRoleGroups.DataSource = RoleController.GetRoleGroups(PortalId)
drpSecurityRoleGroups.DataBind()
drpSecurityRoleGroups.Items.Insert(0, New ListItem(Localization.GetString("AllGroups", Me.LocalResourceFile), "-1"))
End Sub
Private Sub BindRoles()
Dim availableRoles As ArrayList = New ArrayList
Dim roles As IList(Of RoleInfo)
If (drpSecurityRoleGroups.SelectedValue = "-1") Then
roles = RoleController.Instance.GetRoles(PortalId)
Else
Dim objRole As New RoleController
roles = objRole.GetRolesByGroup(PortalId, Convert.ToInt32(drpSecurityRoleGroups.SelectedValue))
End If
If Not roles Is Nothing Then
For Each Role As RoleInfo In roles
availableRoles.Add(New ListItem(Role.RoleName, Role.RoleName))
Next
End If
grdBasicPermissions.DataSource = availableRoles
grdBasicPermissions.DataBind()
grdFormPermissions.DataSource = availableRoles
grdFormPermissions.DataBind()
grdAdminPermissions.DataSource = availableRoles
grdAdminPermissions.DataBind()
End Sub
Private Sub BindAuthorSelection()
For Each value As Integer In System.Enum.GetValues(GetType(AuthorSelectType))
Dim li As New ListItem
li.Value = System.Enum.GetName(GetType(AuthorSelectType), value)
li.Text = Localization.GetString(System.Enum.GetName(GetType(AuthorSelectType), value), Me.LocalResourceFile)
lstAuthorSelection.Items.Add(li)
Next
End Sub
Private Sub BindCategorySortOrder()
For Each value As Integer In System.Enum.GetValues(GetType(CategorySortType))
Dim li As New ListItem
li.Value = System.Enum.GetName(GetType(CategorySortType), value)
li.Text = Localization.GetString(System.Enum.GetName(GetType(CategorySortType), value), Me.LocalResourceFile)
lstCategorySortOrder.Items.Add(li)
Next
End Sub
Private Sub BindDisplayTypes()
For Each value As Integer In System.Enum.GetValues(GetType(DisplayType))
Dim li As New ListItem
li.Value = System.Enum.GetName(GetType(DisplayType), value)
li.Text = Localization.GetString(System.Enum.GetName(GetType(DisplayType), value), Me.LocalResourceFile)
drpDisplayType.Items.Add(li)
Next
End Sub
Private Sub BindCaptchaTypes()
For Each value As Integer In System.Enum.GetValues(GetType(CaptchaType))
Dim li As New ListItem
li.Value = System.Enum.GetName(GetType(CaptchaType), value)
li.Text = Localization.GetString($"CaptchaType{System.Enum.GetName(GetType(CaptchaType), value)}", Me.LocalResourceFile)
drpCaptchaType.Items.Add(li)
Next
End Sub
Private Sub BindRelatedTypes()
For Each value As Integer In System.Enum.GetValues(GetType(RelatedType))
Dim li As New ListItem
li.Value = System.Enum.GetName(GetType(RelatedType), value)
li.Text = Localization.GetString(System.Enum.GetName(GetType(RelatedType), value), Me.LocalResourceFile)
lstRelatedMode.Items.Add(li)
Next
End Sub
Private Sub BindFolders()
Dim folders As List(Of IFolderInfo) = FolderManager.Instance.GetFolders(PortalId)
For Each folder As FolderInfo In folders
Dim FolderItem As New ListItem
If folder.FolderPath = Null.NullString Then
FolderItem.Text = Localization.GetString("Root", Me.LocalResourceFile)
Else
FolderItem.Text = folder.FolderPath
End If
FolderItem.Value = folder.FolderID.ToString()
drpDefaultImageFolder.Items.Add(FolderItem)
drpDefaultFileFolder.Items.Add(New ListItem(FolderItem.Text, FolderItem.Value))
Next
End Sub
Private Sub BindTextEditorMode()
For Each value As Integer In System.Enum.GetValues(GetType(TextEditorModeType))
Dim li As New ListItem
li.Value = System.Enum.GetName(GetType(TextEditorModeType), value)
li.Text = Localization.GetString(System.Enum.GetName(GetType(TextEditorModeType), value), Me.LocalResourceFile)
lstTextEditorSummaryMode.Items.Add(li)
Next
End Sub
Private Sub BindTitleReplacement()
For Each value As Integer In System.Enum.GetValues(GetType(TitleReplacementType))
Dim li As New ListItem
li.Value = System.Enum.GetName(GetType(TitleReplacementType), value)
li.Text = Localization.GetString(System.Enum.GetName(GetType(TitleReplacementType), value), Me.LocalResourceFile)
lstTitleReplacement.Items.Add(li)
Next
End Sub
Private Sub BindUrlMode()
For Each value As Integer In System.Enum.GetValues(GetType(UrlModeType))
Dim li As New ListItem
li.Value = System.Enum.GetName(GetType(UrlModeType), value)
li.Text = Localization.GetString(System.Enum.GetName(GetType(UrlModeType), value), Me.LocalResourceFile)
lstUrlMode.Items.Add(li)
Next
End Sub
Private Sub BindPageSize()
drpNumber.Items.Add(New ListItem(Localization.GetString("NoRestriction", Me.LocalResourceFile), "-1"))
drpNumber.Items.Add(New ListItem(Localization.GetString("1", Me.LocalResourceFile), "1"))
drpNumber.Items.Add(New ListItem(Localization.GetString("2", Me.LocalResourceFile), "2"))
drpNumber.Items.Add(New ListItem(Localization.GetString("3", Me.LocalResourceFile), "3"))
drpNumber.Items.Add(New ListItem(Localization.GetString("4", Me.LocalResourceFile), "4"))
drpNumber.Items.Add(New ListItem(Localization.GetString("5", Me.LocalResourceFile), "5"))
drpNumber.Items.Add(New ListItem(Localization.GetString("6", Me.LocalResourceFile), "6"))
drpNumber.Items.Add(New ListItem(Localization.GetString("7", Me.LocalResourceFile), "7"))
drpNumber.Items.Add(New ListItem(Localization.GetString("8", Me.LocalResourceFile), "8"))
drpNumber.Items.Add(New ListItem(Localization.GetString("9", Me.LocalResourceFile), "9"))
drpNumber.Items.Add(New ListItem(Localization.GetString("10", Me.LocalResourceFile), "10"))
drpNumber.Items.Add(New ListItem(Localization.GetString("15", Me.LocalResourceFile), "15"))
drpNumber.Items.Add(New ListItem(Localization.GetString("20", Me.LocalResourceFile), "20"))
drpNumber.Items.Add(New ListItem(Localization.GetString("50", Me.LocalResourceFile), "50"))
End Sub
Private Sub BindSortBy()
drpSortBy.Items.Add(New ListItem(Localization.GetString("PublishDate.Text", Me.LocalResourceFile), "StartDate"))
drpSortBy.Items.Add(New ListItem(Localization.GetString("ExpiryDate.Text", Me.LocalResourceFile), "EndDate"))
drpSortBy.Items.Add(New ListItem(Localization.GetString("LastUpdate.Text", Me.LocalResourceFile), "LastUpdate"))
drpSortBy.Items.Add(New ListItem(Localization.GetString("HighestRated.Text", Me.LocalResourceFile), "Rating"))
drpSortBy.Items.Add(New ListItem(Localization.GetString("MostCommented.Text", Me.LocalResourceFile), "CommentCount"))
drpSortBy.Items.Add(New ListItem(Localization.GetString("MostViewed.Text", Me.LocalResourceFile), "NumberOfViews"))
drpSortBy.Items.Add(New ListItem(Localization.GetString("Random.Text", Me.LocalResourceFile), "NewID()"))
drpSortBy.Items.Add(New ListItem(Localization.GetString("SortTitle.Text", Me.LocalResourceFile), "Title"))
End Sub
Private Sub BindSortDirection()
drpSortDirection.Items.Add(New ListItem(Localization.GetString("Ascending.Text", Me.LocalResourceFile), "ASC"))
drpSortDirection.Items.Add(New ListItem(Localization.GetString("Descending.Text", Me.LocalResourceFile), "DESC"))
drpSortDirectionComments.Items.Add(New ListItem(Localization.GetString("Ascending.Text", Me.LocalResourceFile), "0"))
drpSortDirectionComments.Items.Add(New ListItem(Localization.GetString("Descending.Text", Me.LocalResourceFile), "1"))
End Sub
Private Sub BindSyndicationLinkMode()
For Each value As Integer In System.Enum.GetValues(GetType(SyndicationLinkType))
Dim li As New ListItem
li.Value = System.Enum.GetName(GetType(SyndicationLinkType), value)
li.Text = Localization.GetString(System.Enum.GetName(GetType(SyndicationLinkType), value), Me.LocalResourceFile)
lstSyndicationLinkMode.Items.Add(li)
Next
End Sub
Private Sub BindSyndicationEnclosureType()
For Each value As Integer In System.Enum.GetValues(GetType(SyndicationEnclosureType))
Dim li As New ListItem
li.Value = System.Enum.GetName(GetType(SyndicationEnclosureType), value)
li.Text = Localization.GetString(System.Enum.GetName(GetType(SyndicationEnclosureType), value) & "-Enclosure", Me.LocalResourceFile)
lstSyndicationEnclosureType.Items.Add(li)
Next
End Sub
Private Sub BindMenuPositionType()
For Each value As Integer In System.Enum.GetValues(GetType(MenuPositionType))
Dim li As New ListItem
li.Value = System.Enum.GetName(GetType(MenuPositionType), value)
li.Text = Localization.GetString(System.Enum.GetName(GetType(MenuPositionType), value), Me.LocalResourceFile)
lstMenuPosition.Items.Add(li)
Next
End Sub
Private Sub BindTemplates()
Dim templateRoot As String = Me.MapPath("Templates")
If Directory.Exists(templateRoot) Then
Dim arrFolders() As String = Directory.GetDirectories(templateRoot)
For Each folder As String In arrFolders
Dim folderName As String = folder.Substring(folder.LastIndexOf("\") + 1)
Dim objListItem As ListItem = New ListItem
objListItem.Text = folderName
objListItem.Value = folderName
drpTemplates.Items.Add(objListItem)
Next
End If
End Sub
Private Sub BindCategories()
Dim objCategoryController As CategoryController = New CategoryController
Dim objCategories As List(Of CategoryInfo) = objCategoryController.GetCategoriesAll(Me.ModuleId, Null.NullInteger, ArticleSettings.CategorySortType)
lstCategories.DataSource = objCategories
lstCategories.DataBind()
lstDefaultCategories.DataSource = objCategories
lstDefaultCategories.DataBind()
drpCategories.DataSource = objCategories
drpCategories.DataBind()
End Sub
Private Sub BindTimeZone()
drpTimeZone.Items.Clear()
For Each tz As TimeZoneInfo In TimeZoneInfo.GetSystemTimeZones()
drpTimeZone.Items.Add(New ListItem(tz.DisplayName, tz.BaseUtcOffset.TotalMinutes))
Next
'DotNetNuke.Services.Localization.Localization.LoadTimeZoneDropDownList(drpTimeZone, BasePage.PageCulture.Name, Convert.ToString(PortalSettings.TimeZoneOffset))
End Sub
Private Sub BindThumbnailType()
For Each value As Integer In System.Enum.GetValues(GetType(ThumbnailType))
Dim li As New ListItem
li.Value = System.Enum.GetName(GetType(ThumbnailType), value)
li.Text = Localization.GetString(System.Enum.GetName(GetType(ThumbnailType), value), Me.LocalResourceFile)
rdoThumbnailType.Items.Add(li)
Next
End Sub
Private Sub BindWatermarkPosition()
For Each value As Integer In System.Enum.GetValues(GetType(WatermarkPosition))
Dim li As New ListItem
li.Value = System.Enum.GetName(GetType(WatermarkPosition), value)
li.Text = Localization.GetString(System.Enum.GetName(GetType(WatermarkPosition), value), Me.LocalResourceFile)
drpWatermarkPosition.Items.Add(li)
Next
End Sub
#End Region
Private Sub BindSettings()
BindBasicSettings()
BindArchiveSettings()
BindCategorySettings()
BindCommentSettings()
BindContentSharingSettings()
BindFilterSettings()
BindFormSettings()
BindImageSettings()
BindFileSettings()
BindNotificationSettings()
BindRelatedSettings()
BindSecuritySettings()
BindSEOSettings()
BindSyndicationSettings()
BindTwitterSettings()
BindThirdPartySettings()
End Sub
#Region " Private Methods - Bind/Save Basic Settings "
Private Sub BindBasicSettings()
chkEnableRatingsAuthenticated.Checked = ArticleSettings.EnableRatingsAuthenticated
chkEnableRatingsAnonymous.Checked = ArticleSettings.EnableRatingsAnonymous
chkEnableCoreSearch.Checked = ArticleSettings.EnableCoreSearch
chkEnableNotificationPing.Checked = ArticleSettings.EnableNotificationPing
chkEnableAutoTrackback.Checked = ArticleSettings.EnableAutoTrackback
chkProcessPostTokens.Checked = ArticleSettings.ProcessPostTokens
If (Settings.Contains(ArticleConstants.ENABLE_INCOMING_TRACKBACK_SETTING)) Then
chkEnableIncomingTrackback.Checked = Convert.ToBoolean(Settings(ArticleConstants.ENABLE_INCOMING_TRACKBACK_SETTING).ToString())
Else
chkEnableIncomingTrackback.Checked = True
End If
If (Settings.Contains(ArticleConstants.LAUNCH_LINKS)) Then
chkLaunchLinks.Checked = Convert.ToBoolean(Settings(ArticleConstants.LAUNCH_LINKS).ToString())
Else
chkLaunchLinks.Checked = ArticleSettings.LaunchLinks
End If
If (Settings.Contains(ArticleConstants.BUBBLE_FEATURED_ARTICLES)) Then
chkBubbleFeaturedArticles.Checked = Convert.ToBoolean(Settings(ArticleConstants.BUBBLE_FEATURED_ARTICLES).ToString())
Else
chkBubbleFeaturedArticles.Checked = False
End If
If (Settings.Contains(ArticleConstants.REQUIRE_CATEGORY)) Then
chkRequireCategory.Checked = Convert.ToBoolean(Settings(ArticleConstants.REQUIRE_CATEGORY).ToString())
Else
chkRequireCategory.Checked = False
End If
If Not (drpDisplayType.Items.FindByValue(ArticleSettings.DisplayMode.ToString()) Is Nothing) Then
drpDisplayType.SelectedValue = ArticleSettings.DisplayMode.ToString()
End If
If Not (drpTemplates.Items.FindByValue(ArticleSettings.Template) Is Nothing) Then
drpTemplates.SelectedValue = ArticleSettings.Template
End If
If (drpNumber.Items.FindByValue(ArticleSettings.PageSize.ToString()) IsNot Nothing) Then
drpNumber.SelectedValue = ArticleSettings.PageSize.ToString()
End If
If Not (drpTimeZone.Items.FindByValue(ArticleSettings.ServerTimeZone.ToString()) Is Nothing) Then
drpTimeZone.SelectedValue = ArticleSettings.ServerTimeZone.ToString()
End If
If Not (drpSortBy.Items.FindByValue(ArticleSettings.SortBy.ToString()) Is Nothing) Then
drpSortBy.SelectedValue = ArticleSettings.SortBy.ToString()
End If
If Not (drpSortDirection.Items.FindByValue(ArticleSettings.SortDirection.ToString()) Is Nothing) Then
drpSortDirection.SelectedValue = ArticleSettings.SortDirection.ToString()
End If
If (lstMenuPosition.Items.FindByValue(ArticleSettings.MenuPosition.ToString()) IsNot Nothing) Then
lstMenuPosition.SelectedValue = ArticleSettings.MenuPosition.ToString()
End If
End Sub
Private Sub SaveBasicSettings()
Dim objModules As New ModuleController
' General Configuration
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.ENABLE_RATINGS_AUTHENTICATED_SETTING, chkEnableRatingsAuthenticated.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.ENABLE_RATINGS_ANONYMOUS_SETTING, chkEnableRatingsAnonymous.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.ENABLE_CORE_SEARCH_SETTING, chkEnableCoreSearch.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.PROCESS_POST_TOKENS, chkProcessPostTokens.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.ENABLE_NOTIFICATION_PING_SETTING, chkEnableNotificationPing.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.ENABLE_AUTO_TRACKBACK_SETTING, chkEnableAutoTrackback.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.ENABLE_INCOMING_TRACKBACK_SETTING, chkEnableIncomingTrackback.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.LAUNCH_LINKS, chkLaunchLinks.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.BUBBLE_FEATURED_ARTICLES, chkBubbleFeaturedArticles.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.REQUIRE_CATEGORY, chkRequireCategory.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.DISPLAY_MODE, CType(System.Enum.Parse(GetType(DisplayType), drpDisplayType.SelectedValue), DisplayType).ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.PAGE_SIZE_SETTING, drpNumber.SelectedValue)
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.TEMPLATE_SETTING, drpTemplates.SelectedValue)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.SERVER_TIMEZONE, drpTimeZone.SelectedValue)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.SORT_BY, drpSortBy.SelectedValue)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.SORT_DIRECTION, drpSortDirection.SelectedValue)
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.MENU_POSITION_TYPE, lstMenuPosition.SelectedValue)
' Clear Cache
DataCache.RemoveCache(TabModuleId.ToString() & TemplateConstants.LISTING_ITEM)
DataCache.RemoveCache(TabModuleId.ToString() & TemplateConstants.LISTING_FEATURED)
DataCache.RemoveCache(TabModuleId.ToString() & TemplateConstants.LISTING_HEADER)
DataCache.RemoveCache(TabModuleId.ToString() & TemplateConstants.LISTING_FOOTER)
DataCache.RemoveCache(TabModuleId.ToString() & TemplateConstants.VIEW_ITEM)
DataCache.RemoveCache(TabModuleId.ToString() & TemplateConstants.VIEW_HEADER)
DataCache.RemoveCache(TabModuleId.ToString() & TemplateConstants.VIEW_FOOTER)
DataCache.RemoveCache(TabModuleId.ToString() & TemplateConstants.COMMENT_ITEM)
DataCache.RemoveCache(TabModuleId.ToString() & TemplateConstants.COMMENT_HEADER)
DataCache.RemoveCache(TabModuleId.ToString() & TemplateConstants.COMMENT_FOOTER)
DataCache.RemoveCache(TabModuleId.ToString() & TemplateConstants.MENU_ITEM)
End Sub
#End Region
#Region " Private Methods - Bind/Save Archive Settings "
Private Sub BindArchiveSettings()
chkArchiveCurrentArticles.Checked = ArticleSettings.ArchiveCurrentArticles
chkArchiveCategories.Checked = ArticleSettings.ArchiveCategories
chkArchiveAuthor.Checked = ArticleSettings.ArchiveAuthor
chkArchiveMonth.Checked = ArticleSettings.ArchiveMonth
End Sub
Private Sub SaveArchiveSettings()
Dim objModules As New ModuleController
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.ARCHIVE_CURRENT_ARTICLES_SETTING, chkArchiveCurrentArticles.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.ARCHIVE_CATEGORIES_SETTING, chkArchiveCategories.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.ARCHIVE_AUTHOR_SETTING, chkArchiveAuthor.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.ARCHIVE_MONTH_SETTING, chkArchiveMonth.Checked.ToString())
End Sub
#End Region
#Region " Private Methods - Bind/Save Category Settings "
Private Sub BindCategorySettings()
If (Settings.Contains(ArticleConstants.DEFAULT_CATEGORIES_SETTING)) Then
If Not (Settings(ArticleConstants.DEFAULT_CATEGORIES_SETTING).ToString = Null.NullString) Then
Dim categories As String() = Settings(ArticleConstants.DEFAULT_CATEGORIES_SETTING).ToString().Split(Char.Parse(","))
For Each category As String In categories
If Not (lstDefaultCategories.Items.FindByValue(category) Is Nothing) Then
lstDefaultCategories.Items.FindByValue(category).Selected = True
End If
Next
End If
End If
txtCategorySelectionHeight.Text = ArticleSettings.CategorySelectionHeight.ToString()
chkCategoryBreadcrumb.Checked = ArticleSettings.CategoryBreadcrumb
chkCategoryName.Checked = ArticleSettings.IncludeInPageName
chkCategoryFilterSubmit.Checked = ArticleSettings.CategoryFilterSubmit
If (lstCategorySortOrder.Items.FindByValue(ArticleSettings.CategorySortType.ToString()) IsNot Nothing) Then
lstCategorySortOrder.SelectedValue = ArticleSettings.CategorySortType.ToString()
End If
End Sub
Private Sub SaveCategorySettings()
Dim objModules As New ModuleController
Dim categories As String = ""
For Each item As ListItem In lstDefaultCategories.Items
If item.Selected Then
If (categories.Length > 0) Then
categories = categories & ","
End If
categories = categories & item.Value
End If
Next item
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.DEFAULT_CATEGORIES_SETTING, categories)
If (IsNumeric(txtCategorySelectionHeight.Text)) Then
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.CATEGORY_SELECTION_HEIGHT_SETTING, txtCategorySelectionHeight.Text)
End If
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.CATEGORY_BREADCRUMB_SETTING, chkCategoryBreadcrumb.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.CATEGORY_NAME_SETTING, chkCategoryName.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.CATEGORY_FILTER_SUBMIT_SETTING, chkCategoryFilterSubmit.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.CATEGORY_SORT_SETTING, lstCategorySortOrder.SelectedValue)
End Sub
#End Region
Private Sub BindCommentSettings()
If (Settings.Contains(ArticleConstants.ENABLE_COMMENTS_SETTING)) Then
chkEnableComments.Checked = Convert.ToBoolean(Settings(ArticleConstants.ENABLE_COMMENTS_SETTING).ToString())
Else
chkEnableComments.Checked = True
End If
If (Settings.Contains(ArticleConstants.ENABLE_ANONYMOUS_COMMENTS_SETTING)) Then
chkEnableAnonymousComments.Checked = Convert.ToBoolean(Settings(ArticleConstants.ENABLE_ANONYMOUS_COMMENTS_SETTING).ToString())
Else
chkEnableAnonymousComments.Checked = True
End If
If (Settings.Contains(ArticleConstants.ENABLE_COMMENT_MODERATION_SETTING)) Then
chkEnableCommentModeration.Checked = Convert.ToBoolean(Settings(ArticleConstants.ENABLE_COMMENT_MODERATION_SETTING).ToString())
Else
chkEnableCommentModeration.Checked = False
End If
If (Settings.Contains(ArticleConstants.COMMENT_HIDE_WEBSITE_SETTING)) Then
chkHideWebsite.Checked = Convert.ToBoolean(Settings(ArticleConstants.COMMENT_HIDE_WEBSITE_SETTING).ToString())
Else
chkHideWebsite.Checked = False
End If
If (Settings.Contains(ArticleConstants.COMMENT_REQUIRE_NAME_SETTING)) Then
chkRequireName.Checked = Convert.ToBoolean(Settings(ArticleConstants.COMMENT_REQUIRE_NAME_SETTING).ToString())
Else
chkRequireName.Checked = True
End If
If (Settings.Contains(ArticleConstants.COMMENT_REQUIRE_EMAIL_SETTING)) Then
chkRequireEmail.Checked = Convert.ToBoolean(Settings(ArticleConstants.COMMENT_REQUIRE_EMAIL_SETTING).ToString())
Else
chkRequireEmail.Checked = True
End If
Dim selectCaptchaType As CaptchaType = CaptchaType.None
If (Settings.Contains(ArticleConstants.USE_CAPTCHA_SETTING)) Then
'there's an existing module setting, so make sure we don't change behavior for that
If Convert.ToBoolean(Settings(ArticleConstants.USE_CAPTCHA_SETTING).ToString()) Then
selectCaptchaType = CaptchaType.DnnCore
End If
Else
If (Settings.Contains(ArticleConstants.CAPTCHATYPE_SETTING)) Then
selectCaptchaType = CType(System.Enum.Parse(GetType(CaptchaType), Settings(ArticleConstants.CAPTCHATYPE_SETTING)), CaptchaType)
End If
End If
Dim selectedItem As ListItem = drpCaptchaType.Items.FindByValue(selectCaptchaType.ToString())
drpCaptchaType.SelectedIndex = drpCaptchaType.Items.IndexOf(selectedItem)
If (Settings.Contains(ArticleConstants.RECAPTCHA_SITEKEY_SETTING)) Then
txtReCaptchaSiteKey.Text = Settings(ArticleConstants.RECAPTCHA_SITEKEY_SETTING).ToString()
End If
If (Settings.Contains(ArticleConstants.RECAPTCHA_SECRETKEY_SETTING)) Then
txtReCaptchaSecretKey.Text = Settings(ArticleConstants.RECAPTCHA_SECRETKEY_SETTING).ToString()
End If
If (Settings.Contains(ArticleConstants.NOTIFY_DEFAULT_SETTING)) Then
chkNotifyDefault.Checked = Convert.ToBoolean(Settings(ArticleConstants.NOTIFY_DEFAULT_SETTING).ToString())
Else
chkNotifyDefault.Checked = False
End If
If Not (drpSortDirectionComments.Items.FindByValue(ArticleSettings.SortDirectionComments.ToString()) Is Nothing) Then
drpSortDirectionComments.SelectedValue = ArticleSettings.SortDirectionComments.ToString()
End If
If (Settings.Contains(ArticleConstants.COMMENT_AKISMET_SETTING)) Then
txtAkismetKey.Text = Settings(ArticleConstants.COMMENT_AKISMET_SETTING).ToString()
End If
End Sub
Private Sub SaveCommentSettings()
Dim objModules As New ModuleController
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.ENABLE_COMMENTS_SETTING, chkEnableComments.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.ENABLE_ANONYMOUS_COMMENTS_SETTING, chkEnableAnonymousComments.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.ENABLE_COMMENT_MODERATION_SETTING, chkEnableCommentModeration.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.COMMENT_HIDE_WEBSITE_SETTING, chkHideWebsite.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.COMMENT_REQUIRE_NAME_SETTING, chkRequireName.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.COMMENT_REQUIRE_EMAIL_SETTING, chkRequireEmail.Checked.ToString())
'This is only for upgraded modules
If Settings.ContainsKey(ArticleConstants.USE_CAPTCHA_SETTING) Then
objModules.DeleteModuleSetting(ModuleId, ArticleConstants.USE_CAPTCHA_SETTING)
objModules.DeleteTabModuleSetting(TabModuleId, ArticleConstants.USE_CAPTCHA_SETTING)
End If
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.CAPTCHATYPE_SETTING, drpCaptchaType.SelectedValue)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.RECAPTCHA_SITEKEY_SETTING, txtReCaptchaSiteKey.Text)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.RECAPTCHA_SECRETKEY_SETTING, txtReCaptchaSecretKey.Text)
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.NOTIFY_DEFAULT_SETTING, chkNotifyDefault.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.COMMENT_SORT_DIRECTION_SETTING, drpSortDirectionComments.SelectedValue)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.COMMENT_AKISMET_SETTING, txtAkismetKey.Text)
End Sub
Private Sub BindContentSharingSettings()
If (Me.UserInfo.IsSuperUser = False) Then
phContentSharing.Visible = False
Else
BindAvailableContentSharingPortals()
BindSelectedContentSharingPortals()
End If
End Sub
Private Sub SaveContentSharingSettings()
End Sub
Private Sub BindFilterSettings()
If (ArticleSettings.MaxArticles <> Null.NullInteger) Then
txtMaxArticles.Text = ArticleSettings.MaxArticles.ToString()
End If
If (ArticleSettings.MaxAge <> Null.NullInteger) Then
txtMaxAge.Text = ArticleSettings.MaxAge.ToString()
End If
If (ArticleSettings.FilterSingleCategory = Null.NullInteger) Then
If (ArticleSettings.FilterCategories IsNot Nothing) Then
For Each category As String In ArticleSettings.FilterCategories
If Not (lstCategories.Items.FindByValue(category) Is Nothing) Then
lstCategories.Items.FindByValue(category).Selected = True
End If
Next
If (ArticleSettings.MatchCategories = MatchOperatorType.MatchAny) Then
rdoMatchAny.Checked = True
End If
If (ArticleSettings.MatchCategories = MatchOperatorType.MatchAll) Then
rdoMatchAll.Checked = True
End If
Else
rdoAllCategories.Checked = True
End If
Else
rdoSingleCategory.Checked = True
If (drpCategories.Items.FindByValue(ArticleSettings.FilterSingleCategory.ToString()) IsNot Nothing) Then
drpCategories.SelectedValue = ArticleSettings.FilterSingleCategory.ToString()
End If
End If
chkShowPending.Checked = ArticleSettings.ShowPending
chkShowFeaturedOnly.Checked = ArticleSettings.FeaturedOnly
chkShowNotFeaturedOnly.Checked = ArticleSettings.NotFeaturedOnly
chkShowSecuredOnly.Checked = ArticleSettings.SecuredOnly
chkShowNotSecuredOnly.Checked = ArticleSettings.NotSecuredOnly
If (ArticleSettings.Author <> Null.NullInteger) Then
Dim objUserController As New DotNetNuke.Entities.Users.UserController
Dim objUser As DotNetNuke.Entities.Users.UserInfo = objUserController.GetUser(Me.PortalId, ArticleSettings.Author)
If Not (objUser Is Nothing) Then
lblAuthorFilter.Text = objUser.Username
End If
Else
lblAuthorFilter.Text = Localization.GetString("SelectAuthor.Text", Me.LocalResourceFile)
End If
chkQueryStringFilter.Checked = ArticleSettings.AuthorUserIDFilter
txtQueryStringParam.Text = ArticleSettings.AuthorUserIDParam
chkUsernameFilter.Checked = ArticleSettings.AuthorUsernameFilter
txtUsernameParam.Text = ArticleSettings.AuthorUsernameParam
chkLoggedInUser.Checked = ArticleSettings.AuthorLoggedInUserFilter
End Sub
Private Sub SaveFilterSettings()
Dim objModules As New ModuleController
If (txtMaxArticles.Text <> "") Then
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.MAX_ARTICLES_SETTING, txtMaxArticles.Text)
Else
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.MAX_ARTICLES_SETTING, Null.NullInteger.ToString())
End If
If (txtMaxAge.Text <> "") Then
If (IsNumeric(txtMaxAge.Text)) Then
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.MAX_AGE_SETTING, txtMaxAge.Text)
Else
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.MAX_AGE_SETTING, Null.NullInteger.ToString())
End If
Else
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.MAX_AGE_SETTING, Null.NullInteger.ToString())
End If
If (rdoAllCategories.Checked) Then
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.CATEGORIES_SETTING & Me.TabId.ToString(), Null.NullInteger.ToString())
End If
If (rdoSingleCategory.Checked) Then
If (drpCategories.SelectedValue <> "") Then
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.CATEGORIES_FILTER_SINGLE_SETTING, drpCategories.SelectedValue)
Else
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.CATEGORIES_FILTER_SINGLE_SETTING, Null.NullInteger.ToString())
End If
Else
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.CATEGORIES_FILTER_SINGLE_SETTING, Null.NullInteger.ToString())
End If
If (rdoMatchAny.Checked Or rdoMatchAll.Checked) Then
Dim categories As String = ""
For Each item As ListItem In lstCategories.Items
If item.Selected Then
If (categories.Length > 0) Then
categories = categories & ","
End If
categories = categories & item.Value
End If
Next item
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.CATEGORIES_SETTING & Me.TabId.ToString(), categories)
If (rdoMatchAny.Checked) Then
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.MATCH_OPERATOR_SETTING, MatchOperatorType.MatchAny.ToString())
End If
If (rdoMatchAll.Checked) Then
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.MATCH_OPERATOR_SETTING, MatchOperatorType.MatchAll.ToString())
End If
End If
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.SHOW_PENDING_SETTING, chkShowPending.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.SHOW_FEATURED_ONLY_SETTING, chkShowFeaturedOnly.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.SHOW_NOT_FEATURED_ONLY_SETTING, chkShowNotFeaturedOnly.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.SHOW_SECURED_ONLY_SETTING, chkShowSecuredOnly.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.SHOW_NOT_SECURED_ONLY_SETTING, chkShowNotSecuredOnly.Checked.ToString())
If (ddlAuthor.Visible) Then
If (ddlAuthor.Items.Count > 0) Then
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.AUTHOR_SETTING, ddlAuthor.SelectedValue)
End If
End If
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.AUTHOR_USERID_FILTER_SETTING, chkQueryStringFilter.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.AUTHOR_USERID_PARAM_SETTING, txtQueryStringParam.Text)
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.AUTHOR_USERNAME_FILTER_SETTING, chkUsernameFilter.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.AUTHOR_USERNAME_PARAM_SETTING, txtUsernameParam.Text)
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.AUTHOR_LOGGED_IN_USER_FILTER_SETTING, chkLoggedInUser.Checked.ToString())
End Sub
Private Sub BindFormSettings()
If (lstAuthorSelection.Items.FindByValue(ArticleSettings.AuthorSelect.ToString()) IsNot Nothing) Then
lstAuthorSelection.SelectedValue = ArticleSettings.AuthorSelect.ToString()
End If
If (ArticleSettings.AuthorDefault <> Null.NullInteger) Then
Dim objUserController As New DotNetNuke.Entities.Users.UserController
Dim objUser As DotNetNuke.Entities.Users.UserInfo = objUserController.GetUser(Me.PortalId, ArticleSettings.AuthorDefault)
If Not (objUser Is Nothing) Then
lblAuthorDefault.Text = objUser.Username
End If
End If
chkExpandSummary.Checked = ArticleSettings.ExpandSummary
txtTextEditorWidth.Text = ArticleSettings.TextEditorWidth
txtTextEditorHeight.Text = ArticleSettings.TextEditorHeight
If (lstTextEditorSummaryMode.Items.FindByValue(ArticleSettings.TextEditorSummaryMode.ToString()) IsNot Nothing) Then
lstTextEditorSummaryMode.SelectedValue = ArticleSettings.TextEditorSummaryMode.ToString()
End If
txtTextEditorSummaryWidth.Text = ArticleSettings.TextEditorSummaryWidth
txtTextEditorSummaryHeight.Text = ArticleSettings.TextEditorSummaryHeight
End Sub
Private Sub SaveFormSettings()
Dim objModules As New ModuleController
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.AUTHOR_SELECT_TYPE, lstAuthorSelection.SelectedValue)
If (drpAuthorDefault.Visible) Then
If (drpAuthorDefault.Items.Count > 0) Then
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.AUTHOR_DEFAULT_SETTING, drpAuthorDefault.SelectedValue)
End If
End If
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.EXPAND_SUMMARY_SETTING, chkExpandSummary.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.TEXT_EDITOR_WIDTH, txtTextEditorWidth.Text)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.TEXT_EDITOR_HEIGHT, txtTextEditorHeight.Text)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.TEXT_EDITOR_SUMMARY_MODE, lstTextEditorSummaryMode.SelectedValue)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.TEXT_EDITOR_SUMMARY_WIDTH, txtTextEditorSummaryWidth.Text)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.TEXT_EDITOR_SUMMARY_HEIGHT, txtTextEditorSummaryHeight.Text)
End Sub
Private Sub BindImageSettings()
chkIncludeJQuery.Checked = ArticleSettings.IncludeJQuery
txtJQueryPath.Text = Me.ArticleSettings.ImageJQueryPath
chkEnableImagesUpload.Checked = ArticleSettings.EnableImagesUpload
chkEnablePortalImages.Checked = ArticleSettings.EnablePortalImages
chkEnableExternalImages.Checked = ArticleSettings.EnableExternalImages
If (drpDefaultImageFolder.Items.FindByValue(ArticleSettings.DefaultImagesFolder.ToString) IsNot Nothing) Then
drpDefaultImageFolder.SelectedValue = ArticleSettings.DefaultImagesFolder.ToString
End If
chkResizeImages.Checked = ArticleSettings.ResizeImages
If (rdoThumbnailType.Items.FindByValue(ArticleSettings.ImageThumbnailType.ToString) IsNot Nothing) Then
rdoThumbnailType.SelectedValue = ArticleSettings.ImageThumbnailType.ToString
Else
rdoThumbnailType.SelectedIndex = 0
End If
txtImageMaxWidth.Text = ArticleSettings.MaxImageWidth.ToString()
txtImageMaxHeight.Text = ArticleSettings.MaxImageHeight.ToString()
chkUseWatermark.Checked = Me.ArticleSettings.WatermarkEnabled
txtWatermarkText.Text = Me.ArticleSettings.WatermarkText
ctlWatermarkImage.Url = Me.ArticleSettings.WatermarkImage
If Not (drpWatermarkPosition.Items.FindByValue(ArticleSettings.WatermarkPosition.ToString()) Is Nothing) Then
drpWatermarkPosition.SelectedValue = ArticleSettings.WatermarkPosition.ToString()
End If
End Sub
Private Sub SaveImageSettings()
Dim objModules As New ModuleController
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.INCLUDE_JQUERY_SETTING, chkIncludeJQuery.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.IMAGE_JQUERY_PATH, txtJQueryPath.Text)
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.ENABLE_UPLOAD_IMAGES_SETTING, chkEnableImagesUpload.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.ENABLE_PORTAL_IMAGES_SETTING, chkEnablePortalImages.Checked.ToString())
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.ENABLE_EXTERNAL_IMAGES_SETTING, chkEnableExternalImages.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.DEFAULT_IMAGES_FOLDER_SETTING, drpDefaultImageFolder.SelectedValue)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.IMAGE_RESIZE_SETTING, chkResizeImages.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.IMAGE_THUMBNAIL_SETTING, rdoThumbnailType.SelectedValue)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.IMAGE_MAX_WIDTH_SETTING, txtImageMaxWidth.Text)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.IMAGE_MAX_HEIGHT_SETTING, txtImageMaxHeight.Text)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.IMAGE_WATERMARK_ENABLED_SETTING, chkUseWatermark.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.IMAGE_WATERMARK_TEXT_SETTING, txtWatermarkText.Text)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.IMAGE_WATERMARK_IMAGE_SETTING, ctlWatermarkImage.Url)
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.IMAGE_WATERMARK_IMAGE_POSITION_SETTING, drpWatermarkPosition.SelectedValue)
End Sub
Private Sub BindFileSettings()
If (drpDefaultFileFolder.Items.FindByValue(ArticleSettings.DefaultFilesFolder.ToString) IsNot Nothing) Then
drpDefaultFileFolder.SelectedValue = ArticleSettings.DefaultFilesFolder.ToString
End If
chkEnablePortalFiles.Checked = ArticleSettings.EnablePortalFiles
End Sub
Private Sub SaveFileSettings()
Dim objModules As New ModuleController
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.DEFAULT_FILES_FOLDER_SETTING, drpDefaultFileFolder.SelectedValue)
objModules.UpdateTabModuleSetting(TabModuleId, ArticleConstants.ENABLE_PORTAL_FILES_SETTING, chkEnablePortalFiles.Checked.ToString())
End Sub
Private Sub BindSecuritySettings()
txtSecureUrl.Text = ArticleSettings.SecureUrl.ToString()
If (ArticleSettings.RoleGroupID <> Null.NullInteger) Then
If (drpSecurityRoleGroups.Items.FindByValue(ArticleSettings.RoleGroupID.ToString()) IsNot Nothing) Then
drpSecurityRoleGroups.SelectedValue = ArticleSettings.RoleGroupID.ToString()
End If
End If
BindRoles()
End Sub
Private Sub SaveSecuritySettings()
Dim objModules As New ModuleController
Dim submitRoles As String = ""
Dim secureRoles As String = ""
Dim autoSecureRoles As String = ""
Dim approveRoles As String = ""
Dim autoApproveRoles As String = ""
Dim autoApproveCommentRoles As String = ""
Dim featureRoles As String = ""
Dim autoFeatureRoles As String = ""
For Each item As DataGridItem In grdBasicPermissions.Items
Dim role As String = grdBasicPermissions.DataKeys(item.ItemIndex).ToString()
Dim chkSubmit As CheckBox = CType(item.FindControl("chkSubmit"), CheckBox)
If (chkSubmit.Checked) Then
If (submitRoles = "") Then
submitRoles = role
Else
submitRoles = submitRoles & ";" & role
End If
End If
Dim chkSecure As CheckBox = CType(item.FindControl("chkSecure"), CheckBox)
If (chkSecure.Checked) Then
If (secureRoles = "") Then
secureRoles = role
Else
secureRoles = secureRoles & ";" & role
End If
End If
Dim chkAutoSecure As CheckBox = CType(item.FindControl("chkAutoSecure"), CheckBox)
If (chkAutoSecure.Checked) Then
If (autoSecureRoles = "") Then
autoSecureRoles = role
Else
autoSecureRoles = autoSecureRoles & ";" & role
End If
End If
Dim chkApprove As CheckBox = CType(item.FindControl("chkApprove"), CheckBox)
If (chkApprove.Checked) Then
If (approveRoles = "") Then
approveRoles = role
Else
approveRoles = approveRoles & ";" & role
End If
End If
Dim chkAutoApproveArticle As CheckBox = CType(item.FindControl("chkAutoApproveArticle"), CheckBox)
If (chkAutoApproveArticle.Checked) Then
If (autoApproveRoles = "") Then
autoApproveRoles = role
Else
autoApproveRoles = autoApproveRoles & ";" & role
End If
End If