forked from DNNCommunity/DNN.Blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathManage.ascx
136 lines (134 loc) · 6.51 KB
/
Manage.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
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Manage.ascx.vb" Inherits="DotNetNuke.Modules.Blog.Manage" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.UI.WebControls" Assembly="DotNetNuke" %>
<%@ Register TagPrefix="dnn" Assembly="DotNetNuke.Web" Namespace="DotNetNuke.Web.UI.WebControls" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<div class="dnnForm" id="tabs">
<ul class="dnnAdminTabNav">
<li><a href="#Blogs"><%= LocalizeString("Blogs")%></a></li>
<li><a href="#Posts"><%= LocalizeString("Posts")%></a></li>
</ul>
<div id="Blogs" class="dnnClear">
<asp:DataList runat="server" ID="dlBlogs">
<HeaderTemplate>
<table class="dnnGrid">
<tr class="dnnGridHeader">
<td></td>
<td></td>
<td></td>
<td><%= LocalizeString("Blog")%></td>
<td><%= LocalizeString("Owner")%></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr class="dnnGridItem">
<td><a href="<%# EditUrl("Blog", Eval("BlogId"), "BlogEdit") %>" class="blogicon-edit icon16" title="Edit"></a></td>
<td><a href="<%# EditUrl("Blog", Eval("BlogId"), "BlogImport") %>" class="blogicon-download-alt icon16" title="Import"></a></td>
<td><a href="#" class="blogicon-upload-alt icon16 exportlink" title="Export" data-blogid="<%# Eval("BlogId") %>"></a></td>
<td><%# Eval("Title") %></td>
<td><%# Eval("DisplayName") %></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:DataList>
<p>
<asp:LinkButton runat="server" ID="cmdAdd" resourcekey="cmdAdd" CssClass="dnnSecondaryAction" />
</p>
</div>
<div id="Posts" class="dnnClear">
<div class="coreMessaging" id="blogPostsError"></div>
<dnn:DNNGrid id="grdPosts" autogeneratecolumns="false" cssclass="dnnGrid dnnSecurityRolesGrid"
runat="server" allowpaging="True" allowcustompaging="True" enableviewstate="True" AllowSorting="true"
onneeddatasource="GetPosts">
<MasterTableView>
<Columns>
<dnn:DnnGridTemplateColumn HeaderText="Actions">
<ItemStyle Width="90px"></ItemStyle>
<ItemTemplate>
<a href="<%# EditUrl("Post", Eval("ContentItemId"), "PostEdit") %>"
class="blogicon-edit icon16"
title="Edit"
style="display:<%# IIF(CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo).Blog.CanEdit OR BlogContext.Security.CanEditThisPost(CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo)), "inline", "none") %>"></a>
<a href="#"
onclick="if (confirm('<%= LocalizeJSString("DeletePost") %>')) {blogService.deletePost(<%# Eval("BlogID") %>, <%# Eval("ContentItemID") %>, function() {$('#cmdDeletePost<%# Eval("ContentItemID") %>').parent().parent().hide()})};return false;"
id="cmdDeletePost<%# Eval("ContentItemID") %>"
class="blogicon-remove icon16"
title="Delete"
style="display:<%# IIF(CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo).Blog.CanEdit OR BlogContext.Security.CanEditThisPost(CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo)), "inline", "none") %>"></a>
<a href="#"
onclick="if (confirm('<%= LocalizeJSString("ApprovePost") %>')) {blogService.approvePost(<%# Eval("BlogID") %>, <%# Eval("ContentItemID") %>, function() {$('#cmdApprovePost<%# Eval("ContentItemID") %>').hide();$('#approveTick<%# Eval("ContentItemID") %>').text('✓')})};return false;"
id="cmdApprovePost<%# Eval("ContentItemID") %>"
class="blogicon-ok icon16"
title="Approve"
style="display:<%# IIF(CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo).Blog.CanApprove AND NOT CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo).Published, "inline", "none") %>"></a>
</ItemTemplate>
</dnn:DnnGridTemplateColumn>
<dnn:DnnGridBoundColumn datafield="PublishedOnDate" headertext="Date" AllowSorting="True" SortExpression="PublishedOnDate" DataFormatString="{0:g}" />
<dnn:DnnGridBoundColumn datafield="Title" headertext="Title" AllowSorting="True" SortExpression="Title" />
<dnn:DnnGridTemplateColumn HeaderText="Published">
<ItemStyle Width="30px" HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<span class="blogicon-<%# IIf(Eval("Published"), "ok", "remove")%> icon16" id="approveTick<%# Eval("ContentItemID") %>"></span>
</ItemTemplate>
</dnn:DnnGridTemplateColumn>
<dnn:DnnGridTemplateColumn HeaderText="Blog">
<ItemTemplate>
<asp:Label ID="Label1" Runat="server" Text='<%# CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo).Blog.Title %>' />
</ItemTemplate>
</dnn:DnnGridTemplateColumn>
</Columns>
</MasterTableView>
</dnn:DNNGrid>
</div>
</div>
<p class="updatecancelbar">
<asp:LinkButton runat="server" ID="cmdReturn" resourcekey="cmdReturn" CssClass="dnnPrimaryAction" />
</p>
<div id="blogServiceErrorBox">
</div>
<script type="text/javascript">
(function ($, Sys) {
$('#tabs').dnnTabs();
var selectedBlog;
var $dialogexport = $('<div class="dnnDialog"></div>')
.html('<p><%=LocalizeJSString("Export.Help") %></p><p><a id="blogMLDownloadLink" style=""><%=LocalizeJSString("Download") %></a></p>')
.dialog({
autoOpen: false,
resizable: false,
dialogClass: 'dnnFormPopup dnnClear',
title: '<%=LocalizeJSString("Export") %>',
height: 250,
width: 500,
open: function (e) {
$('#blogMLDownloadLink').hide();
$('.ui-dialog-buttonpane').find('button:contains("<%=LocalizeJSString("Export") %>")').addClass('dnnPrimaryAction');
$('.ui-dialog-buttonpane').find('button:contains("<%=LocalizeJSString("Cancel") %>")').addClass('dnnSecondaryAction');
},
buttons: [
{
text: '<%=LocalizeJSString("Cancel") %>',
click: function () {
$(this).dialog("close");
}
},
{
text: '<%=LocalizeJSString("Export") %>',
click: function () {
$('.ui-dialog-buttonpane').find('button:contains("<%=LocalizeJSString("Export") %>")').attr("disabled", "disabled");
blogService.exportBlog(selectedBlog, function (returnValue) {
$('.ui-dialog-buttonpane').find('button:contains("<%=LocalizeJSString("Export") %>")').removeAttr("disabled");
$('#blogMLDownloadLink').attr('href', returnValue);
$('#blogMLDownloadLink').show();
});
}
}
]
});
$('.exportlink').click(function () {
selectedBlog = $(this).attr('data-blogid');
$dialogexport.dialog('open');
return false;
});
} (jQuery, window.Sys));
</script>