-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDnn.EditBar.UI_01.01.00.xml
2599 lines (2476 loc) · 112 KB
/
Dnn.EditBar.UI_01.01.00.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.EditBar.UI.dll" version="01.01.00" generated="2017-08-10 12:33:44Z" generationTime="4.9586647">
<namespace name="Dnn.EditBar.UI.Components">
<class name="BusinessController">
<declaration><![CDATA[public class BusinessController : IUpgradeable]]></declaration>
<documentation>
</documentation>
<constructors>
<constructor name=".ctor">
<declaration><![CDATA[public BusinessController()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="2147483647" sc="0" el="0" ec="0">
</location>
<body hash="d41d8cd98f00b204e9800998ecf8427e"><![CDATA[]]></body>
</codeblock>
</constructor>
<constructor name=".cctor">
<declaration><![CDATA[static BusinessController()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="9" sc="9" el="9" ec="105">Components\BusinessController.cs</location>
<body hash="d76ae0ba76c33c4222d80cade870cd9c"><![CDATA[private static readonly DnnLogger Logger = DnnLogger.GetClassLogger(typeof(BusinessController))]]></body>
</codeblock>
</constructor>
</constructors>
<methods>
<method name="UpgradeModule">
<declaration><![CDATA[public string UpgradeModule(string version)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="12" sc="9" el="20" ec="10">Components\BusinessController.cs</location>
<body hash="cedc6779883b86bc61abbcd00f8e7ac6"><![CDATA[{
switch (version)
{
case "01.00.00":
break;
}
return "Success";
}]]></body>
</codeblock>
</method>
</methods>
<fields>
<field name="Logger">
<declaration><![CDATA[private static readonly DnnLogger Logger = DnnLogger.GetClassLogger(typeof(BusinessController));]]></declaration>
<documentation>
</documentation>
</field>
</fields>
<properties>
</properties>
<events>
</events>
</class>
</namespace>
<namespace name="Dnn.EditBar.UI.Controllers">
<class name="ContentEditorManager">
<declaration><![CDATA[public class ContentEditorManager : UserControlBase]]></declaration>
<documentation>
<summary>
Content Editor Manager
</summary>
</documentation>
<constructors>
<constructor name=".ctor">
<declaration><![CDATA[private bool _supportAjax = true;]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="48" sc="9" el="48" ec="42">Controllers\ContentEditorManager.cs</location>
<body hash="add0cb86c9f6ebb651b6c117d27d62d3"><![CDATA[private bool _supportAjax = true]]></body>
</codeblock>
</constructor>
</constructors>
<methods>
<method name="AutoSetUserMode">
<declaration><![CDATA[private void AutoSetUserMode()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="633" sc="9" el="670" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="4cacdfabcc42923c27fcc94535f01cbb"><![CDATA[{
int tabId = PortalSettings.ActiveTab.TabID;
int portalId = PortalSettings.Current.PortalId;
string pageId = string.Format("{0}:{1}", portalId, tabId);
HttpCookie cookie = Request.Cookies["StayInEditMode"];
if (cookie != null && cookie.Value == "YES")
{
if (PortalSettings.Current.UserMode != PortalSettings.Mode.Edit)
{
SetUserMode("EDIT");
SetLastPageHistory(pageId);
Response.Redirect(Request.RawUrl, true);
}
return;
}
string lastPageId = GetLastPageHistory();
var isShowAsCustomError = Request.QueryString.AllKeys.Contains("aspxerrorpath");
if (lastPageId != pageId && !isShowAsCustomError)
{
// navigate between pages
if (PortalSettings.Current.UserMode != PortalSettings.Mode.View)
{
SetUserMode("VIEW");
SetLastPageHistory(pageId);
Response.Redirect(Request.RawUrl, true);
}
}
if (!isShowAsCustomError)
{
SetLastPageHistory(pageId);
}
}]]></body>
</codeblock>
</method>
<method name="CheckCallbackData">
<declaration><![CDATA[private void CheckCallbackData()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="510" sc="9" el="528" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="8fa167ee35df319e607eb346be2a558f"><![CDATA[{
if (Request.Cookies["CEM_CallbackData"] != null)
{
var cookie = Request.Cookies["CEM_CallbackData"];
var callbackData = cookie.Value;
if (!string.IsNullOrEmpty(callbackData) && callbackData.StartsWith("module-"))
{
var moduleId = Convert.ToInt32(callbackData.Substring(7));
var moduleContainer = FindModuleContainer(moduleId);
var moduleInfo = FindModuleInfo(moduleId);
if (moduleContainer != null && moduleInfo != null && moduleContainer.Parent is HtmlContainerControl)
{
((HtmlContainerControl) moduleContainer.Parent).Attributes["data-module-title"] = moduleInfo.ModuleTitle;
ProcessDragTipShown(moduleContainer);
}
}
}
}]]></body>
</codeblock>
</method>
<method name="CheckPendingData">
<declaration><![CDATA[private void CheckPendingData()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="465" sc="9" el="493" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="922f35f7531639d84a2327c9139b01d4"><![CDATA[{
if (Request.Cookies["cem_pending"] != null)
{
var cookie = Request.Cookies["cem_pending"];
var pendingData = cookie.Value;
if (!string.IsNullOrEmpty(pendingData))
{
var tabId = PortalSettings.ActiveTab.TabID;
int moduleId;
if (pendingData.StartsWith("module-")
&& Int32.TryParse(pendingData.Substring(7), out moduleId)
&& ModuleController.Instance.GetModule(moduleId, tabId, false) != null)
{
RemoveTabModule(tabId, moduleId);
//remove related modules
ModuleController.Instance.GetTabModules(tabId).Values
.Where(m => m.ModuleID > moduleId)
.ForEach(m =>
{
RemoveTabModule(tabId, m.ModuleID);
});
}
}
cookie.Expires = DateTime.Now.AddDays(-1);
Response.Cookies.Add(cookie);
}
}]]></body>
</codeblock>
</method>
<method name="CreateChildControls">
<declaration><![CDATA[protected override void CreateChildControls()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="140" sc="9" el="213" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="3dcff7a00efde075a94083b1a4191e53"><![CDATA[{
base.CreateChildControls();
foreach (string paneId in PortalSettings.ActiveTab.Panes)
{
var pane = Skin.FindControl(paneId) as HtmlContainerControl;
if (pane == null)
{
continue;
}
var ajaxPanel = new DnnAjaxPanel
{
ID = pane.ID + "_SyncPanel",
RestoreOriginalRenderDelegate = false,
};
try
{
if (!Page.IsPostBack)
{
//find update panels in pane and fire the unload event for a known issue: CONTENT-4039
var updatePanels = GetUpdatePanelsInPane(pane);
updatePanels.ForEach(p => p.Unload += UpdatePanelUnloadEvent);
}
var paneIndex = pane.Parent.Controls.IndexOf(pane);
pane.Parent.Controls.AddAt(paneIndex, ajaxPanel);
ajaxPanel.Controls.Add(pane);
}
catch (Exception ex)
{
SupportAjax = false;
return;
}
ajaxPanel.CssClass = pane.Attributes["class"];
pane.Attributes["class"] = string.Empty;
var scriptManager = ScriptManager.GetCurrent(Page);
if (scriptManager != null && scriptManager.IsInAsyncPostBack
&& ajaxPanel.UniqueID == Request.Form["__EVENTTARGET"]
&& !string.IsNullOrEmpty(Request.Form["__EVENTARGUMENT"])
&& Request.Form["__EVENTARGUMENT"].ToLowerInvariant() != "undefined"
&& Request.Form["__EVENTARGUMENT"].ToLowerInvariant().StartsWith("module-"))
{
var moduleId = Convert.ToInt32(Request.Form["__EVENTARGUMENT"].Substring(7));
var moduleContainer = FindModuleContainer(moduleId);
if (moduleContainer != null)
{
var moduleControl = FindModuleControl(moduleId);
var moduleInfo = FindModuleInfo(moduleId);
if (moduleControl != null && moduleInfo != null && moduleContainer.Parent is HtmlContainerControl)
{
((HtmlContainerControl) moduleContainer.Parent).Attributes["data-module-title"] = moduleInfo.ModuleTitle;
if (HaveContentLayoutModuleOnPage())
{
Page.Items[typeof(ProxyPage)] = moduleControl;
}
else
{
moduleControl.Page = new ProxyPage(Page);
}
ProcessDragTipShown(moduleContainer);
}
}
}
}
}]]></body>
</codeblock>
</method>
<method name="FindControlRecursive">
<declaration><![CDATA[private static void FindControlRecursive(Control rootControl, string controlId, ICollection<Control> foundControls)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="327" sc="9" el="338" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="a2b782c9b87c8bcf1b73c14c06244f90"><![CDATA[{
if (rootControl.ID == controlId)
{
foundControls.Add(rootControl);
}
foreach(Control subControl in rootControl.Controls)
{
FindControlRecursive(subControl, controlId, foundControls);
}
}]]></body>
</codeblock>
</method>
<method name="FindModuleContainer">
<declaration><![CDATA[private Container FindModuleContainer(int moduleId)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="541" sc="9" el="543" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="675369b485cf99f6dc5b00efd7cdb833"><![CDATA[{
return ControlUtilities.FindFirstDescendent<Container>(Skin, c => c.ID == "ctr" + moduleId);
}]]></body>
</codeblock>
</method>
<method name="FindModuleControl">
<declaration><![CDATA[private Control FindModuleControl(int moduleId)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="546" sc="9" el="559" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="90093e72bf3ad83aa43280074b0b1805"><![CDATA[{
var moduleContainer = FindModuleContainer(moduleId);
if (moduleContainer != null)
{
var moduleInfo = FindModuleInfo(moduleId);
if (moduleInfo != null)
{
var controlId = Path.GetFileNameWithoutExtension(moduleInfo.ModuleControl.ControlSrc);
return ControlUtilities.FindFirstDescendent<Control>(moduleContainer, c => c.ID == controlId);
}
}
return null;
}]]></body>
</codeblock>
</method>
<method name="FindModuleInfo">
<declaration><![CDATA[private ModuleInfo FindModuleInfo(int moduleId)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="562" sc="9" el="565" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="206ce3578068643dd5941f9928f9a236"><![CDATA[{
return PortalSettings.ActiveTab.Modules.Cast<ModuleInfo>()
.FirstOrDefault(m => m.ModuleID == moduleId);
}]]></body>
</codeblock>
</method>
<method name="GetCurrent">
<declaration><![CDATA[internal static ContentEditorManager GetCurrent(Page page)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="77" sc="9" el="84" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="a7361aaf561f56411016280170d49b67"><![CDATA[{
if (page.Items.Contains("ContentEditorManager"))
{
return page.Items["ContentEditorManager"] as ContentEditorManager;
}
return null;
}]]></body>
</codeblock>
</method>
<method name="GetLastPageHistory">
<declaration><![CDATA[private string GetLastPageHistory()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="619" sc="9" el="625" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="649c2a5e817a30bd21df43025cc8e29e"><![CDATA[{
var cookie = Request.Cookies["LastPageId"];
if (cookie != null)
return cookie.Value;
return "NEW";
}]]></body>
</codeblock>
</method>
<method name="GetPaneClientIdCollection">
<declaration><![CDATA[private IEnumerable<IEnumerable<string>> GetPaneClientIdCollection()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="304" sc="9" el="324" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="4efe6da3e07b2e9a6fb58cf24a1941c6"><![CDATA[{
var panelClientIds = new List<List<string>>(PortalSettings.ActiveTab.Panes.Count);
try
{
var skinControl = Page.FindControl("SkinPlaceHolder").Controls[0];
foreach (var pane in PortalSettings.ActiveTab.Panes.Cast<string>())
{
var foundControls = new List<Control>();
FindControlRecursive(skinControl, pane, foundControls);
panelClientIds.Add((from control in foundControls select control.ClientID).ToList());
}
}
catch (Exception ex)
{
Exceptions.LogException(ex);
}
return panelClientIds;
}]]></body>
</codeblock>
</method>
<method name="GetPanesClientIds">
<declaration><![CDATA[private string GetPanesClientIds(IEnumerable<IEnumerable<string>> panelCliendIdCollection)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="385" sc="9" el="387" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="ed6f22cc1b0dcc9ff2450ed315fc4e73"><![CDATA[{
return string.Join(";", panelCliendIdCollection.Select(x => String.Join(",", x)));
}]]></body>
</codeblock>
</method>
<method name="GetUpdatePanelsInPane">
<declaration><![CDATA[private List<UpdatePanel> GetUpdatePanelsInPane(Control parent)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="568" sc="9" el="583" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="9e307efa5679914a37d7146da25a5ffa"><![CDATA[{
var panels = new List<UpdatePanel>();
if (parent is UpdatePanel)
{
panels.Add(parent as UpdatePanel);
}
else
{
foreach (Control childControl in parent.Controls)
{
panels.AddRange(GetUpdatePanelsInPane(childControl));
}
}
return panels;
}]]></body>
</codeblock>
</method>
<method name="HasTabPermission">
<declaration><![CDATA[public static bool HasTabPermission(string permissionKey)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="288" sc="9" el="301" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="404ad733870627838c5dc6769d20ad26"><![CDATA[{
var principal = Thread.CurrentPrincipal;
if (!principal.Identity.IsAuthenticated)
{
return false;
}
var currentPortal = PortalController.Instance.GetCurrentPortalSettings();
bool isAdminUser = currentPortal.UserInfo.IsSuperUser || PortalSecurity.IsInRole(currentPortal.AdministratorRoleName);
if (isAdminUser) return true;
return TabPermissionController.HasTabPermission(permissionKey);
}]]></body>
</codeblock>
</method>
<method name="HaveContentLayoutModuleOnPage">
<declaration><![CDATA[private bool HaveContentLayoutModuleOnPage()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="601" sc="9" el="611" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="8d57602af31e292d5b672102bafbda50"><![CDATA[{
var moduleDefinition =
ModuleDefinitionController.GetModuleDefinitions().Values
.FirstOrDefault(m => m.DefinitionName == "Content Layout");
if (moduleDefinition != null)
{
return PortalSettings.ActiveTab.Modules.Cast<ModuleInfo>().Any(m => m.ModuleDefID == moduleDefinition.ModuleDefID);
}
return false;
}]]></body>
</codeblock>
</method>
<method name="IsAdmin">
<declaration><![CDATA[private bool IsAdmin()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="673" sc="9" el="676" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="2713cc20e34bea6c415e04d3604e7dd4"><![CDATA[{
var user = PortalSettings.UserInfo;
return user.IsSuperUser || PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName);
}]]></body>
</codeblock>
</method>
<method name="IsPageEditor">
<declaration><![CDATA[private bool IsPageEditor()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="282" sc="9" el="285" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="12147b7966ddece7350860c90a218365"><![CDATA[{
return HasTabPermission("EDIT");
}]]></body>
</codeblock>
</method>
<method name="OnInit">
<declaration><![CDATA[protected override void OnInit(EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="91" sc="9" el="129" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="5553c6a601e0f602952871426eb91445"><![CDATA[{
base.OnInit(e);
if (GetCurrent(Page) != null)
{
throw new Exception("Instance has already initialized");
}
AutoSetUserMode();
var user = PortalSettings.UserInfo;
if (user.UserID > 0)
{
ClientAPI.RegisterClientVariable(Page, "dnn_current_userid", PortalSettings.UserInfo.UserID.ToString(), true);
}
if (PortalSettings.UserMode != PortalSettings.Mode.Edit
|| !IsPageEditor()
|| EditBarController.Instance.GetMenuItems().Count == 0)
{
Parent.Controls.Remove(this);
return;
}
RegisterClientResources();
RegisterEditBarResources();
Page.Items.Add("ContentEditorManager", this);
//if there is pending work cookie, then reset it
CheckPendingData();
//if there is callback data cookie, then process the module for drag.
CheckCallbackData();
EnsureChildControls();
}]]></body>
</codeblock>
</method>
<method name="OnPreRender">
<declaration><![CDATA[protected override void OnPreRender(EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="132" sc="9" el="137" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="043a5f3b1a5bae094078d332a808af87"><![CDATA[{
base.OnPreRender(e);
RemoveEmptyPaneClass();
RegisterInitScripts();
}]]></body>
</codeblock>
</method>
<method name="ProcessDragTipShown">
<declaration><![CDATA[private void ProcessDragTipShown(Container moduleContainer)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="531" sc="9" el="538" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="20d541f82b0adb50ca15b3f5a5cc4e0b"><![CDATA[{
var dragTipShown = Convert.ToString(Personalization.GetProfile("Usability", "DragTipShown" + PortalSettings.PortalId));
if (string.IsNullOrEmpty(dragTipShown) && moduleContainer.Parent is HtmlContainerControl && Request.Cookies["noFloat"] == null)
{
Personalization.SetProfile("Usability", "DragTipShown" + PortalSettings.PortalId, "true");
((HtmlContainerControl) moduleContainer.Parent).Attributes["class"] += " dragtip";
}
}]]></body>
</codeblock>
</method>
<method name="RegisterClientResources">
<declaration><![CDATA[private void RegisterClientResources()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="231" sc="9" el="262" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="003b997aca405751414ecd15d01fed4b"><![CDATA[{
ClientResourceManager.EnableAsyncPostBackHandler();
//register drop down list required resources
ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/components/DropDownList/dnn.DropDownList.css", FileOrder.Css.ResourceCss);
ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/scripts/jquery/dnn.jScrollBar.css", FileOrder.Css.ResourceCss);
ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.extensions.js");
ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.jquery.extensions.js");
ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.DataStructures.js");
ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/jquery/jquery.mousewheel.js");
ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/jquery/dnn.jScrollBar.js");
ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/TreeView/dnn.TreeView.js");
ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/TreeView/dnn.DynamicTreeView.js");
ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/Components/DropDownList/dnn.DropDownList.js");
ClientResourceManager.RegisterScript(Page, Path.Combine(ControlFolder, "ContentEditorManager/Js/ModuleManager.js"));
ClientResourceManager.RegisterScript(Page, Path.Combine(ControlFolder, "ContentEditorManager/Js/ModuleDialog.js"));
ClientResourceManager.RegisterScript(Page, Path.Combine(ControlFolder, "ContentEditorManager/Js/ExistingModuleDialog.js"));
ClientResourceManager.RegisterScript(Page, Path.Combine(ControlFolder, "ContentEditorManager/Js/ModuleService.js"));
ClientResourceManager.RegisterScript(Page, Path.Combine(ControlFolder, "ContentEditorManager/Js/ContentEditor.js"));
ClientResourceManager.RegisterStyleSheet(Page,
Path.Combine(ControlFolder, "ContentEditorManager/Styles/ContentEditor.css"), CssFileOrder);
ServicesFramework.Instance.RequestAjaxScriptSupport();
JavaScript.RequestRegistration(CommonJs.DnnPlugins);
//We need to add the Dnn JQuery plugins because the Edit Bar removes the Control Panel from the page
JavaScript.RequestRegistration(CommonJs.KnockoutMapping);
ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/Components/Tokeninput/jquery.tokeninput.js");
ClientResourceManager.RegisterStyleSheet(Page,
"~/Resources/Shared/Components/Tokeninput/Themes/token-input-facebook.css");
}]]></body>
</codeblock>
</method>
<method name="RegisterEditBarResources">
<declaration><![CDATA[private void RegisterEditBarResources()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="265" sc="9" el="279" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="84713f6201ad81adc75948e584514a2b"><![CDATA[{
JavaScript.RequestRegistration(CommonJs.jQuery);
ServicesFramework.Instance.RequestAjaxAntiForgerySupport();
ClientAPI.RegisterClientVariable(Page, "editbar_isAdmin", IsAdmin().ToString(), true);
var settings = EditBarController.Instance.GetConfigurations(PortalSettings.PortalId);
var settingsScript = "window.editBarSettings = " + JsonConvert.SerializeObject(settings) + ";";
Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "EditBarSettings", settingsScript, true);
ClientResourceManager.RegisterScript(Page, "~/DesktopModules/admin/Dnn.EditBar/scripts/editBarContainer.js");
ClientResourceManager.RegisterStyleSheet(Page, "~/DesktopModules/admin/Dnn.EditBar/css/editBarContainer.css");
}]]></body>
</codeblock>
</method>
<method name="RegisterInitScripts">
<declaration><![CDATA[private void RegisterInitScripts()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="360" sc="9" el="382" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="5d7e299540c3e214acaf3db6384b603e"><![CDATA[{
RegisterLocalResources();
ClientAPI.RegisterClientVariable(Page, "cem_loginurl", Globals.LoginURL(HttpContext.Current.Request.RawUrl, false), true);
var panes = string.Join(",", PortalSettings.ActiveTab.Panes.Cast<string>());
var panesClientIds = GetPanesClientIds(GetPaneClientIdCollection());
const string scriptFormat = @"dnn.ContentEditorManager.init({{type: 'moduleManager', panes: '{0}', panesClientIds: '{2}', supportAjax: {1}}});";
var script = string.Format(scriptFormat,
panes,
SupportAjax ? "true" : "false",
panesClientIds);
if (ScriptManager.GetCurrent(Page) != null)
{
// respect MS AJAX
ScriptManager.RegisterStartupScript(Page, GetType(), "ContentEditorManager", script, true);
}
else
{
Page.ClientScript.RegisterStartupScript(GetType(), "ContentEditorManager", script, true);
}
}]]></body>
</codeblock>
</method>
<method name="RegisterLocalResources">
<declaration><![CDATA[private void RegisterLocalResources()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="390" sc="9" el="462" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="2a45f0d45c580156fa7912669ed70650"><![CDATA[{
const string scriptFormat = @"dnn.ContentEditorManagerResources = {{
title: '{0}',
nomodules: '{1}',
dragtip: '{2}',
pendingsave: '{3}',
confirmTitle: '{4}',
confirmYes: '{5}',
confirmNo: '{6}',
cancelConfirm: '{7}',
deleteModuleConfirm: '{8}',
cancel: '{9}',
searchPlaceHolder: '{10}',
categoryRecommended: '{11}',
categoryAll: '{12}',
pagePicker_clearButtonTooltip: '{13}',
pagePicker_loadingResultText: '{14}',
pagePicker_resultsText: '{15}',
pagePicker_searchButtonTooltip: '{16}',
pagePicker_searchInputPlaceHolder: '{17}',
pagePicker_selectedItemCollapseTooltip: '{18}',
pagePicker_selectedItemExpandTooltip: '{19}',
pagePicker_selectItemDefaultText: '{20}',
pagePicker_sortAscendingButtonTitle: '{21}',
pagePicker_sortAscendingButtonTooltip: '{22}',
pagePicker_sortDescendingButtonTooltip: '{23}',
pagePicker_unsortedOrderButtonTooltip: '{24}',
site: '{25}',
page: '{26}',
addExistingModule: '{27}'
}};";
var script = string.Format(scriptFormat,
Localization.GetSafeJSString("AddModule.Text", LocalResourcesFile),
Localization.GetSafeJSString("NoModules.Text", LocalResourcesFile),
Localization.GetSafeJSString("DragTip.Text", LocalResourcesFile),
Localization.GetSafeJSString("PendingSave.Text", LocalResourcesFile),
Localization.GetSafeJSString("ConfirmTitle.Text", LocalResourcesFile),
Localization.GetSafeJSString("ConfirmYes.Text", LocalResourcesFile),
Localization.GetSafeJSString("ConfirmNo.Text", LocalResourcesFile),
Localization.GetSafeJSString("CancelConfirm.Text", LocalResourcesFile),
Localization.GetSafeJSString("DeleteModuleConfirm.Text", LocalResourcesFile),
Localization.GetSafeJSString("Cancel.Text", LocalResourcesFile),
Localization.GetSafeJSString("SearchPlaceHolder.Text", LocalResourcesFile),
Localization.GetSafeJSString("Category_Recommended.Text", LocalResourcesFile),
Localization.GetSafeJSString("Category_All.Text", LocalResourcesFile),
Localization.GetSafeJSString("pagePicker_clearButtonTooltip.Text", LocalResourcesFile),
Localization.GetSafeJSString("pagePicker_loadingResultText.Text", LocalResourcesFile),
Localization.GetSafeJSString("pagePicker_resultsText.Text", LocalResourcesFile),
Localization.GetSafeJSString("pagePicker_searchButtonTooltip.Text", LocalResourcesFile),
Localization.GetSafeJSString("pagePicker_searchInputPlaceHolder.Text", LocalResourcesFile),
Localization.GetSafeJSString("pagePicker_selectedItemCollapseTooltip.Text", LocalResourcesFile),
Localization.GetSafeJSString("pagePicker_selectedItemExpandTooltip.Text", LocalResourcesFile),
Localization.GetSafeJSString("pagePicker_selectItemDefaultText.Text", LocalResourcesFile),
Localization.GetSafeJSString("pagePicker_sortAscendingButtonTitle.Text", LocalResourcesFile),
Localization.GetSafeJSString("pagePicker_sortAscendingButtonTooltip.Text", LocalResourcesFile),
Localization.GetSafeJSString("pagePicker_sortDescendingButtonTooltip.Text", LocalResourcesFile),
Localization.GetSafeJSString("pagePicker_unsortedOrderButtonTooltip.Text", LocalResourcesFile),
Localization.GetSafeJSString("Site.Text", LocalResourcesFile),
Localization.GetSafeJSString("Page.Text", LocalResourcesFile),
Localization.GetSafeJSString("AddExistingModule.Text", LocalResourcesFile)
);
if (ScriptManager.GetCurrent(Page) != null)
{
// respect MS AJAX
ScriptManager.RegisterStartupScript(Page, GetType(), "ContentEditorManagerResources", script, true);
}
else
{
Page.ClientScript.RegisterStartupScript(GetType(), "ContentEditorManagerResources", script, true);
}
}]]></body>
</codeblock>
</method>
<method name="RemoveEmptyPaneClass">
<declaration><![CDATA[private void RemoveEmptyPaneClass()]]></declaration>
<documentation>
<summary>
remove default empty pane class as some skin have special style on it
and it may caught style issues with content editor feature, then we use a
new style to cover it.
</summary>
</documentation>
<codeblock>
<location sl="346" sc="9" el="357" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="d025f816c8dd13fc1c8afeb5c16bf67c"><![CDATA[{
foreach (string paneId in PortalSettings.ActiveTab.Panes)
{
var paneControl = Skin.FindControl(paneId) as HtmlContainerControl;
if (paneControl != null
&& !string.IsNullOrEmpty(paneControl.Attributes["class"])
&& paneControl.Attributes["class"].Contains("DNNEmptyPane"))
{
paneControl.Attributes["class"] = $"{paneControl.Attributes["class"]} EditBarEmptyPane";
}
}
}]]></body>
</codeblock>
</method>
<method name="RemoveTabModule">
<declaration><![CDATA[private void RemoveTabModule(int tabId, int moduleId)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="496" sc="9" el="507" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="f028975e4ca0272019a0db1a408c18cf"><![CDATA[{
ModuleController.Instance.DeleteTabModule(tabId, moduleId, false);
//remove that module control
var moduleControl = ControlUtilities.FindFirstDescendent<Container>(Skin,
c => c.ID == "ctr" + moduleId);
if (moduleControl != null)
{
moduleControl.Parent.Parent.Controls.Remove(moduleControl.Parent);
}
}]]></body>
</codeblock>
</method>
<method name="Render">
<declaration><![CDATA[protected override void Render(HtmlTextWriter writer)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="216" sc="9" el="224" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="272c347ba3066ba3e62751ac49049ac2"><![CDATA[{
var scripts = ScriptManager.GetCurrent(Page).GetRegisteredStartupScripts()
.Where(s => s.Control is ProxyPage).ToList();
foreach (var script in scripts)
{
ScriptManager.RegisterStartupScript(Page, script.Type, script.Key, script.Script, script.AddScriptTags);
}
base.Render(writer);
}]]></body>
</codeblock>
</method>
<method name="SetLastPageHistory">
<declaration><![CDATA[private void SetLastPageHistory(string pageId)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="614" sc="9" el="616" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="70a12db5f2df804064baa9a361d05cac"><![CDATA[{
Response.Cookies.Add(new HttpCookie("LastPageId", pageId) { Path = !string.IsNullOrEmpty(Globals.ApplicationPath) ? Globals.ApplicationPath : "/" });
}]]></body>
</codeblock>
</method>
<method name="SetUserMode">
<declaration><![CDATA[private void SetUserMode(string userMode)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="628" sc="9" el="630" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="e43f827c53fc2d6e484eaf081f1e03f5"><![CDATA[{
Personalization.SetProfile("Usability", "UserMode" + PortalSettings.PortalId, userMode.ToUpper());
}]]></body>
</codeblock>
</method>
<method name="UpdatePanelUnloadEvent">
<declaration><![CDATA[private void UpdatePanelUnloadEvent(object sender, EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="586" sc="9" el="598" ec="10">Controllers\ContentEditorManager.cs</location>
<body hash="6c0ee21323422ca9559a005f4c9ce1dd"><![CDATA[{
try
{
var methodInfo = typeof(ScriptManager).GetMethods(BindingFlags.NonPublic | BindingFlags.Instance)
.First(i => i.Name.Equals("System.Web.UI.IScriptManagerInternal.RegisterUpdatePanel"));
methodInfo.Invoke(ScriptManager.GetCurrent(Page),
new[] { sender });
}
catch (Exception ex)
{
Exceptions.LogException(ex);
}
}]]></body>
</codeblock>
</method>
</methods>
<fields>
<field name="_supportAjax">
<declaration><![CDATA[private bool _supportAjax = true;]]></declaration>
<documentation>
</documentation>
</field>
<field name="ControlFolder">
<declaration><![CDATA[public const string ControlFolder = "~/DesktopModules/admin/Dnn.EditBar/Resources";]]></declaration>
<documentation>
</documentation>
</field>
<field name="CssFileOrder">
<declaration><![CDATA[private const int CssFileOrder = 40;]]></declaration>
<documentation>
</documentation>
</field>
</fields>
<properties>
<property name="LocalResourcesFile">
<declaration><![CDATA[private string LocalResourcesFile]]></declaration>
<documentation>
</documentation>
</property>
<property name="Skin">
<declaration><![CDATA[public Skin Skin]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="53" sc="28" el="53" ec="32">Controllers\ContentEditorManager.cs</location>
<body hash="b5eda0a74558a342cf659187f06f746f"><![CDATA[get]]></body>
</codeblock>
<codeblock>
<location sl="53" sc="33" el="53" ec="37">Controllers\ContentEditorManager.cs</location>
<body hash="cdaeeeba9b4a4c5ebf042c0215a7bb0e"><![CDATA[set]]></body>
</codeblock>
</property>
<property name="SupportAjax">
<declaration><![CDATA[private bool SupportAjax]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="63" sc="13" el="65" ec="14">Controllers\ContentEditorManager.cs</location>
<body hash="87440019119c10e8ac5ce377dd0de069"><![CDATA[{
return ScriptManager.GetCurrent(Page) != null && _supportAjax;
}]]></body>
</codeblock>
<codeblock>
<location sl="67" sc="13" el="69" ec="14">Controllers\ContentEditorManager.cs</location>
<body hash="b47afbd54aeff916823cadb58296d4f2"><![CDATA[{
_supportAjax = value;
}]]></body>
</codeblock>
</property>
</properties>
<events>
</events>
</class>
<class name="EditBarController">
<declaration><![CDATA[public class EditBarController : ServiceLocator<IEditBarController, EditBarController>, IEditBarController]]></declaration>
<documentation>
</documentation>
<constructors>
<constructor name=".ctor">
<declaration><![CDATA[public EditBarController()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="2147483647" sc="0" el="0" ec="0">
</location>
<body hash="d41d8cd98f00b204e9800998ecf8427e"><![CDATA[]]></body>
</codeblock>
</constructor>
<constructor name=".cctor">
<declaration><![CDATA[static EditBarController()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="27" sc="9" el="29" ec="60">Controllers\EditBarController.cs</location>
<body hash="ee452195b613518a3577c9c3b7b99f88"><![CDATA[private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(EditBarController));
private static object _threadLocker = new object();]]></body>
</codeblock>
</constructor>
</constructors>
<methods>
<method name="GetAllMenuItemTypes">
<declaration><![CDATA[private static IEnumerable<Type> GetAllMenuItemTypes()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="111" sc="9" el="118" ec="10">Controllers\EditBarController.cs</location>
<body hash="ae4248f611f5936c1b06c490ba465f15"><![CDATA[{
var typeLocator = new TypeLocator();
return typeLocator.GetAllMatchingTypes(
t => t != null &&
t.IsClass &&
!t.IsAbstract &&
typeof(BaseMenuItem).IsAssignableFrom(t));
}]]></body>
</codeblock>
</method>
<method name="GetConfigurations">
<declaration><![CDATA[public IDictionary<string, object> GetConfigurations(int portalId)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="39" sc="9" el="55" ec="10">Controllers\EditBarController.cs</location>
<body hash="234f0f159e753184af9f0a5c1d2e21d8"><![CDATA[{
var settings = new Dictionary<string, object>();
var portalSettings = PortalSettings.Current;
var user = portalSettings.UserInfo;
settings.Add("applicationPath", Globals.ApplicationPath);
settings.Add("buildNumber", Host.CrmVersion.ToString(CultureInfo.InvariantCulture));
settings.Add("userId", user.UserID);
settings.Add("debugMode", HttpContext.Current != null && HttpContext.Current.IsDebuggingEnabled);
settings.Add("portalId", portalSettings.PortalId);
settings.Add("culture", portalSettings.CultureCode);
settings.Add("loginUrl", Globals.LoginURL(HttpContext.Current?.Request.RawUrl, false));
settings.Add("items", GetMenuItems());
return settings;
}]]></body>
</codeblock>
</method>
<method name="GetFactory">
<declaration><![CDATA[protected override Func<IEditBarController> GetFactory()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="32" sc="9" el="34" ec="10">Controllers\EditBarController.cs</location>
<body hash="9ceb03885baad2b67a0e5e686bbd2431"><![CDATA[{
return () => new EditBarController();
}]]></body>
</codeblock>
</method>
<method name="GetMenuItemInstances">
<declaration><![CDATA[private static IEnumerable<BaseMenuItem> GetMenuItemInstances()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="2147483647" sc="0" el="0" ec="0">
</location>
<body hash="d41d8cd98f00b204e9800998ecf8427e"><![CDATA[]]></body>