forked from DNNCommunity/DNN.Blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathManagementPanel.ascx
190 lines (190 loc) · 8.17 KB
/
ManagementPanel.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
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ManagementPanel.ascx.vb" Inherits="DotNetNuke.Modules.Blog.Controls.ManagementPanel" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<div style="height:40px" id="pnlManagement" runat="server">
<a href="#" id="cmdCopyModule" runat="server" class="dnnSecondaryAction" visible="false"><%=LocalizeString("cmdCopyModule")%></a>
<asp:LinkButton runat="server" ID="cmdManageBlogs" resourcekey="cmdManageBlogs" Visible="false" CssClass="dnnSecondaryAction" />
<asp:LinkButton runat="server" ID="cmdAdmin" resourcekey="cmdAdmin" Visible="false" CssClass="dnnSecondaryAction" />
<asp:LinkButton runat="server" ID="cmdEditPost" resourcekey="cmdEditPost" Visible="false" CssClass="dnnSecondaryAction" />
<asp:LinkButton runat="server" ID="cmdBlog" resourcekey="cmdBlog" Visible="false" CssClass="dnnPrimaryAction" />
<div style="float:right">
<a href="#" id="doclink" runat="server" visible="false"><i class="fa fa-book fa-fw icon16"></i> <span class="sr-only">Documentation</span></a>
<a href="<%=DotNetNuke.Common.Globals.NavigateUrl()%>" id="homelink" title="<%=LocalizeString("Home") %>"><i class="fa fa-home fa-fw icon16"></i> <span class="sr-only"><%=LocalizeString("Home") %></span></a>
<a href="#" id="wlwlink" runat="server"><i class="fa fa-pencil fa-fw icon16"></i> <span class="sr-only"><%=LocalizeString("WLW") %></span></a>
<a href="<%=RssLink%>" id="rsslink<%=ModuleId %>" title="<%=LocalizeString("RSS") %>" target="_blank"><i class="fa fa-rss fa-fw icon16"></i> <span class="sr-only"><%=LocalizeString("RSS") %></span></a>
<a href="#" id="searchlink<%=ModuleId %>" title="<%=LocalizeString("Search") %>"><i class="fa fa-search fa-fw icon16"></i> <span class="sr-only"><%=LocalizeString("Search") %></span></a>
</div>
</div>
<div class="dnnDialog" id="pnlCopyModule" runat="server">
<div class="dnnClear">
<div class="dnnFormItem">
<dnn:label id="lblTemplate" runat="server" controlname="ddTemplate" suffix=":" />
<asp:DropDownList runat="server" ID="ddTemplate" />
</div>
<div class="dnnFormItem">
<dnn:Label ID="lblTitle" runat="server" Suffix=":" />
<asp:TextBox runat="server" ID="txtTitle" />
</div>
<div class="dnnFormItem">
<dnn:Label ID="lblPane" runat="server" Suffix=":" />
<asp:DropDownList runat="server" ID="ddPane" />
</div>
<div class="dnnFormItem">
<dnn:Label ID="lblInsert" runat="server" Suffix=":" />
<asp:DropDownList runat="server" ID="ddPosition" />
</div>
<div class="dnnRight">
<a href="#" class="dnnSecondaryAction" onclick="$('#<%=pnlCopyModule.ClientId %>').dialog('close')"><%=LocalizeString("cmdCancel") %></a>
<a href="#" id="cmdAdd<%=ModuleId %>" class="dnnPrimaryAction"><%=LocalizeString("cmdAdd") %></a>
</div>
</div>
</div>
<script>
(function ($, Sys) {
$(document).ready(function () {
<% If BlogContext.Security.CanAddPost %>
var $dialogWLW = $('<div class="dnnDialog"></div>')
.html('<input type="text" id="txtWLWLink<%=ModuleId %>" style="width:95%"></input><br/><span><%=LocalizeJSString("WLW.Help") %></span>')
.dialog({
autoOpen: false,
resizable: false,
dialogClass: 'dnnFormPopup dnnClear',
title: '<%=LocalizeJSString("WLW") %>',
height: 160,
width: 500
});
$('#<%=wlwlink.ClientId %>').click(function () {
$dialogWLW.dialog('open');
$('#txtWLWLink<%=ModuleId %>').val('http://<%= Request.Url.Host & DotNetNuke.Common.Globals.ApplicationPath & String.Format("/DesktopModules/Blog/BlogPost.ashx?portalid={0}&tabid={1}&moduleid={2}", PortalId, TabId, ModuleId) %>').select();
return false;
});
<% End If %>
<% If BlogContext.Security.IsEditor %>
$('#<%=pnlCopyModule.ClientId %>')
.dialog({
autoOpen: false,
resizable: false,
dialogClass: 'dnnFormPopup dnnClear',
title: '<%=LocalizeJSString("cmdCopyModule") %>',
width: 800
});
$('#<%=cmdCopyModule.ClientId %>').click(function () {
$('#<%=pnlCopyModule.ClientId %>').dialog('open');
return false;
});
$('#cmdAdd<%=ModuleId %>').click(function () {
blogService.addModule($('#<%=ddPane.ClientId %>').val(), $('#<%=ddPosition.ClientId %>').val(), $('#<%=txtTitle.ClientId %>').val(), $('#<%=ddTemplate.ClientId %>').val(),
function() {
location.reload()
});
$('#<%=pnlCopyModule.ClientId %>').dialog('close');
return false;
});
<% End If %>
var $dialogSearch = $('<div class="dnnDialog"></div>')
.html('<input type="text" id="txtSearch" style="width:95%"></input><br/><%=LocalizeJSString("SearchIn") %> <input type="checkbox" id="scopeAll<%=ModuleId %>" value="1" checked="1" /><%=LocalizeJSString("SearchAll") %><input type="checkbox" id="scopeTitle<%=ModuleId %>" value="1" checked="1" /><%=LocalizeJSString("Title") %><input type="checkbox" id="scopeContents<%=ModuleId %>" value="1" /><%=LocalizeJSString("Contents") %><% If BlogContext.Security.CanAddPost %><input type="checkbox" id="chkUnpublished<%=ModuleId %>" value="1" /><%=LocalizeJSString("Unpublished") %><% End If %>')
.dialog({
autoOpen: false,
resizable: false,
dialogClass: 'dnnFormPopup dnnClear',
title: '<%=LocalizeJSString("Search") %>',
height: 210,
width: 500,
open: function (e) {
$('.ui-dialog-buttonpane').find('button:contains("<%=LocalizeJSString("Search") %>")').addClass('dnnPrimaryAction');
$('.ui-dialog-buttonpane').find('button:contains("<%=LocalizeJSString("Cancel") %>")').addClass('dnnSecondaryAction');
},
buttons: [
{
text: '<%=LocalizeJSString("Cancel") %>',
click: function () {
$(this).dialog("close");
}
},
{
text: '<%=LocalizeJSString("Search") %>',
click: function () {
$(this).dialog("close");
var url
if ($('#scopeAll<%=ModuleId %>').is(':checked')) {
url = '<%=BlogContext.ModuleUrls.GetUrl(False, False, False, False, True) %>';
} else {
url = '<%=BlogContext.ModuleUrls.GetUrl(True, False, True, True, True) %>';
}
url += 'search=' + $('#txtSearch').val();
if ($('#scopeTitle<%=ModuleId %>').is(':checked')) {
url += '&t=1'
}
if ($('#scopeContents<%=ModuleId %>').is(':checked')) {
url += '&c=1'
}
if ($('#chkUnpublished<%=ModuleId %>').is(':checked')) {
url += '&u=1'
}
window.location.href = encodeURI(url);
}
}
]
});
$('#searchlink<%=ModuleId %>').click(function () {
$dialogSearch.dialog('open');
return false;
});
<% If BlogContext.Security.CanAddPost %>
var $blogChoose = $('<div class="dnnDialog"></div>')
.html('<%=BlogSelectListHtml %>')
.dialog({
autoOpen: false,
resizable: false,
dialogClass: 'dnnFormPopup dnnClear',
title: '<%=LocalizeJSString("BlogChoose") %>',
width: 500,
open: function (e) {
$('.ui-dialog-buttonpane').find('button:contains("<%=LocalizeJSString("cmdBlog") %>")').addClass('dnnPrimaryAction');
$('.ui-dialog-buttonpane').find('button:contains("<%=LocalizeJSString("Cancel") %>")').addClass('dnnSecondaryAction');
$('#<%:ClientID%>ddBlog').width("100%");
},
buttons: [
{
text: '<%=LocalizeJSString("Cancel") %>',
click: function () {
$(this).dialog("close");
}
},
{
text: '<%=LocalizeJSString("cmdBlog") %>',
click: function () {
$(this).dialog("close");
var url = '<%=EditUrl("PostEdit") %>';
if (url.indexOf("?") == -1) {
url += '?'
} else {
url += '&'
};
url += 'Blog=' + $('#<%:ClientID%>ddBlog').val();
window.location.href = encodeURI(url);
}
}
]
});
<% If NrBlogs > 1 %>
$('#<%=cmdBlog.ClientId %>').click(function () {
$blogChoose.dialog('open');
return false;
});
<% ElseIf NrBlogs = 1 %>
$('#<%=cmdBlog.ClientId %>').click(function () {
var url = '<%=EditUrl("PostEdit") %>';
if (url.indexOf("?") == -1) {
url += '?'
} else {
url += '&'
};
url += 'Blog=' + $('#<%:ClientID%>ddBlog').val();
window.location.href = encodeURI(url);
return false;
});
<% End If %>
<% End If %>
});
} (jQuery, window.Sys));
</script>