-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathEdit.ascx
113 lines (88 loc) · 4.84 KB
/
Edit.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
<%@ Control Language="C#" Inherits="Christoc.Modules.dnnsimplearticle.Edit" AutoEventWireup="True"
CodeBehind="Edit.ascx.cs" %>
<%@ Register TagPrefix="dnn" Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" %>
<%@ Register TagPrefix="dnn" Assembly="DotNetNuke.Web" Namespace="DotNetNuke.Web.UI.WebControls" %>
<%@ Register TagPrefix="dnn" TagName="label" Src="~/controls/LabelControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx" %>
<%@ Register TagPrefix="dnn" TagName="URL" Src="~/controls/URLControl.ascx" %>
<%@ Import Namespace="DotNetNuke.Services.Localization" %>
<div class="dnnForm dnnSimpleArticleSettings dnnClear" id="dnnSimpleArticleSettings">
<div class="dnnFormExpandContent"><a href=""><%=LocalizeString("ExpandAll")%></a></div>
<h2 id="dnnSitePanel-BasicSettings" class="dnnFormSectionHead">
</h2>
<h2 class="dnnFormSectionHead">
<a href="" class="dnnSectionExpanded">
<%=LocalizeString("BasicSettings")%></a></h2>
<fieldset>
<div class="dnnFormItem">
<dnn:label ID="lblTitle" ControlName="txtTitle" runat="server" />
<asp:TextBox ID="txtTitle" runat="server" Columns="50" CssClass="txtTitle" /><asp:RequiredFieldValidator
ID="rfvTitle" runat="server" ControlToValidate="txtTitle" CssClass="NormalRed" />
</div>
<div class="dnnFormItem">
<dnn:label ID="lblPermaLink" ControlName="txtPermaLink" runat="server" />
<asp:TextBox ID="txtPermaLink" runat="server" Columns="50" CssClass="txtPermaLink" /><asp:RequiredFieldValidator
ID="rfvPermaLink" runat="server" ControlToValidate="txtPermaLink" CssClass="NormalRed" />
</div>
</fieldset>
<h2 id="H1" class="dnnFormSectionHead"><a href="" class="dnnSectionExpanded"><%=LocalizeString("Description")%></a></h2>
<fieldset>
<div class="dnnFormItem">
<dnn:TextEditor ID="txtDescription" runat="server" Width="100%" Height="300px" />
<asp:RequiredFieldValidator ID="rfvDescription" runat="server" ControlToValidate="txtDescription"
CssClass="NormalRed" />
</div>
<div class="dnnFormItem">
<asp:UpdatePanel ID="pnlImage" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<dnn:label ID="lblImage" runat="server" ControlName="urlImage" />
<dnn:URL ID="urlImage" runat="server" Width="325"
ShowFiles="true"
ShowUrls="false"
ShowTabs="false"
ShowLog="false"
ShowTrack="false"
Required="False"
ShowNewWindow="False" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</fieldset>
<h2 id="H2" class="dnnFormSectionHead">
<a href="" class="dnnSectionExpanded">
<%=LocalizeString("ArticleBody")%></a></h2>
<fieldset>
<div class="dnnFormItem">
<dnn:TextEditor ID="txtBody" runat="server" Width="100%" Height="400px" />
</div>
<div class="dnnFormItem">
<dnn:label ID="lblTerms" runat="server" ControlName="cbTerms" />
<asp:ListBox ID="lstTerms" runat="server" DataValueField="termId" DataTextField="Name" SelectionMode="Multiple"></asp:ListBox>
</div>
</fieldset>
<div class="dnnFormItem">
<asp:LinkButton ID="lbSave" runat="server" resourcekey="lbSave" OnClick="LbSaveClick" CssClass="dnnPrimaryAction" />
<asp:LinkButton ID="lbCancel" runat="server" resourcekey="lbCancel" OnClick="LbCancelClick"
CausesValidation="false" CssClass="dnnSecondaryAction" />
</div>
</div>
<script language="javascript" type="text/javascript">
/*globals jQuery, window, Sys */
(function ($, Sys) {
function dnnSimpleArticleSettings() {
$('#dnnSimpleArticleSettings').dnnPanels();
$('#dnnSimpleArticleSettings .dnnFormExpandContent a').dnnExpandAll({ expandText: '<%=Localization.GetString("ExpandAll", LocalResourceFile)%>', collapseText: '<%=Localization.GetString("CollapseAll", LocalResourceFile)%>', targetArea: '#dnnSimpleArticleSettings' });
}
$(document).ready(function () {
dnnSimpleArticleSettings();
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {
dnnSimpleArticleSettings();
});
});
//TODO: don't fire this if the article already exists and has a value in permalink?
$('.txtTitle').on('keyup', function () {
$('.txtPermaLink').val($(this).val().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').toLowerCase());
});
}(jQuery, window.Sys));
</script>
<asp:Literal ID="litUrls" runat="server" />