forked from ActiveForums/ActiveForums
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ControlPanel.ascx
214 lines (193 loc) · 7.86 KB
/
ControlPanel.ascx
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
<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="ControlPanel.ascx.cs" Inherits="DotNetNuke.Modules.ActiveForums.ControlPanel" %>
<%@ Register assembly="DotNetNuke.Modules.ActiveForums" namespace="DotNetNuke.Modules.ActiveForums.Controls" tagPrefix="am" %>
<script type="text/javascript">
var imgPath = '<%=Page.ResolveUrl("~/DesktopModules/ActiveForums/images/")%>';
var dlgHeight;
var dlgWidth;
var dlgTitle;
var selectedTab;
function getSelectedTab(){
return selectedTab;
};
function setSelectedTab(id){
selectedTab = id;
}
function LoadView(param,opt,tab){
closeAllProp();
af_clearLoad();
af_showLoad();
selectedTab = '';
if (opt==undefined){
opt = '';
};
if (typeof(tab)!='undefined') {
History.pushState(null, null, '?cpview=' + param + '¶ms=' + opt + '&tab=' + tab);
}else{
History.pushState(null, null, '?cpview=' + param + '¶ms=' + opt);
}
<%=cbShell.ClientID%>.Callback(param,opt);
}
function getTop(obj,height){
var dlg=document.getElementById(obj);
var winH=document.body.clientHeight;
var top=((winH/2)-(height/2));
dlg.style.top=top+'px';
};
function getLeft(obj,width){
var dlg=document.getElementById(obj);
var winW=document.body.offsetWidth;
dlg.style.left=((winW/2)-(width/2))+'px';
};
function afam_showDialog(title,key,height,width,optional){
dlgHeight=height;
dlgWidth=width;
dlgTitle=title;
getTop("amModal",height);
getLeft("amModal",width);
var modal = document.getElementById("amModal");
var modalFrameDiv = document.getElementById("amModalFrameDiv");
modal.style.zIndex=200001;
modal.style.height=dlgHeight+'px';
modal.style.width=dlgWidth+'px';
modal.style.display='block';
modalFrameDiv.style.height=height-22+'px';
amcp.UI.LoadMask();
var amModalHeader=document.getElementById("amModalHeaderText");
amModalHeader.innerHTML=dlgTitle;
if(optional=='undefined'){optional=''};
var modFrame = document.getElementById("amModalFrame");
if (modFrame != undefined){
modFrame.height = '0';
};
<%=cbModal.ClientID%>.Callback('load',key,optional)
};
function amaf_closeDialog(){
var modFrame = document.getElementById("amModalFrame");
if (modFrame != undefined){
modFrame.height = '0';
modFrame.parentNode.removeChild(modFrame);
}
var dlg=document.getElementById("amModal");
dlg.style.display='none';
var cModal = document.getElementById("<%=cbModal.ClientID%>");
cModal.removeChild(cModal.firstChild);
amcp.UI.ClearMask();
};
function af_getShell(){
return '<%=cbShell.ClientID%>';
};
function amClearTab(){
selectedTab = '';
};
function af_shellComplete(){
af_clearLoad(500);
//toggleTab(selectedTab);
var tab = getQueryString()["tab"];
if (typeof(tab) != 'undefined') {
toggleTab(document.getElementById(tab));
}
};
function af_shellInit(){
if (window.location.toString().indexOf('#') >= 0) {
var sHash = window.location.hash.substring(1) + '|';
var params = sHash.split('|');
var view = params[0].split("=")[1];
var param = params[1];
if (param.indexOf('!') >= 0) {
param = param.replace('params=', '');
} else {
param = param.split("=")[1];
};
LoadView(view, param);
}else {
var view = getQueryString()["cpview"];
var parms = getQueryString()["params"];
LoadView(view, parms);
};
};
function af_setSession(){
if (window.location.toString().indexOf('#') >= 0) {
var sHash = window.location.hash.substring(1) + '|';
var params = sHash.split('|');
var view = params[0].split("=")[1];
var param = params[1];
if (param.indexOf('!') >= 0) {
param = param.replace('params=', '');
} else {
param = param.split("=")[1];
};
<%=cbShell.ClientID%>.Callback(view,param,1);
};
};
</script>
<div>
<div class="amcpcontainer" id="amcpcontainer">
<div class="amcploader" id="amcploader">
<span>[RESX:PleaseWait]</span>
<img src="~/desktopmodules/activeforums/images/spinner-lg.gif" runat="server" />
</div>
<div id="amcpnotify" class="amcpnotify">
<div>
<i></i>
<span id="amcpnotify-message"></span>
</div>
</div>
<div class="amnavbar">
<div class="amcpmdtoolbar">
<am:imagebutton id="btnHome" runat="server" Height="50" Width="55" PostBack="False" ClientSideScript="LoadView('home');" ImageLocation="TOP" text="[RESX:Dashboard]" ImageUrl="~/DesktopModules/ActiveForums/images/home32.png" />
<am:imagebutton id="btnForums" runat="server" Height="50" Width="50" PostBack="False" ClientSideScript="LoadView('manageforums');" ImageLocation="TOP" text="[RESX:Forums]" ImageUrl="~/DesktopModules/ActiveForums/images/forums32.png" />
<am:imagebutton id="btnTemplates" runat="server" Height="50" Width="50" PostBack="False" ClientSideScript="LoadView('templates');" ImageLocation="TOP" text="[RESX:Templates]" ImageUrl="~/DesktopModules/ActiveForums/images/templates32.png" />
<am:imagebutton id="btnFilters" runat="server" Height="50" Width="50" PostBack="False" ClientSideScript="LoadView('filters');" ImageLocation="TOP" text="[RESX:Filters]" ImageUrl="~/DesktopModules/ActiveForums/images/filters32.png" />
<am:imagebutton id="btnRanks" runat="server" Height="50" Width="50" PostBack="False" ClientSideScript="LoadView('ranks');" ImageLocation="TOP" text="[RESX:Ranks]" ImageUrl="~/DesktopModules/ActiveForums/images/ranks32.png" />
<am:imagebutton id="btnTags" runat="server" Height="50" Width="50" PostBack="False" ClientSideScript="LoadView('tags');" ImageLocation="TOP" text="[RESX:Tags]" ImageUrl="~/DesktopModules/ActiveForums/images/tags32.png" />
<am:imagebutton id="btnCategories" runat="server" Height="50" Width="50" PostBack="False" ClientSideScript="LoadView('categories');" ImageLocation="TOP" text="[RESX:Categories]" ImageUrl="~/DesktopModules/ActiveForums/images/categories32.png" />
<am:imagebutton id="btnReturn" runat="server" Height="50" Width="50" PostBack="False" ImageLocation="TOP" text="[RESX:Exit]" ImageUrl="~/DesktopModules/ActiveForums/images/return32.png" />
</div>
</div>
<am:CallBack id="cbShell" runat="server" Debug="false" CssClass="amcpshell" OnCallbackComplete="af_shellComplete">
<Content>
<asp:PlaceHolder id="plhControlPanel" runat="server" />
</Content>
</am:CallBack>
</div>
<div class="amcpfooter">
<table width="100%" cellpadding="0" cellspacing="0"><tr><td style="text-align:left;padding-top:2px;"><asp:Label ID="lblProd" runat="server" CssClass="amcpfootertext" /></td><td style="text-align:right;padding-top:2px;"><asp:label ID="lblCopy" runat="server" CssClass="amcpfootertext" /></td></tr></table>
</div>
<div id="amModal" class="amModal" style="display:none;position:absolute;">
<div class="amModalHeader">
<div class="amModalHeaderText" id="amModalHeaderText"></div>
<div class="amModalCloseImg" onclick="amaf_closeDialog();"><img src="<%=Page.ResolveUrl("~/DesktopModules/activeforums/images/close.gif")%>" alt="[RESX:Close]" /></div>
</div>
<div class="amModalFrame" id="amModalFrameDiv">
<am:Callback ID="cbModal" runat="server" Debug="false">
<Content>
<asp:PlaceHolder ID="plhModal" runat="server" />
</Content>
</am:Callback>
</div>
</div>
<am:scriptloader id="amScriptLoader" TextSuggest="true" Callback="true" runat="server" ActiveGrid="true" RequiredFieldValidator="true" />
<am:imagebutton ID="btnDummy" runat="server" Visible="false" />
<div id="amtip" class="amtip" style="display:none;">
<div id="amtipbubble" class="amtipbubble">
<div id="amtiptext" class="amtiptext"></div>
</div>
</div>
</div>
<div id="amProp">
</div>
<script type="text/javascript">
(function (window, undefined) {
var History = window.History;
if (!History.enabled) {
return false;
}
History.Adapter.bind(window, 'statechange', function () { // Note: We are using statechange instead of popstate
var State = History.getState(); // Note: We are using History.getState() instead of event.state
if (State != undefined) {
afHistoryChange(State.url, State.data);
}
});
})(window);
af_shellInit();
</script>