-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dnn.Modules.Languages_08.00.04.xml
6960 lines (6635 loc) · 290 KB
/
Dnn.Modules.Languages_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.Languages.dll" version="08.00.04" generated="2017-06-19 23:39:31Z" generationTime="8.2897304">
<namespace name="Dnn.Modules.Languages">
<class name="CLControl">
<declaration><![CDATA[public class CLControl : UserControl]]></declaration>
<documentation>
</documentation>
<constructors>
<constructor name=".ctor">
<declaration><![CDATA[public CLControl()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="205" sc="9" el="208" ec="10">CLControl.ascx.cs</location>
<body hash="b8f346fafa3f593aff1645331f729108"><![CDATA[public CLControl()
{
enablePageEdit = false;
}]]></body>
</codeblock>
</constructor>
</constructors>
<methods>
<method name="BindAll">
<declaration><![CDATA[public void BindAll(int tabID)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="213" sc="9" el="383" ec="10">CLControl.ascx.cs</location>
<body hash="4cf845c307b972ad6d23d329fafffb10"><![CDATA[{
TabID = tabID;
var currentTab = TabController.Instance.GetTab(tabID, PortalSettings.PortalId, false);
//Unique id of default language page
var uniqueId = currentTab.DefaultLanguageGuid != Null.NullGuid ? currentTab.DefaultLanguageGuid : currentTab.UniqueId;
// get all non admin pages and not deleted
var allPages = TabController.Instance.GetTabsByPortal(PortalSettings.PortalId).Values.Where(t => t.TabID != PortalSettings.AdminTabId && (Null.IsNull(t.ParentId) || t.ParentId != PortalSettings.AdminTabId));
allPages = allPages.Where(t => t.IsDeleted == false);
// get all localized pages of current page
var tabInfos = allPages as IList<TabInfo> ?? allPages.ToList();
var localizedPages = tabInfos.Where(t => t.DefaultLanguageGuid == uniqueId || t.UniqueId == uniqueId).OrderBy(t => t.DefaultLanguageGuid).ToList();
Dictionary<string, TabInfo> localizedTabs = null;
// we are going to build up a list of locales
// this is a bit more involved, since we want the default language to be first.
// also, we do not want to add any locales the user has no access to
var locales = new List<string>();
var localeController = new LocaleController();
var localeDict = localeController.GetLocales(PortalSettings.PortalId);
if (localeDict.Count > 0)
{
if (localizedPages.Count() == 1 && localizedPages.First().CultureCode == "")
{
// locale neutral page
locales.Add("");
}
else if (localizedPages.Count() == 1 && localizedPages.First().CultureCode != PortalSettings.DefaultLanguage)
{
locales.Add(localizedPages.First().CultureCode);
localizedTabs = new Dictionary<string, TabInfo>();
localizedTabs.Add(localizedPages.First().CultureCode, localizedPages.First());
}
else
{
//force sort order, so first add default language
locales.Add(PortalSettings.DefaultLanguage);
// build up a list of localized tabs.
// depending on whether or not the selected page is in the default langauge
// we will add the localized tabs from the current page
// or from the defaultlanguage page
if (currentTab.CultureCode == PortalSettings.DefaultLanguage)
{
localizedTabs = currentTab.LocalizedTabs;
}
else
{
// selected page is not in default language
// add localizedtabs from defaultlanguage page
if (currentTab.DefaultLanguageTab != null)
{
localizedTabs = currentTab.DefaultLanguageTab.LocalizedTabs;
}
}
if (localizedTabs != null)
{
// only add locales from tabs the user has at least view permissions to.
// we will handle the edit permissions at a later stage
locales.AddRange(from localizedTab in localizedTabs where TabPermissionController.CanViewPage(localizedTab.Value) select localizedTab.Value.CultureCode);
}
}
}
else
{
locales.Add("");
}
Data = new DnnPages(locales);
// filter the list of localized pages to only those that have a culture we want to see
var viewableLocalizedPages = localizedPages.Where(localizedPage => locales.Find(locale => locale == localizedPage.CultureCode) != null).ToList();
if (viewableLocalizedPages.Count() > 4)
{
mainContainer.Attributes.Add("class", "container RadGrid RadGrid_Default overflow");
}
foreach (var tabInfo in viewableLocalizedPages)
{
var localTabInfo = tabInfo;
var dnnPage = Data.Page(localTabInfo.CultureCode);
if (!TabPermissionController.CanViewPage(tabInfo))
{
Data.RemoveLocale(localTabInfo.CultureCode);
Data.Pages.Remove(dnnPage);
break;
}
dnnPage.TabID = localTabInfo.TabID;
dnnPage.TabName = localTabInfo.TabName;
dnnPage.Title = localTabInfo.Title;
dnnPage.Description = localTabInfo.Description;
dnnPage.Path = localTabInfo.TabPath.Substring(0, localTabInfo.TabPath.LastIndexOf("//", StringComparison.Ordinal)).Replace("//", "");
dnnPage.HasChildren = (TabController.Instance.GetTabsByPortal(PortalSettings.PortalId).WithParentId(tabInfo.TabID).Count != 0);
dnnPage.CanAdminPage = TabPermissionController.CanAdminPage(tabInfo);
dnnPage.CanViewPage = TabPermissionController.CanViewPage(tabInfo);
dnnPage.LocalResourceFile = LocalResourceFile;
// calculate position in the form of 1.3.2...
var SiblingTabs = tabInfos.Where(t => t.ParentId == localTabInfo.ParentId && t.CultureCode == localTabInfo.CultureCode || t.CultureCode == null).OrderBy(t => t.TabOrder).ToList();
dnnPage.Position = (SiblingTabs.IndexOf(localTabInfo) + 1).ToString(CultureInfo.InvariantCulture);
int ParentTabId = localTabInfo.ParentId;
while (ParentTabId > 0)
{
TabInfo ParentTab = tabInfos.Single(t => t.TabID == ParentTabId);
int id = ParentTabId;
SiblingTabs = tabInfos.Where(t => t.ParentId == id && t.CultureCode == localTabInfo.CultureCode || t.CultureCode == null).OrderBy(t => t.TabOrder).ToList();
dnnPage.Position = (SiblingTabs.IndexOf(localTabInfo) + 1).ToString(CultureInfo.InvariantCulture) + "." + dnnPage.Position;
ParentTabId = ParentTab.ParentId;
}
dnnPage.DefaultLanguageGuid = localTabInfo.DefaultLanguageGuid;
dnnPage.IsTranslated = localTabInfo.IsTranslated;
dnnPage.IsPublished = TabController.Instance.IsTabPublished(localTabInfo);
// generate modules information
foreach (var moduleInfo in ModuleController.Instance.GetTabModules(localTabInfo.TabID).Values)
{
var guid = moduleInfo.DefaultLanguageGuid == Null.NullGuid ? moduleInfo.UniqueId : moduleInfo.DefaultLanguageGuid;
var dnnModules = Data.Module(guid); // modules of each language
var dnnModule = dnnModules.Module(localTabInfo.CultureCode);
// detect error : 2 modules with same uniqueId on the same page
dnnModule.LocalResourceFile = LocalResourceFile;
if (dnnModule.TabModuleID > 0)
{
dnnModule.ErrorDuplicateModule = true;
ErrorExists = true;
continue;
}
dnnModule.ModuleTitle = moduleInfo.ModuleTitle;
dnnModule.DefaultLanguageGuid = moduleInfo.DefaultLanguageGuid;
dnnModule.TabId = localTabInfo.TabID;
dnnModule.TabModuleID = moduleInfo.TabModuleID;
dnnModule.ModuleID = moduleInfo.ModuleID;
dnnModule.CanAdminModule = ModulePermissionController.CanAdminModule(moduleInfo);
dnnModule.CanViewModule = ModulePermissionController.CanViewModule(moduleInfo);
dnnModule.IsDeleted = moduleInfo.IsDeleted;
if (moduleInfo.DefaultLanguageGuid != Null.NullGuid)
{
ModuleInfo defaultLanguageModule = ModuleController.Instance.GetModuleByUniqueID(moduleInfo.DefaultLanguageGuid);
if (defaultLanguageModule != null)
{
dnnModule.DefaultModuleID = defaultLanguageModule.ModuleID;
if (defaultLanguageModule.ParentTab.UniqueId != moduleInfo.ParentTab.DefaultLanguageGuid)
dnnModule.DefaultTabName = defaultLanguageModule.ParentTab.TabName;
}
}
dnnModule.IsTranslated = moduleInfo.IsTranslated;
dnnModule.IsLocalized = moduleInfo.IsLocalized;
dnnModule.IsShared = TabController.Instance.GetTabsByModuleID(moduleInfo.ModuleID).Values.Count(t => t.CultureCode == moduleInfo.CultureCode) > 1;
// detect error : the default language module is on an other page
dnnModule.ErrorDefaultOnOtherTab = moduleInfo.DefaultLanguageGuid != Null.NullGuid && moduleInfo.DefaultLanguageModule == null;
// detect error : different culture on tab and module
dnnModule.ErrorCultureOfModuleNotCultureOfTab = moduleInfo.CultureCode != localTabInfo.CultureCode;
ErrorExists = ErrorExists || dnnModule.ErrorDefaultOnOtherTab || dnnModule.ErrorCultureOfModuleNotCultureOfTab;
}
}
rDnnModules.DataSource = Data.Modules;
rDnnModules.DataBind();
}]]></body>
</codeblock>
</method>
<method name="BuildSettingsURL">
<declaration><![CDATA[protected string BuildSettingsURL(int tabId)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="170" sc="9" el="178" ec="10">CLControl.ascx.cs</location>
<body hash="8aefe3e5796df67b56fc3fb08fbf884f"><![CDATA[{
string url = Globals.NavigateURL(tabId, "Tab", "action=edit&activeTab=settingTab");
if (PortalSettings != null && PortalSettings.EnablePopUps)
{
url = UrlUtils.PopUpUrl(url, null, PortalSettings, false, false);
}
return url;
}]]></body>
</codeblock>
</method>
<method name="cmdDeleteModule">
<declaration><![CDATA[protected void cmdDeleteModule(object sender, EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="101" sc="9" el="111" ec="10">CLControl.ascx.cs</location>
<body hash="42c5d82590834efb40e2d0d39539c4c5"><![CDATA[{
if ((sender) is LinkButton)
{
var cmdDeleteModule = (LinkButton)sender;
var tabModuleId = int.Parse(cmdDeleteModule.CommandArgument);
var moduleInfo = ModuleController.Instance.GetTabModule(tabModuleId);
ModuleController.Instance.DeleteTabModule(moduleInfo.TabID, moduleInfo.ModuleID, false);
Response.Redirect(Request.RawUrl, false);
}
}]]></body>
</codeblock>
</method>
<method name="cmdDeleteTranslatedPage">
<declaration><![CDATA[protected void cmdDeleteTranslatedPage(object sender, EventArgs eventArgs)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="89" sc="9" el="98" ec="10">CLControl.ascx.cs</location>
<body hash="dd62f7506046bff6270cce6efd2f259b"><![CDATA[{
if ((sender) is LinkButton)
{
var cmdDeleteTranslation = (LinkButton)sender;
var args = cmdDeleteTranslation.CommandArgument.Split('|');
int tabId = int.Parse(args[0]);
TabController.Instance.DeleteTab(tabId, PortalSettings.PortalId);
Response.Redirect(Request.RawUrl, false);
}
}]]></body>
</codeblock>
</method>
<method name="cmdRestoreModule">
<declaration><![CDATA[protected void cmdRestoreModule(object sender, EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="114" sc="9" el="123" ec="10">CLControl.ascx.cs</location>
<body hash="4e0720a9c369075237805dfcc12291e3"><![CDATA[{
if ((sender) is LinkButton)
{
var cmdRestoreModule = (LinkButton)sender;
var tabModuleId = int.Parse(cmdRestoreModule.CommandArgument);
var moduleInfo = ModuleController.Instance.GetTabModule(tabModuleId);
ModuleController.Instance.RestoreModule(moduleInfo);
Response.Redirect(Request.RawUrl, false);
}
}]]></body>
</codeblock>
</method>
<method name="CultureName">
<declaration><![CDATA[protected string CultureName(object cultureCode)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="160" sc="9" el="167" ec="10">CLControl.ascx.cs</location>
<body hash="2992b1987e6e62a85ac7aeb22faba0f8"><![CDATA[{
string returnValue = "Neutral Language";
if (cultureCode != null)
{
returnValue = new CultureInfo((string)cultureCode).NativeName;
}
return returnValue;
}]]></body>
</codeblock>
</method>
<method name="DeletedClass">
<declaration><![CDATA[protected string DeletedClass(bool isDeleted)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="193" sc="9" el="195" ec="10">CLControl.ascx.cs</location>
<body hash="dd1ca758b9ab54e0c62022e0388894ea"><![CDATA[{
return isDeleted ? "moduleDeleted" : "";
}]]></body>
</codeblock>
</method>
<method name="DisableTabVersioningAndWorkflow">
<declaration><![CDATA[private static void DisableTabVersioningAndWorkflow(TabInfo tab)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="690" sc="9" el="699" ec="10">CLControl.ascx.cs</location>
<body hash="8f2f769749a2ac287cb826e04992bf76"><![CDATA[{
if (TabVersionSettings.Instance.IsVersioningEnabled(tab.PortalID))
{
TabVersionSettings.Instance.SetEnabledVersioningForTab(tab.TabID, false);
}
if (TabWorkflowSettings.Instance.IsWorkflowEnabled(tab.PortalID))
{
TabWorkflowSettings.Instance.SetWorkflowEnabled(tab.PortalID, tab.TabID, false);
}
}]]></body>
</codeblock>
</method>
<method name="EnableTabVersioningAndWorkflow">
<declaration><![CDATA[private static void EnableTabVersioningAndWorkflow(TabInfo tab)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="678" sc="9" el="687" ec="10">CLControl.ascx.cs</location>
<body hash="03551cd5b2d72377e7393e2798c6b395"><![CDATA[{
if (TabVersionSettings.Instance.IsVersioningEnabled(tab.PortalID))
{
TabVersionSettings.Instance.SetEnabledVersioningForTab(tab.TabID, true);
}
if (TabWorkflowSettings.Instance.IsWorkflowEnabled(tab.PortalID))
{
TabWorkflowSettings.Instance.SetWorkflowEnabled(tab.PortalID, tab.TabID, true);
}
}]]></body>
</codeblock>
</method>
<method name="FixLocalizationErrors">
<declaration><![CDATA[public void FixLocalizationErrors(int tabId)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="648" sc="9" el="671" ec="10">CLControl.ascx.cs</location>
<body hash="a7f02c6ec75e0c35306c7e8bfdca7106"><![CDATA[{
BindAll(tabId);
foreach (var dnnModules in Data.Modules)
{
foreach (var dnnModule in dnnModules.Modules)
{
if (dnnModule.ErrorDefaultOnOtherTab) //the default language module is on an other page
{
}
else if (dnnModule.ErrorCultureOfModuleNotCultureOfTab)
{ // # culture tab and module
ModuleInfo moduleInfo = ModuleController.Instance.GetTabModule(dnnModule.TabModuleID);
moduleInfo.CultureCode = dnnModule.CultureCode;
ModuleController.Instance.UpdateModule(moduleInfo);
}
else if (dnnModule.ErrorDuplicateModule) // duplicate
{
ModuleController.Instance.DeleteTabModule(dnnModule.TabId, dnnModule.ModuleID, true);
}
}
}
}]]></body>
</codeblock>
</method>
<method name="GetModuleInfo">
<declaration><![CDATA[protected string GetModuleInfo(object moduleID)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="132" sc="9" el="157" ec="10">CLControl.ascx.cs</location>
<body hash="e76e8ec78bbf247c0c1c54b24deff0f8"><![CDATA[{
string returnValue = "";
if (moduleID != null)
{
var moduleInfo = ModuleController.Instance.GetModule((int)moduleID, Null.NullInteger, true);
if (moduleInfo != null)
{
if (moduleInfo.IsDeleted)
{
returnValue = LocalizeString("ModuleDeleted.Text");
}
else
{
if (ModulePermissionController.CanAdminModule(moduleInfo))
{
returnValue = string.Format(LocalizeString("ModuleInfo.Text"), moduleInfo.ModuleDefinition.FriendlyName, moduleInfo.ModuleTitle, moduleInfo.PaneName);
}
else
{
returnValue = LocalizeString("ModuleInfoForNonAdmins.Text");
}
}
}
}
return returnValue;
}]]></body>
</codeblock>
</method>
<method name="GetModuleTitleHint">
<declaration><![CDATA[protected string GetModuleTitleHint(bool isDeleted)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="126" sc="9" el="128" ec="10">CLControl.ascx.cs</location>
<body hash="fec11009991c9ee711a2670e2644fe60"><![CDATA[{
return LocalizeString(isDeleted ? "ModuleDeleted.Text" : "ModuleTitle.Text");
}]]></body>
</codeblock>
</method>
<method name="LocalizeString">
<declaration><![CDATA[protected string LocalizeString(string key)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="73" sc="9" el="75" ec="10">CLControl.ascx.cs</location>
<body hash="fdb9cfd70aff46a9da06e018de02d9c8"><![CDATA[{
return Localization.GetString(key, LocalResourceFile);
}]]></body>
</codeblock>
</method>
<method name="Page_Load">
<declaration><![CDATA[protected void Page_Load(object sender, EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="707" sc="9" el="711" ec="10">CLControl.ascx.cs</location>
<body hash="50b7be9a7f001137a7ebf42c7e4b0e17"><![CDATA[{
ClientResourceManager.RegisterStyleSheet(Page, "~/DesktopModules/Admin/Languages/CLTools.css");
dummyGrid.Attributes.Add("style", "display:none");
}]]></body>
</codeblock>
</method>
<method name="PublishVisible">
<declaration><![CDATA[protected bool PublishVisible(string code)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="181" sc="9" el="190" ec="10">CLControl.ascx.cs</location>
<body hash="a733ed755ceb89780b77300d9119f4ea"><![CDATA[{
bool isPublished = Null.NullBoolean;
Locale enabledLanguage;
if (LocaleController.Instance.GetLocales(PortalSettings.PortalId).TryGetValue(code, out enabledLanguage))
{
isPublished = enabledLanguage.IsPublished && (enabledLanguage.Code != PortalSettings.DefaultLanguage);
}
return isPublished;
}]]></body>
</codeblock>
</method>
<method name="rDnnModules_ItemDataBound">
<declaration><![CDATA[protected void rDnnModules_ItemDataBound(object sender, RepeaterItemEventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="715" sc="9" el="745" ec="10">CLControl.ascx.cs</location>
<body hash="695d7b7d400b2417c4c494f12780752a"><![CDATA[{
RepeaterItem item = e.Item;
if (e.Item.ItemType == ListItemType.Header)
{
var rDnnPage = (Repeater)item.FindControl("rDnnPage");
rDnnPage.DataSource = Data.Pages;
rDnnPage.DataBind();
var rHeader = (Repeater)item.FindControl("rHeader");
rHeader.DataSource = Data.Pages;
rHeader.DataBind();
var rColHeader = (Repeater)item.FindControl("rColHeader");
rColHeader.DataSource = Data.Pages;
rColHeader.DataBind();
}
else if (e.Item.ItemType == ListItemType.Footer)
{
var rFooter = (Repeater)item.FindControl("rFooter");
rFooter.DataSource = Data.Pages;
rFooter.DataBind();
}
else if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
{
var rDnnModule = (Repeater)item.FindControl("rDnnModule");
var dnnModules = (DnnModules)item.DataItem;
rDnnModule.DataSource = dnnModules.Modules;
rDnnModule.DataBind();
}
}]]></body>
</codeblock>
</method>
<method name="SaveData">
<declaration><![CDATA[public void SaveData()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="386" sc="9" el="645" ec="10">CLControl.ascx.cs</location>
<body hash="05ec89f88e1a4257d8a2509300ae344b"><![CDATA[{
// pages actions
var rDnnPage = (Repeater)Globals.FindControlRecursiveDown(rDnnModules, "rDnnPage");
var tabsToPublish = new List<TabInfo>();
var moduleTranslateOverrides = new Dictionary<int, bool>();
foreach (RepeaterItem repeaterItem in rDnnPage.Items)
{
var tbTabName = (TextBox)repeaterItem.FindControl("tbTabName");
var tabName = tbTabName.Text;
var tbTabTitle = (TextBox)repeaterItem.FindControl("tbTitle");
var tabTitle = tbTabTitle.Text;
var tbTabDescription = (TextBox)repeaterItem.FindControl("tbDescription");
var tabDescription = tbTabDescription.Text;
var hfTabId = (HiddenField)repeaterItem.FindControl("hfTabID");
int tabID;
var ConvertSuccess = int.TryParse(hfTabId.Value, out tabID);
if (!ConvertSuccess)
{
tabID = -1;
}
if (tabID > 0)
{
var tabInfo = TabController.Instance.GetTab(tabID, PortalSettings.PortalId, true);
var updateTab = false;
if (tabInfo.TabName != tabName)
{
tabInfo.TabName = tabName;
updateTab = true;
}
if (tabInfo.Title != tabTitle)
{
tabInfo.Title = tabTitle;
updateTab = true;
}
if (tabInfo.Description != tabDescription)
{
tabInfo.Description = tabDescription;
updateTab = true;
}
if (updateTab)
{
TabController.Instance.UpdateTab(tabInfo);
}
}
}
// manage all actions we need to take for all modules on all pages
foreach (RepeaterItem repeaterItem in rDnnModules.Items)
{
var rDnnModule = (Repeater)repeaterItem.FindControl("rDnnModule");
foreach (RepeaterItem riDnnModule in rDnnModule.Items)
{
var hfTabModuleID = (HiddenField)riDnnModule.FindControl("hfTabModuleID");
int tabModuleID = int.Parse(hfTabModuleID.Value);
if (tabModuleID > 0)
{
var tbModuleTitle = (TextBox)riDnnModule.FindControl("tbModuleTitle");
var moduleTitle = tbModuleTitle.Text;
var cbLocalized = (CheckBox)riDnnModule.FindControl("cbLocalized");
var moduleLocalized = cbLocalized.Checked;
var cbTranslated = (CheckBox)riDnnModule.FindControl("cbTranslated");
var moduleTranslated = cbTranslated.Checked;
var tabModule = ModuleController.Instance.GetTabModule(tabModuleID);
if (tabModule.ModuleTitle != moduleTitle)
{
tabModule.ModuleTitle = moduleTitle;
ModuleController.Instance.UpdateModule(tabModule);
}
if (tabModule.DefaultLanguageGuid != Null.NullGuid && tabModule.IsLocalized != moduleLocalized)
{
var locale = LocaleController.Instance.GetLocale(tabModule.CultureCode);
if (moduleLocalized)
ModuleController.Instance.LocalizeModule(tabModule, locale);
else
ModuleController.Instance.DeLocalizeModule(tabModule);
}
bool moduleTranslateOverride;
moduleTranslateOverrides.TryGetValue(tabModule.TabID, out moduleTranslateOverride);
if (!moduleTranslateOverride && tabModule.IsTranslated != moduleTranslated)
{
ModuleController.Instance.UpdateTranslationStatus(tabModule, moduleTranslated);
}
}
else
{
var cbAddModule = (CheckBox)riDnnModule.FindControl("cbAddModule");
if (cbAddModule.Checked)
{
// find the first existing module on the line
foreach (RepeaterItem riCopy in rDnnModule.Items)
{
var hfTabModuleIDCopy = (HiddenField)riCopy.FindControl("hfTabModuleID");
int tabModuleIDCopy = int.Parse(hfTabModuleIDCopy.Value);
if (tabModuleIDCopy > 0)
{
ModuleInfo miCopy = ModuleController.Instance.GetTabModule(tabModuleIDCopy);
if (miCopy.DefaultLanguageGuid == Null.NullGuid)
{ // default
var hfTabID = (HiddenField)rDnnPage.Items[riDnnModule.ItemIndex].FindControl("hfTabID");
var tabId = int.Parse(hfTabID.Value);
var toTabInfo = TabController.Instance.GetTab(tabId, PortalSettings.PortalId, false);
DisableTabVersioningAndWorkflow(toTabInfo);
ModuleController.Instance.CopyModule(miCopy, toTabInfo, Null.NullString, true);
EnableTabVersioningAndWorkflow(toTabInfo);
var localizedModule = ModuleController.Instance.GetModule(miCopy.ModuleID, tabId, false);
ModuleController.Instance.LocalizeModule(localizedModule, LocaleController.Instance.GetLocale(localizedModule.CultureCode));
}
else
{
var miCopyDefault = ModuleController.Instance.GetModuleByUniqueID(miCopy.DefaultLanguageGuid);
var hfTabID = (HiddenField)rDnnPage.Items[riDnnModule.ItemIndex].FindControl("hfTabID");
var tabId = int.Parse(hfTabID.Value);
var toTabInfo = TabController.Instance.GetTab(tabId, PortalSettings.PortalId, false);
ModuleController.Instance.CopyModule(miCopyDefault, toTabInfo, Null.NullString, true);
}
if (riDnnModule.ItemIndex == 0)
{ // default language
ModuleInfo miDefault = null;
foreach (RepeaterItem ri in rDnnPage.Items)
{
var hfTabID = (HiddenField)ri.FindControl("hfTabID");
int tabID = int.Parse(hfTabID.Value);
if (ri.ItemIndex == 0)
{
miDefault = ModuleController.Instance.GetModule(miCopy.ModuleID, tabID, false);
}
else
{
ModuleInfo moduleInfo = ModuleController.Instance.GetModule(miCopy.ModuleID, tabID, false);
if (moduleInfo != null)
{
if (miDefault != null)
{
moduleInfo.DefaultLanguageGuid = miDefault.UniqueId;
}
ModuleController.Instance.UpdateModule(moduleInfo);
}
}
}
}
break;
}
}
}
}
}
}
var rFooter = (Repeater)Globals.FindControlRecursiveDown(rDnnModules, "rFooter");
foreach (RepeaterItem repeaterItem in rFooter.Items)
{
var moduleTranslateOverride = false;
var cbTranslated = (CheckBox)repeaterItem.FindControl("cbTranslated");
var tabTranslated = cbTranslated.Checked;
var cbPublish = (CheckBox)repeaterItem.FindControl("cbPublish");
var hfTabId = (HiddenField)repeaterItem.FindControl("hfTabID");
int tabID;
var ConvertSuccess = int.TryParse(hfTabId.Value, out tabID);
if (!ConvertSuccess)
{
tabID = -1;
}
if (tabID > 0)
{
var tabInfo = TabController.Instance.GetTab(tabID, PortalSettings.PortalId, true);
if (!tabInfo.IsDefaultLanguage)
{
if (tabInfo.IsTranslated != tabTranslated)
{
TabController.Instance.UpdateTranslationStatus(tabInfo, tabTranslated);
if (tabTranslated)
{
moduleTranslateOverride = true;
var tabModules = ModuleController.Instance.GetTabModules(tabInfo.TabID);
foreach (
var moduleKVP in
tabModules.Where(
moduleKVP =>
moduleKVP.Value.DefaultLanguageModule != null && moduleKVP.Value.LocalizedVersionGuid != moduleKVP.Value.DefaultLanguageModule.LocalizedVersionGuid))
{
ModuleController.Instance.UpdateTranslationStatus(moduleKVP.Value, true);
}
}
}
if (cbPublish.Checked)
{
tabsToPublish.Add(tabInfo);
}
}
}
moduleTranslateOverrides.Add(tabID, moduleTranslateOverride);
}
// if we have tabs to publish, do it.
// marks all modules as translated, marks page as translated
foreach (var tabInfo in tabsToPublish)
{
//First mark all modules as translated
foreach (ModuleInfo m in ModuleController.Instance.GetTabModules(tabInfo.TabID).Values)
{
ModuleController.Instance.UpdateTranslationStatus(m, true);
}
//First mark tab as translated
TabController.Instance.UpdateTranslationStatus(tabInfo, true);
//Next publish Tab (update Permissions)
TabController.Instance.PublishTab(tabInfo);
}
// manage translated status of tab. In order to do that, we need to check if all modules on the page are translated
var tabTranslatedStatus = true;
foreach (RepeaterItem repeaterItem in rDnnPage.Items)
{
var hfTabId = (HiddenField)repeaterItem.FindControl("hfTabID");
int tabID;
var ConvertSuccess = int.TryParse(hfTabId.Value, out tabID);
if (!ConvertSuccess)
{
tabID = -1;
}
if (tabID > 0)
{
var tabInfo = TabController.Instance.GetTab(tabID, PortalSettings.PortalId, true);
if (tabInfo != null)
{
if (tabInfo.ChildModules.Any(moduleKVP => !moduleKVP.Value.IsTranslated))
{
tabTranslatedStatus = false;
}
if (tabTranslatedStatus && !tabInfo.IsTranslated)
{
TabController.Instance.UpdateTranslationStatus(tabInfo, true);
}
}
}
}
}]]></body>
</codeblock>
</method>
</methods>
<fields>
<field name="_localResourceFile">
<declaration><![CDATA[private string _localResourceFile;]]></declaration>
<documentation>
</documentation>
</field>
<field name="dummyGrid">
<declaration><![CDATA[protected DnnGrid dummyGrid;]]></declaration>
<documentation>
<summary>
dummyGrid control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="mainContainer">
<declaration><![CDATA[protected HtmlGenericControl mainContainer;]]></declaration>
<documentation>
<summary>
mainContainer control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="rDnnModules">
<declaration><![CDATA[protected Repeater rDnnModules;]]></declaration>
<documentation>
<summary>
rDnnModules 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="Data">
<declaration><![CDATA[protected CLControl.DnnPages Data]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="78" sc="35" el="78" ec="39">CLControl.ascx.cs</location>
<body hash="b5eda0a74558a342cf659187f06f746f"><![CDATA[get]]></body>
</codeblock>
<codeblock>
<location sl="78" sc="40" el="78" ec="44">CLControl.ascx.cs</location>
<body hash="cdaeeeba9b4a4c5ebf042c0215a7bb0e"><![CDATA[set]]></body>
</codeblock>
</property>
<property name="enablePageEdit">
<declaration><![CDATA[public bool enablePageEdit]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="210" sc="38" el="210" ec="42">CLControl.ascx.cs</location>
<body hash="b5eda0a74558a342cf659187f06f746f"><![CDATA[get]]></body>
</codeblock>
<codeblock>
<location sl="210" sc="43" el="210" ec="47">CLControl.ascx.cs</location>
<body hash="cdaeeeba9b4a4c5ebf042c0215a7bb0e"><![CDATA[set]]></body>
</codeblock>
</property>
<property name="ErrorExists">
<declaration><![CDATA[public bool ErrorExists]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="201" sc="35" el="201" ec="39">CLControl.ascx.cs</location>
<body hash="b5eda0a74558a342cf659187f06f746f"><![CDATA[get]]></body>
</codeblock>
<codeblock>
<location sl="201" sc="40" el="201" ec="44">CLControl.ascx.cs</location>
<body hash="cdaeeeba9b4a4c5ebf042c0215a7bb0e"><![CDATA[set]]></body>
</codeblock>
</property>
<property name="LocalResourceFile">
<declaration><![CDATA[protected string LocalResourceFile]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="53" sc="13" el="66" ec="14">CLControl.ascx.cs</location>
<body hash="ab8678ebb7b68a5772acd55f902e2060"><![CDATA[{
string fileRoot;
if (string.IsNullOrEmpty(_localResourceFile))
{
fileRoot = TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/" + "CLTools.ascx";
}
else
{
fileRoot = _localResourceFile;
}
_localResourceFile = fileRoot;
return fileRoot;
}]]></body>
</codeblock>
</property>
<property name="PortalSettings">
<declaration><![CDATA[protected PortalSettings PortalSettings]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="83" sc="13" el="85" ec="14">CLControl.ascx.cs</location>
<body hash="5ab4f2f069ec3680a0fc11e1d9f2b05e"><![CDATA[{
return PortalController.Instance.GetCurrentPortalSettings();
}]]></body>
</codeblock>
</property>
<property name="TabID">
<declaration><![CDATA[public int TabID]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="203" sc="28" el="203" ec="32">CLControl.ascx.cs</location>
<body hash="b5eda0a74558a342cf659187f06f746f"><![CDATA[get]]></body>
</codeblock>
<codeblock>
<location sl="203" sc="33" el="203" ec="37">CLControl.ascx.cs</location>
<body hash="cdaeeeba9b4a4c5ebf042c0215a7bb0e"><![CDATA[set]]></body>
</codeblock>
</property>
</properties>
<events>
</events>
</class>
<class name="EditLanguage">
<declaration><![CDATA[public class EditLanguage : PortalModuleBase]]></declaration>
<documentation>-----------------------------------------------------------------------------
<summary>
The EditLanguage ModuleUserControlBase is used to edit a Language
</summary>
<remarks>
</remarks>
-----------------------------------------------------------------------------</documentation>
<constructors>
<constructor name=".ctor">
<declaration><![CDATA[public EditLanguage()]]></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="BindLanguage">
<declaration><![CDATA[private void BindLanguage()]]></declaration>
<documentation>-----------------------------------------------------------------------------
<summary>
This routine Binds the Language
</summary>
-----------------------------------------------------------------------------</documentation>
<codeblock>
<location sl="87" sc="9" el="134" ec="10">EditLanguage.ascx.cs</location>
<body hash="cc7162b408fe9169cd49b963209fc83f"><![CDATA[{
languageLanguageLabel.Visible = (Language != null);
languageComboBox.Visible = Language == null;
languageComboBox.IncludeNoneSpecified = false;
languageComboBox.HideLanguagesList = LocaleController.Instance.GetLocales(Null.NullInteger);
languageComboBox.DataBind();
fallbackLanguageLabel.Visible = !UserInfo.IsSuperUser;
fallBackComboBox.Visible = UserInfo.IsSuperUser;
fallBackComboBox.IncludeNoneSpecified = true;
if (Language != null)
{
var hideLanguagesList = new Dictionary<string, Locale>();
hideLanguagesList.Add(Language.Code, Language);
fallBackComboBox.HideLanguagesList = hideLanguagesList;
}
fallBackComboBox.DataBind();
if (!IsPostBack && Language != null)
{
fallbackLanguageLabel.Language = Language.Fallback;
languageLanguageLabel.Language = Language.Code;
languageComboBox.SetLanguage(Language.Code);
fallBackComboBox.SetLanguage(Language.Fallback);
}
if (Language == null || Language.Code == PortalSettings.DefaultLanguage)
{
translatorsRow.Visible = false;
}
else
{
string defaultRoles = PortalController.GetPortalSetting(string.Format("DefaultTranslatorRoles-{0}", Language.Code), PortalId, "Administrators");
translatorRoles.SelectedRoleNames = new ArrayList(defaultRoles.Split(';'));
translatorsRow.Visible = true;
}
bool isEnabled = Null.NullBoolean;
if (!IsAddMode)
{
Locale enabledLanguage = null;
isEnabled = LocaleController.Instance.GetLocales(ModuleContext.PortalId).TryGetValue(Language.Code, out enabledLanguage);
}
cmdDelete.Visible = (UserInfo.IsSuperUser && !IsAddMode && !isEnabled && !Language.IsPublished && LocaleController.Instance.CanDeleteLanguage(Language.LanguageId) &&
Language.Code.ToLowerInvariant() != "en-us");
}]]></body>
</codeblock>
</method>
<method name="cmdCancel_Click">
<declaration><![CDATA[protected void cmdCancel_Click(object sender, EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="161" sc="9" el="171" ec="10">EditLanguage.ascx.cs</location>
<body hash="dc8ebfaa7193a54158a3d6e7bddfbf4c"><![CDATA[{
try
{
Response.Redirect(Globals.NavigateURL(), true);
//Module failed to load
}
catch (Exception exc)
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}]]></body>
</codeblock>
</method>
<method name="cmdDelete_Click">
<declaration><![CDATA[protected void cmdDelete_Click(object sender, EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="174" sc="9" el="184" ec="10">EditLanguage.ascx.cs</location>
<body hash="655a7d5bbcb0e59b2ffcc157dfa56c7a"><![CDATA[{