-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dnn.Modules.Lists_08.00.04.xml
1784 lines (1746 loc) · 60.6 KB
/
Dnn.Modules.Lists_08.00.04.xml
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
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<root file="Dnn.Modules.Lists.dll" version="08.00.04" generated="2017-06-19 23:39:39Z" generationTime="2.2525405">
<namespace name="Dnn.Modules.Lists">
<class name="ListEditor">
<declaration><![CDATA[public class ListEditor : PortalModuleBase]]></declaration>
<documentation>-----------------------------------------------------------------------------
<summary>
Manages Entry List
</summary>
<remarks>
</remarks>
-----------------------------------------------------------------------------</documentation>
<constructors>
<constructor name=".ctor">
<declaration><![CDATA[public ListEditor()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="2147483647" sc="0" el="0" ec="0">
</location>
<body hash="d41d8cd98f00b204e9800998ecf8427e"><![CDATA[]]></body>
</codeblock>
</constructor>
</constructors>
<methods>
<method name="BindList">
<declaration><![CDATA[private void BindList(string key)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="68" sc="9" el="73" ec="10">ListEditor.ascx.cs</location>
<body hash="dcc73ad8fc8abaac4fe744f14c409c98"><![CDATA[{
lstEntries.SelectedKey = key;
lstEntries.ListPortalID = PortalSettings.ActiveTab.IsSuperTab ? Null.NullInteger : PortalId;
lstEntries.ShowDelete = true;
lstEntries.DataBind();
}]]></body>
</codeblock>
</method>
<method name="BindTree">
<declaration><![CDATA[private void BindTree()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="76" sc="9" el="123" ec="10">ListEditor.ascx.cs</location>
<body hash="2493d6bcb53a4218201333c34aa3b96f"><![CDATA[{
var ctlLists = new ListController();
var colLists = ctlLists.GetListInfoCollection(string.Empty, string.Empty, PortalSettings.ActiveTab.PortalID);
var indexLookup = new Hashtable();
listTree.Nodes.Clear();
foreach (ListInfo list in colLists)
{
String filteredNode;
if (list.DisplayName.Contains(":"))
{
var finalPeriod = list.DisplayName.LastIndexOf(".", StringComparison.InvariantCulture);
filteredNode = list.DisplayName.Substring(finalPeriod + 1);
}
else
{
filteredNode = list.DisplayName;
}
var node = new DnnTreeNode { Text = filteredNode };
{
node.Value = list.Key;
node.ToolTip = String.Format(LocalizeString("NoEntries"), list.EntryCount);
node.ImageUrl = IconController.IconURL("Folder");
}
if (list.Level == 0)
{
listTree.Nodes.Add(node);
}
else
{
if (indexLookup[list.ParentList] != null)
{
var parentNode = (DnnTreeNode) indexLookup[list.ParentList];
parentNode.Nodes.Add(node);
}
}
//Add index key here to find it later, should suggest with Joe to add it to DNNTree
if (indexLookup[list.Key] == null)
{
indexLookup.Add(list.Key, node);
}
}
}]]></body>
</codeblock>
</method>
<method name="cmdAddList_Click">
<declaration><![CDATA[private void cmdAddList_Click(object sender, EventArgs e)]]></declaration>
<documentation>-----------------------------------------------------------------------------
<summary>
Handles Add New List command
</summary>
<param name="sender"></param>
<param name="e"></param>
<remarks>
Using "CommandName" property of cmdSaveEntry to determine this is a new list
</remarks>
-----------------------------------------------------------------------------</documentation>
<codeblock>
<location sl="226" sc="9" el="229" ec="10">ListEditor.ascx.cs</location>
<body hash="b55075fec21d3d9db1852b5b69e46b6d"><![CDATA[{
Mode = "AddList";
BindList("");
}]]></body>
</codeblock>
</method>
<method name="DNNTree_NodeClick">
<declaration><![CDATA[private void DNNTree_NodeClick(object source, RadTreeNodeEventArgs e)]]></declaration>
<documentation>-----------------------------------------------------------------------------
<summary>
Populate list entries based on value selected in DNNTree
</summary>
<param name="source"></param>
<param name="e"></param>
<remarks>
</remarks>
-----------------------------------------------------------------------------</documentation>
<codeblock>
<location sl="210" sc="9" el="213" ec="10">ListEditor.ascx.cs</location>
<body hash="22b4a87df93de832039d1baea58c388b"><![CDATA[{
Mode = "ListEntries";
BindList(e.Node.Value);
}]]></body>
</codeblock>
</method>
<method name="OnInit">
<declaration><![CDATA[protected override void OnInit(EventArgs e)]]></declaration>
<documentation>-----------------------------------------------------------------------------
<summary>
Page_Init runs when the control is initialised
</summary>
-----------------------------------------------------------------------------</documentation>
<codeblock>
<location sl="135" sc="9" el="143" ec="10">ListEditor.ascx.cs</location>
<body hash="2b98bf531119a9f5ddc4074cac2360de"><![CDATA[{
base.OnInit(e);
//Set the List Entries Control Properties
lstEntries.ID = "ListEntries";
//ensure that module context is forwarded from parent module to child module
lstEntries.ModuleContext.Configuration = ModuleContext.Configuration;
}]]></body>
</codeblock>
</method>
<method name="OnLoad">
<declaration><![CDATA[protected override void OnLoad(EventArgs e)]]></declaration>
<documentation>-----------------------------------------------------------------------------
<summary>
Page load, bind tree and enable controls
</summary>
<param name="e"></param>
<remarks>
</remarks>
-----------------------------------------------------------------------------</documentation>
<codeblock>
<location sl="154" sc="9" el="181" ec="10">ListEditor.ascx.cs</location>
<body hash="cc4b324752c92964d3e556ea8cd65e6c"><![CDATA[{
base.OnLoad(e);
listTree.NodeClick += DNNTree_NodeClick;
cmdAddList.Click += cmdAddList_Click;
try
{
if (!Page.IsPostBack)
{
//configure tree
if (Request.QueryString["Key"] != null)
{
Mode = "ListEntries";
BindList(Request.QueryString["Key"]);
}
else
{
Mode = "NoList";
}
BindTree();
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}]]></body>
</codeblock>
</method>
<method name="OnPreRender">
<declaration><![CDATA[protected override void OnPreRender(EventArgs e)]]></declaration>
<documentation>-----------------------------------------------------------------------------
<summary>
Page_PreRender runs just prior to the control being rendered
</summary>
<param name="e"></param>
<remarks>
</remarks>
-----------------------------------------------------------------------------</documentation>
<codeblock>
<location sl="192" sc="9" el="198" ec="10">ListEditor.ascx.cs</location>
<body hash="9cd6220cf50838b7dc852edb35adb31e"><![CDATA[{
base.OnPreRender(e);
var listSelected = Mode != "NoList";
divNoList.Visible = !listSelected;
divDetails.Visible = listSelected;
}]]></body>
</codeblock>
</method>
</methods>
<fields>
<field name="cmdAddList">
<declaration><![CDATA[protected LinkButton cmdAddList;]]></declaration>
<documentation>
<summary>
cmdAddList control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="divDetails">
<declaration><![CDATA[protected HtmlGenericControl divDetails;]]></declaration>
<documentation>
<summary>
divDetails control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="divNoList">
<declaration><![CDATA[protected HtmlGenericControl divNoList;]]></declaration>
<documentation>
<summary>
divNoList control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="listTree">
<declaration><![CDATA[protected DnnTreeView listTree;]]></declaration>
<documentation>
<summary>
listTree control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="lstEntries">
<declaration><![CDATA[protected ListEntries lstEntries;]]></declaration>
<documentation>
<summary>
lstEntries control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
</fields>
<properties>
<property name="Mode">
<declaration><![CDATA[protected string Mode]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="54" sc="13" el="56" ec="14">ListEditor.ascx.cs</location>
<body hash="0b0b3758ecae03bc1238aca0a0d2daa0"><![CDATA[{
return lstEntries.Mode;
}]]></body>
</codeblock>
<codeblock>
<location sl="58" sc="13" el="60" ec="14">ListEditor.ascx.cs</location>
<body hash="d0f49f320e3a6709547d594e125942ba"><![CDATA[{
lstEntries.Mode = value;
}]]></body>
</codeblock>
</property>
</properties>
<events>
</events>
</class>
<class name="ListEntries">
<declaration><![CDATA[public class ListEntries : PortalModuleBase]]></declaration>
<documentation>
<summary>
Manages Entry List
</summary>
</documentation>
<constructors>
<constructor name=".ctor">
<declaration><![CDATA[public ListEntries()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="2147483647" sc="0" el="0" ec="0">
</location>
<body hash="d41d8cd98f00b204e9800998ecf8427e"><![CDATA[]]></body>
</codeblock>
</constructor>
</constructors>
<methods>
<method name="add_ListCreated">
<declaration><![CDATA[public void add_ListCreated(EventHandler value)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="2147483647" sc="0" el="0" ec="0">
</location>
<body hash="d41d8cd98f00b204e9800998ecf8427e"><![CDATA[]]></body>
</codeblock>
</method>
<method name="add_ListEntryCreated">
<declaration><![CDATA[public void add_ListEntryCreated(EventHandler value)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="2147483647" sc="0" el="0" ec="0">
</location>
<body hash="d41d8cd98f00b204e9800998ecf8427e"><![CDATA[]]></body>
</codeblock>
</method>
<method name="BindGrid">
<declaration><![CDATA[private void BindGrid()]]></declaration>
<documentation>
<summary>
Loads top level entry list
</summary>
</documentation>
<codeblock>
<location sl="249" sc="3" el="309" ec="4">ListEntries.ascx.cs</location>
<body hash="e264e742ddb953af7db4cbf9e72acf46"><![CDATA[{
foreach (GridColumn column in grdEntries.Columns)
{
if (ReferenceEquals(column.GetType(), typeof(DnnGridImageCommandColumn)))
{
//Manage Delete Confirm JS
var imageColumn = (DnnGridImageCommandColumn)column;
if (imageColumn.CommandName == "Delete")
{
imageColumn.OnClickJs = Localization.GetString("DeleteItem");
if (SystemList)
{
column.Visible = false;
}
else
{
column.Visible = true;
}
}
//Localize Image Column Text
if (!string.IsNullOrEmpty(imageColumn.CommandName))
{
imageColumn.Text = Localization.GetString(imageColumn.CommandName, LocalResourceFile);
}
}
else if(ReferenceEquals(column.GetType(), typeof(DnnGridTemplateColumn)))
{
if (EnableSortOrder)
{
column.Visible = true;
}
else
{
column.Visible = false;
}
}
}
grdEntries.DataSource = SelectedListItems; //selList
grdEntries.DataBind();
if (SelectedListItems == null)
{
lblEntryCount.Text = "0 " + Localization.GetString("Entries", LocalResourceFile);
}
else
{
lblEntryCount.Text = SelectedListItems.Count() + " " + Localization.GetString("Entries", LocalResourceFile);
foreach (var item in SelectedListItems)
{
//list cannot be deleted if any of the item belongs to host
if (item.SystemList)
{
cmdDeleteList.Visible = false;
break;
}
}
}
}]]></body>
</codeblock>
</method>
<method name="BindListInfo">
<declaration><![CDATA[private void BindListInfo()]]></declaration>
<documentation>
<summary>
Loads top level entry list
</summary>
</documentation>
<codeblock>
<location sl="315" sc="3" el="383" ec="4">ListEntries.ascx.cs</location>
<body hash="f5ebae15ff3b13e24019f369aabac737"><![CDATA[{
lblListName.Text = ListName;
lblListParent.Text = ParentKey;
rowListParent.Visible = (!string.IsNullOrEmpty(ParentKey));
chkEnableSortOrder.Checked = EnableSortOrder;
if (!SystemList && ShowDelete)
{
cmdDeleteList.Visible = true;
ClientAPI.AddButtonConfirm(cmdDeleteList, Localization.GetString("DeleteItem"));
}
else
{
cmdDeleteList.Visible = false;
}
switch (Mode)
{
case "ListEntries":
EnableView(true);
break;
case "EditEntry":
EnableView(false);
EnableEdit(false);
break;
case "AddEntry":
EnableView(false);
EnableEdit(false);
if (SelectedList != null)
{
txtParentKey.Text = SelectedList.ParentKey;
}
else
{
rowEnableSortOrder.Visible = true;
}
txtEntryName.Text = ListName;
rowListName.Visible = false;
txtEntryValue.Text = "";
txtEntryText.Text = "";
cmdSaveEntry.CommandName = "SaveEntry";
break;
case "AddList":
EnableView(false);
EnableEdit(true);
rowListName.Visible = true;
txtParentKey.Text = "";
txtEntryName.Text = "";
txtEntryValue.Text = "";
txtEntryText.Text = "";
txtEntryName.ReadOnly = false;
cmdSaveEntry.CommandName = "SaveList";
var ctlLists = new ListController();
ddlSelectList.Enabled = true;
ddlSelectList.DataSource = ctlLists.GetListInfoCollection(string.Empty, string.Empty, PortalSettings.ActiveTab.PortalID);
ddlSelectList.DataTextField = "DisplayName";
ddlSelectList.DataValueField = "Key";
ddlSelectList.DataBind();
//ddlSelectList.Items.Insert(0, new ListItem(Localization.GetString("None_Specified"), ""));
ddlSelectList.InsertItem(0, Localization.GetString("None_Specified"), "");
//Reset dropdownlist
ddlSelectParent.ClearSelection();
ddlSelectParent.Enabled = false;
break;
}
}]]></body>
</codeblock>
</method>
<method name="DataBind">
<declaration><![CDATA[public override void DataBind()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="475" sc="3" el="479" ec="4">ListEntries.ascx.cs</location>
<body hash="c5aa498b0c63ddc2c44636e1e1132f7c"><![CDATA[{
InitList();
BindListInfo();
BindGrid();
}]]></body>
</codeblock>
</method>
<method name="DeleteItem">
<declaration><![CDATA[private void DeleteItem(int entryId)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="386" sc="3" el="404" ec="4">ListEntries.ascx.cs</location>
<body hash="92c831d3adf34b91653c0805afe6ee45"><![CDATA[{
if (SelectedListItems.Any())
{
try
{
var ctlLists = new ListController();
ctlLists.DeleteListEntryByID(entryId, true);
DataBind();
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
else
{
DeleteList();
}
}]]></body>
</codeblock>
</method>
<method name="DeleteList">
<declaration><![CDATA[private void DeleteList()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="407" sc="3" el="413" ec="4">ListEntries.ascx.cs</location>
<body hash="a4beb51c7fe61171a292bca5e5b005cc"><![CDATA[{
var ctlLists = new ListController();
ctlLists.DeleteList(SelectedList, true);
Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId));
}]]></body>
</codeblock>
</method>
<method name="EnableEdit">
<declaration><![CDATA[private void EnableEdit(bool addList)]]></declaration>
<documentation>
<summary>
Switching to edit mode, change controls visibility for editing depends on AddList params
</summary>
</documentation>
<codeblock>
<location sl="419" sc="3" el="426" ec="4">ListEntries.ascx.cs</location>
<body hash="7b36e3e66e07cac89776bf9661b16356"><![CDATA[{
rowListdetails.Visible = (!addList);
rowSelectList.Visible = addList;
rowSelectParent.Visible = addList;
rowEnableSortOrder.Visible = addList;
rowParentKey.Visible = false;
cmdDelete.Visible = false;
}]]></body>
</codeblock>
</method>
<method name="EnableView">
<declaration><![CDATA[private void EnableView(bool viewMode)]]></declaration>
<documentation>
<summary>
Switching to view mode, change controls visibility for viewing
</summary>
<param name="viewMode">Boolean value to determine View or Edit mode</param></documentation>
<codeblock>
<location sl="433" sc="3" el="437" ec="4">ListEntries.ascx.cs</location>
<body hash="05855c94ad6c58bd48bbd9a4029ec1b8"><![CDATA[{
rowListdetails.Visible = true;
rowEntryGrid.Visible = viewMode;
rowEntryEdit.Visible = (!viewMode);
}]]></body>
</codeblock>
</method>
<method name="EntriesGridItemCommand">
<declaration><![CDATA[protected void EntriesGridItemCommand(object source, GridCommandEventArgs e)]]></declaration>
<documentation>
<summary>
Handles events when clicking image button in the grid (Edit/Up/Down)
</summary>
<param name="source"></param>
<param name="e"></param></documentation>
<codeblock>
<location sl="518" sc="3" el="567" ec="4">ListEntries.ascx.cs</location>
<body hash="c760952e7915e3ec585c89abee317e88"><![CDATA[{
try
{
var ctlLists = new ListController();
int entryID = Convert.ToInt32(((GridDataItem) e.Item).GetDataKeyValue("EntryID"));
switch (e.CommandName.ToLower())
{
case "delete":
Mode = "ListEntries";
DeleteItem(entryID);
break;
case "edit":
Mode = "EditEntry";
ListEntryInfo entry = ctlLists.GetListEntryInfo(entryID);
txtEntryID.Text = entryID.ToString(CultureInfo.InvariantCulture);
txtParentKey.Text = entry.ParentKey;
txtEntryValue.Text = entry.Value;
txtEntryText.Text = entry.Text;
rowListName.Visible = false;
cmdSaveEntry.CommandName = "Update";
if (!SystemList)
{
cmdDelete.Visible = true;
ClientAPI.AddButtonConfirm(cmdDelete, Localization.GetString("DeleteItem"));
}
else
{
cmdDelete.Visible = false;
}
e.Canceled = true; //stop the grid from providing inline editing
DataBind();
break;
case "up":
ctlLists.UpdateListSortOrder(entryID, true);
DataBind();
break;
case "down":
ctlLists.UpdateListSortOrder(entryID, false);
DataBind();
break;
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}]]></body>
</codeblock>
</method>
<method name="EntriesGridItemDataBound">
<declaration><![CDATA[protected void EntriesGridItemDataBound(object sender, GridItemEventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="570" sc="3" el="592" ec="4">ListEntries.ascx.cs</location>
<body hash="294bfb52c2c8a22d9e222f5eed3624d0"><![CDATA[{
if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.EditItem || e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.SelectedItem)
{
var entry = (ListEntryInfo)e.Item.DataItem;
if (entry != null)
{
//Hide Edit option for system list
var length = e.Item.Controls.Count;
var editCommand = e.Item.Controls[length - 2].Controls[0] as ImageButton;
if (editCommand != null)
{
editCommand.Visible = PortalSettings.ActiveTab.IsSuperTab || !(entry.SystemList || entry.PortalID == Null.NullInteger);
}
//Hide Delete option for system list
var delCommand = e.Item.Controls[length - 1].Controls[0] as ImageButton;
if (delCommand != null)
{
delCommand.Visible = PortalSettings.ActiveTab.IsSuperTab || !(entry.SystemList || entry.PortalID == Null.NullInteger);
}
}
}
}]]></body>
</codeblock>
</method>
<method name="GetList">
<declaration><![CDATA[private ListInfo GetList(string key, bool update)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="440" sc="3" el="455" ec="4">ListEntries.ascx.cs</location>
<body hash="c286d9e0f9bb8c8aec8d1e6c05603972"><![CDATA[{
var ctlLists = new ListController();
int index = key.IndexOf(":", StringComparison.Ordinal);
string listName = key.Substring(index + 1);
string parentKey = Null.NullString;
if (index > 0)
{
parentKey = key.Substring(0, index);
}
if (update)
{
ListName = listName;
ParentKey = parentKey;
}
return ctlLists.GetListInfo(listName, parentKey, ListPortalID);
}]]></body>
</codeblock>
</method>
<method name="InitList">
<declaration><![CDATA[private void InitList()]]></declaration>
<documentation>
<summary>
Loads top level entry list
</summary>
</documentation>
<codeblock>
<location sl="461" sc="3" el="468" ec="4">ListEntries.ascx.cs</location>
<body hash="051a48113ca9251c2776f47b4e9b9191"><![CDATA[{
if (SelectedList != null)
{
DefinitionID = SelectedList.DefinitionID;
EnableSortOrder = SelectedList.EnableSortOrder;
SystemList = SelectedList.SystemList;
}
}]]></body>
</codeblock>
</method>
<method name="OnAddEntryClick">
<declaration><![CDATA[protected void OnAddEntryClick(object sender, EventArgs e)]]></declaration>
<documentation>
<summary>
Handles Add New Entry command
</summary>
<param name="sender"></param>
<param name="e"></param>
<remarks>
Using "CommandName" property of cmdSaveEntry to determine this is a new entry of an existing list
</remarks></documentation>
<codeblock>
<location sl="629" sc="3" el="632" ec="4">ListEntries.ascx.cs</location>
<body hash="3e9b89ca2aa130018dbf0a05ca3f9591"><![CDATA[{
Mode = "AddEntry";
DataBind();
}]]></body>
</codeblock>
</method>
<method name="OnCancelClick">
<declaration><![CDATA[protected void OnCancelClick(object sender, EventArgs e)]]></declaration>
<documentation>
<summary>
Cancel
</summary>
<param name="sender"></param>
<param name="e"></param></documentation>
<codeblock>
<location sl="787" sc="3" el="804" ec="4">ListEntries.ascx.cs</location>
<body hash="5bcee845cf4f4caf20a75b507e366407"><![CDATA[{
try
{
Mode = "ListEntries";
if (!string.IsNullOrEmpty(SelectedKey))
{
DataBind();
}
else
{
Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId));
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}]]></body>
</codeblock>
</method>
<method name="OnDeleteClick">
<declaration><![CDATA[protected void OnDeleteClick(object sender, EventArgs e)]]></declaration>
<documentation>
<summary>
Delete List
</summary>
<param name="sender"></param>
<param name="e"></param>
<remarks>
If deleting entry is not the last one in the list, rebinding the grid, otherwise return back to main page (rebinding DNNTree)
</remarks></documentation>
<codeblock>
<location sl="777" sc="3" el="779" ec="4">ListEntries.ascx.cs</location>
<body hash="7fc8659276b8803cb842d4c6763d370f"><![CDATA[{
DeleteItem(Convert.ToInt32(txtEntryID.Text));
}]]></body>
</codeblock>
</method>
<method name="OnDeleteListClick">
<declaration><![CDATA[protected void OnDeleteListClick(object sender, EventArgs e)]]></declaration>
<documentation>
<summary>
Delete List
</summary>
<param name="sender"></param>
<param name="e"></param></documentation>
<codeblock>
<location sl="764" sc="3" el="766" ec="4">ListEntries.ascx.cs</location>
<body hash="34e9a5a88478688df6102e748d743d35"><![CDATA[{
DeleteList();
}]]></body>
</codeblock>
</method>
<method name="OnInit">
<declaration><![CDATA[protected override void OnInit(EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="486" sc="3" el="510" ec="4">ListEntries.ascx.cs</location>
<body hash="e8915c82fc270aed9d6b6086f1c0bda8"><![CDATA[{
base.OnInit(e);
grdEntries.ItemCommand += EntriesGridItemCommand;
grdEntries.ItemDataBound += EntriesGridItemDataBound;
ddlSelectList.SelectedIndexChanged += SelectListIndexChanged;
cmdAddEntry.Click += OnAddEntryClick;
cmdCancel.Click += OnCancelClick;
cmdDelete.Click += OnDeleteClick;
cmdDeleteList.Click += OnDeleteListClick;
cmdSaveEntry.Click += OnSaveEntryClick;
try
{
if (!Page.IsPostBack)
{
Mode = "ListEntries";
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}]]></body>
</codeblock>
</method>
<method name="OnListCreated">
<declaration><![CDATA[protected void OnListCreated(EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="807" sc="3" el="812" ec="4">ListEntries.ascx.cs</location>
<body hash="de93eb124fcdb53d7c273f5f9218a889"><![CDATA[{
if (ListCreated != null)
{
ListCreated(this, e);
}
}]]></body>
</codeblock>
</method>
<method name="OnListEntryCreated">
<declaration><![CDATA[protected void OnListEntryCreated(EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="815" sc="3" el="820" ec="4">ListEntries.ascx.cs</location>
<body hash="622aa1c6833b843b7270df44861cdcad"><![CDATA[{
if (ListEntryCreated != null)
{
ListEntryCreated(this, e);
}
}]]></body>
</codeblock>
</method>
<method name="OnSaveEntryClick">
<declaration><![CDATA[protected void OnSaveEntryClick(object sender, EventArgs e)]]></declaration>
<documentation>
<summary>
Handles cmdSaveEntry.Click
</summary>
<param name="sender"></param>
<param name="e"></param>
<remarks>
Using "CommandName" property of cmdSaveEntry to determine action to take (ListUpdate/AddEntry/AddList)
</remarks></documentation>
<codeblock>
<location sl="643" sc="3" el="756" ec="4">ListEntries.ascx.cs</location>
<body hash="24b42084c25398fa699dc0c24cac163c"><![CDATA[{
string entryValue;
string entryText;
if (UserInfo.IsSuperUser)
{
entryValue = txtEntryValue.Text;
entryText = txtEntryText.Text;
}
else
{
var ps = new PortalSecurity();
entryValue = ps.InputFilter(txtEntryValue.Text, PortalSecurity.FilterFlag.NoScripting);
entryText = ps.InputFilter(txtEntryText.Text, PortalSecurity.FilterFlag.NoScripting);
}
var listController = new ListController();
var listName = string.IsNullOrEmpty(ListName) ? txtEntryName.Text : (!string.IsNullOrEmpty(ParentKey) ? ParentKey + ":" : string.Empty) + ListName;
var entry = new ListEntryInfo();
{
entry.DefinitionID = Null.NullInteger;
entry.PortalID = ListPortalID;
entry.ListName = listName;
entry.Value = entryValue;
entry.Text = entryText;
}
if (Page.IsValid)
{
Mode = "ListEntries";
switch (cmdSaveEntry.CommandName.ToLower())
{
case "update":
entry.ListName = ListName;
entry.ParentKey = SelectedList.ParentKey;
entry.EntryID = int.Parse(txtEntryID.Text);
bool canUpdate = true;
foreach (var curEntry in listController.GetListEntryInfoItems(SelectedList.Name, entry.ParentKey, entry.PortalID))
{
if (entry.EntryID != curEntry.EntryID) //not the same item we are trying to update
{
if (entry.Value == curEntry.Value)
{
Skin.AddModuleMessage(this, Localization.GetString("ItemAlreadyPresent", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError);
canUpdate = false;
break;
}
}
}
if (canUpdate)
{
listController.UpdateListEntry(entry);
DataBind();
}
break;
case "saveentry":
if (SelectedList != null)
{
entry.ParentKey = SelectedList.ParentKey;
entry.ParentID = SelectedList.ParentID;
entry.Level = SelectedList.Level;
}
if (chkEnableSortOrder.Checked)
{
entry.SortOrder = 1;
}
else
{
entry.SortOrder = 0;
}
if (listController.AddListEntry(entry) == Null.NullInteger) //entry already found in database
{
Skin.AddModuleMessage(this, Localization.GetString("ItemAlreadyPresent", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError);
Mode = "AddEntry";
}
else
{
DataBind();
}
break;
case "savelist":
if (ddlSelectParent.SelectedIndex != -1)
{
int parentID = int.Parse(ddlSelectParent.SelectedItem.Value);
ListEntryInfo parentEntry = listController.GetListEntryInfo(parentID);
entry.ParentID = parentID;
entry.DefinitionID = parentEntry.DefinitionID;
entry.Level = parentEntry.Level + 1;
entry.ParentKey = parentEntry.Key;
}
if (chkEnableSortOrder.Checked)
{
entry.SortOrder = 1;
}
else
{
entry.SortOrder = 0;
}
if (listController.AddListEntry(entry) == Null.NullInteger) //entry already found in database
{
Skin.AddModuleMessage(this, Localization.GetString("ItemAlreadyPresent", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError);
}
else
{
SelectedKey = entry.ParentKey.Replace(":", ".") + ":" + entry.ListName;
Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", "Key=" + SelectedKey));
}
break;
}
}
}]]></body>
</codeblock>
</method>
<method name="remove_ListCreated">
<declaration><![CDATA[public void remove_ListCreated(EventHandler value)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="2147483647" sc="0" el="0" ec="0">
</location>
<body hash="d41d8cd98f00b204e9800998ecf8427e"><![CDATA[]]></body>
</codeblock>
</method>
<method name="remove_ListEntryCreated">
<declaration><![CDATA[public void remove_ListEntryCreated(EventHandler value)]]></declaration>
<documentation>