-
Notifications
You must be signed in to change notification settings - Fork 8
/
Newsletter.ascx
163 lines (154 loc) · 9.55 KB
/
Newsletter.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
<%@ Control Inherits="Dnn.Modules.Newsletters.Newsletter" Language="C#" AutoEventWireup="true" Codebehind="Newsletter.ascx.cs" %>
<%@ Register TagPrefix="dnn" TagName="texteditor" Src="~/controls/texteditor.ascx" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="URLControl" Src="~/controls/DnnUrlControl.ascx" %>
<%@ Register TagPrefix="dnn" Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" %>
<%@ Register TagPrefix="dnn" Assembly="DotNetNuke.Web" Namespace="DotNetNuke.Web.UI.WebControls" %>
<%@ Register TagPrefix="dnn" Assembly="DotNetNuke.Web.Client" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" %>
<dnn:DnnJsInclude runat="server" FilePath="~/Resources/Shared/Components/Tokeninput/jquery.tokeninput.js" Priority="103" />
<dnn:DnnCssInclude runat="server" FilePath="~/Resources/Shared/Components/Tokeninput/Themes/token-input-facebook.css" />
<div class="dnnForm dnnNewsletters dnnClear" id="dnnNewsletters">
<ul class="dnnAdminTabNav dnnClear">
<li><a href="#newMessage"><%=LocalizeString("Message")%></a></li>
<li><a href="#newAdvancedSettings"><%=LocalizeString("AdvancedSettings")%></a></li>
</ul>
<div class="newMessage" id="newMessage">
<fieldset>
<div class="dnnFormItem">
<dnn:Label ID="plRoles" runat="server" ControlName="recipients" />
<input type='text' id='recipients' name='recipients' runat="server" />
</div>
<div class="dnnFormItem">
<dnn:Label id="plLanguages" runat="server" ControlName="selLanguage" />
<dnn:LanguageSelector runat="server" ID="selLanguage" SelectionMode="Multiple" ListDirection="Vertical" ItemStyle="FlagAndCaption" />
</div>
<div class="dnnFormItem">
<dnn:label id="plEmail" runat="server" controlname="txtEmail"/>
<asp:TextBox ID="txtEmail" runat="server" TextMode="MultiLine" rows="3" Columns="60" CssClass="noResize" />
</div>
<div class="dnnFormItem">
<dnn:label id="plFrom" runat="server" controlname="txtFrom" />
<asp:TextBox ID="txtFrom" runat="server" MaxLength="100"/>
<asp:RegularExpressionValidator ID="revEmailAddress" runat="server" resourcekey="revEmailAddress.ErrorMessage"
CssClass="dnnFormMessage dnnFormError" ControlToValidate="txtFrom"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic" />
</div>
<div class="dnnFormItem">
<dnn:label id="plReplyTo" runat="server" controlname="txtReplyTo" />
<asp:TextBox ID="txtReplyTo" runat="server" MaxLength="100" />
<asp:RegularExpressionValidator ID="revReplyTo" runat="server" resourcekey="revEmailAddress.ErrorMessage" CssClass="dnnFormMessage dnnFormError" ControlToValidate="txtReplyTo" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic" />
</div>
<div class="dnnFormItem">
<dnn:Label ID="plSubject" runat="server" ControlName="txtSubject" />
<asp:TextBox ID="txtSubject" runat="server" MaxLength="100" />
</div>
<div class="dnnFormItem">
<dnn:texteditor ID="teMessage" runat="server" Width="100%" TextRenderMode="Raw" HtmlEncode="False" defaultmode="Rich" height="350" choosemode="True" chooserender="False" />
</div>
</fieldset>
</div>
<div class="newAdvancedSettings" id="newAdvancedSettings">
<fieldset>
<div class="dnnFormItem dnnNewsletterAttachment">
<dnn:label id="plAttachment" runat="server" controlname="ctlAttachment" />
<div class="dnnLeft"><dnn:URLControl id="ctlAttachment" runat="server" Required="False" ShowUpLoad="true" ShowTrack="False" ShowLog="False" ShowTabs="False" ShowUrls="False" /></div>
</div>
<div class="dnnFormItem">
<dnn:label id="plReplaceTokens" runat="server" controlname="chkReplaceTokens" />
<asp:CheckBox id="chkReplaceTokens" runat="server" Checked="true" />
</div>
<div class="dnnFormItem">
<dnn:Label id="plPriority" runat="server" ControlName="cboPriority" />
<asp:DropDownList id="cboPriority" runat="server">
<asp:ListItem resourcekey="High" Value="1" />
<asp:ListItem resourcekey="Normal" Value="2" Selected="True" />
<asp:ListItem resourcekey="Low" Value="3" />
</asp:DropDownList>
</div>
<div class="dnnFormItem">
<dnn:Label id="plSendMethod" runat="server" ControlName="cboSendMethod" />
<asp:DropDownList id="cboSendMethod" runat="server" AutoPostBack="true">
<asp:ListItem resourcekey="SendTo" Value="TO" Selected="True" />
<asp:ListItem resourcekey="SendBCC" Value="BCC" />
<asp:ListItem resourcekey="SendRelay" Value="RELAY" />
</asp:DropDownList>
</div>
<div id="pnlRelayAddress" runat="server" visible="false" class="dnnFormItem">
<dnn:label id="plRelayAddress" runat="server" controlname="txtRelayAddress" />
<asp:TextBox ID="txtRelayAddress" runat="server" Columns="40" MaxLength="100" />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" resourcekey="revEmailAddress.ErrorMessage" CssClass="dnnFormMessage dnnFormError" ControlToValidate="txtRelayAddress" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic" />
</div>
<div class="dnnFormItem">
<dnn:Label id="plSendAction" runat="server" ControlName="optSendAction" />
<asp:RadioButtonList id="optSendAction" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="dnnNewsletterRadios">
<asp:ListItem resourcekey="Synchronous" Value="S" />
<asp:ListItem resourcekey="Asynchronous" Value="A" Selected="True" />
</asp:RadioButtonList>
</div>
</fieldset>
</div>
<ul class="dnnActions dnnClear">
<li><asp:LinkButton ID="cmdSend" resourcekey="cmdSend" runat="server" CssClass="dnnPrimaryAction" /></li>
<li><asp:LinkButton ID="cmdPreview" resourcekey="cmdPreview" runat="server" CssClass="dnnSecondaryAction dnnDeleteRole" /></li>
</ul>
</div>
<asp:Panel ID="pnlPreview" runat="server" EnableViewState="false" Visible="false">
<table>
<tr>
<td style="width:100px; vertical-align:top"><asp:Label ID="label3" runat="server" resourcekey="Preview">Preview</asp:Label></td>
<td style="width:460px;"></td>
</tr>
<tr>
<td style="width:100px; vertical-align:top"><asp:Label ID="label1" runat="server" resourcekey="plSubject"></asp:Label></td>
<td style="width:460px;"><asp:Label id="lblPreviewSubject" runat="server"></asp:Label></td>
</tr>
<tr>
<td style="width:100px; vertical-align:top"><asp:Label ID="label2" runat="server" resourcekey="Message"></asp:Label></td>
<td style="width:460px;"><asp:Label id="lblPreviewBody" runat="server"></asp:Label></td>
</tr>
</table>
<ul class="dnnActions dnnClear">
<li><asp:LinkButton ID="cmdCancelPreview" resourcekey="cmdCancelPreview" runat="server" CssClass="dnnPrimaryAction" /></li>
</ul>
</asp:Panel>
<script language="javascript" type="text/javascript">
/*globals jQuery, window, Sys */
(function ($, Sys) {
function setUpDnnNewsletter() {
$('#dnnNewsletters').dnnTabs();
$('#<%=recipients.ClientID%>').tokenInput($.ServicesFramework(<%=ModuleId %>).getServiceRoot('InternalServices') + 'MessagingService/' + "Search", {
theme: "facebook",
prePopulate: <%=GetInitialEntries()%>,
resultsFormatter: function (item) {
if (item.id.startsWith("user-")) {
return "<li class='user'><img src='" + item.iconfile + "' title='" + item.name + "' height='25px' width='25px' /><span>" + item.name + "</span></li>";
} else if (item.id.startsWith("role-")) {
return "<li class='role'><img src='" + item.iconfile + "' title='" + item.name + "' height='25px' width='25px' /><span>" + item.name + "</span></li>";
}
return "<li>" + item[this.propertyToSearch] + "</li>";
},
minChars: 2,
preventDuplicates: true,
hintText: '',
noResultsText: "No Results",
searchingText: "Searching...",
onError: function (xhr, status) {
var messageNode = $("<div/>")
.addClass('dnnFormMessage dnnFormWarning')
.text('An error occurred while getting suggestions: ' + status);
$('#<%=recipients.ClientID%>').prepend(messageNode);
messageNode.fadeOut(3000, 'easeInExpo', function () {
messageNode.remove();
});
}
});
$('label[for="<%=recipients.ClientID%>"]').attr('for', 'token-input-<%=recipients.ClientID%>');
}
$(document).ready(function () {
setUpDnnNewsletter();
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {
setUpDnnNewsletter();
});
});
} (jQuery, window.Sys));
</script>