-
Notifications
You must be signed in to change notification settings - Fork 4
/
Loader.ascx.cs
63 lines (57 loc) · 2.28 KB
/
Loader.ascx.cs
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
using System;
using CompanyName.ModuleName.Components.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules.Actions;
using DotNetNuke.Security;
using DotNetNuke.Security.Permissions;
using DotNetNuke.UI;
namespace CompanyName.ModuleName
{
public partial class Loader : CustomModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
CustomModuleBase form = null;
string view = "";
switch (Null.SetNullString(Request.QueryString["View"]))
{
case "":
view = Null.SetNullString(Settings["View"]);
if (view != "")
{
var settingsView = LoadControl(ControlPath + "Views/" + view) as CustomModuleBase;
settingsView.SelectedControl = view.Replace(".ascx", "");
settingsView.ID = view.Replace(".ascx", "");
phOutput.Controls.Add(settingsView);
}
else
{
var defaultView = LoadControl(ControlPath + "Views/NoSettings.ascx") as CustomModuleBase;
defaultView.SelectedControl = "NoSettings";
defaultView.ID = "NoSettings";
phOutput.Controls.Add(defaultView);
}
break;
default:
view = Null.SetNullString(Request.QueryString["View"]);
form = LoadControl(ControlPath + "Views/" + view + ".ascx") as CustomModuleBase;
form.ID = view;
form.SelectedControl = view;
phOutput.Controls.Add(form);
break;
}
}
public ModuleActionCollection ModuleActions
{
get
{
var actions = new ModuleActionCollection();
if (ModulePermissionController.CanManageModule(ModuleConfiguration))
{
actions.Add(GetNextActionID(), "Configuration", "", "", "edit.gif", EditUrl("view", "configure", "Loader"), false, SecurityAccessLevel.Edit, true, false);
}
return actions;
}
}
}
}