PluginProbe ʕ •ᴥ•ʔ
Download Manager / 3.3.63
Download Manager v3.3.63
3.3.63 3.3.62 3.3.61 3.3.60 3.3.59 3.3.58 3.3.57 3.3.56 trunk 2.1.3 2.3.0 2.5.96 2.5.97 2.6.2 2.6.96 2.8.3 2.9.99 3.0.4 3.1.05 3.1.07 3.1.08 3.1.11 3.1.12 3.1.14 3.1.17 3.1.18 3.1.22 3.1.23 3.1.24 3.1.25 3.1.26 3.1.27 3.1.28 3.2.04 3.2.13 3.2.14 3.2.16 3.2.18 3.2.19 3.2.21 3.2.22 3.2.23 3.2.24 3.2.25 3.2.27 3.2.28 3.2.29 3.2.30 3.2.31 3.2.32 3.2.33 3.2.34 3.2.35 3.2.37 3.2.38 3.2.39 3.2.40 3.2.41 3.2.42 3.2.43 3.2.44 3.2.45 3.2.46 3.2.47 3.2.48 3.2.49 3.2.50 3.2.51 3.2.52 3.2.53 3.2.54 3.2.55 3.2.56 3.2.57 3.2.58 3.2.59 3.2.60 3.2.61 3.2.63 3.2.64 3.2.65 3.2.66 3.2.67 3.2.68 3.2.69 3.2.70 3.2.71 3.2.72 3.2.73 3.2.74 3.2.75 3.2.76 3.2.77 3.2.78 3.2.79 3.2.80 3.2.81 3.2.82 3.2.83 3.2.84 3.2.85 3.2.86 3.2.87 3.2.88 3.2.89 3.2.90 3.2.91 3.2.92 3.2.93 3.2.94 3.2.95 3.2.96 3.2.97 3.2.98 3.2.99 3.3.00 3.3.01 3.3.02 3.3.03 3.3.04 3.3.05 3.3.06 3.3.07 3.3.08 3.3.09 3.3.10 3.3.11 3.3.12 3.3.13 3.3.14 3.3.15 3.3.16 3.3.17 3.3.18 3.3.19 3.3.20 3.3.21 3.3.22 3.3.23 3.3.24 3.3.25 3.3.26 3.3.27 3.3.28 3.3.29 3.3.30 3.3.31 3.3.32 3.3.33 3.3.34 3.3.35 3.3.36 3.3.37 3.3.38 3.3.39 3.3.40 3.3.41 3.3.42 3.3.43 3.3.44 3.3.45 3.3.46 3.3.47 3.3.48 3.3.49 3.3.50 3.3.51 3.3.52 3.3.53 3.3.54 3.3.55
download-manager / src / Admin / views / templates / email-template-editor.php
download-manager / src / Admin / views / templates Last commit date
custom-tags.php 1 week ago email-template-editor.php 2 years ago email-template-settings.php 5 months ago emails-template.php 4 years ago header.php 3 years ago import-template.php 5 years ago list-templates.php 1 week ago templates.php 1 week ago
email-template-editor.php
231 lines
1 <?php
2 $tpl = \WPDM\__\Email::getTemplate(wpdm_query_var('id'));
3 $info = \WPDM\__\Email::info(wpdm_query_var('id'));
4 ?>
5 <div class="wrap w3eden">
6
7 <?php
8 require_once __DIR__.'/header.php';
9 ?>
10
11
12
13 <?php if(is_array($info)){ ?>
14
15
16 <div class="row">
17 <div class="col-md-12">
18 <div class="well" style="font-size: 11pt;font-weight: 600">
19 <div class="pull-right">
20 <?php echo sprintf(__('To: %s'), ucfirst($info['for'])); ?>
21 </div>
22 <?php echo sprintf(__('Editing: %s'), $info['label']); ?>
23 </div>
24 </div>
25 </div>
26 <div class="row">
27 <div class="col-md-8">
28
29 <form action="" method="post" id="email-editor-form">
30
31 <?php wp_nonce_field(WPDM_PRI_NONCE, '__setnonce'); ?>
32 <input type="hidden" name="id" value="<?php echo wpdm_query_var('id', 'esc_attr'); ?>" />
33 <input type="text" name="email_template[subject]" required="required" title="<?php echo __( "Email Subject" , "download-manager" ); ?>" placeholder="<?php echo __( "Email Subject" , "download-manager" ); ?>" x-moz-errormessage="<?php echo __( "Email Subject" , "download-manager" ); ?>" value="<?php echo $tpl['subject']; ?>" class="form-control input-lg">
34 <ul class="nav nav-tabs" style="margin-top: 10px; ">
35 <li class="active"><a href="#code" data-toggle="tab"><?php echo __( "Message" , "download-manager" ); ?></a></li>
36 <li><a href="#preview" data-toggle="tab"><?php echo __( "Preview" , "download-manager" ); ?></a></li>
37 </ul>
38 <div class="tab-content tpleditor">
39 <div class="tab-pane active" id="code">
40
41 <?php wp_editor(stripslashes($tpl['message']),'content', array('textarea_name' => 'email_template[message]')); ?>
42 </div>
43 <div class="tab-pane" id="preview">
44 <i class="fas fa-sun fa-spin"></i> Loading Preview...
45 </div>
46 </div>
47 <br/>
48 <?php
49 if($info['for'] == 'admin'){ ?>
50 <div class="row">
51 <div class="col-md-12">
52 <div class="form-group">
53 <div class="input-group input-group-lg">
54 <div class="input-group-addon ttip" title="<?php echo __( "Recipient's Email" , "download-manager" ); ?>"><i class="fas fa-paper-plane"></i></div>
55 <input placeholder="<?php echo __( "Recipient's Email" , "download-manager" ); ?>" type="text" class="form-control input-lg" name="email_template[to_email]" value="<?php echo $tpl['to_email']; ?>">
56 </div>
57
58 </div>
59 </div>
60
61 </div>
62 <?php } ?>
63 <div class="row">
64 <div class="col-md-6">
65 <div class="form-group">
66 <?php echo __( "From Name" , "download-manager" ); ?>
67 <input type="text" class="form-control" name="email_template[from_name]" value="<?php echo $tpl['from_name']; ?>">
68
69 </div>
70 </div>
71 <div class="col-md-6">
72 <div class="form-group">
73 <?php echo __( "From Email" , "download-manager" ); ?>
74 <input type="text" class="form-control" name="email_template[from_email]" value="<?php echo $tpl['from_email']; ?>">
75
76 </div>
77 </div>
78 </div>
79
80
81
82
83 <br/>
84 <div class="text-right"><button type="submit" value="" class="btn btn-primary btn-lg"><i class="fas fa-hdd"></i> <?php echo __( "Save Changes" , "download-manager" ); ?></button></div>
85
86
87
88
89 <br/>
90
91
92
93
94 </form>
95
96
97 </div>
98
99
100
101
102
103
104
105
106
107 <div class="col-md-4">
108 <div class="panel panel-default">
109 <div class="panel-heading"><?php echo __( "Template Variables" , "download-manager" ); ?></div>
110
111 <table id="template_tags" class="table" style="margin-top: -1px">
112 <?php foreach (\WPDM\__\Email::tags() as $tag => $info){ ?>
113 <tr><td><input type="text" readonly="readonly" class="form-control" onclick="this.select()" value="<?php echo $tag; ?>" style="font-size:10px;width: 120px;text-align: center;"></td><td><?php echo $info['desc']; ?></td></tr>
114 <?php } ?>
115
116 </table>
117
118
119 </div>
120 </div>
121 </div>
122 <script>
123
124 jQuery.fn.extend({
125 insertAtCaret: function(myValue){
126 return this.each(function(i) {
127 if (document.selection) {
128 //For browsers like Internet Explorer
129 this.focus();
130 var sel = document.selection.createRange();
131 sel.text = myValue;
132 this.focus();
133 }
134 else if (this.selectionStart || this.selectionStart == '0') {
135 //For browsers like Firefox and Webkit based
136 var startPos = this.selectionStart;
137 var endPos = this.selectionEnd;
138 var scrollTop = this.scrollTop;
139 this.value = this.value.substring(0, startPos)+myValue+this.value.substring(endPos,this.value.length);
140 this.focus();
141 this.selectionStart = startPos + myValue.length;
142 this.selectionEnd = startPos + myValue.length;
143 this.scrollTop = scrollTop;
144 } else {
145 this.value += myValue;
146 this.focus();
147 }
148 });
149 }
150 });
151
152 jQuery(function(){
153 jQuery('a[href="#preview"]').on('shown.bs.tab', function (e) {
154 jQuery('#preview').html('<i class="fas fa-sun fa-spin"></i> Loading Preview...');
155 tinyMCE.triggerSave();
156 jQuery('#email-editor-form').ajaxSubmit({
157 success: function (res) {
158 jQuery('#preview').html("<iframe style='width:100%;height:700px;border:0;' src='edit.php?action=email_template_preview&id=<?php echo wpdm_query_var('id', 'txt'); ?>&__empnonce=<?php echo wp_create_nonce(WPDM_PRI_NONCE); ?>'></iframe>");
159 }
160 });
161 //jQuery.post(ajaxurl,{action:'',template:'<?php echo wpdm_query_var('id'); ?>'},function(res){
162
163 //});
164 });
165
166 jQuery('#email-editor-form').on('submit', function(e) {
167 e.preventDefault();
168 tinyMCE.triggerSave();
169 WPDM.blockUI('#email-editor-form');
170 jQuery(this).ajaxSubmit({
171 url: ajaxurl+'?action=wpdm_save_email_template',
172 success: function (res) {
173 WPDM.unblockUI('#email-editor-form');
174 }
175 });
176 });
177
178 jQuery('.dropdown-menu a').click(function(e){
179 e.preventDefault();
180 var tag = jQuery(this).attr('href').replace('#','');
181 jQuery('#content').insertAtCaret(tag);
182 });
183
184 jQuery('#template_tags .form-control').on('select', function(){
185 try {
186 var successful = document.execCommand('copy');
187 var msg = successful ? 'successful' : 'unsuccessful';
188 console.log('Copying text command was ' + msg);
189 } catch (err) {
190 console.log('Oops, unable to copy');
191 }
192 })
193 });
194
195 </script>
196
197
198
199 <div style="clear: both"></div>
200
201
202 <?php } else { ?>
203
204 <div class="alert alert-danger" style="margin: 40px">
205 <i class="fa fa-exclamation-triangle"></i> <?php echo __( "Eamil template not found.", "download-manager" ) ?>
206 </div>
207
208 <?php } ?>
209
210
211 </div>
212
213
214 <style>
215 #template_tags .form-control{
216 background: #fafafa;
217 }
218 #wp-content-editor-tools{
219 background: #ffffff;
220 }
221 .wp-editor-tabs{
222 margin-top: 3px;
223 }
224 .input-group-lg .input-group-addon{
225 border-radius: 3px 0 0 3px !important;
226 }
227 .input-group-lg .form-control{
228 border-radius: 0 3px 3px 0 !important;
229 }
230 </style>
231