Contact Form by WD – responsive drag & drop contact form builder tool - Version 1.8.37

Version Description

  • Fixed: Bug on edit_old() function for old forms.
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Contact Form by WD – responsive drag & drop contact form builder tool
Version 1.8.37
Comparing to
See all releases

Code changes from version 1.8.36 to 1.8.37

admin/views/FMViewManage_fmc.php CHANGED
@@ -1,4262 +1,4283 @@
1
- <?php
2
-
3
- class FMViewManage_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- // Constructor & Destructor //
17
- ////////////////////////////////////////////////////////////////////////////////////////
18
- public function __construct($model) {
19
- $this->model = $model;
20
- }
21
-
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- $rows_data = $this->model->get_rows_data();
27
- $page_nav = $this->model->page_nav();
28
- $search_value = ((isset($_POST['search_value'])) ? esc_html($_POST['search_value']) : '');
29
- $search_select_value = ((isset($_POST['search_select_value'])) ? (int) $_POST['search_select_value'] : 0);
30
- $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
31
- $order_by_array = array('id', 'title', 'mail');
32
- $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
33
- $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
34
- $ids_string = '';
35
- ?>
36
- <div class="fm-user-manual">
37
- This section allows you to create, edit forms.
38
- <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
39
- </div>
40
- <div class="fm-upgrade-pro">
41
- <a target="_blank" href="https://web-dorado.com/files/fromContactForm.php">
42
- <div class="fm-upgrade-img">
43
- UPGRADE TO PRO VERSION
44
- <span></span>
45
- </div>
46
- </a>
47
- </div>
48
- <div class="fm-clear"></div>
49
- <form onkeypress="fm_doNothing(event)" class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fmc" style="width:99%;">
50
- <?php wp_nonce_field('nonce_fmc', 'nonce_fmc'); ?>
51
- <div class="fm-page-banner">
52
- <div class="fm-logo">
53
- </div>
54
- <div class="fm-logo-title">Contact Form</br>Maker</div>
55
- <button class="fm-button add-button medium" onclick="fm_set_input_value('task', 'add'); fm_form_submit(event, 'manage_form')">
56
- <span></span>
57
- Add New
58
- </button>
59
- </div>
60
- <div class="tablenav top">
61
- <?php
62
- WDW_FMC_Library::search('Title', $search_value, 'manage_form');
63
- WDW_FMC_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'manage_form');
64
- ?>
65
- </div>
66
- <table class="wp-list-table widefat fixed pages">
67
- <thead>
68
- <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;"/></th>
69
- <th class="table_small_col <?php if ($order_by == 'id') { echo $order_class; } ?>">
70
- <a onclick="fm_set_input_value('task', ''); fm_set_input_value('order_by', 'id'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'manage_form')" href="">
71
- <span>ID</span><span class="sorting-indicator"></span></a>
72
- </th>
73
- <th class="<?php if ($order_by == 'title') { echo $order_class; } ?>">
74
- <a onclick="fm_set_input_value('task', ''); fm_set_input_value('order_by', 'title'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'title' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'manage_form')" href="">
75
- <span>Title</span><span class="sorting-indicator"></span></a>
76
- </th>
77
- <th class="<?php if ($order_by == 'mail') { echo $order_class; } ?>">
78
- <a onclick="fm_set_input_value('task', ''); fm_set_input_value('order_by', 'mail'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'mail' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'manage_form')" href="">
79
- <span>Email to send submissions to</span><span class="sorting-indicator"></span></a>
80
- </th>
81
- <th class="table_big_col">Shortcode</th>
82
- <th class="table_large_col">PHP function</th>
83
- <th class="table_small_col">Edit</th>
84
- <th class="table_small_col">
85
- <a title="Delete selected items" href="" onclick="if (confirm('Do you want to delete selected items?')) { fm_set_input_value('task', 'delete_all'); fm_form_submit(event, 'manage_form'); } else { return false; }">Delete</a>
86
- </th>
87
- </thead>
88
- <tbody id="tbody_arr">
89
- <?php
90
- if ($rows_data) {
91
- foreach ($rows_data as $row_data) {
92
- $alternate = (!isset($alternate) || $alternate == '') ? 'class="alternate"' : '';
93
- $old = '';
94
- if (isset($row_data->form) && ($row_data->form != '')) {
95
- $old = '_old';
96
- }
97
- ?>
98
- <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
99
- <td class="table_small_col check-column">
100
- <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox"/>
101
- </td>
102
- <td class="table_small_col"><?php echo $row_data->id; ?></td>
103
- <td>
104
- <a onclick="fm_set_input_value('task', 'edit<?php echo $old; ?>'); fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'manage_form')" href="" title="Edit"><?php echo $row_data->title; ?></a>
105
- </td>
106
- <td><?php echo $row_data->mail; ?></td>
107
- <td class="table_big_col" style="padding-left: 0; padding-right: 0;">
108
- <input type="text" value='[wd_contact_form id="<?php echo $row_data->id; ?>"]' onclick="fm_select_value(this)" size="12" readonly="readonly" style="padding-left: 1px; padding-right: 1px;"/>
109
- </td>
110
- <td class="table_large_col" style="padding-left: 0; padding-right: 0;">
111
- <input type="text" value='&#60;?php wd_contact_form_maker(<?php echo $row_data->id; ?>); ?&#62;' onclick="fm_select_value(this)" readonly="readonly" style="padding-left: 1px; padding-right: 1px;"/>
112
- </td>
113
- <td class="table_small_col">
114
- <button class="fm-icon edit-icon" onclick="fm_set_input_value('task', 'edit<?php echo $old; ?>'); fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'manage_form')">
115
- <span></span>
116
- </button>
117
- </td>
118
- <td class="table_small_col">
119
- <button class="fm-icon delete-icon" onclick="if (confirm('Do you want to delete selected item(s)?')) { fm_set_input_value('task', 'delete'); fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'manage_form'); } else { return false; }">
120
- <span></span>
121
- </button>
122
- </td>
123
- </tr>
124
- <?php
125
- $ids_string .= $row_data->id . ',';
126
- }
127
- }
128
- ?>
129
- </tbody>
130
- </table>
131
- <input id="task" name="task" type="hidden" value=""/>
132
- <input id="current_id" name="current_id" type="hidden" value=""/>
133
- <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>"/>
134
- <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc"/>
135
- <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>"/>
136
- </form>
137
- <?php
138
- }
139
-
140
- public function edit($id) {
141
- ?>
142
- <img src="<?php echo WD_FMC_URL . '/images/buttons.png'; ?>" style="display:none;"/>
143
- <?php
144
- $row = $this->model->get_row_data_new($id);
145
- $themes = $this->model->get_theme_rows_data();
146
- $labels = array();
147
- $label_id = array();
148
- $label_order_original = array();
149
- $label_type = array();
150
- $label_all = explode('#****#', $row->label_order);
151
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
152
- foreach ($label_all as $key => $label_each) {
153
- $label_id_each = explode('#**id**#', $label_each);
154
- array_push($label_id, $label_id_each[0]);
155
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
156
- array_push($label_order_original, addslashes($label_oder_each[0]));
157
- array_push($label_type, $label_oder_each[1]);
158
- }
159
- $labels['id'] = '"' . implode('","', $label_id) . '"';
160
- $labels['label'] = '"' . implode('","', $label_order_original) . '"';
161
- $labels['type'] = '"' . implode('","', $label_type) . '"';
162
- $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
163
- ?>
164
- <script type="text/javascript">
165
- var plugin_url = "<?php echo WD_FMC_URL; ?>";
166
- var field_limitation = "<?php echo get_option("wd_cfield_limit", ''); ?>";
167
- </script>
168
- <script src="<?php echo WD_FMC_URL . '/js/formmaker_div_free.js'; ?>?ver=<?php echo get_option("wd_form_maker_version"); ?>" type="text/javascript"></script>
169
- <script type="text/javascript">
170
- form_view = 1;
171
- form_view_count = 1;
172
- form_view_max = 1;
173
- function submitbutton() {
174
- <?php if ($id) { ?>
175
- if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
176
- alert('Please wait while page loading.');
177
- return false;
178
- }
179
- <?php } ?>
180
- tox = '';
181
- form_fields = '';
182
- document.getElementById('take').style.display = "none";
183
- document.getElementById('page_bar').style.display = "none";
184
- jQuery('#saving').html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>');
185
- jQuery('.wdform_section').each(function() {
186
- var this2 = this;
187
- jQuery(this2).find('.wdform_column').each(function() {
188
- if(!jQuery(this).html() && jQuery(this2).children().length>1)
189
- jQuery(this).remove();
190
- });
191
- });
192
- remove_whitespace(document.getElementById('take'));
193
- l_id_array = [<?php echo $labels['id']?>];
194
- l_label_array = [<?php echo $labels['label']?>];
195
- l_type_array = [<?php echo $labels['type']?>];
196
- l_id_removed = [];
197
- for (x = 0; x < l_id_array.length; x++) {
198
- l_id_removed[l_id_array[x]] = true;
199
- }
200
- for (t = 1; t <= form_view_max; t++) {
201
- if (document.getElementById('form_id_tempform_view' + t)) {
202
- wdform_page = document.getElementById('form_id_tempform_view' + t);
203
- remove_whitespace(wdform_page);
204
- n = wdform_page.childNodes.length - 2;
205
- for (q = 0; q <= n; q++) {
206
- if (!wdform_page.childNodes[q].getAttribute("wdid")) {
207
- wdform_section = wdform_page.childNodes[q];
208
- for (x = 0; x < wdform_section.childNodes.length; x++) {
209
- wdform_column = wdform_section.childNodes[x];
210
- if (wdform_column.firstChild) {
211
- for (y=0; y < wdform_column.childNodes.length; y++) {
212
- is_in_old = false;
213
- wdform_row = wdform_column.childNodes[y];
214
- if (wdform_row.nodeType == 3) {
215
- continue;
216
- }
217
- wdid = wdform_row.getAttribute("wdid");
218
- if (!wdid) {
219
- continue;
220
- }
221
- l_id = wdid;
222
- l_label = document.getElementById(wdid + '_element_labelform_id_temp').innerHTML;
223
- l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
224
- wdtype = wdform_row.firstChild.getAttribute('type');
225
-
226
- for (var z = 0; z < l_id_array.length; z++) {
227
- if (l_type_array[z] == "type_address") {
228
- if (document.getElementById(l_id + "_mini_label_street1") || document.getElementById(l_id + "_mini_label_street2") || document.getElementById(l_id + "_mini_label_city") || document.getElementById(l_id + "_mini_label_state") || document.getElementById(l_id+"_mini_label_postal") || document.getElementById(l_id+"_mini_label_country")) {
229
- l_id_removed[l_id_array[z]] = false;
230
- }
231
- }
232
- else {
233
- if (l_id_array[z] == wdid) {
234
- l_id_removed[l_id] = false;
235
- }
236
- }
237
-
238
- }
239
-
240
- if (wdtype == "type_address") {
241
- addr_id = parseInt(wdid);
242
- id_for_country = addr_id;
243
- if (document.getElementById(id_for_country + "_mini_label_street1"))
244
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_street1").innerHTML + '#**label**#type_address#****#';
245
- addr_id++;
246
- if (document.getElementById(id_for_country + "_mini_label_street2"))
247
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_street2").innerHTML + '#**label**#type_address#****#';
248
- addr_id++;
249
- if (document.getElementById(id_for_country+"_mini_label_city"))
250
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_city").innerHTML + '#**label**#type_address#****#';
251
- addr_id++;
252
- if (document.getElementById(id_for_country + "_mini_label_state"))
253
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_state").innerHTML + '#**label**#type_address#****#';
254
- addr_id++;
255
- if (document.getElementById(id_for_country + "_mini_label_postal"))
256
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_postal").innerHTML + '#**label**#type_address#****#';
257
- addr_id++;
258
- if (document.getElementById(id_for_country+"_mini_label_country")) {
259
- tox=tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_country").innerHTML + '#**label**#type_address#****#';
260
- }
261
-
262
- }
263
- else {
264
- tox = tox + wdid + '#**id**#' + l_label + '#**label**#' + wdtype + '#****#';
265
- }
266
-
267
- id = wdid;
268
- form_fields += wdid + "*:*id*:*";
269
- form_fields += wdtype + "*:*type*:*";
270
- w_choices = new Array();
271
- w_choices_value=new Array();
272
- w_choices_checked = new Array();
273
- w_choices_disabled = new Array();
274
- w_choices_params =new Array();
275
- w_allow_other_num = 0;
276
- w_property = new Array();
277
- w_property_type = new Array();
278
- w_property_values = new Array();
279
- w_choices_price = new Array();
280
- if (document.getElementById(id+'_element_labelform_id_temp').innerHTML) {
281
- w_field_label = document.getElementById(id + '_element_labelform_id_temp').innerHTML.replace(/(\r\n|\n|\r)/gm," ");
282
- }
283
- else {
284
- w_field_label = " ";
285
- }
286
- if (document.getElementById(id + '_label_sectionform_id_temp')) {
287
- if (document.getElementById(id + '_label_sectionform_id_temp').style.display == "block") {
288
- w_field_label_pos = "top";
289
- }
290
- else {
291
- w_field_label_pos = "left";
292
- }
293
- }
294
- if (document.getElementById(id + "_elementform_id_temp")) {
295
- s = document.getElementById(id + "_elementform_id_temp").style.width;
296
- w_size=s.substring(0,s.length - 2);
297
- }
298
- if (document.getElementById(id + "_label_sectionform_id_temp")) {
299
- s = document.getElementById(id + "_label_sectionform_id_temp").style.width;
300
- w_field_label_size = s.substring(0, s.length - 2);
301
- }
302
- if (document.getElementById(id + "_requiredform_id_temp")) {
303
- w_required = document.getElementById(id + "_requiredform_id_temp").value;
304
- }
305
- if (document.getElementById(id + "_uniqueform_id_temp")) {
306
- w_unique = document.getElementById(id + "_uniqueform_id_temp").value;
307
- }
308
- if (document.getElementById(id + '_label_sectionform_id_temp')) {
309
- w_class = document.getElementById(id + '_label_sectionform_id_temp').getAttribute("class");
310
- if (!w_class) {
311
- w_class = "";
312
- }
313
- }
314
- gen_form_fields();
315
- wdform_row.innerHTML = "%" + id + " - " + l_label + "%";
316
- }
317
- }
318
- }
319
- }
320
- else {
321
- id = wdform_page.childNodes[q].getAttribute("wdid");
322
- w_editor = document.getElementById(id + "_element_sectionform_id_temp").innerHTML;
323
- form_fields += id + "*:*id*:*";
324
- form_fields += "type_section_break" + "*:*type*:*";
325
- form_fields += "custom_" + id + "*:*w_field_label*:*";
326
- form_fields += w_editor + "*:*w_editor*:*";
327
- form_fields += "*:*new_field*:*";
328
- wdform_page.childNodes[q].innerHTML = "%" + id + " - " + "custom_" + id + "%";
329
- }
330
- }
331
- }
332
- }
333
- document.getElementById('label_order_current').value = tox;
334
-
335
- for (x = 0; x < l_id_array.length; x++) {
336
- if (l_id_removed[l_id_array[x]]) {
337
- tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
338
- }
339
- }
340
-
341
- document.getElementById('label_order').value = tox;
342
- document.getElementById('form_fields').value = form_fields;
343
- refresh_();
344
- document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
345
- document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
346
- document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
347
- return true;
348
- }
349
-
350
- gen = <?php echo (($id != 0) ? $row->counter : 1); ?>;
351
-
352
- function enable() {
353
- alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
354
- for (x = 0; x < 14; x++) {
355
- document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png?ver=<?php echo get_option("wd_form_maker_version"); ?>";
356
- }
357
- if (document.getElementById('formMakerDiv').style.display == 'block') {
358
- jQuery('#formMakerDiv').slideToggle(200);
359
- }
360
- else {
361
- jQuery('#formMakerDiv').slideToggle(400);
362
- }
363
-
364
- if (document.getElementById('formMakerDiv1').style.display == 'block') {
365
- jQuery('#formMakerDiv1').slideToggle(200);
366
- }
367
- else {
368
- jQuery('#formMakerDiv1').slideToggle(400);
369
- }
370
- document.getElementById('when_edit').style.display = 'none';
371
- }
372
-
373
- function enable2() {
374
- alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
375
- for (x = 0; x < 14; x++) {
376
- document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png?ver=<?php echo get_option("wd_form_maker_version"); ?>";
377
- }
378
- if (document.getElementById('formMakerDiv').style.display == 'block') {
379
- jQuery('#formMakerDiv').slideToggle(200);
380
- }
381
- else {
382
- jQuery('#formMakerDiv').slideToggle(400);
383
- }
384
-
385
- if (document.getElementById('formMakerDiv1').style.display == 'block') {
386
- jQuery('#formMakerDiv1').slideToggle(200);
387
- }
388
- else {
389
- jQuery('#formMakerDiv1').slideToggle(400);
390
- }
391
- document.getElementById('when_edit').style.display = 'block';
392
- if (document.getElementById('field_types').offsetWidth) {
393
- document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
394
- }
395
- if (document.getElementById('field_types').offsetHeight) {
396
- document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
397
- }
398
- }
399
- </script>
400
- <div class="fm-user-manual">
401
- This section allows you to add fields to your form.
402
- <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-4.html">Read More in User Manual</a>
403
- </div>
404
- <div class="fm-upgrade-pro">
405
- <a target="_blank" href="https://web-dorado.com/files/fromContactForm.php">
406
- <div class="fm-upgrade-img">
407
- UPGRADE TO PRO VERSION
408
- <span></span>
409
- </div>
410
- </a>
411
- </div>
412
- <div class="fm-clear"></div>
413
- <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fmc" style="width:99%;">
414
- <?php wp_nonce_field('nonce_fmc', 'nonce_fmc'); ?>
415
- <h2 class="fm-h2-message"></h2>
416
- <div class="fm-page-header">
417
- <!-- <div class="fm-page-title">
418
- <?php echo $page_title; ?>
419
- </div> -->
420
- <div style="float:left;">
421
- <div class="fm-logo-edit-page"></div>
422
- <div class="fm-title-edit-page">Contact Form</br>Maker</div>
423
- </div>
424
- <div class="fm-page-actions">
425
- <button class="fm-button form-options-button medium" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_options');">
426
- <span></span>
427
- Form Options
428
- </button>
429
- <button class="fm-button form-layout-button medium" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_layout');">
430
- <span></span>
431
- Form Layout
432
- </button>
433
- <div style="height:40px; border-right: 1px solid #848484; display: inline-block; width: 5px; vertical-align: bottom; margin-right: 5px;"></div>
434
- <?php
435
- if(isset($row->backup_id) )
436
- if($row->backup_id!="") {
437
- global $wpdb;
438
- $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id > ".$row->backup_id." AND id = ".$row->id." ORDER BY backup_id ASC LIMIT 0 , 1 ";
439
- $backup_id = $wpdb->get_var($query);
440
- if($backup_id) { ?>
441
- <button class="fm-button redo-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; jQuery('#saving_text').html('Redo');fm_set_input_value('task', 'redo');">
442
- <span></span>
443
- Redo
444
- </button>
445
- <?php
446
- }
447
- $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id < ".$row->backup_id." AND id = ".$row->id." ORDER BY backup_id DESC LIMIT 0 , 1 ";
448
- $backup_id = $wpdb->get_var($query);
449
-
450
- if($backup_id) { ?>
451
- <button class="fm-button undo-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; jQuery('#saving_text').html('Undo');fm_set_input_value('task', 'undo');">
452
- <span></span>
453
- Undo
454
- </button>
455
- <?php
456
- }
457
- }
458
- ?>
459
-
460
- <?php if ($id) { ?>
461
- <button class="fm-button save-as-copy-button medium" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save_as_copy');">
462
- <span></span>
463
- Save as Copy
464
- </button>
465
- <?php } ?>
466
- <button class="fm-button save-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save');">
467
- <span></span>
468
- Save
469
- </button>
470
- <button class="fm-button apply-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'apply');">
471
- <span></span>
472
- Apply
473
- </button>
474
- <button class="fm-button cancel-button small" onclick="fm_set_input_value('task', 'cancel');">
475
- <span></span>
476
- Cancel
477
- </button>
478
- </div>
479
- <div class="fm-clear"></div>
480
- </div>
481
- <div class="fm-title">
482
- <span style="">Form title:&nbsp;</span>
483
- <input id="title" name="title" value="<?php echo $row->title; ?>"/>
484
- </div>
485
- <div class="fm-clear"></div>
486
- <br/>
487
- <div class="fm-theme-banner">
488
- <div class="fm-theme" style="float:left;">
489
-
490
- <span style="">Theme:&nbsp;</span>
491
- <select id="theme" name="theme" onChange="set_preview()">
492
- <?php
493
- foreach ($themes as $theme) {
494
- ?>
495
- <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
496
- <?php
497
- }
498
- ?>
499
- </select>
500
- <button id="preview_form" class="fm-button preview-button small" onclick="tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'form_id' => $row->id, 'test_theme' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>'); return false;">
501
- <span></span>
502
- Preview
503
- </button>
504
- <button id="edit_css" class="fm-button options-edit-button small" onclick="tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS_fmc', 'id' => $row->theme, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>'); return false;">
505
- <span></span>
506
- Edit CSS
507
- </button>
508
- </div>
509
- <div style="float:right;">
510
- <button class="fm-button add-new-button large" onclick="enable(); Enable(); return false;">
511
- Add a New Field
512
- <span></span>
513
- </button>
514
- </div>
515
- </div>
516
- <div class="fm-clear"></div>
517
- <div id="formMakerDiv" onclick="close_window()"></div>
518
- <div id="formMakerDiv1">
519
- <table class="formMakerDiv1_table" border="0" width="100%" cellpadding="0" cellspacing="0" height="100%">
520
- <tr>
521
- <td style="padding:0px">
522
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" >
523
- <tr valign="top">
524
- <td width="20%" height="100%" id="field_types">
525
- <div id="when_edit" style="display: none;"></div>
526
- <table border="0" cellpadding="0" cellspacing="3" width="100%" style="border-collapse: separate; border-spacing: 3px;">
527
- <tbody>
528
- <tr>
529
- <td align="center" onclick="addRow('customHTML')" class="field_buttons" id="table_editor">
530
- <img src="<?php echo WD_FMC_URL; ?>/images/customHTML.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_customHTML">
531
- <div>Custom HTML</div>
532
- </td>
533
- <td align="center" onclick="addRow('text')" class="field_buttons" id="table_text">
534
- <img src="<?php echo WD_FMC_URL; ?>/images/text.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_text">
535
- <div>Text input</div>
536
- </td>
537
- </tr>
538
- <tr>
539
- <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" class="field_buttons field_disabled" id="table_checkbox">
540
- <img src="<?php echo WD_FMC_URL; ?>/images/checkbox.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_checkbox">
541
- <div>Multiple Choice</div>
542
- </td>
543
- <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" class="field_buttons field_disabled" id="table_radio">
544
- <img src="<?php echo WD_FMC_URL; ?>/images/radio.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_radio">
545
- <div>Single Choice</div>
546
- </td>
547
- </tr>
548
- <tr>
549
- <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" class="field_buttons field_disabled" id="table_survey">
550
- <img src="<?php echo WD_FMC_URL; ?>/images/survey.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_survey">
551
- <div>Survey Tools</div>
552
- </td>
553
- <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" class="field_buttons field_disabled" id="table_time_and_date">
554
- <img src="<?php echo WD_FMC_URL; ?>/images/time_and_date.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_time_and_date">
555
- <div>Time and Date</div>
556
- </td>
557
- </tr>
558
- <tr>
559
- <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" class="field_buttons field_disabled" id="table_select">
560
- <img src="<?php echo WD_FMC_URL; ?>/images/select.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_select">
561
- <div>Select Box</div>
562
- </td>
563
- <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" class="field_buttons field_disabled" id="table_file_upload">
564
- <img src="<?php echo WD_FMC_URL; ?>/images/file_upload.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_file_upload">
565
- <div>File Upload</div>
566
- </td>
567
- </tr>
568
- <tr>
569
- <td align="center" onclick="addRow('section_break')" class="field_buttons" id="table_section_break">
570
- <img src="<?php echo WD_FMC_URL; ?>/images/section_break.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_section_break">
571
- <div>Section Break</div>
572
- </td>
573
- <td align="center" onclick="addRow('page_break')" class="field_buttons" id="table_page_break">
574
- <img src="<?php echo WD_FMC_URL; ?>/images/page_break.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_page_break">
575
- <div>Page Break</div>
576
- </td>
577
- </tr>
578
- <tr>
579
- <td align="center" onclick="addRow('map')" class="field_buttons" id="table_map">
580
- <img src="<?php echo WD_FMC_URL; ?>/images/map.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_map">
581
- <div>Map</div>
582
- </td>
583
- <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" id="table_paypal" class="field_buttons field_disabled">
584
- <img src="<?php echo WD_FMC_URL; ?>/images/paypal.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_paypal">
585
- <div>PayPal</div>
586
- </td>
587
- </tr>
588
- <tr>
589
- <td align="center" onclick="addRow('captcha')" class="field_buttons" id="table_captcha">
590
- <img src="<?php echo WD_FMC_URL; ?>/images/captcha.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_captcha">
591
- <div>Captcha</div>
592
- </td>
593
- <td align="center" onclick="addRow('button')" id="table_button" class="field_buttons">
594
- <img src="<?php echo WD_FMC_URL; ?>/images/button.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_button">
595
- <div>Button</div>
596
- </td>
597
- </tr>
598
- </tbody>
599
- </table>
600
- </td>
601
- <td width="40%" height="100%" align="left">
602
- <div id="edit_table"></div>
603
- </td>
604
- <td align="center" valign="top" style="background: url("<?php echo WD_FMC_URL . '/images/border2.png'; ?>") repeat-y;">&nbsp;</td>
605
- <td style="padding:15px;">
606
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" >
607
- <tr>
608
- <td align="right">
609
- <input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
610
- At The End
611
- <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
612
- At The Beginning
613
- <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
614
- Before
615
- <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" onclick="change_before()" disabled="disabled"></select>
616
- <br>
617
- <button class="fm-button field-save-button small" onclick="add(0, false); return false;">
618
- Save
619
- <span></span>
620
- </button>
621
- <button class="fm-button cancel-button small" onclick="close_window(); return false;">
622
- Cancel
623
- <span></span>
624
- </button>
625
- <hr style="margin-bottom:10px" />
626
- </td>
627
- </tr>
628
- <tr height="100%" valign="top">
629
- <td id="show_table"></td>
630
- </tr>
631
- </table>
632
- </td>
633
- </tr>
634
- </table>
635
- </td>
636
- </tr>
637
- </table>
638
- <input type="hidden" id="old" />
639
- <input type="hidden" id="old_selected" />
640
- <input type="hidden" id="element_type" />
641
- <input type="hidden" id="editing_id" />
642
- <input type="hidden" value="<?php echo WD_FMC_URL; ?>" id="form_plugins_url" />
643
- <div id="main_editor" style="position: fixed; display: none; z-index: 140;">
644
- <?php if (user_can_richedit()) {
645
- wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
646
- }
647
- else { ?>
648
- <textarea name="form_maker_editor" id="form_maker_editor" cols="40" rows="5" style="width: 440px; height: 350px;" class="mce_editable" aria-hidden="true"></textarea>
649
- <?php
650
- }
651
- ?>
652
- </div>
653
- </div>
654
- <?php if (!function_exists('the_editor')) { ?>
655
- <iframe id="tinymce" style="display: none;"></iframe>
656
- <?php } ?>
657
-
658
- <div class="fm-edit-content">
659
- <div class="fm-drag-and-drop">
660
- <div>
661
- <label for="enable_sortable">Enable Drag & Drop</label>
662
- <button name="sortable" id="enable_sortable" class="fm-checkbox-radio-button <?php echo $row->sortable == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="enable_drag(this); return false;" value="<?php echo $row->sortable; ?>">
663
- <span></span>
664
- </button>
665
- <input type="hidden" name="sortable" id="sortable_hidden" value="<?php echo $row->sortable; ?>"/>
666
- </div>
667
- <div>
668
- You can use drag and drop to move the fields up/down for the change of the order and left/right for creating columns within the form.
669
- </div>
670
- </div>
671
- <fieldset>
672
- <legend></legend>
673
- <?php if ($id) { ?>
674
- <div style="margin: 8px; display: table; width: 100%;" id="page_bar">
675
- <div id="page_navigation" style="display: table-row;">
676
- <div align="center" id="pages" show_title="<?php echo $row->show_title; ?>" show_numbers="<?php echo $row->show_numbers; ?>" type="<?php echo $row->pagination; ?>" style="display: table-cell; width:90%;"></div>
677
- <div align="left" id="edit_page_navigation" style="display: table-cell; vertical-align: middle;"></div>
678
- </div>
679
- </div>
680
- <div id="take" class="main">
681
- <?php echo $row->form_front; ?>
682
- </div>
683
- <?php } else { ?>
684
- <div style="margin:8px; display:table; width:100%" id="page_bar">
685
- <div id="page_navigation" style="display:table-row">
686
- <div align="center" id="pages" show_title="false" show_numbers="true" type="none" style="display:table-cell; width:90%"></div>
687
- <div align="left" id="edit_page_navigation" style="display:table-cell; vertical-align: middle;"></div>
688
- </div>
689
- </div>
690
- <div id="take" class="main">
691
- <div class="wdform-page-and-images" style="display:table; border-top:0px solid black;">
692
- <div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false">
693
- <div class="wdform_section">
694
- <div class="wdform_column"></div>
695
- </div>
696
- <div valign="top" class="wdform_footer" style="width: 100%;">
697
- <div style="width: 100%;">
698
- <div style="width: 100%; display: table; padding-top:10px;">
699
- <div style="display: table-row-group;">
700
- <div id="form_id_temppage_nav1" style="display: table-row;"></div>
701
- </div>
702
- </div>
703
- </div>
704
- </div>
705
- </div>
706
- <div id="form_id_tempform_view_img1" style="float: right;">
707
- <div>
708
- <img src="<?php echo WD_FMC_URL . '/images/minus.png?ver='. get_option("wd_form_maker_version"); ?>" title="Show or hide the page" class="page_toolbar" onClick="show_or_hide('1')" onMouseOver="chnage_icons_src(this,'minus')" onmouseout="chnage_icons_src(this,'minus')" id="show_page_img_1"/>
709
- <img src="<?php echo WD_FMC_URL . '/images/page_delete.png?ver='. get_option("wd_form_maker_version"); ?>" title="Delete the page" class="page_toolbar" onClick="remove_page('1')" onMouseOver="chnage_icons_src(this,'page_delete')" onmouseout="chnage_icons_src(this,'page_delete')"/>
710
- <img src="<?php echo WD_FMC_URL . '/images/page_delete_all.png?ver='. get_option("wd_form_maker_version"); ?>" title="Delete the page with fields" class="page_toolbar" onClick="remove_page_all('1')" onMouseOver="chnage_icons_src(this,'page_delete_all')" onmouseout="chnage_icons_src(this,'page_delete_all')"/>
711
- <img src="<?php echo WD_FMC_URL . '/images/page_edit.png?ver='. get_option("wd_form_maker_version"); ?>" title="Edit the page" class="page_toolbar" onClick="edit_page_break('1')" onMouseOver="chnage_icons_src(this,'page_edit')" onmouseout="chnage_icons_src(this,'page_edit')"/>
712
- </div>
713
- </div>
714
- </div>
715
- </div>
716
- <?php } ?>
717
- </fieldset>
718
- </div>
719
- <input type="hidden" name="form_front" id="form_front" />
720
- <input type="hidden" name="form_fields" id="form_fields" />
721
- <input type="hidden" name="pagination" id="pagination" />
722
- <input type="hidden" name="show_title" id="show_title" />
723
- <input type="hidden" name="show_numbers" id="show_numbers" />
724
- <input type="hidden" name="public_key" id="public_key" />
725
- <input type="hidden" name="private_key" id="private_key" />
726
- <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
727
- <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order; ?>" />
728
- <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
729
- <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
730
- <input type="hidden" id="araqel" value="0" />
731
- <input type="hidden" name="backup_id" id="backup_id" value="<?php echo $row->backup_id;?>">
732
-
733
- <?php if ($id) { ?>
734
- <script type="text/javascript">
735
- function set_preview() {
736
- jQuery("#preview_form").attr("onclick", "tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&test_theme=" + jQuery('#theme').val() + "&width=1000&height=500&TB_iframe=1'); return false;");
737
- jQuery("#edit_css").attr("onclick", "tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id=" + jQuery('#theme').val() + "&width=800&height=500&TB_iframe=1'); return false;");
738
- }
739
- function formOnload() {
740
- for (t = 0; t < <?php echo $row->counter; ?>; t++) {
741
- if (document.getElementById(t + "_typeform_id_temp")) {
742
- if (document.getElementById(t + "_typeform_id_temp").value == "type_map" || document.getElementById(t + "_typeform_id_temp").value == "type_mark_map") {
743
- if_gmap_init(t);
744
- for (q = 0; q < 20; q++) {
745
- if (document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q)) {
746
- w_long = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q));
747
- w_lat = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("lat" + q));
748
- w_info = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("info" + q));
749
- add_marker_on_map(t, q, w_long, w_lat, w_info, false);
750
- }
751
- }
752
- }
753
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_date") {
754
- // Calendar.setup({
755
- // inputField:t + "_elementform_id_temp",
756
- // ifFormat:document.getElementById(t + "_buttonform_id_temp").getAttribute('format'),
757
- // button:t + "_buttonform_id_temp",
758
- // align:"Tl",
759
- // singleClick:true,
760
- // firstDay:0
761
- // });
762
- }
763
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_name") {
764
- var myu = t;
765
- jQuery(document).ready(function () {
766
- jQuery("#" + myu + "_mini_label_first").click(function () {
767
- if (jQuery(this).children('input').length == 0) {
768
- var first = "<input type='text' id='first' class='first' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
769
- jQuery(this).html(first);
770
- jQuery("input.first").focus();
771
- jQuery("input.first").blur(function () {
772
- var id_for_blur = document.getElementById('first').parentNode.id.split('_');
773
- var value = jQuery(this).val();
774
- jQuery("#" + id_for_blur[0] + "_mini_label_first").text(value);
775
- });
776
- }
777
- });
778
- jQuery("label#" + myu + "_mini_label_last").click(function () {
779
- if (jQuery(this).children('input').length == 0) {
780
- var last = "<input type='text' id='last' class='last' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
781
- jQuery(this).html(last);
782
- jQuery("input.last").focus();
783
- jQuery("input.last").blur(function () {
784
- var id_for_blur = document.getElementById('last').parentNode.id.split('_');
785
- var value = jQuery(this).val();
786
- jQuery("#" + id_for_blur[0] + "_mini_label_last").text(value);
787
- });
788
- }
789
- });
790
- jQuery("label#" + myu + "_mini_label_title").click(function () {
791
- if (jQuery(this).children('input').length == 0) {
792
- var title_ = "<input type='text' id='title_' class='title_' style='outline:none; border:none; background:none; width:50px;' value=\"" + jQuery(this).text() + "\">";
793
- jQuery(this).html(title_);
794
- jQuery("input.title_").focus();
795
- jQuery("input.title_").blur(function () {
796
- var id_for_blur = document.getElementById('title_').parentNode.id.split('_');
797
- var value = jQuery(this).val();
798
- jQuery("#" + id_for_blur[0] + "_mini_label_title").text(value);
799
- });
800
- }
801
- });
802
- jQuery("label#" + myu + "_mini_label_middle").click(function () {
803
- if (jQuery(this).children('input').length == 0) {
804
- var middle = "<input type='text' id='middle' class='middle' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
805
- jQuery(this).html(middle);
806
- jQuery("input.middle").focus();
807
- jQuery("input.middle").blur(function () {
808
- var id_for_blur = document.getElementById('middle').parentNode.id.split('_');
809
- var value = jQuery(this).val();
810
- jQuery("#" + id_for_blur[0] + "_mini_label_middle").text(value);
811
- });
812
- }
813
- });
814
- });
815
- }
816
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_phone") {
817
- var myu = t;
818
- jQuery(document).ready(function () {
819
- jQuery("label#" + myu + "_mini_label_area_code").click(function () {
820
- if (jQuery(this).children('input').length == 0) {
821
- var area_code = "<input type='text' id='area_code' class='area_code' size='10' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
822
- jQuery(this).html(area_code);
823
- jQuery("input.area_code").focus();
824
- jQuery("input.area_code").blur(function () {
825
- var id_for_blur = document.getElementById('area_code').parentNode.id.split('_');
826
- var value = jQuery(this).val();
827
- jQuery("#" + id_for_blur[0] + "_mini_label_area_code").text(value);
828
- });
829
- }
830
- });
831
- jQuery("label#" + myu + "_mini_label_phone_number").click(function () {
832
- if (jQuery(this).children('input').length == 0) {
833
- var phone_number = "<input type='text' id='phone_number' class='phone_number' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
834
- jQuery(this).html(phone_number);
835
- jQuery("input.phone_number").focus();
836
- jQuery("input.phone_number").blur(function () {
837
- var id_for_blur = document.getElementById('phone_number').parentNode.id.split('_');
838
- var value = jQuery(this).val();
839
- jQuery("#" + id_for_blur[0] + "_mini_label_phone_number").text(value);
840
- });
841
- }
842
- });
843
- });
844
- }
845
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_date_fields") {
846
- var myu = t;
847
- jQuery(document).ready(function () {
848
- jQuery("label#" + myu + "_day_label").click(function () {
849
- if (jQuery(this).children('input').length == 0) {
850
- var day = "<input type='text' id='day' class='day' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
851
- jQuery(this).html(day);
852
- jQuery("input.day").focus();
853
- jQuery("input.day").blur(function () {
854
- var id_for_blur = document.getElementById('day').parentNode.id.split('_');
855
- var value = jQuery(this).val();
856
- jQuery("#" + id_for_blur[0] + "_day_label").text(value);
857
- });
858
- }
859
- });
860
- jQuery("label#" + myu + "_month_label").click(function () {
861
- if (jQuery(this).children('input').length == 0) {
862
- var month = "<input type='text' id='month' class='month' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
863
- jQuery(this).html(month);
864
- jQuery("input.month").focus();
865
- jQuery("input.month").blur(function () {
866
- var id_for_blur = document.getElementById('month').parentNode.id.split('_');
867
- var value = jQuery(this).val();
868
- jQuery("#" + id_for_blur[0] + "_month_label").text(value);
869
- });
870
- }
871
- });
872
- jQuery("label#" + myu + "_year_label").click(function () {
873
- if (jQuery(this).children('input').length == 0) {
874
- var year = "<input type='text' id='year' class='year' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
875
- jQuery(this).html(year);
876
- jQuery("input.year").focus();
877
- jQuery("input.year").blur(function () {
878
- var id_for_blur = document.getElementById('year').parentNode.id.split('_');
879
- var value = jQuery(this).val();
880
- jQuery("#" + id_for_blur[0] + "_year_label").text(value);
881
- });
882
- }
883
- });
884
- });
885
- }
886
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_time") {
887
- var myu = t;
888
- jQuery(document).ready(function () {
889
- jQuery("label#" + myu + "_mini_label_hh").click(function () {
890
- if (jQuery(this).children('input').length == 0) {
891
- var hh = "<input type='text' id='hh' class='hh' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
892
- jQuery(this).html(hh);
893
- jQuery("input.hh").focus();
894
- jQuery("input.hh").blur(function () {
895
- var id_for_blur = document.getElementById('hh').parentNode.id.split('_');
896
- var value = jQuery(this).val();
897
- jQuery("#" + id_for_blur[0] + "_mini_label_hh").text(value);
898
- });
899
- }
900
- });
901
- jQuery("label#" + myu + "_mini_label_mm").click(function () {
902
- if (jQuery(this).children('input').length == 0) {
903
- var mm = "<input type='text' id='mm' class='mm' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
904
- jQuery(this).html(mm);
905
- jQuery("input.mm").focus();
906
- jQuery("input.mm").blur(function () {
907
- var id_for_blur = document.getElementById('mm').parentNode.id.split('_');
908
- var value = jQuery(this).val();
909
- jQuery("#" + id_for_blur[0] + "_mini_label_mm").text(value);
910
- });
911
- }
912
- });
913
- jQuery("label#" + myu + "_mini_label_ss").click(function () {
914
- if (jQuery(this).children('input').length == 0) {
915
- var ss = "<input type='text' id='ss' class='ss' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
916
- jQuery(this).html(ss);
917
- jQuery("input.ss").focus();
918
- jQuery("input.ss").blur(function () {
919
- var id_for_blur = document.getElementById('ss').parentNode.id.split('_');
920
- var value = jQuery(this).val();
921
- jQuery("#" + id_for_blur[0] + "_mini_label_ss").text(value);
922
- });
923
- }
924
- });
925
- jQuery("label#" + myu + "_mini_label_am_pm").click(function () {
926
- if (jQuery(this).children('input').length == 0) {
927
- var am_pm = "<input type='text' id='am_pm' class='am_pm' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
928
- jQuery(this).html(am_pm);
929
- jQuery("input.am_pm").focus();
930
- jQuery("input.am_pm").blur(function () {
931
- var id_for_blur = document.getElementById('am_pm').parentNode.id.split('_');
932
- var value = jQuery(this).val();
933
- jQuery("#" + id_for_blur[0] + "_mini_label_am_pm").text(value);
934
- });
935
- }
936
- });
937
- });
938
- }
939
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_paypal_price") {
940
- var myu = t;
941
- jQuery(document).ready(function () {
942
- jQuery("#" + myu + "_mini_label_dollars").click(function () {
943
- if (jQuery(this).children('input').length == 0) {
944
- var dollars = "<input type='text' id='dollars' class='dollars' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
945
- jQuery(this).html(dollars);
946
- jQuery("input.dollars").focus();
947
- jQuery("input.dollars").blur(function () {
948
- var id_for_blur = document.getElementById('dollars').parentNode.id.split('_');
949
- var value = jQuery(this).val();
950
- jQuery("#" + id_for_blur[0] + "_mini_label_dollars").text(value);
951
- });
952
- }
953
- });
954
- jQuery("label#" + myu + "_mini_label_cents").click(function () {
955
- if (jQuery(this).children('input').length == 0) {
956
- var cents = "<input type='text' id='cents' class='cents' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
957
- jQuery(this).html(cents);
958
- jQuery("input.cents").focus();
959
- jQuery("input.cents").blur(function () {
960
- var id_for_blur = document.getElementById('cents').parentNode.id.split('_');
961
- var value = jQuery(this).val();
962
- jQuery("#" + id_for_blur[0] + "_mini_label_cents").text(value);
963
- });
964
- }
965
- });
966
- });
967
- }
968
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_address") {
969
- var myu = t;
970
- jQuery(document).ready(function () {
971
- jQuery("label#" + myu + "_mini_label_street1").click(function () {
972
- if (jQuery(this).children('input').length == 0) {
973
- var street1 = "<input type='text' id='street1' class='street1' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
974
- jQuery(this).html(street1);
975
- jQuery("input.street1").focus();
976
- jQuery("input.street1").blur(function () {
977
- var id_for_blur = document.getElementById('street1').parentNode.id.split('_');
978
- var value = jQuery(this).val();
979
- jQuery("#" + id_for_blur[0] + "_mini_label_street1").text(value);
980
- });
981
- }
982
- });
983
- jQuery("label#" + myu + "_mini_label_street2").click(function () {
984
- if (jQuery(this).children('input').length == 0) {
985
- var street2 = "<input type='text' id='street2' class='street2' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
986
- jQuery(this).html(street2);
987
- jQuery("input.street2").focus();
988
- jQuery("input.street2").blur(function () {
989
- var id_for_blur = document.getElementById('street2').parentNode.id.split('_');
990
- var value = jQuery(this).val();
991
- jQuery("#" + id_for_blur[0] + "_mini_label_street2").text(value);
992
- });
993
- }
994
- });
995
- jQuery("label#" + myu + "_mini_label_city").click(function () {
996
- if (jQuery(this).children('input').length == 0) {
997
- var city = "<input type='text' id='city' class='city' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
998
- jQuery(this).html(city);
999
- jQuery("input.city").focus();
1000
- jQuery("input.city").blur(function () {
1001
- var id_for_blur = document.getElementById('city').parentNode.id.split('_');
1002
- var value = jQuery(this).val();
1003
- jQuery("#" + id_for_blur[0] + "_mini_label_city").text(value);
1004
- });
1005
- }
1006
- });
1007
- jQuery("label#" + myu + "_mini_label_state").click(function () {
1008
- if (jQuery(this).children('input').length == 0) {
1009
- var state = "<input type='text' id='state' class='state' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
1010
- jQuery(this).html(state);
1011
- jQuery("input.state").focus();
1012
- jQuery("input.state").blur(function () {
1013
- var id_for_blur = document.getElementById('state').parentNode.id.split('_');
1014
- var value = jQuery(this).val();
1015
- jQuery("#" + id_for_blur[0] + "_mini_label_state").text(value);
1016
- });
1017
- }
1018
- });
1019
- jQuery("label#" + myu + "_mini_label_postal").click(function () {
1020
- if (jQuery(this).children('input').length == 0) {
1021
- var postal = "<input type='text' id='postal' class='postal' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
1022
- jQuery(this).html(postal);
1023
- jQuery("input.postal").focus();
1024
- jQuery("input.postal").blur(function () {
1025
- var id_for_blur = document.getElementById('postal').parentNode.id.split('_');
1026
- var value = jQuery(this).val();
1027
- jQuery("#" + id_for_blur[0] + "_mini_label_postal").text(value);
1028
- });
1029
- }
1030
- });
1031
- jQuery("label#" + myu + "_mini_label_country").click(function () {
1032
- if (jQuery(this).children('input').length == 0) {
1033
- var country = "<input type='country' id='country' class='country' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
1034
- jQuery(this).html(country);
1035
- jQuery("input.country").focus();
1036
- jQuery("input.country").blur(function () {
1037
- var id_for_blur = document.getElementById('country').parentNode.id.split('_');
1038
- var value = jQuery(this).val();
1039
- jQuery("#" + id_for_blur[0] + "_mini_label_country").text(value);
1040
- });
1041
- }
1042
- });
1043
- });
1044
- }
1045
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_scale_rating") {
1046
- var myu = t;
1047
- jQuery(document).ready(function () {
1048
- jQuery("#" + myu + "_mini_label_worst").click(function () {
1049
- if (jQuery(this).children('input').length == 0) {
1050
- var worst = "<input type='text' id='worst' class='worst' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
1051
- jQuery(this).html(worst);
1052
- jQuery("input.worst").focus();
1053
- jQuery("input.worst").blur(function () {
1054
- var id_for_blur = document.getElementById('worst').parentNode.id.split('_');
1055
- var value = jQuery(this).val();
1056
- jQuery("#" + id_for_blur[0] + "_mini_label_worst").text(value);
1057
- });
1058
- }
1059
- });
1060
- jQuery("label#" + myu + "_mini_label_best").click(function () {
1061
- if (jQuery(this).children('input').length == 0) {
1062
- var best = "<input type='text' id='best' class='best' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
1063
- jQuery(this).html(best);
1064
- jQuery("input.best").focus();
1065
- jQuery("input.best").blur(function () {
1066
- var id_for_blur = document.getElementById('best').parentNode.id.split('_');
1067
- var value = jQuery(this).val();
1068
- jQuery("#" + id_for_blur[0] + "_mini_label_best").text(value);
1069
- });
1070
- }
1071
- });
1072
- });
1073
- }
1074
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_spinner") {
1075
- var spinner_value = document.getElementById(t + "_elementform_id_temp").value;
1076
- var spinner_min_value = document.getElementById(t + "_min_valueform_id_temp").value;
1077
- var spinner_max_value = document.getElementById(t + "_max_valueform_id_temp").value;
1078
- var spinner_step = document.getElementById(t + "_stepform_id_temp").value;
1079
- jQuery("#" + t + "_elementform_id_temp")[0].spin = null;
1080
- spinner = jQuery("#" + t + "_elementform_id_temp").spinner();
1081
- spinner.spinner("value", spinner_value);
1082
- jQuery("#" + t + "_elementform_id_temp").spinner({ min:spinner_min_value});
1083
- jQuery("#" + t + "_elementform_id_temp").spinner({ max:spinner_max_value});
1084
- jQuery("#" + t + "_elementform_id_temp").spinner({ step:spinner_step});
1085
- }
1086
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_slider") {
1087
- var slider_value = document.getElementById(t + "_slider_valueform_id_temp").value;
1088
- var slider_min_value = document.getElementById(t + "_slider_min_valueform_id_temp").value;
1089
- var slider_max_value = document.getElementById(t + "_slider_max_valueform_id_temp").value;
1090
- var slider_element_value = document.getElementById(t + "_element_valueform_id_temp");
1091
- var slider_value_save = document.getElementById(t + "_slider_valueform_id_temp");
1092
- jQuery("#" + t + "_elementform_id_temp")[0].slide = null;
1093
- jQuery(function () {
1094
- jQuery("#" + t + "_elementform_id_temp").slider({
1095
- range:"min",
1096
- value:eval(slider_value),
1097
- min:eval(slider_min_value),
1098
- max:eval(slider_max_value),
1099
- slide:function (event, ui) {
1100
- slider_element_value.innerHTML = "" + ui.value;
1101
- slider_value_save.value = "" + ui.value;
1102
- }
1103
- });
1104
- });
1105
- }
1106
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_range") {
1107
- var spinner_value0 = document.getElementById(t + "_elementform_id_temp0").value;
1108
- var spinner_step = document.getElementById(t + "_range_stepform_id_temp").value;
1109
- jQuery("#" + t + "_elementform_id_temp0")[0].spin = null;
1110
- jQuery("#" + t + "_elementform_id_temp1")[0].spin = null;
1111
- spinner0 = jQuery("#" + t + "_elementform_id_temp0").spinner();
1112
- spinner0.spinner("value", spinner_value0);
1113
- jQuery("#" + t + "_elementform_id_temp0").spinner({ step:spinner_step});
1114
- var spinner_value1 = document.getElementById(t + "_elementform_id_temp1").value;
1115
- spinner1 = jQuery("#" + t + "_elementform_id_temp1").spinner();
1116
- spinner1.spinner("value", spinner_value1);
1117
- jQuery("#" + t + "_elementform_id_temp1").spinner({ step:spinner_step});
1118
- var myu = t;
1119
- jQuery(document).ready(function () {
1120
- jQuery("#" + myu + "_mini_label_from").click(function () {
1121
- if (jQuery(this).children('input').length == 0) {
1122
- var from = "<input type='text' id='from' class='from' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
1123
- jQuery(this).html(from);
1124
- jQuery("input.from").focus();
1125
- jQuery("input.from").blur(function () {
1126
- var id_for_blur = document.getElementById('from').parentNode.id.split('_');
1127
- var value = jQuery(this).val();
1128
- jQuery("#" + id_for_blur[0] + "_mini_label_from").text(value);
1129
- });
1130
- }
1131
- });
1132
- jQuery("label#" + myu + "_mini_label_to").click(function () {
1133
- if (jQuery(this).children('input').length == 0) {
1134
- var to = "<input type='text' id='to' class='to' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
1135
- jQuery(this).html(to);
1136
- jQuery("input.to").focus();
1137
- jQuery("input.to").blur(function () {
1138
- var id_for_blur = document.getElementById('to').parentNode.id.split('_');
1139
- var value = jQuery(this).val();
1140
- jQuery("#" + id_for_blur[0] + "_mini_label_to").text(value);
1141
- });
1142
- }
1143
- });
1144
- });
1145
- }
1146
- }
1147
- }
1148
-
1149
- remove_whitespace(document.getElementById('take'));
1150
- form_view = 1;
1151
- form_view_count = 0;
1152
-
1153
- for (i = 1; i <= 30; i++) {
1154
- if (document.getElementById('form_id_tempform_view' + i)) {
1155
- form_view_count++;
1156
- form_view_max = i;
1157
- tbody_img = document.createElement('div');
1158
- tbody_img.setAttribute('id', 'form_id_tempform_view_img' + i);
1159
- tbody_img.style.cssText = "float:right";
1160
- tr_img = document.createElement('div');
1161
- var img = document.createElement('img');
1162
- img.setAttribute('src', '<?php echo WD_FMC_URL; ?>/images/minus.png?ver=<?php echo get_option("wd_form_maker_version"); ?>');
1163
- img.setAttribute('title', 'Show or hide the page');
1164
- img.setAttribute("class", "page_toolbar");
1165
- img.setAttribute('id', 'show_page_img_' + i);
1166
- img.setAttribute('onClick', 'show_or_hide("' + i + '")');
1167
- img.setAttribute("onmouseover", 'chnage_icons_src(this,"minus")');
1168
- img.setAttribute("onmouseout", 'chnage_icons_src(this,"minus")');
1169
- var img_X = document.createElement("img");
1170
- img_X.setAttribute("src", "<?php echo WD_FMC_URL; ?>/images/page_delete.png?ver=<?php echo get_option("wd_form_maker_version"); ?>");
1171
- img_X.setAttribute('title', 'Delete the page');
1172
- img_X.setAttribute("class", "page_toolbar");
1173
- img_X.setAttribute("onclick", 'remove_page("' + i + '")');
1174
- img_X.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete")');
1175
- img_X.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete")');
1176
- var img_X_all = document.createElement("img");
1177
- img_X_all.setAttribute("src", "<?php echo WD_FMC_URL; ?>/images/page_delete_all.png?ver=<?php echo get_option("wd_form_maker_version"); ?>");
1178
- img_X_all.setAttribute('title', 'Delete the page with fields');
1179
- img_X_all.setAttribute("class", "page_toolbar");
1180
- img_X_all.setAttribute("onclick", 'remove_page_all("' + i + '")');
1181
- img_X_all.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete_all")');
1182
- img_X_all.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete_all")');
1183
- var img_EDIT = document.createElement("img");
1184
- img_EDIT.setAttribute("src", "<?php echo WD_FMC_URL; ?>/images/page_edit.png?ver=<?php echo get_option("wd_form_maker_version"); ?>");
1185
- img_EDIT.setAttribute('title', 'Edit the page');
1186
- img_EDIT.setAttribute("class", "page_toolbar");
1187
- img_EDIT.setAttribute("onclick", 'edit_page_break("' + i + '")');
1188
- img_EDIT.setAttribute("onmouseover", 'chnage_icons_src(this,"page_edit")');
1189
- img_EDIT.setAttribute("onmouseout", 'chnage_icons_src(this,"page_edit")');
1190
- tr_img.appendChild(img);
1191
- tr_img.appendChild(img_X);
1192
- tr_img.appendChild(img_X_all);
1193
- tr_img.appendChild(img_EDIT);
1194
- tbody_img.appendChild(tr_img);
1195
- document.getElementById('form_id_tempform_view' + i).parentNode.appendChild(tbody_img);
1196
- }
1197
- }
1198
-
1199
- if (form_view_count > 1) {
1200
- for (i = 1; i <= form_view_max; i++) {
1201
- if (document.getElementById('form_id_tempform_view' + i)) {
1202
- first_form_view = i;
1203
- break;
1204
- }
1205
- }
1206
- form_view = form_view_max;
1207
- need_enable = false;
1208
- generate_page_nav(first_form_view);
1209
- var img_EDIT = document.createElement("img");
1210
- img_EDIT.setAttribute("src", "<?php echo WD_FMC_URL . '/images/edit.png?ver='.get_option("wd_form_maker_version"); ?>");
1211
- img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
1212
- img_EDIT.setAttribute("onclick", 'el_page_navigation()');
1213
- var td_EDIT = document.getElementById("edit_page_navigation");
1214
- td_EDIT.appendChild(img_EDIT);
1215
- document.getElementById('page_navigation').appendChild(td_EDIT);
1216
- }
1217
- document.getElementById('araqel').value = 1;
1218
- }
1219
- jQuery(window).load(function () {
1220
- formOnload();
1221
- });
1222
- jQuery(function() {
1223
- jQuery('.wdform_section .wdform_column:last-child').each(function() {
1224
- jQuery(this).parent().append(jQuery('<div></div>').addClass("wdform_column"));
1225
- });
1226
-
1227
- sortable_columns();
1228
- if(<?php echo $row->sortable ?>==1) {
1229
- jQuery( ".wdform_arrows" ).hide();
1230
- all_sortable_events();
1231
- }
1232
- else
1233
- jQuery('.wdform_column').sortable( "disable" );
1234
-
1235
- });
1236
- </script>
1237
- <?php
1238
- } else { ?>
1239
- <script type="text/javascript">
1240
- jQuery(function() {
1241
- jQuery('.wdform_section .wdform_column:last-child').each(function() {
1242
- jQuery(this).parent().append(jQuery('<div></div>').addClass("wdform_column"));
1243
- });
1244
- sortable_columns();
1245
- all_sortable_events();
1246
- });
1247
- </script>
1248
- <?php } ?>
1249
- <input type="hidden" name="option" value="com_formmaker" />
1250
- <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
1251
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
1252
- <input type="hidden" id="task" name="task" value=""/>
1253
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
1254
- </form>
1255
- <?php
1256
- }
1257
-
1258
- public function edit_old($id) {
1259
- // header("X-XSS-Protection: 0");
1260
- $row = $this->model->get_row_data($id);
1261
- $themes = $this->model->get_theme_rows_data('old');
1262
- $labels = array();
1263
- $label_id = array();
1264
- $label_order_original = array();
1265
- $label_type = array();
1266
- $label_all = explode('#****#', $row->label_order);
1267
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
1268
- foreach ($label_all as $key => $label_each) {
1269
- $label_id_each = explode('#**id**#', $label_each);
1270
- array_push($label_id, $label_id_each[0]);
1271
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
1272
- array_push($label_order_original, addslashes($label_oder_each[0]));
1273
- array_push($label_type, $label_oder_each[1]);
1274
- }
1275
- $labels['id'] = '"' . implode('","', $label_id) . '"';
1276
- $labels['label'] = '"' . implode('","', $label_order_original) . '"';
1277
- $labels['type'] = '"' . implode('","', $label_type) . '"';
1278
-
1279
- $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
1280
- ?>
1281
- <script type="text/javascript">
1282
- var plugin_url = "<?php echo WD_FMC_URL; ?>";
1283
- </script>
1284
- <script src="<?php echo WD_FMC_URL . '/js/formmaker_free.js'; ?>?ver=<?php echo get_option("wd_form_maker_version"); ?>" type="text/javascript"></script>
1285
- <script type="text/javascript">
1286
- function submitbutton() {
1287
- if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
1288
- alert('Please wait while page loading.');
1289
- return false;
1290
- }
1291
- tox = '';
1292
- l_id_array = [<?php echo $labels['id']?>];
1293
- l_label_array = [<?php echo $labels['label']?>];
1294
- l_type_array = [<?php echo $labels['type']?>];
1295
- l_id_removed = [];
1296
- for (x=0; x< l_id_array.length; x++) {
1297
- l_id_removed[l_id_array[x]]=true;
1298
- }
1299
- for (t=1;t<=form_view_max;t++) {
1300
- if (document.getElementById('form_id_tempform_view'+t)) {
1301
- form_view_element=document.getElementById('form_id_tempform_view'+t);
1302
- n=form_view_element.childNodes.length-2;
1303
- for(q=0;q<=n;q++) {
1304
- if (form_view_element.childNodes[q].nodeType!=3) {
1305
- if (!form_view_element.childNodes[q].id) {
1306
- GLOBAL_tr=form_view_element.childNodes[q];
1307
- for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
1308
- table=GLOBAL_tr.firstChild.childNodes[x];
1309
- tbody=table.firstChild;
1310
- for (y=0; y < tbody.childNodes.length; y++) {
1311
- is_in_old=false;
1312
- tr=tbody.childNodes[y];
1313
- l_id=tr.id;
1314
- l_label=document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
1315
- l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
1316
- l_type=tr.getAttribute('type');
1317
- for (z = 0; z < l_id_array.length; z++) {
1318
- if (l_id_array[z] == l_id) {
1319
- if (l_type_array[z] == "type_address") {
1320
- if (document.getElementById(l_id + "_mini_label_street1")) {
1321
- l_id_removed[l_id_array[z]] = false;
1322
- }
1323
- if (document.getElementById(l_id+"_mini_label_street2")) {
1324
- l_id_removed[parseInt(l_id_array[z]) + 1] = false;
1325
- }
1326
- if (document.getElementById(l_id+"_mini_label_city")) {
1327
- l_id_removed[parseInt(l_id_array[z]) + 2] = false;
1328
- }
1329
- if (document.getElementById(l_id+"_mini_label_state")) {
1330
- l_id_removed[parseInt(l_id_array[z]) + 3] = false;
1331
- }
1332
- if (document.getElementById(l_id+"_mini_label_postal")) {
1333
- l_id_removed[parseInt(l_id_array[z]) + 4] = false;
1334
- }
1335
- if (document.getElementById(l_id+"_mini_label_country")) {
1336
- l_id_removed[parseInt(l_id_array[z]) + 5] = false;
1337
- }
1338
- z = z + 5;
1339
- }
1340
- else {
1341
- l_id_removed[l_id] = false;
1342
- }
1343
- }
1344
- }
1345
- if (tr.getAttribute('type')=="type_address") {
1346
- addr_id=parseInt(tr.id);
1347
- id_for_country= addr_id;
1348
- if(document.getElementById(id_for_country+"_mini_label_street1"))
1349
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street1").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1350
- if(document.getElementById(id_for_country+"_mini_label_street2"))
1351
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street2").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1352
- if(document.getElementById(id_for_country+"_mini_label_city"))
1353
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_city").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1354
- if(document.getElementById(id_for_country+"_mini_label_state"))
1355
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_state").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1356
- if(document.getElementById(id_for_country+"_mini_label_postal"))
1357
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_postal").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1358
- if(document.getElementById(id_for_country+"_mini_label_country"))
1359
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_country").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';
1360
- }
1361
- else {
1362
- tox = tox+l_id+'#**id**#'+l_label+'#**label**#'+l_type+'#****#';
1363
- }
1364
- }
1365
- }
1366
- }
1367
- }
1368
- }
1369
- }
1370
- }
1371
- document.getElementById('label_order_current').value = tox;
1372
- for (x = 0; x < l_id_array.length; x++) {
1373
- if (l_id_removed[l_id_array[x]]) {
1374
- tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
1375
- }
1376
- }
1377
- document.getElementById('label_order').value = tox;
1378
- refresh_old();
1379
- document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
1380
- document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
1381
- document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
1382
- return true;
1383
- }
1384
-
1385
- gen = <?php echo (($id != 0) ? $row->counter : 1); ?>;
1386
-
1387
- function enable() {
1388
- alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1389
- for (x = 0; x < 14; x++) {
1390
- document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png?ver=<?php echo get_option("wd_form_maker_version"); ?>";
1391
- }
1392
- if (document.getElementById('formMakerDiv').style.display == 'block') {
1393
- jQuery('#formMakerDiv').slideToggle(200);
1394
- }
1395
- else {
1396
- jQuery('#formMakerDiv').slideToggle(400);
1397
- }
1398
-
1399
- if (document.getElementById('formMakerDiv1').style.display == 'block') {
1400
- jQuery('#formMakerDiv1').slideToggle(200);
1401
- }
1402
- else {
1403
- jQuery('#formMakerDiv1').slideToggle(400);
1404
- }
1405
- document.getElementById('when_edit').style.display = 'none';
1406
- }
1407
-
1408
- function enable2() {
1409
- alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1410
- for (x = 0; x < 14; x++) {
1411
- document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png?ver=<?php echo get_option("wd_form_maker_version"); ?>";
1412
- }
1413
- if (document.getElementById('formMakerDiv').style.display == 'block') {
1414
- jQuery('#formMakerDiv').slideToggle(200);
1415
- }
1416
- else {
1417
- jQuery('#formMakerDiv').slideToggle(400);
1418
- }
1419
-
1420
- if (document.getElementById('formMakerDiv1').style.display == 'block') {
1421
- jQuery('#formMakerDiv1').slideToggle(200);
1422
- }
1423
- else {
1424
- jQuery('#formMakerDiv1').slideToggle(400);
1425
- }
1426
- document.getElementById('when_edit').style.display = 'block';
1427
- if (document.getElementById('field_types').offsetWidth) {
1428
- document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
1429
- }
1430
- if (document.getElementById('field_types').offsetHeight) {
1431
- document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
1432
- }
1433
- }
1434
- </script>
1435
- <div style="font-size: 14px; font-weight: bold;">
1436
- This section allows you to add fields to your form.
1437
- <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-4.html">Read More in User Manual</a>
1438
- </div>
1439
- <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fmc" style="width:99%;">
1440
- <?php wp_nonce_field('nonce_fmc', 'nonce_fmc'); ?>
1441
- <h2><?php echo $page_title; ?></h2>
1442
- <div style="float: right; margin: 0 5px 0 0;">
1443
- <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'id' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="preview_form" title="Form Preview" onclick="return false;">
1444
- Preview
1445
- </a>
1446
- <input class="button-primary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_options_old');" value="Form options"/>
1447
- <?php
1448
- if ($id) {
1449
- ?>
1450
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save_as_copy_old')" value="Save as Copy"/>
1451
- <?php
1452
- }
1453
- ?>
1454
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save_old')" value="Save"/>
1455
- <input class="button-secondary" type="submit" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'apply_old')" value="Apply"/>
1456
- <input class="button-secondary" type="submit" onclick="fm_set_input_value('task', 'cancel')" value="Cancel"/>
1457
- </div>
1458
-
1459
- <div class="formmaker_table" width="100%">
1460
- <div style="float: left; text-align: center;"><br />
1461
- <img src="<?php echo WD_FMC_URL . '/images/FormMaker.png?ver='. get_option("wd_form_maker_version"); ?>" /><br /><br />
1462
- <img src="<?php echo WD_FMC_URL . '/images/logo.png?ver='. get_option("wd_form_maker_version"); ?>" />
1463
- </div>
1464
- <div style="float:right">
1465
- <span style="font-size: 16.76pt; font-family: tahoma; color: #FFFFFF; vertical-align: middle;">Form title:&nbsp;&nbsp;</span>
1466
- <input id="title" name="title" class="form_maker_title" value="<?php echo $row->title; ?>"/>
1467
- <br />
1468
- <img src="<?php echo WD_FMC_URL . '/images/formoptions.png'; ?>" onclick="if (fm_check_required('title', 'Form title')) {return false;}; submitbutton(); fm_set_input_value('task', 'form_options_old'); fm_form_submit(event, 'manage_form');" style="cursor: pointer; margin: 10px 0 10px 10px; float: right;"/>
1469
- <br /><br /><br />
1470
- <img src="<?php echo WD_FMC_URL . '/images/addanewfield.png'; ?>" onclick="enable(); Enable();" style="cursor: pointer; margin:10px 0 10px 10px; float: right;"/>
1471
- </div>
1472
- </div>
1473
-
1474
- <div id="formMakerDiv" onclick="close_window()"></div>
1475
- <div id="formMakerDiv1" style="padding-top: 20px;" align="center">
1476
- <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" class="formMakerDiv1_table">
1477
- <tr>
1478
- <td style="padding:0px">
1479
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1480
- <tr valign="top">
1481
- <td width="15%" height="100%" style="border-right: dotted black 1px;" id="field_types">
1482
- <div id="when_edit" style="display: none;"></div>
1483
- <table border="0" cellpadding="0" cellspacing="3" width="100%">
1484
- <tr>
1485
- <td align="center" onClick="addRow('customHTML')" style="cursor:pointer" id="table_editor" class="field_buttons">
1486
- <img src="<?php echo WD_FMC_URL . '/images/customHTML.png'; ?>" style="margin:5px" id="img_customHTML"/>
1487
- </td>
1488
- <td align="center" onClick="addRow('text')" style="cursor:pointer" id="table_text" class="field_buttons">
1489
- <img src="<?php echo WD_FMC_URL . '/images/text.png'; ?>" style="margin:5px" id="img_text"/>
1490
- </td>
1491
- </tr>
1492
- <tr>
1493
- <td align="center" onClick="addRow('time_and_date')" style="cursor:pointer" id="table_time_and_date" class="field_buttons">
1494
- <img src="<?php echo WD_FMC_URL . '/images/time_and_date.png'; ?>" style="margin:5px" id="img_time_and_date"/>
1495
- </td>
1496
- <td align="center" onClick="addRow('select')" style="cursor:pointer" id="table_select" class="field_buttons">
1497
- <img src="<?php echo WD_FMC_URL . '/images/select.png'; ?>" style="margin:5px" id="img_select"/>
1498
- </td>
1499
- </tr>
1500
- <tr>
1501
- <td align="center" onClick="addRow('checkbox')" style="cursor:pointer" id="table_checkbox" class="field_buttons">
1502
- <img src="<?php echo WD_FMC_URL . '/images/checkbox.png'; ?>" style="margin:5px" id="img_checkbox"/>
1503
- </td>
1504
- <td align="center" onClick="addRow('radio')" style="cursor:pointer" id="table_radio" class="field_buttons">
1505
- <img src="<?php echo WD_FMC_URL . '/images/radio.png'; ?>" style="margin:5px" id="img_radio"/>
1506
- </td>
1507
- </tr>
1508
- <tr>
1509
- <td align="center" onClick="addRow('file_upload')" style="cursor:pointer" id="table_file_upload" class="field_buttons">
1510
- <img src="<?php echo WD_FMC_URL . '/images/file_upload.png'; ?>" style="margin:5px" id="img_file_upload"/>
1511
- </td>
1512
- <td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha" class="field_buttons">
1513
- <img src="<?php echo WD_FMC_URL . '/images/captcha.png'; ?>" style="margin:5px" id="img_captcha"/>
1514
- </td>
1515
- </tr>
1516
- <tr>
1517
- <td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break" class="field_buttons">
1518
- <img src="<?php echo WD_FMC_URL . '/images/page_break.png'; ?>" style="margin:5px" id="img_page_break"/>
1519
- </td>
1520
- <td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break" class="field_buttons">
1521
- <img src="<?php echo WD_FMC_URL . '/images/section_break.png'; ?>" style="margin:5px" id="img_section_break"/>
1522
- </td>
1523
- </tr>
1524
- <tr>
1525
- <td align="center" onClick="addRow('map')" style="cursor:pointer" id="table_map" class="field_buttons">
1526
- <img src="<?php echo WD_FMC_URL . '/images/map.png'; ?>" style="margin:5px" id="img_map"/>
1527
- </td>
1528
- <td align="center" onClick="addRow('paypal')" id="table_paypal" class="field_buttons">
1529
- <img src="<?php echo WD_FMC_URL . '/images/paypal.png'; ?>" style="margin:5px" id="img_paypal"/>
1530
- </td>
1531
- </tr>
1532
- <tr>
1533
- <td align="center" onClick="addRow('survey')" class="field_buttons" id="table_survey">
1534
- <img src="<?php echo WD_FMC_URL . '/images/survey.png'; ?>" style="margin:5px" id="img_survey"/>
1535
- </td>
1536
- <td align="center" onClick="addRow('button')" id="table_button" class="field_buttons">
1537
- <img src="<?php echo WD_FMC_URL . '/images/button.png'; ?>" style="margin:5px" id="img_button"/>
1538
- </td>
1539
- </tr>
1540
- </table>
1541
- </td>
1542
- <td width="35%" height="100%" align="left">
1543
- <div id="edit_table" style="padding:0px; overflow-y:scroll; height:575px"></div>
1544
- </td>
1545
- <td align="center" valign="top" style="background: url("<?php echo WD_FMC_URL . '/images/border2.png'; ?>") repeat-y;">&nbsp;</td>
1546
- <td style="padding:15px">
1547
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1548
- <tr>
1549
- <td align="right">
1550
- <input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
1551
- At The End
1552
- <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
1553
- At The Beginning
1554
- <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
1555
- Before
1556
- <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" disabled="disabled"></select>
1557
- <img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FMC_URL . '/images/save.png'; ?>" onClick="add(0, false)"/>
1558
- <img alt="CANCEL" title="cancel" style="cursor: pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FMC_URL . '/images/cancel_but.png'; ?>" onClick="close_window()"/>
1559
- <hr style=" margin-bottom:10px" />
1560
- </td>
1561
- </tr>
1562
- <tr height="100%" valign="top">
1563
- <td id="show_table"></td>
1564
- </tr>
1565
- </table>
1566
- </td>
1567
- </tr>
1568
- </table>
1569
- </td>
1570
- </tr>
1571
- </table>
1572
- <input type="hidden" id="old" />
1573
- <input type="hidden" id="old_selected" />
1574
- <input type="hidden" id="element_type" />
1575
- <input type="hidden" id="editing_id" />
1576
- <input type="hidden" value="<?php echo WD_FMC_URL; ?>" id="form_plugins_url" />
1577
- <div id="main_editor" style="position: fixed; display: none; z-index: 140;">
1578
- <?php
1579
- if (user_can_richedit()) {
1580
- wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
1581
- }
1582
- else {
1583
- ?>
1584
- <textarea cols="36" rows="5" id="form_maker_editor" name="form_maker_editor" style="width: 440px; height: 350px; resize: vertical;" class="mce_editable" aria-hidden="true"></textarea>
1585
- <?php
1586
- }
1587
- ?>
1588
- </div>
1589
- </div>
1590
- <?php
1591
- if (!function_exists('the_editor')) {
1592
- ?>
1593
- <iframe id="tinymce" style="display: none;"></iframe>
1594
- <?php
1595
- }
1596
- ?>
1597
- <br />
1598
- <br />
1599
- <fieldset>
1600
- <legend><h2 style="color: #00aeef;">Form</h2></legend>
1601
- <table width="100%" style="margin:8px">
1602
- <tr id="page_navigation">
1603
- <td align="center" width="90%" id="pages" show_title="<?php echo $row->show_title; ?>" show_numbers="<?php echo $row->show_numbers; ?>" type="<?php echo $row->pagination; ?>"></td>
1604
- <td align="left" id="edit_page_navigation"></td>
1605
- </tr>
1606
- </table>
1607
- <div id="take">
1608
- <?php
1609
- if ($row->form) {
1610
- echo $row->form;
1611
- }
1612
- else {
1613
- ?>
1614
- <table border="0" cellpadding="4" cellspacing="0" class="wdform_table1" style="width: 100%;">
1615
- <tbody id="form_id_tempform_view1" class="wdform_tbody1" page_title="Untitled page" next_title="Next" next_type="button" next_class="wdform_page_button" next_checkable="false" previous_title="Previous" previous_type="button" previous_class="wdform_page_button" previous_checkable="false">
1616
- <tr class="wdform_tr1">
1617
- <td class="wdform_td1" >
1618
- <table class="wdform_table2">
1619
- <tbody class="wdform_tbody2"></tbody>
1620
- </table>
1621
- </td>
1622
- </tr>
1623
- <tr class="wdform_footer">
1624
- <td colspan="100" valign="top">
1625
- <table width="100%" style="padding-right:170px">
1626
- <tbody>
1627
- <tr id="form_id_temppage_nav1">
1628
- </tr>
1629
- </tbody>
1630
- </table>
1631
- </td>
1632
- </tr>
1633
- <tbody id="form_id_tempform_view_img1" style="float: right !important;" >
1634
- <tr>
1635
- <td width="0%"></td>
1636
- <td align="right">
1637
- <img src="<?php echo WD_FMC_URL . '/images/minus.png?ver='. get_option("wd_form_maker_version").''; ?>" title="Show or hide the page" class="page_toolbar" onclick="show_or_hide('1')" onmouseover="chnage_icons_src(this,'minus')" onmouseout="chnage_icons_src(this,'minus')" id="show_page_img_1" />
1638
- </td>
1639
- <td>
1640
- <img src="<?php echo WD_FMC_URL . '/images/page_delete.png?ver='. get_option("wd_form_maker_version").''; ?>" title="Delete the page" class="page_toolbar" onclick="remove_page('1')" onmouseover="chnage_icons_src(this,'page_delete')" onmouseout="chnage_icons_src(this,'page_delete')" />
1641
- </td>
1642
- <td>
1643
- <img src="<?php echo WD_FMC_URL . '/images/page_delete_all.png?ver='. get_option("wd_form_maker_version").''; ?>" title="Delete the page with fields" class="page_toolbar" onclick="remove_page_all('1')" onmouseover="chnage_icons_src(this,'page_delete_all')" onmouseout="chnage_icons_src(this,'page_delete_all')" />
1644
- </td>
1645
- <td>
1646
- <img src="<?php echo WD_FMC_URL . '/images/page_edit.png?ver='. get_option("wd_form_maker_version").''; ?>" title="Edit the page" class="page_toolbar" onclick="edit_page_break('1')" onmouseover="chnage_icons_src(this,'page_edit')" onmouseout="chnage_icons_src(this,'page_edit')" />
1647
- </td>
1648
- </tr>
1649
- </tbody>
1650
- </table>
1651
- <?php
1652
- }
1653
- ?>
1654
- </div>
1655
- </fieldset>
1656
- <input type="hidden" name="form" id="form" />
1657
- <input type="hidden" name="form_front" id="form_front" />
1658
- <input type="hidden" name="pagination" id="pagination" />
1659
- <input type="hidden" name="show_title" id="show_title" />
1660
- <input type="hidden" name="show_numbers" id="show_numbers" />
1661
- <input type="hidden" name="public_key" id="public_key" />
1662
- <input type="hidden" name="private_key" id="private_key" />
1663
- <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
1664
- <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order; ?>" />
1665
- <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
1666
- <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
1667
- <input type="hidden" id="araqel" value="0" />
1668
- <script type="text/javascript">
1669
- form_view = 1;
1670
- form_view_count = 1;
1671
- form_view_max = 1;
1672
- function formOnload() {
1673
- // Enable maps.
1674
- for (t = 0; t < <?php echo $row->counter;?>; t++)
1675
- if (document.getElementById(t+"_typeform_id_temp")) {
1676
- if (document.getElementById(t+"_typeform_id_temp").value=="type_map" || document.getElementById(t+"_typeform_id_temp").value=="type_mark_map") {
1677
- if_gmap_init(t);
1678
- for (q = 0; q < 20; q++) {
1679
- if (document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q)) {
1680
- w_long=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q));
1681
- w_lat=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("lat"+q));
1682
- w_info=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("info"+q));
1683
- add_marker_on_map(t,q, w_long, w_lat, w_info, false);
1684
- }
1685
- }
1686
- }
1687
- else
1688
- if (document.getElementById(t+"_typeform_id_temp").value == "type_date") {
1689
- // Calendar.setup({
1690
- // inputField: t+"_elementform_id_temp",
1691
- // ifFormat: document.getElementById(t+"_buttonform_id_temp").getAttribute('format'),
1692
- // button: t+"_buttonform_id_temp",
1693
- // align: "Tl",
1694
- // singleClick: true,
1695
- // firstDay: 0
1696
- // });
1697
- }
1698
- else
1699
- if(document.getElementById(t+"_typeform_id_temp").value=="type_spinner") {
1700
- var spinner_value = jQuery("#" + t + "_elementform_id_temp").get( "aria-valuenow" );
1701
- var spinner_min_value = document.getElementById(t+"_min_valueform_id_temp").value;
1702
- var spinner_max_value = document.getElementById(t+"_max_valueform_id_temp").value;
1703
- var spinner_step = document.getElementById(t+"_stepform_id_temp").value;
1704
-
1705
- jQuery( "#"+t+"_elementform_id_temp" ).removeClass( "ui-spinner-input" )
1706
- .prop( "disabled", false )
1707
- .removeAttr( "autocomplete" )
1708
- .removeAttr( "role" )
1709
- .removeAttr( "aria-valuemin" )
1710
- .removeAttr( "aria-valuemax" )
1711
- .removeAttr( "aria-valuenow" );
1712
-
1713
- span_ui= document.getElementById(t+"_elementform_id_temp").parentNode;
1714
- span_ui.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp"));
1715
- span_ui.parentNode.removeChild(span_ui);
1716
-
1717
- jQuery("#"+t+"_elementform_id_temp")[0].spin = null;
1718
-
1719
- spinner = jQuery( "#"+t+"_elementform_id_temp" ).spinner();
1720
- spinner.spinner( "value", spinner_value );
1721
- jQuery( "#"+t+"_elementform_id_temp" ).spinner({ min: spinner_min_value});
1722
- jQuery( "#"+t+"_elementform_id_temp" ).spinner({ max: spinner_max_value});
1723
- jQuery( "#"+t+"_elementform_id_temp" ).spinner({ step: spinner_step});
1724
-
1725
- }
1726
- else
1727
- if(document.getElementById(t+"_typeform_id_temp").value=="type_slider") {
1728
-
1729
- var slider_value = document.getElementById(t+"_slider_valueform_id_temp").value;
1730
- var slider_min_value = document.getElementById(t+"_slider_min_valueform_id_temp").value;
1731
- var slider_max_value = document.getElementById(t+"_slider_max_valueform_id_temp").value;
1732
-
1733
- var slider_element_value = document.getElementById( t+"_element_valueform_id_temp" );
1734
- var slider_value_save = document.getElementById( t+"_slider_valueform_id_temp" );
1735
-
1736
- document.getElementById(t+"_elementform_id_temp").innerHTML = "";
1737
- document.getElementById(t+"_elementform_id_temp").removeAttribute( "class" );
1738
- document.getElementById(t+"_elementform_id_temp").removeAttribute( "aria-disabled" );
1739
-
1740
- jQuery("#"+t+"_elementform_id_temp")[0].slide = null;
1741
-
1742
- jQuery(function() {
1743
- jQuery( "#"+t+"_elementform_id_temp").slider({
1744
- range: "min",
1745
- value: eval(slider_value),
1746
- min: eval(slider_min_value),
1747
- max: eval(slider_max_value),
1748
- slide: function( event, ui ) {
1749
- slider_element_value.innerHTML = "" + ui.value ;
1750
- slider_value_save.value = "" + ui.value;
1751
-
1752
- }
1753
- });
1754
-
1755
-
1756
- });
1757
-
1758
-
1759
- }
1760
- else
1761
- if(document.getElementById(t+"_typeform_id_temp").value=="type_range"){
1762
- var spinner_value0 = jQuery("#" + t+"_elementform_id_temp0").get( "aria-valuenow" );
1763
- var spinner_step = document.getElementById(t+"_range_stepform_id_temp").value;
1764
-
1765
- jQuery( "#"+t+"_elementform_id_temp0" ).removeClass( "ui-spinner-input" )
1766
- .prop( "disabled", false )
1767
- .removeAttr( "autocomplete" )
1768
- .removeAttr( "role" )
1769
- .removeAttr( "aria-valuenow" );
1770
-
1771
- span_ui= document.getElementById(t+"_elementform_id_temp0").parentNode;
1772
- span_ui.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp0"));
1773
- span_ui.parentNode.removeChild(span_ui);
1774
-
1775
-
1776
- jQuery("#"+t+"_elementform_id_temp0")[0].spin = null;
1777
- jQuery("#"+t+"_elementform_id_temp1")[0].spin = null;
1778
-
1779
- spinner0 = jQuery( "#"+t+"_elementform_id_temp0" ).spinner();
1780
- spinner0.spinner( "value", spinner_value0 );
1781
- jQuery( "#"+t+"_elementform_id_temp0" ).spinner({ step: spinner_step});
1782
-
1783
-
1784
-
1785
- var spinner_value1 = jQuery("#" + t+"_elementform_id_temp1").get( "aria-valuenow" );
1786
-
1787
- jQuery( "#"+t+"_elementform_id_temp1" ).removeClass( "ui-spinner-input" )
1788
- .prop( "disabled", false )
1789
- .removeAttr( "autocomplete" )
1790
- .removeAttr( "role" )
1791
- .removeAttr( "aria-valuenow" );
1792
-
1793
- span_ui1= document.getElementById(t+"_elementform_id_temp1").parentNode;
1794
- span_ui1.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp1"));
1795
- span_ui1.parentNode.removeChild(span_ui1);
1796
-
1797
- spinner1 = jQuery( "#"+t+"_elementform_id_temp1" ).spinner();
1798
- spinner1.spinner( "value", spinner_value1 );
1799
- jQuery( "#"+t+"_elementform_id_temp1" ).spinner({ step: spinner_step});
1800
-
1801
- var myu = t;
1802
- jQuery(document).ready(function() {
1803
-
1804
- jQuery("#"+myu+"_mini_label_from").click(function() {
1805
- if (jQuery(this).children('input').length == 0) {
1806
- var from = "<input type='text' id='from' class='from' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
1807
- jQuery(this).html(from);
1808
- jQuery("input.from").focus();
1809
- jQuery("input.from").blur(function() {
1810
- var id_for_blur = document.getElementById('from').parentNode.id.split('_');
1811
- var value = jQuery(this).val();
1812
- jQuery("#"+id_for_blur[0]+"_mini_label_from").text(value);
1813
- });
1814
- }
1815
- });
1816
-
1817
- jQuery("label#"+myu+"_mini_label_to").click(function() {
1818
- if (jQuery(this).children('input').length == 0) {
1819
-
1820
- var to = "<input type='text' id='to' class='to' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
1821
- jQuery(this).html(to);
1822
- jQuery("input.to").focus();
1823
- jQuery("input.to").blur(function() {
1824
- var id_for_blur = document.getElementById('to').parentNode.id.split('_');
1825
- var value = jQuery(this).val();
1826
-
1827
- jQuery("#"+id_for_blur[0]+"_mini_label_to").text(value);
1828
- });
1829
-
1830
- }
1831
- });
1832
-
1833
-
1834
-
1835
- });
1836
- }
1837
-
1838
- else
1839
- if(document.getElementById(t+"_typeform_id_temp").value=="type_name"){
1840
- var myu = t;
1841
- jQuery(document).ready(function() {
1842
-
1843
- jQuery("#"+myu+"_mini_label_first").click(function() {
1844
-
1845
- if (jQuery(this).children('input').length == 0) {
1846
-
1847
- var first = "<input type='text' id='first' class='first' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1848
- jQuery(this).html(first);
1849
- jQuery("input.first").focus();
1850
- jQuery("input.first").blur(function() {
1851
-
1852
- var id_for_blur = document.getElementById('first').parentNode.id.split('_');
1853
- var value = jQuery(this).val();
1854
- jQuery("#"+id_for_blur[0]+"_mini_label_first").text(value);
1855
- });
1856
- }
1857
- });
1858
-
1859
- jQuery("label#"+myu+"_mini_label_last").click(function() {
1860
- if (jQuery(this).children('input').length == 0) {
1861
-
1862
- var last = "<input type='text' id='last' class='last' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1863
- jQuery(this).html(last);
1864
- jQuery("input.last").focus();
1865
- jQuery("input.last").blur(function() {
1866
- var id_for_blur = document.getElementById('last').parentNode.id.split('_');
1867
- var value = jQuery(this).val();
1868
-
1869
- jQuery("#"+id_for_blur[0]+"_mini_label_last").text(value);
1870
- });
1871
-
1872
- }
1873
- });
1874
-
1875
- jQuery("label#"+myu+"_mini_label_title").click(function() {
1876
- if (jQuery(this).children('input').length == 0) {
1877
- var title = "<input type='text' id='title' class='title' size='10' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1878
- jQuery(this).html(title);
1879
- jQuery("input.title").focus();
1880
- jQuery("input.title").blur(function() {
1881
- var id_for_blur = document.getElementById('title').parentNode.id.split('_');
1882
- var value = jQuery(this).val();
1883
-
1884
-
1885
- jQuery("#"+id_for_blur[0]+"_mini_label_title").text(value);
1886
- });
1887
- }
1888
-
1889
- });
1890
-
1891
-
1892
- jQuery("label#"+myu+"_mini_label_middle").click(function() {
1893
- if (jQuery(this).children('input').length == 0) {
1894
- var middle = "<input type='text' id='middle' class='middle' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1895
- jQuery(this).html(middle);
1896
- jQuery("input.middle").focus();
1897
- jQuery("input.middle").blur(function() {
1898
- var id_for_blur = document.getElementById('middle').parentNode.id.split('_');
1899
- var value = jQuery(this).val();
1900
-
1901
- jQuery("#"+id_for_blur[0]+"_mini_label_middle").text(value);
1902
- });
1903
- }
1904
- });
1905
-
1906
- });
1907
- }
1908
- else
1909
- if(document.getElementById(t+"_typeform_id_temp").value=="type_address"){
1910
- var myu = t;
1911
-
1912
- jQuery(document).ready(function() {
1913
- jQuery("label#"+myu+"_mini_label_street1").click(function() {
1914
-
1915
- if (jQuery(this).children('input').length == 0) {
1916
- var street1 = "<input type='text' id='street1' class='street1' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1917
- jQuery(this).html(street1);
1918
- jQuery("input.street1").focus();
1919
- jQuery("input.street1").blur(function() {
1920
- var id_for_blur = document.getElementById('street1').parentNode.id.split('_');
1921
- var value = jQuery(this).val();
1922
- jQuery("#"+id_for_blur[0]+"_mini_label_street1").text(value);
1923
- });
1924
- }
1925
- });
1926
-
1927
- jQuery("label#"+myu+"_mini_label_street2").click(function() {
1928
- if (jQuery(this).children('input').length == 0) {
1929
- var street2 = "<input type='text' id='street2' class='street2' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1930
- jQuery(this).html(street2);
1931
- jQuery("input.street2").focus();
1932
- jQuery("input.street2").blur(function() {
1933
- var id_for_blur = document.getElementById('street2').parentNode.id.split('_');
1934
- var value = jQuery(this).val();
1935
- jQuery("#"+id_for_blur[0]+"_mini_label_street2").text(value);
1936
- });
1937
- }
1938
- });
1939
-
1940
-
1941
- jQuery("label#"+myu+"_mini_label_city").click(function() {
1942
- if (jQuery(this).children('input').length == 0) {
1943
- var city = "<input type='text' id='city' class='city' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1944
- jQuery(this).html(city);
1945
- jQuery("input.city").focus();
1946
- jQuery("input.city").blur(function() {
1947
- var id_for_blur = document.getElementById('city').parentNode.id.split('_');
1948
- var value = jQuery(this).val();
1949
- jQuery("#"+id_for_blur[0]+"_mini_label_city").text(value);
1950
- });
1951
- }
1952
- });
1953
-
1954
- jQuery("label#"+myu+"_mini_label_state").click(function() {
1955
- if (jQuery(this).children('input').length == 0) {
1956
- var state = "<input type='text' id='state' class='state' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1957
- jQuery(this).html(state);
1958
- jQuery("input.state").focus();
1959
- jQuery("input.state").blur(function() {
1960
- var id_for_blur = document.getElementById('state').parentNode.id.split('_');
1961
- var value = jQuery(this).val();
1962
- jQuery("#"+id_for_blur[0]+"_mini_label_state").text(value);
1963
- });
1964
- }
1965
- });
1966
-
1967
- jQuery("label#"+myu+"_mini_label_postal").click(function() {
1968
- if (jQuery(this).children('input').length == 0) {
1969
- var postal = "<input type='text' id='postal' class='postal' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1970
- jQuery(this).html(postal);
1971
- jQuery("input.postal").focus();
1972
- jQuery("input.postal").blur(function() {
1973
- var id_for_blur = document.getElementById('postal').parentNode.id.split('_');
1974
- var value = jQuery(this).val();
1975
- jQuery("#"+id_for_blur[0]+"_mini_label_postal").text(value);
1976
- });
1977
- }
1978
- });
1979
-
1980
-
1981
- jQuery("label#"+myu+"_mini_label_country").click(function() {
1982
- if (jQuery(this).children('input').length == 0) {
1983
- var country = "<input type='country' id='country' class='country' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1984
- jQuery(this).html(country);
1985
- jQuery("input.country").focus();
1986
- jQuery("input.country").blur(function() {
1987
- var id_for_blur = document.getElementById('country').parentNode.id.split('_');
1988
- var value = jQuery(this).val();
1989
- jQuery("#"+id_for_blur[0]+"_mini_label_country").text(value);
1990
- });
1991
- }
1992
- });
1993
- });
1994
-
1995
- }
1996
- else
1997
- if(document.getElementById(t+"_typeform_id_temp").value=="type_phone"){
1998
- var myu = t;
1999
-
2000
- jQuery(document).ready(function() {
2001
- jQuery("label#"+myu+"_mini_label_area_code").click(function() {
2002
- if (jQuery(this).children('input').length == 0) {
2003
-
2004
- var area_code = "<input type='text' id='area_code' class='area_code' size='10' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2005
-
2006
- jQuery(this).html(area_code);
2007
- jQuery("input.area_code").focus();
2008
- jQuery("input.area_code").blur(function() {
2009
- var id_for_blur = document.getElementById('area_code').parentNode.id.split('_');
2010
- var value = jQuery(this).val();
2011
- jQuery("#"+id_for_blur[0]+"_mini_label_area_code").text(value);
2012
- });
2013
- }
2014
- });
2015
-
2016
-
2017
- jQuery("label#"+myu+"_mini_label_phone_number").click(function() {
2018
-
2019
- if (jQuery(this).children('input').length == 0) {
2020
- var phone_number = "<input type='text' id='phone_number' class='phone_number' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2021
-
2022
- jQuery(this).html(phone_number);
2023
-
2024
- jQuery("input.phone_number").focus();
2025
- jQuery("input.phone_number").blur(function() {
2026
- var id_for_blur = document.getElementById('phone_number').parentNode.id.split('_');
2027
- var value = jQuery(this).val();
2028
- jQuery("#"+id_for_blur[0]+"_mini_label_phone_number").text(value);
2029
- });
2030
- }
2031
- });
2032
-
2033
- });
2034
- }
2035
- else
2036
- if(document.getElementById(t+"_typeform_id_temp").value=="type_date_fields"){
2037
- var myu = t;
2038
-
2039
- jQuery(document).ready(function() {
2040
- jQuery("label#"+myu+"_day_label").click(function() {
2041
- if (jQuery(this).children('input').length == 0) {
2042
- var day = "<input type='text' id='day' class='day' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2043
- jQuery(this).html(day);
2044
- jQuery("input.day").focus();
2045
- jQuery("input.day").blur(function() {
2046
- var id_for_blur = document.getElementById('day').parentNode.id.split('_');
2047
- var value = jQuery(this).val();
2048
-
2049
- jQuery("#"+id_for_blur[0]+"_day_label").text(value);
2050
- });
2051
- }
2052
- });
2053
-
2054
-
2055
- jQuery("label#"+myu+"_month_label").click(function() {
2056
- if (jQuery(this).children('input').length == 0) {
2057
- var month = "<input type='text' id='month' class='month' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2058
- jQuery(this).html(month);
2059
- jQuery("input.month").focus();
2060
- jQuery("input.month").blur(function() {
2061
- var id_for_blur = document.getElementById('month').parentNode.id.split('_');
2062
- var value = jQuery(this).val();
2063
-
2064
- jQuery("#"+id_for_blur[0]+"_month_label").text(value);
2065
- });
2066
- }
2067
- });
2068
-
2069
- jQuery("label#"+myu+"_year_label").click(function() {
2070
- if (jQuery(this).children('input').length == 0) {
2071
- var year = "<input type='text' id='year' class='year' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2072
- jQuery(this).html(year);
2073
- jQuery("input.year").focus();
2074
- jQuery("input.year").blur(function() {
2075
- var id_for_blur = document.getElementById('year').parentNode.id.split('_');
2076
- var value = jQuery(this).val();
2077
-
2078
- jQuery("#"+id_for_blur[0]+"_year_label").text(value);
2079
- });
2080
- }
2081
- });
2082
-
2083
- });
2084
-
2085
-
2086
- }
2087
- else
2088
- if(document.getElementById(t+"_typeform_id_temp").value=="type_time"){
2089
- var myu = t;
2090
-
2091
- jQuery(document).ready(function() {
2092
- jQuery("label#"+myu+"_mini_label_hh").click(function() {
2093
- if (jQuery(this).children('input').length == 0) {
2094
- var hh = "<input type='text' id='hh' class='hh' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2095
- jQuery(this).html(hh);
2096
- jQuery("input.hh").focus();
2097
- jQuery("input.hh").blur(function() {
2098
- var id_for_blur = document.getElementById('hh').parentNode.id.split('_');
2099
- var value = jQuery(this).val();
2100
-
2101
-
2102
- jQuery("#"+id_for_blur[0]+"_mini_label_hh").text(value);
2103
- });
2104
- }
2105
- });
2106
-
2107
-
2108
- jQuery("label#"+myu+"_mini_label_mm").click(function() {
2109
- if (jQuery(this).children('input').length == 0) {
2110
- var mm = "<input type='text' id='mm' class='mm' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2111
- jQuery(this).html(mm);
2112
- jQuery("input.mm").focus();
2113
- jQuery("input.mm").blur(function() {
2114
- var id_for_blur = document.getElementById('mm').parentNode.id.split('_');
2115
- var value = jQuery(this).val();
2116
-
2117
- jQuery("#"+id_for_blur[0]+"_mini_label_mm").text(value);
2118
- });
2119
- }
2120
- });
2121
-
2122
- jQuery("label#"+myu+"_mini_label_ss").click(function() {
2123
- if (jQuery(this).children('input').length == 0) {
2124
- var ss = "<input type='text' id='ss' class='ss' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2125
- jQuery(this).html(ss);
2126
- jQuery("input.ss").focus();
2127
- jQuery("input.ss").blur(function() {
2128
- var id_for_blur = document.getElementById('ss').parentNode.id.split('_');
2129
- var value = jQuery(this).val();
2130
-
2131
- jQuery("#"+id_for_blur[0]+"_mini_label_ss").text(value);
2132
- });
2133
- }
2134
- });
2135
-
2136
- jQuery("label#"+myu+"_mini_label_am_pm").click(function() {
2137
- if (jQuery(this).children('input').length == 0) {
2138
- var am_pm = "<input type='text' id='am_pm' class='am_pm' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2139
- jQuery(this).html(am_pm);
2140
- jQuery("input.am_pm").focus();
2141
- jQuery("input.am_pm").blur(function() {
2142
- var id_for_blur = document.getElementById('am_pm').parentNode.id.split('_');
2143
- var value = jQuery(this).val();
2144
-
2145
- jQuery("#"+id_for_blur[0]+"_mini_label_am_pm").text(value);
2146
- });
2147
- }
2148
- });
2149
- });
2150
-
2151
- }
2152
-
2153
- else
2154
- if(document.getElementById(t+"_typeform_id_temp").value=="type_paypal_price"){
2155
- var myu = t;
2156
- jQuery(document).ready(function() {
2157
-
2158
- jQuery("#"+myu+"_mini_label_dollars").click(function() {
2159
-
2160
- if (jQuery(this).children('input').length == 0) {
2161
-
2162
- var dollars = "<input type='text' id='dollars' class='dollars' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2163
- jQuery(this).html(dollars);
2164
- jQuery("input.dollars").focus();
2165
- jQuery("input.dollars").blur(function() {
2166
-
2167
- var id_for_blur = document.getElementById('dollars').parentNode.id.split('_');
2168
- var value = jQuery(this).val();
2169
- jQuery("#"+id_for_blur[0]+"_mini_label_dollars").text(value);
2170
- });
2171
- }
2172
- });
2173
-
2174
- jQuery("label#"+myu+"_mini_label_cents").click(function() {
2175
- if (jQuery(this).children('input').length == 0) {
2176
-
2177
- var cents = "<input type='text' id='cents' class='cents' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2178
- jQuery(this).html(cents);
2179
- jQuery("input.cents").focus();
2180
- jQuery("input.cents").blur(function() {
2181
- var id_for_blur = document.getElementById('cents').parentNode.id.split('_');
2182
- var value = jQuery(this).val();
2183
-
2184
- jQuery("#"+id_for_blur[0]+"_mini_label_cents").text(value);
2185
- });
2186
-
2187
- }
2188
- });
2189
- });
2190
- }
2191
- else
2192
- if(document.getElementById(t+"_typeform_id_temp").value=="type_scale_rating"){
2193
- var myu = t;
2194
- jQuery(document).ready(function() {
2195
-
2196
- jQuery("#"+myu+"_mini_label_worst").click(function() {
2197
-
2198
- if (jQuery(this).children('input').length == 0) {
2199
-
2200
- var worst = "<input type='text' id='worst' class='worst' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
2201
- jQuery(this).html(worst);
2202
- jQuery("input.worst").focus();
2203
- jQuery("input.worst").blur(function() {
2204
-
2205
- var id_for_blur = document.getElementById('worst').parentNode.id.split('_');
2206
- var value = jQuery(this).val();
2207
- jQuery("#"+id_for_blur[0]+"_mini_label_worst").text(value);
2208
- });
2209
- }
2210
- });
2211
-
2212
- jQuery("label#"+myu+"_mini_label_best").click(function() {
2213
- if (jQuery(this).children('input').length == 0) {
2214
-
2215
- var best = "<input type='text' id='best' class='best' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
2216
- jQuery(this).html(best);
2217
- jQuery("input.best").focus();
2218
- jQuery("input.best").blur(function() {
2219
- var id_for_blur = document.getElementById('best').parentNode.id.split('_');
2220
- var value = jQuery(this).val();
2221
-
2222
- jQuery("#"+id_for_blur[0]+"_mini_label_best").text(value);
2223
- });
2224
-
2225
- }
2226
- });
2227
-
2228
-
2229
-
2230
- });
2231
- }
2232
- }
2233
- form_view = 1;
2234
- form_view_count = 0;
2235
- for (i = 1; i <= 30; i++) {
2236
- if (document.getElementById('form_id_tempform_view'+i)) {
2237
- form_view_count++;
2238
- form_view_max=i;
2239
- }
2240
- }
2241
- if (form_view_count > 1) {
2242
- for (i=1; i<=form_view_max; i++) {
2243
- if (document.getElementById('form_id_tempform_view'+i)) {
2244
- first_form_view=i;
2245
- break;
2246
- }
2247
- }
2248
- form_view=form_view_max;
2249
- generate_page_nav(first_form_view);
2250
- var img_EDIT = document.createElement("img");
2251
- img_EDIT.setAttribute("src", "<?php echo WD_FMC_URL . '/images/edit.png'; ?>");
2252
- img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
2253
- img_EDIT.setAttribute("onclick", 'el_page_navigation()');
2254
- var td_EDIT = document.getElementById("edit_page_navigation");
2255
- td_EDIT.appendChild(img_EDIT);
2256
- document.getElementById('page_navigation').appendChild(td_EDIT);
2257
- }
2258
- //if(document.getElementById('take').innerHTML.indexOf('up_row(')==-1) location.reload(true);
2259
- //else
2260
-
2261
- document.getElementById('form').value=document.getElementById('take').innerHTML;
2262
- document.getElementById('araqel').value = 1;
2263
- }
2264
- jQuery(window).load(function () {
2265
- formOnload();
2266
- });
2267
- </script>
2268
-
2269
- <input type="hidden" name="option" value="com_formmaker" />
2270
- <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
2271
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
2272
-
2273
- <input type="hidden" id="task" name="task" value=""/>
2274
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
2275
- </form>
2276
- <script>
2277
- jQuery(window).load(function() {
2278
- fm_popup();
2279
- });
2280
- </script>
2281
- <?php
2282
- }
2283
-
2284
- public function form_options_old($id) {
2285
- $row = $this->model->get_row_data($id);
2286
- $themes = $this->model->get_theme_rows_data('_old');
2287
- $page_title = $row->title . ' form options';
2288
- $label_id = array();
2289
- $label_label = array();
2290
- $label_type = array();
2291
- $label_all = explode('#****#', $row->label_order_current);
2292
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
2293
- foreach ($label_all as $key => $label_each) {
2294
- $label_id_each = explode('#**id**#', $label_each);
2295
- array_push($label_id, $label_id_each[0]);
2296
- $label_order_each = explode('#**label**#', $label_id_each[1]);
2297
- array_push($label_label, $label_order_each[0]);
2298
- array_push($label_type, $label_order_each[1]);
2299
- }
2300
- ?>
2301
- <script>
2302
- gen = "<?php echo $row->counter; ?>";
2303
- form_view_max = 20;
2304
- function set_preview() {
2305
- document.getElementById('preview_form').href = '<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id='+document.getElementById('theme').value+'&width=1000&height=500&TB_iframe=1';
2306
- }
2307
- </script>
2308
- <div style="font-size: 14px; font-weight: bold;">
2309
- This section allows you to edit form options.
2310
- <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-3.html">Read More in User Manual</a>
2311
- </div>
2312
- <form class="wrap" method="post" action="admin.php?page=manage_fmc" style="width:99%;" name="adminForm" id="adminForm">
2313
- <?php wp_nonce_field('nonce_fmc', 'nonce_fmc'); ?>
2314
- <h2><?php echo $page_title; ?></h2>
2315
- <div style="float: right; margin: 0 5px 0 0;">
2316
- <input class="button-secondary" type="submit" onclick="if (fm_check_email('mail') ||
2317
- fm_check_email('from_mail') ||
2318
- fm_check_email('paypal_email')) {return false;}; fm_set_input_value('task', 'save_options_old')" value="Save"/>
2319
- <input class="button-secondary" type="submit" onclick="if (fm_check_email('mail') ||
2320
- fm_check_email('from_mail') ||
2321
- fm_check_email('paypal_email')) {return false;}; fm_set_input_value('task', 'apply_options_old')" value="Apply"/>
2322
- <input class="button-secondary" type="submit" onclick="fm_set_input_value('task', 'cancel_options_old')" value="Cancel"/>
2323
- </div>
2324
- <input type="hidden" name="take" id="take" value="<?php $row->form ?>">
2325
- <div class="submenu-box" style="width: 99%; float: left; margin: 15px 0 0 0;">
2326
- <div class="submenu-pad">
2327
- <ul id="submenu" class="configuration">
2328
- <li>
2329
- <a id="general" class="fm_fieldset_tab" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
2330
- </li>
2331
- <li>
2332
- <a id="actions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
2333
- </li>
2334
- <li>
2335
- <a id="payment" class="fm_fieldset_tab" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
2336
- </li>
2337
- <li>
2338
- <a id="javascript" class="fm_fieldset_tab" onclick="form_maker_options_tabs('javascript')" href="#">JavaScript</a>
2339
- </li>
2340
- <li>
2341
- <a id="custom" class="fm_fieldset_tab" onclick="form_maker_options_tabs('custom')" href="#">Custom Text in Email</a>
2342
- </li>
2343
- </ul>
2344
- </div>
2345
- </div>
2346
- <fieldset id="actions_fieldset" class="adminform fm_fieldset_deactive">
2347
- <legend style="color:#0B55C4;font-weight: bold;">Actions after submission</legend>
2348
- <table class="admintable">
2349
- <tr valign="top">
2350
- <td class="fm_options_label">
2351
- <label>Action type</label>
2352
- </td>
2353
- <td class="fm_options_value">
2354
- <div><input type="radio" name="submit_text_type" id="text_type_none" onclick="set_type('none')" value="1" <?php echo ($row->submit_text_type != 2 && $row->submit_text_type != 3 && $row->submit_text_type != 4 && $row->submit_text_type != 5) ? "checked" : ""; ?> /><label for="text_type_none">Stay on Form</label></div>
2355
- <div><input type="radio" name="submit_text_type" id="text_type_post" onclick="set_type('post')" value="2" <?php echo ($row->submit_text_type == 2) ? "checked" : ""; ?> /><label for="text_type_post">Post</label></label></div>
2356
- <div><input type="radio" name="submit_text_type" id="text_type_page" onclick="set_type('page')" value="5" <?php echo ($row->submit_text_type == 5) ? "checked" : ""; ?> /><label for="text_type_page">Page</label></label></div>
2357
- <div><input type="radio" name="submit_text_type" id="text_type_custom_text" onclick="set_type('custom_text')" value="3" <?php echo ($row->submit_text_type == 3 ) ? "checked" : ""; ?> /><label for="text_type_custom_text">Custom Text</label></label></div>
2358
- <div><input type="radio" name="submit_text_type" id="text_type_url" onclick="set_type('url')" value="4" <?php echo ($row->submit_text_type == 4) ? "checked" : ""; ?> /><label for="text_type_url">URL</div>
2359
- </td>
2360
- </tr>
2361
- <tr id="none" <?php echo (($row->submit_text_type == 2 || $row->submit_text_type == 3 || $row->submit_text_type == 4 || $row->submit_text_type == 5) ? 'style="display:none"' : ''); ?>>
2362
- <td class="fm_options_label">
2363
- <label>Stay on Form</label>
2364
- </td>
2365
- <td class="fm_options_value">
2366
- <img src="<?php echo WD_FMC_URL . '/images/tick.png'; ?>" border="0">
2367
- </td>
2368
- </tr>
2369
- <tr id="post" <?php echo (($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
2370
- <td class="fm_options_label">
2371
- <label for="post_name">Post</label>
2372
- </td>
2373
- <td class="fm_options_value">
2374
- <select id="post_name" name="post_name">
2375
- <option value="0">- Select Post -</option>
2376
- <?php
2377
- // The Query.
2378
- $args = array('posts_per_page' => 10000);
2379
- query_posts($args);
2380
- // The Loop.
2381
- while (have_posts()) : the_post(); ?>
2382
- <option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php echo (($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
2383
- <?php
2384
- endwhile;
2385
- // Reset Query.
2386
- wp_reset_query();
2387
- ?>
2388
- </select>
2389
- </td>
2390
- </tr>
2391
- <tr id="page" <?php echo (($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
2392
- <td class="fm_options_label">
2393
- <label for="page_name">Page</label>
2394
- </td>
2395
- <td class="fm_options_value">
2396
- <select id="page_name" name="page_name" style="width:153px; font-size:11px;">
2397
- <option value="0">- Select Page -</option>
2398
- <?php
2399
- // The Query.
2400
- $pages = get_pages();
2401
- // The Loop.
2402
- foreach ($pages as $page) {
2403
- $page_id = get_page_link($page->ID);
2404
- ?>
2405
- <option value="<?php echo $page_id; ?>" <?php echo (($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
2406
- <?php
2407
- }
2408
- // Reset Query.
2409
- wp_reset_query();
2410
- ?>
2411
- </select>
2412
- </td>
2413
- </tr>
2414
- <tr id="custom_text" <?php echo (($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
2415
- <td class="fm_options_label">
2416
- <label for="submit_text">Text</label>
2417
- </td>
2418
- <td class="fm_options_value">
2419
- <?php
2420
- if (user_can_richedit()) {
2421
- wp_editor($row->submit_text, 'submit_text', array('teeny' => FALSE, 'textarea_name' => 'submit_text', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2422
- }
2423
- else {
2424
- ?>
2425
- <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical;">
2426
- <?php echo $row->submit_text; ?>
2427
- </textarea>
2428
- <?php
2429
- }
2430
- ?>
2431
- </td>
2432
- </tr>
2433
- <tr id="url" <?php echo (($row->submit_text_type != 4 ) ? 'style="display:none"' : ''); ?>>
2434
- <td class="fm_options_label">
2435
- <label for="url">URL</label>
2436
- </td>
2437
- <td class="fm_options_value">
2438
- <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url; ?>" />
2439
- </td>
2440
- </tr>
2441
- </table>
2442
- </fieldset>
2443
- <fieldset id="custom_fieldset" class="adminform fm_fieldset_deactive">
2444
- <legend style="color:#0B55C4;font-weight: bold;">Custom text in email</legend>
2445
- <table class="admintable">
2446
- <tr>
2447
- <td class="fm_options_label" valign="top">
2448
- <label>For Administrator</label>
2449
- </td>
2450
- <td class="fm_options_value">
2451
- <div style="margin-bottom:5px">
2452
- <?php
2453
- $choise = "document.getElementById('script_mail')";
2454
- for ($i = 0; $i < count($label_label); $i++) {
2455
- if ($label_type[$i] == "type_submit_reset" || $label_type[$i] == "type_editor" || $label_type[$i] == "type_map" || $label_type[$i] == "type_mark_map" || $label_type[$i] == "type_captcha" || $label_type[$i] == "type_recaptcha" || $label_type[$i] == "type_button") {
2456
- continue;
2457
- }
2458
- $param = htmlspecialchars(addslashes($label_label[$i]));
2459
- ?>
2460
- <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo htmlspecialchars(addslashes($label_label[$i])); ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
2461
- <?php
2462
- }
2463
- ?>
2464
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2465
- </div>
2466
- <?php
2467
- if (user_can_richedit()) {
2468
- wp_editor($row->script_mail, 'script_mail', array('teeny' => FALSE, 'textarea_name' => 'script_mail', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2469
- }
2470
- else {
2471
- ?>
2472
- <textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail; ?></textarea>
2473
- <?php
2474
- }
2475
- ?>
2476
- </td>
2477
- </tr>
2478
- <tr>
2479
- <td valign="top" height="30"></td>
2480
- <td valign="top"></td>
2481
- </tr>
2482
- <tr>
2483
- <td class="fm_options_label" valign="top">
2484
- <label>For User</label>
2485
- </td>
2486
- <td class="fm_options_value">
2487
- <div style="margin-bottom:5px">
2488
- <?php
2489
- $choise = "document.getElementById('script_mail_user')";
2490
- for ($i = 0; $i < count($label_label); $i++) {
2491
- if ($label_type[$i] == "type_submit_reset" || $label_type[$i] == "type_editor" || $label_type[$i] == "type_map" || $label_type[$i] == "type_mark_map" || $label_type[$i] == "type_captcha" || $label_type[$i] == "type_recaptcha" || $label_type[$i] == "type_button") {
2492
- continue;
2493
- }
2494
- $param = htmlspecialchars(addslashes($label_label[$i]));
2495
- ?>
2496
- <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo htmlspecialchars(addslashes($label_label[$i])); ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
2497
- <?php
2498
- }
2499
- ?>
2500
- <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2501
- </div>
2502
- <?php
2503
- if (user_can_richedit()) {
2504
- wp_editor($row->script_mail_user, 'script_mail_user', array('teeny' => FALSE, 'textarea_name' => 'script_mail_user', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2505
- }
2506
- else {
2507
- ?>
2508
- <textarea name="script_mail_user" id="script_mail_user" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail_user; ?></textarea>
2509
- <?php
2510
- }
2511
- ?>
2512
- </td>
2513
- </tr>
2514
- </table>
2515
- </fieldset>
2516
- <fieldset id="general_fieldset" class="adminform fm_fieldset_deactive">
2517
- <legend style="color:#0B55C4;font-weight: bold;">General Options</legend>
2518
- <table class="admintable" style="float:left">
2519
- <tr valign="top">
2520
- <td class="fm_options_label">
2521
- <label for="mail">Email to send submissions to</label>
2522
- </td>
2523
- <td class="fm_options_value">
2524
- <input id="mail" name="mail" value="<?php echo $row->mail; ?>" style="width:250px;" />
2525
- </td>
2526
- </tr>
2527
- <tr valign="top">
2528
- <td class="fm_options_label">
2529
- <label for="from_mail">From Email</label>
2530
- </td>
2531
- <td class="fm_options_value">
2532
- <input id="from_mail" name="from_mail" value="<?php echo $row->from_mail; ?>" style="width:250px;" />
2533
- </td>
2534
- </tr>
2535
- <tr valign="top">
2536
- <td class="fm_options_label">
2537
- <label for="from_name">From Name</label>
2538
- </td>
2539
- <td class="fm_options_value">
2540
- <input id="from_name" name="from_name" value="<?php echo $row->from_name; ?>" style="width:250px;"/>
2541
- </td>
2542
- </tr>
2543
- <tr valign="top">
2544
- <td class="fm_options_label">
2545
- <label for="theme">Theme</label>
2546
- </td>
2547
- <td class="fm_options_value">
2548
- <select id="theme" name="theme" style="width:260px;" onChange="set_preview()">
2549
- <?php
2550
- foreach ($themes as $theme) {
2551
- ?>
2552
- <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
2553
- <?php
2554
- }
2555
- ?>
2556
- </select>
2557
- <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'id' => $row->theme, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="preview_form" title="Form Preview" onclick="return false;">
2558
- Preview
2559
- </a>
2560
- </td>
2561
- </tr>
2562
- </table>
2563
- </fieldset>
2564
- <fieldset id="payment_fieldset" class="adminform fm_fieldset_deactive">
2565
- <legend style="color:#0B55C4;font-weight: bold;">Payment Options</legend>
2566
- <table class="admintable">
2567
- <tr valign="top">
2568
- <td class="fm_options_label">
2569
- <label>Turn Paypal On</label>
2570
- </td>
2571
- <td class="fm_options_value">
2572
- <div><input type="radio" name="paypal_mode" id="paypal_mode1" value="1" <?php echo ($row->paypal_mode == "1") ? "checked" : ""; ?> /><label for="paypal_mode1">On</label></div>
2573
- <div><input type="radio" name="paypal_mode" id="paypal_mode2" value="0" <?php echo ($row->paypal_mode != "1") ? "checked" : ""; ?> /><label for="paypal_mode2">Off</label></div>
2574
- </td>
2575
- </tr>
2576
- <tr valign="top">
2577
- <td class="fm_options_label">
2578
- <label>Checkout Mode</label>
2579
- </td>
2580
- <td class="fm_options_value">
2581
- <div><input type="radio" name="checkout_mode" id="checkout_mode1" value="production" <?php echo ($row->checkout_mode == "production") ? "checked" : ""; ?> /><label for="checkout_mode1">Production</label></div>
2582
- <div><input type="radio" name="checkout_mode" id="checkout_mode2" value="testmode" <?php echo ($row->checkout_mode != "production") ? "checked" : ""; ?> /><label for="checkout_mode2">Testmode</label></div>
2583
- </td>
2584
- </tr>
2585
- <tr valign="top">
2586
- <td class="fm_options_label">
2587
- <label for="paypal_email">Paypal email</label>
2588
- </td>
2589
- <td class="fm_options_value">
2590
- <input type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px">
2591
- </td>
2592
- </tr>
2593
- <tr valign="top">
2594
- <td class="fm_options_label">
2595
- <label for="payment_currency">Payment Currency</label>
2596
- </td>
2597
- <td class="fm_options_value">
2598
- <select id="payment_currency" name="payment_currency" style="width:253px">
2599
- <option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ &#8226; U.S. Dollar</option>
2600
- <option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>&#8364; &#8226; Euro</option>
2601
- <option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>&#163; &#8226; Pound Sterling</option>
2602
- <option value="JPY" <?php echo (($row->payment_currency == 'JPY') ? 'selected' : ''); ?>>&#165; &#8226; Japanese Yen</option>
2603
- <option value="CAD" <?php echo (($row->payment_currency == 'CAD') ? 'selected' : ''); ?>>C$ &#8226; Canadian Dollar</option>
2604
- <option value="MXN" <?php echo (($row->payment_currency == 'MXN') ? 'selected' : ''); ?>>Mex$ &#8226; Mexican Peso</option>
2605
- <option value="HKD" <?php echo (($row->payment_currency == 'HKD') ? 'selected' : ''); ?>>HK$ &#8226; Hong Kong Dollar</option>
2606
- <option value="HUF" <?php echo (($row->payment_currency == 'HUF') ? 'selected' : ''); ?>>Ft &#8226; Hungarian Forint</option>
2607
- <option value="NOK" <?php echo (($row->payment_currency == 'NOK') ? 'selected' : ''); ?>>kr &#8226; Norwegian Kroner</option>
2608
- <option value="NZD" <?php echo (($row->payment_currency == 'NZD') ? 'selected' : ''); ?>>NZ$ &#8226; New Zealand Dollar</option>
2609
- <option value="SGD" <?php echo (($row->payment_currency == 'SGD') ? 'selected' : ''); ?>>S$ &#8226; Singapore Dollar</option>
2610
- <option value="SEK" <?php echo (($row->payment_currency == 'SEK') ? 'selected' : ''); ?>>kr &#8226; Swedish Kronor</option>
2611
- <option value="PLN" <?php echo (($row->payment_currency == 'PLN') ? 'selected' : ''); ?>>zl &#8226; Polish Zloty</option>
2612
- <option value="AUD" <?php echo (($row->payment_currency == 'AUD') ? 'selected' : ''); ?>>A$ &#8226; Australian Dollar</option>
2613
- <option value="DKK" <?php echo (($row->payment_currency == 'DKK') ? 'selected' : ''); ?>>kr &#8226; Danish Kroner</option>
2614
- <option value="CHF" <?php echo (($row->payment_currency == 'CHF') ? 'selected' : ''); ?>>CHF &#8226; Swiss Francs</option>
2615
- <option value="CZK" <?php echo (($row->payment_currency == 'CZK') ? 'selected' : ''); ?>>Kc &#8226; Czech Koruny</option>
2616
- <option value="ILS" <?php echo (($row->payment_currency == 'ILS') ? 'selected' : ''); ?>>&#8362; &#8226; Israeli Sheqel</option>
2617
- <option value="BRL" <?php echo (($row->payment_currency == 'BRL') ? 'selected' : ''); ?>>R$ &#8226; Brazilian Real</option>
2618
- <option value="TWD" <?php echo (($row->payment_currency == 'TWD') ? 'selected' : ''); ?>>NT$ &#8226; Taiwan New Dollars</option>
2619
- <option value="MYR" <?php echo (($row->payment_currency == 'MYR') ? 'selected' : ''); ?>>RM &#8226; Malaysian Ringgit</option>
2620
- <option value="PHP" <?php echo (($row->payment_currency == 'PHP') ? 'selected' : ''); ?>>&#8369; &#8226; Philippine Peso</option>
2621
- <option value="THB" <?php echo (($row->payment_currency == 'THB') ? 'selected' : ''); ?>>&#xe3f; &#8226; Thai Bahtv</option>
2622
- </select>
2623
- </td>
2624
- </tr>
2625
- <tr valign="top">
2626
- <td class="fm_options_label">
2627
- <label for="tax">Tax</label>
2628
- </td>
2629
- <td class="fm_options_value">
2630
- <input type="text" name="tax" id="tax" value="<?php echo $row->tax; ?>" class="text_area" style="width: 40px;" onKeyPress="return check_isnum_point(event)"> %
2631
- </td>
2632
- </tr>
2633
- </table>
2634
- </fieldset>
2635
- <fieldset id="javascript_fieldset" class="adminform fm_fieldset_deactive">
2636
- <legend style="color:#0B55C4;font-weight: bold;">JavaScript</legend>
2637
- <table class="admintable">
2638
- <tr valign="top">
2639
- <td class="fm_options_label">
2640
- <label for="javascript">Javascript</label>
2641
- </td>
2642
- <td class="fm_options_value">
2643
- <textarea style="margin: 0px;" cols="60" rows="30" name="javascript" id="javascript"><?php echo $row->javascript; ?></textarea>
2644
- </td>
2645
- </tr>
2646
- </table>
2647
- </fieldset>
2648
- <input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo WDW_FMC_Library::get('fieldset_id', 'general'); ?>" />
2649
- <input type="hidden" id="task" name="task" value=""/>
2650
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
2651
- </form>
2652
- <script>
2653
- jQuery(window).load(function () {
2654
- form_maker_options_tabs(jQuery("#fieldset_id").val());
2655
- fm_popup();
2656
- });
2657
- </script>
2658
- <?php
2659
- }
2660
-
2661
- public function form_options($id) {
2662
-
2663
-
2664
- $row = $this->model->get_row_data($id);
2665
- $themes = $this->model->get_theme_rows_data();
2666
- $queries = $this->model->get_queries_rows_data($id);
2667
- $userGroups = get_editable_roles();
2668
- $page_title = $row->title . ' form options';
2669
- $label_id = array();
2670
- $label_label = array();
2671
- $label_type = array();
2672
- $label_all = explode('#****#', $row->label_order_current);
2673
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
2674
- foreach ($label_all as $key => $label_each) {
2675
- $label_id_each = explode('#**id**#', $label_each);
2676
- array_push($label_id, $label_id_each[0]);
2677
- $label_order_each = explode('#**label**#', $label_id_each[1]);
2678
- array_push($label_label, $label_order_each[0]);
2679
- array_push($label_type, $label_order_each[1]);
2680
- }
2681
- $fields = explode('*:*id*:*type_submitter_mail*:*type*:*', $row->form_fields);
2682
- $fields_count = count($fields);
2683
- ?>
2684
- <script>
2685
- function fm_change_radio_checkbox_text(elem) {
2686
- var labels_array = [];
2687
- labels_array['paypal_mode'] = ['Off', 'On'];
2688
- labels_array['checkout_mode'] = ['Testmode', 'Production'];
2689
- labels_array['mail_mode'] = ['Text', 'HTML'];
2690
- labels_array['mail_mode_user'] = ['Text', 'HTML'];
2691
- labels_array['value'] = ['1', '0'];
2692
-
2693
- jQuery(elem).val(labels_array['value'][jQuery(elem).val()]);
2694
- jQuery(elem).next().val(jQuery(elem).val());
2695
-
2696
- var clicked_element = labels_array[jQuery(elem).attr('name')];
2697
- jQuery(elem).find('label').html(clicked_element[jQuery(elem).val()]);
2698
- if(jQuery( elem ).hasClass( "fm-text-yes" )) {
2699
- jQuery( elem ).removeClass('fm-text-yes').addClass('fm-text-no');
2700
- jQuery(elem).find("span").animate({
2701
- right: parseInt(jQuery( elem ).css( "width")) - 14 + 'px'
2702
- }, 400, function() {
2703
- });
2704
- }
2705
- else {
2706
- jQuery( elem ).removeClass('fm-text-no').addClass('fm-text-yes');
2707
- jQuery(elem).find("span").animate({
2708
- right: 0
2709
- }, 400, function() {
2710
- });
2711
- }
2712
- }
2713
-
2714
- gen = "<?php echo $row->counter; ?>";
2715
- form_view_max = 20;
2716
- function set_preview() {
2717
- jQuery("#preview_form").attr("onclick", "tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&test_theme=" + jQuery('#theme').val() + "&width=1000&height=500&TB_iframe=1'); return false;");
2718
- jQuery("#edit_css").attr("onclick", "tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id=" + jQuery('#theme').val() + "&width=800&height=500&TB_iframe=1'); return false;");
2719
- }
2720
-
2721
- function set_condition() {
2722
- field_condition = '';
2723
- for(i=0;i<500;i++) {
2724
- conditions = '';
2725
- if(document.getElementById("condition"+i)) {
2726
- field_condition+=document.getElementById("show_hide"+i).value+"*:*show_hide*:*";
2727
- field_condition+=document.getElementById("fields"+i).value+"*:*field_label*:*";
2728
- field_condition+=document.getElementById("all_any"+i).value+"*:*all_any*:*";
2729
- for(k=0;k<500;k++) {
2730
- if(document.getElementById("condition_div"+i+"_"+k)) {
2731
- conditions+=document.getElementById("field_labels"+i+"_"+k).value+"***";
2732
- conditions+=document.getElementById("is_select"+i+"_"+k).value+"***";
2733
- if(document.getElementById("field_value"+i+"_"+k).tagName=="SELECT" ) {
2734
- if(document.getElementById("field_value"+i+"_"+k).getAttribute('multiple')) {
2735
- var sel = document.getElementById("field_value"+i+"_"+k);
2736
- var selValues = '';
2737
- for(m=0; m < sel.length; m++) {
2738
- if(sel.options[m].selected)
2739
-
2740
- selValues += sel.options[m].value+"@@@";
2741
- }
2742
- conditions+=selValues;
2743
- } else {
2744
- conditions+=document.getElementById("field_value"+i+"_"+k).value;
2745
- }
2746
- }
2747
- else
2748
- conditions+=document.getElementById("field_value"+i+"_"+k).value;
2749
- conditions+="*:*next_condition*:*";
2750
- }
2751
- }
2752
- field_condition+=conditions;
2753
- field_condition+="*:*new_condition*:*";
2754
- }
2755
- }
2756
- document.getElementById('condition').value = field_condition;
2757
- }
2758
-
2759
- function show_verify_options(s){
2760
- if(s){
2761
- jQuery(".verification_div").removeAttr( "style" );
2762
- jQuery(".expire_link").removeAttr( "style" );
2763
-
2764
- } else{
2765
- jQuery(".verification_div").css( 'display', 'none' );
2766
- jQuery(".expire_link").css( 'display', 'none' );
2767
- }
2768
- }
2769
- </script>
2770
- <style>
2771
- .CodeMirror {
2772
- border: 1px solid #ccc;
2773
- font-size: 12px;
2774
- margin-bottom: 6px;
2775
- background: white;
2776
- }
2777
- </style>
2778
- <div class="fm-user-manual">
2779
- This section allows you to edit form options.
2780
- <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-3.html">Read More in User Manual</a>
2781
- </div>
2782
- <div class="fm-upgrade-pro">
2783
- <a target="_blank" href="https://web-dorado.com/files/fromContactForm.php">
2784
- <div class="fm-upgrade-img">
2785
- UPGRADE TO PRO VERSION
2786
- <span></span>
2787
- </div>
2788
- </a>
2789
- </div>
2790
- <div class="fm-clear"></div>
2791
- <form class="wrap" method="post" action="admin.php?page=manage_fmc" style="width:99%;" name="adminForm" id="adminForm">
2792
- <?php wp_nonce_field('nonce_fmc', 'nonce_fmc'); ?>
2793
- <div class="fm-page-header">
2794
- <div class="fm-page-title" style="width: inherit;">
2795
- <?php echo $page_title; ?>
2796
- </div>
2797
- <div class="fm-page-actions">
2798
- <button class="fm-button save-button small" onclick="if (fm_check_email('mailToAdd') ||fm_check_email('from_mail') || fm_check_email('reply_to') || fm_check_email('mail_from_user') || fm_check_email('reply_to_user') || fm_check_email('mail_from_other') || fm_check_email('reply_to_other') || fm_check_email('paypal_email')) {return false;}; set_condition(); wd_fm_apply_options('save_options');">
2799
- <span></span>
2800
- Save
2801
- </button>
2802
- <button class="fm-button apply-button small" onclick="if (fm_check_email('mailToAdd') || fm_check_email('from_mail') || fm_check_email('reply_to') || fm_check_email('mail_from_user') || fm_check_email('reply_to_user') || fm_check_email('mail_from_other') || fm_check_email('reply_to_other') || fm_check_email('paypal_email')) {return false;}; set_condition(); wd_fm_apply_options('apply_options');">
2803
- <span></span>
2804
- Apply
2805
- </button>
2806
- <button class="fm-button cancel-button small" onclick="fm_set_input_value('task', 'cancel_options');">
2807
- <span></span>
2808
- Cancel
2809
- </button>
2810
- </div>
2811
- <div class="fm-clear"></div>
2812
- </div>
2813
- <div class="fm-form-options">
2814
- <div class="submenu-box">
2815
- <div class="submenu-pad">
2816
- <ul id="submenu" class="configuration">
2817
- <li>
2818
- <a id="general" class="fm_fieldset_tab" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
2819
- </li>
2820
- <li>
2821
- <a id="custom" class="fm_fieldset_tab" onclick="form_maker_options_tabs('custom')" href="#">Email Options</a>
2822
- </li>
2823
- <li>
2824
- <a id="actions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
2825
- </li>
2826
- <li>
2827
- <a id="payment" class="fm_fieldset_tab" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
2828
- </li>
2829
- <li>
2830
- <a id="javascript" class="fm_fieldset_tab" onclick="form_maker_options_tabs('javascript'); codemirror_for_javascript();" href="#">JavaScript</a>
2831
- </li>
2832
- <li>
2833
- <a id="conditions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('conditions')" href="#">Conditional Fields</a>
2834
- </li>
2835
-
2836
- </ul>
2837
- </div>
2838
- </div>
2839
- <fieldset id="general_fieldset" class="adminform fm_fieldset_deactive">
2840
- <legend>General Options</legend>
2841
- <table class="admintable" >
2842
- <tr valign="top">
2843
- <td class="fm_options_label">
2844
- <label>Published</label>
2845
- </td>
2846
- <td class="fm_options_value">
2847
- <button class="fm-checkbox-radio-button <?php echo $row->published == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->published; ?>">
2848
- <span></span>
2849
- </button>
2850
- <input type="hidden" name="published" value="<?php echo $row->published; ?>"/>
2851
- </td>
2852
- </tr>
2853
- <tr valign="top">
2854
- <td class="fm_options_label">
2855
- <label>Save data(to database)</label>
2856
- </td>
2857
- <td class="fm_options_value">
2858
- <button class="fm-checkbox-radio-button <?php echo $row->savedb == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->savedb; ?>">
2859
- <span></span>
2860
- </button>
2861
- <input type="hidden" name="savedb" value="<?php echo $row->savedb; ?>"/>
2862
- </td>
2863
- </tr>
2864
- <tr valign="top">
2865
- <td class="fm_options_label">
2866
- <label for="theme">Theme</label>
2867
- </td>
2868
- <td class="fm_options_value">
2869
- <select id="theme" name="theme" onChange="set_preview()">
2870
- <?php
2871
- foreach ($themes as $theme) {
2872
- ?>
2873
- <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
2874
- <?php
2875
- }
2876
- ?>
2877
- </select>
2878
- <button id="preview_form" class="fm-button preview-button small" onclick="tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'form_id' => $row->id, 'test_theme' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>'); return false;">
2879
- <span></span>
2880
- Preview
2881
- </button>
2882
- <button id="edit_css" class="fm-button options-edit-button small" onclick="tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS_fmc', 'id' => $row->theme, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>'); return false;">
2883
- <span></span>
2884
- Edit CSS
2885
- </button>
2886
- </td>
2887
- </tr>
2888
- <tr valign="top">
2889
- <td class="fm_options_label">
2890
- <label for="requiredmark">Required fields mark</label>
2891
- </td>
2892
- <td class="fm_options_value">
2893
- <input type="text" id="requiredmark" name="requiredmark" value="<?php echo $row->requiredmark; ?>" style="width:250px;" />
2894
- </td>
2895
- </tr>
2896
- <tr valign="top">
2897
- <td class="fm_options_label">
2898
- <label>Save Uploads</label>
2899
- </td>
2900
- <td class="fm_options_value">
2901
- <button class="fm-checkbox-radio-button <?php echo $row->save_uploads == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->save_uploads; ?>">
2902
- <span></span>
2903
- </button>
2904
- <input type="hidden" name="save_uploads" value="<?php echo $row->save_uploads; ?>"/>
2905
- </td>
2906
- </tr>
2907
- </table>
2908
- <br/>
2909
- <div class="error_fm" style="padding: 5px; font-size: 14px;">Front end submissions are disabled in free version.</div>
2910
- <fieldset class="adminform">
2911
- <legend>Front end submissions access level</legend>
2912
- <table>
2913
- <tr>
2914
- <td class="key">
2915
- <label for="name">Allow User to see submissions:</label>
2916
- </td>
2917
- <td>
2918
- <?php
2919
- $checked_UserGroup=explode(',',$row->user_id_wd);
2920
- $i = 0;
2921
- foreach($userGroups as $val => $uG) {
2922
- echo '<input type="checkbox" value="'.$val .'" id="user_'.$i.'"';
2923
- if(in_array($val ,$checked_UserGroup))
2924
- echo 'checked="checked"';
2925
- echo 'onchange="acces_level('.count($userGroups).')" disabled/><label for="user_'.$i.'">'.$uG["name"].'</label><br>';
2926
- $i++;
2927
- }
2928
- ?>
2929
- <input type="checkbox" value="guest" id="user_<?php echo $i; ?>" onchange="acces_level(<?php echo count($userGroups); ?>)"<?php echo (in_array('guest', $checked_UserGroup) ? 'checked="checked"' : '') ?> disabled/><label for="user_<?php echo $i; ?>">Guest</label>
2930
- <input type="hidden" name="user_id_wd" value="<?php echo $row->user_id_wd ?>" id="user_id_wd" />
2931
- </td>
2932
- </tr>
2933
- </table>
2934
- </fieldset>
2935
- <?php
2936
- $labels_for_submissions = $this->model->get_labels($id);
2937
- $payment_info = $this->model->is_paypal($id);
2938
- $labels_id_for_submissions= array();
2939
- $label_titles_for_submissions=array();
2940
- $labels_type_for_submissions= array();
2941
- if($labels_for_submissions) {
2942
- $label_id_for_submissions= array();
2943
- $label_order_original_for_submissions= array();
2944
- $label_type_for_submissions= array();
2945
-
2946
- if(strpos($row->label_order, 'type_paypal_')) {
2947
- $row->label_order=$row->label_order."item_total#**id**#Item Total#**label**#type_paypal_payment_total#****#total#**id**#Total#**label**#type_paypal_payment_total#****#0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
2948
- }
2949
-
2950
- $label_all_for_submissions = explode('#****#',$row->label_order);
2951
- $label_all_for_submissions = array_slice($label_all_for_submissions,0, count($label_all_for_submissions)-1);
2952
- foreach($label_all_for_submissions as $key => $label_each) {
2953
- $label_id_each=explode('#**id**#',$label_each);
2954
- array_push($label_id_for_submissions, $label_id_each[0]);
2955
- $label_order_each=explode('#**label**#', $label_id_each[1]);
2956
- array_push($label_order_original_for_submissions, $label_order_each[0]);
2957
- array_push($label_type_for_submissions, $label_order_each[1]);
2958
- }
2959
-
2960
- foreach($label_id_for_submissions as $key => $label) {
2961
- if(in_array($label, $labels_for_submissions)) {
2962
- array_push($labels_type_for_submissions, $label_type_for_submissions[$key]);
2963
- array_push($labels_id_for_submissions, $label);
2964
- array_push($label_titles_for_submissions, $label_order_original_for_submissions[$key]);
2965
- }
2966
- }
2967
- }
2968
-
2969
- $stats_labels = array();
2970
- $stats_labels_ids = array();
2971
- foreach($labels_type_for_submissions as $key => $label_type_cur) {
2972
- if($label_type_cur=="type_checkbox" || $label_type_cur=="type_radio" || $label_type_cur=="type_own_select" || $label_type_cur=="type_country" || $label_type_cur=="type_paypal_select" || $label_type_cur=="type_paypal_radio" || $label_type_cur=="type_paypal_checkbox" || $label_type_cur=="type_paypal_shipping") {
2973
- $stats_labels_ids[] = $labels_id_for_submissions[$key];
2974
- $stats_labels[] = $label_titles_for_submissions[$key];
2975
- }
2976
- }
2977
- ?>
2978
- <script type="text/javascript">
2979
- function inArray(needle, myarray) {
2980
- var length = myarray.length;
2981
- for(var i = 0; i < length; i++) {
2982
- if(myarray[i] == needle) return true;
2983
- }
2984
- return false;
2985
- }
2986
-
2987
- function checked_labels(class_name) {
2988
- var checked_ids ='';
2989
- jQuery('.'+class_name).each(function() {
2990
- if(this.checked) {
2991
- checked_ids += this.value+',';
2992
- }
2993
- });
2994
-
2995
- if(class_name == 'filed_label') {
2996
- document.getElementById("frontend_submit_fields").value = checked_ids ;
2997
- if(checked_ids == document.getElementById("all_fields").value)
2998
- document.getElementById("all_fields").checked = true;
2999
- else
3000
- document.getElementById("all_fields").checked = false;
3001
- }
3002
- else {
3003
- document.getElementById("frontend_submit_stat_fields").value = checked_ids ;
3004
- if(checked_ids == document.getElementById("all_stats_fields").value)
3005
- document.getElementById("all_stats_fields").checked = true;
3006
- else
3007
- document.getElementById("all_stats_fields").checked = false;
3008
- }
3009
- }
3010
-
3011
- jQuery(document).ready(function () {
3012
- jQuery('.filed_label').each(function() {
3013
- if(document.getElementById("frontend_submit_fields").value == document.getElementById("all_fields").value)
3014
- document.getElementById("all_fields").checked = true;
3015
- if(inArray(this.value, document.getElementById("frontend_submit_fields").value.split(","))) {
3016
- this.checked = true;
3017
- }
3018
- });
3019
-
3020
- jQuery('.stats_filed_label').each(function() {
3021
- if(document.getElementById("frontend_submit_stat_fields").value == document.getElementById("all_stats_fields").value)
3022
- document.getElementById("all_stats_fields").checked = true;
3023
- if(inArray(this.value, document.getElementById("frontend_submit_stat_fields").value.split(","))) {
3024
- this.checked = true;
3025
- }
3026
- });
3027
-
3028
- jQuery(document).on('change','input[name="all_fields"]',function() {
3029
- jQuery('.filed_label').prop("checked" , this.checked);
3030
- });
3031
-
3032
- jQuery(document).on('change','input[name="all_stats_fields"]',function() {
3033
- jQuery('.stats_filed_label').prop("checked" , this.checked);
3034
- });
3035
- });
3036
- </script>
3037
- <style>
3038
- li{
3039
- list-style-type: none;
3040
- }
3041
-
3042
- .simple_table {
3043
- padding-left: 0px !important;
3044
- }
3045
-
3046
- .simple_table input, .simple_table label, .simple_table img {
3047
- display:inline-block !important;
3048
- float:none !important;
3049
- }
3050
- </style>
3051
- <fieldset class="adminform">
3052
- <legend>Fields to hide in frontend submissions</legend>
3053
- <?php if(count($label_titles_for_submissions)): ?>
3054
- <table style="margin-left:-3px;">
3055
- <tr>
3056
- <td>
3057
- <label>Select fields:</label>
3058
- </td>
3059
- <td class="simple_table">
3060
- <ul id="form_fields">
3061
- <li>
3062
- <input type="checkbox" name="all_fields" id="all_fields" value="submit_id,<?php echo implode(',',$labels_id_for_submissions)."," . ($payment_info ? "payment_info" : ""); ?>" onclick="checked_labels('filed_label')" disabled/>
3063
- <label for="all_fields">Select All</label>
3064
- </li>
3065
- <?php
3066
- echo "<li><input type=\"checkbox\" id=\"submit_id\" name=\"submit_id\" value=\"submit_id\" class=\"filed_label\" onclick=\"checked_labels('filed_label')\" disabled><label for=\"submit_id\">ID</label></li>";
3067
-
3068
- for($i=0, $n=count($label_titles_for_submissions); $i < $n ; $i++)
3069
- {
3070
- $field_label = $label_titles_for_submissions[$i];
3071
-
3072
- echo "<li><input type=\"checkbox\" id=\"filed_label".$i."\" name=\"filed_label".$i."\" value=\"".$labels_id_for_submissions[$i]."\" class=\"filed_label\" onclick=\"checked_labels('filed_label')\" disabled><label for=\"filed_label".$i."\">".(strlen($field_label) > 80 ? substr ($field_label ,0, 80).'...' : $field_label)."</label></li>";
3073
-
3074
- }
3075
- if($payment_info)
3076
- echo "<li><input type=\"checkbox\" id=\"payment_info\" name=\"payment_info\" value=\"payment_info\" class=\"filed_label\" onclick=\"checked_labels('filed_label')\" disabled><label for=\"payment_info\">Payment Info</label></li>";
3077
- ?>
3078
- </ul>
3079
- <input type="hidden" name="frontend_submit_fields" value="<?php echo $row->frontend_submit_fields ?>" id="frontend_submit_fields" />
3080
- </td>
3081
- </tr>
3082
- <?php if($stats_labels): ?>
3083
- <tr id="stats">
3084
- <td>
3085
- <label>Stats fields:</label>
3086
- </td>
3087
- <td class="simple_table">
3088
- <ul id="stats_fields">
3089
- <li>
3090
- <input type="checkbox" name="all_stats_fields" id="all_stats_fields" value="<?php echo implode(',',$stats_labels_ids).","; ?>" onclick="checked_labels('stats_filed_label')" disabled>
3091
- <label for="all_stats_fields">Select All</label>
3092
- </li>
3093
- <?php
3094
- for($i=0, $n=count($stats_labels); $i < $n ; $i++)
3095
- {
3096
- $field_label = $stats_labels[$i];
3097
- echo "<li><input type=\"checkbox\" id=\"stats_filed_label".$i."\" name=\"stats_filed_label".$i."\" value=\"".$stats_labels_ids[$i]."\" class=\"stats_filed_label\" onclick=\"checked_labels('stats_filed_label')\" disabled><label for=\"stats_filed_label".$i."\" >".(strlen($field_label) > 80 ? substr ($field_label ,0, 80).'...' : $field_label)."</label></li>";
3098
- }
3099
- ?>
3100
- </ul>
3101
- <input type="hidden" name="frontend_submit_stat_fields" value="<?php echo $row->frontend_submit_stat_fields ?>" id="frontend_submit_stat_fields" />
3102
- </td>
3103
- </tr>
3104
- <?php endif; ?>
3105
- </table>
3106
- <?php endif; ?>
3107
- </fieldset>
3108
- </fieldset>
3109
- <fieldset id="custom_fieldset" class="adminform fm_fieldset_deactive">
3110
- <legend>Email Options</legend>
3111
- <table class="admintable">
3112
- <tr valign="top">
3113
- <td style="width: 75px; vertical-align: middle;">
3114
- <label>Send E-mail</label>
3115
- </td>
3116
- <td style="padding: 15px;">
3117
- <button class="fm-checkbox-radio-button <?php echo $row->sendemail == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->sendemail; ?>">
3118
- <span></span>
3119
- </button>
3120
- <input type="hidden" name="sendemail" value="<?php echo $row->sendemail; ?>"/>
3121
- </td>
3122
- </tr>
3123
- </table>
3124
- <fieldset class="adminform fm_mail_options">
3125
- <legend>Email to Administrator</legend>
3126
- <table class="admintable">
3127
- <tr valign="top">
3128
- <td class="fm_options_label">
3129
- <label for="mailToAdd">Email to send submissions to</label>
3130
- </td>
3131
- <td class="fm_options_value">
3132
- <input type="text" id="mailToAdd" name="mailToAdd" style="width: 250px;" />
3133
- <input type="hidden" id="mail" name="mail" value="<?php echo $row->mail . ($row->mail && (substr($row->mail, -1) != ',') ? ',' : ''); ?>" />
3134
- <img src="<?php echo WD_FMC_URL . '/images/add.png?ver='. get_option("wd_form_maker_version"); ?>" style="vertical-align: middle; cursor: pointer;" title="Add more emails" onclick="if (fm_check_email('mailToAdd')) {return false;};cfm_create_input('mail', 'mailToAdd', 'cfm_mail_div', '<?php echo WD_FMC_URL; ?>')" />
3135
- <div id="cfm_mail_div">
3136
- <?php
3137
- $mail_array = explode(',', $row->mail);
3138
- foreach ($mail_array as $mail) {
3139
- if ($mail && $mail != ',') {
3140
- ?>
3141
- <div class="fm_mail_input">
3142
- <?php echo $mail; ?>
3143
- <img src="<?php echo WD_FMC_URL; ?>/images/delete.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" class="fm_delete_img" onclick="fm_delete_mail(this, '<?php echo $mail; ?>')" title="Delete Email" />
3144
- </div>
3145
- <?php
3146
- }
3147
- }
3148
- ?>
3149
- </div>
3150
- </td>
3151
- </tr>
3152
- <tr valign="top">
3153
- <td class="fm_options_label">
3154
- <label for="from_mail">Email From</label>
3155
- </td>
3156
- <td class="fm_options_value">
3157
- <?php
3158
- $is_other = TRUE;
3159
- for ($i = 0; $i < $fields_count - 1; $i++) {
3160
- ?>
3161
- <div>
3162
- <input type="radio" name="from_mail" id="from_mail<?php echo $i; ?>" value="<?php echo (strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]); ?>" <?php echo ((strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]) == $row->from_mail ? 'checked="checked"' : '' ); ?> onclick="wdhide('mail_from_other')" />
3163
- <label for="from_mail<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
3164
- </div>
3165
- <?php
3166
- if(strlen($fields[$i])!=1) {
3167
- if (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) == $row->from_mail) {
3168
- $is_other = FALSE;
3169
- }
3170
- }
3171
- else {
3172
- if($fields[$i] == $row->from_mail)
3173
- $is_other=false;
3174
- }
3175
- }
3176
- ?>
3177
- <div style="<?php echo ($fields_count == 1) ? 'display:none;' : ''; ?>">
3178
- <input type="radio" id="other" name="from_mail" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('mail_from_other')" />
3179
- <label for="other">Other</label>
3180
- </div>
3181
- <input type="text" style="width: <?php echo ($fields_count == 1) ? '250px' : '235px; margin-left: 15px' ?>; display: <?php echo ($is_other) ? 'block;' : 'none;'; ?>" id="mail_from_other" name="mail_from_other" value="<?php echo ($is_other) ? $row->from_mail : ''; ?>" />
3182
- </td>
3183
- </tr>
3184
- <tr valign="top">
3185
- <td class="fm_options_label">
3186
- <label for="from_name">From Name</label>
3187
- </td>
3188
- <td class="fm_options_value">
3189
- <input type="text" id="from_name" name="from_name" value="<?php echo $row->from_name; ?>" style="width: 250px;" />
3190
- <img src="<?php echo WD_FMC_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="document.getElementById('mail_from_labels').style.display='block';" style="vertical-align: middle; cursor: pointer;display:inline-block; margin:0px; float:none;">
3191
- <?php
3192
- $choise = "document.getElementById('from_name')";
3193
- echo '<div style="position:relative; top:-3px;"><div id="mail_from_labels" class="email_labels" style="display:none;">';
3194
- echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3195
- for($i=0; $i<count($label_label); $i++) {
3196
- if($label_type[$i]=="type_submit_reset" || $label_type[$i]=="type_editor" || $label_type[$i]=="type_map" || $label_type[$i]=="type_mark_map" || $label_type[$i]=="type_captcha"|| $label_type[$i]=="type_recaptcha" || $label_type[$i]=="type_button" || $label_type[$i]=="type_file_upload" || $label_type[$i]=="type_send_copy" || $label_type[$i]=="type_matrix")
3197
- continue;
3198
-
3199
- $param = htmlspecialchars(addslashes($label_label[$i]));
3200
- $fld_label = $param;
3201
- if(strlen($fld_label)>30) {
3202
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3203
- $fld_label = explode("\n", $fld_label);
3204
- $fld_label = $fld_label[0] . ' ...';
3205
- }
3206
-
3207
- echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_from_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3208
- }
3209
- echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3210
-
3211
- echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3212
- echo '</div></div>';
3213
- ?>
3214
- </td>
3215
- </tr>
3216
- <tr valign="top">
3217
- <td class="fm_options_label">
3218
- <label for="reply_to">Reply to<br/>(if different from "Email From") </label>
3219
- </td>
3220
- <td class="fm_options_value">
3221
- <?php
3222
- $is_other = TRUE;
3223
- for ($i = 0; $i < $fields_count - 1; $i++) {
3224
- ?>
3225
- <div>
3226
- <input type="radio" name="reply_to" id="reply_to<?php echo $i; ?>" value="<?php echo (strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]); ?>" <?php echo ((strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]) == $row->reply_to ? 'checked="checked"' : '' ); ?> onclick="wdhide('reply_to_other')" />
3227
- <label for="reply_to<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
3228
- </div>
3229
- <?php
3230
- if(strlen($fields[$i])!=1) {
3231
- if (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) == $row->reply_to) {
3232
- $is_other = FALSE;
3233
- }
3234
- }
3235
- else {
3236
- if($fields[$i] == $row->reply_to)
3237
- $is_other=false;
3238
- }
3239
- }
3240
- ?>
3241
- <div style="<?php echo ($fields_count == 1) ? 'display: none;' : ''; ?>">
3242
- <input type="radio" id="other1" name="reply_to" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('reply_to_other')" />
3243
- <label for="other1">Other</label>
3244
- </div>
3245
- <input type="text" style="width: <?php echo ($fields_count == 1) ? '250px' : '235px; margin-left: 15px'; ?>; display: <?php echo ($is_other) ? 'block;' : 'none;'; ?>" id="reply_to_other" name="reply_to_other" value="<?php echo ($is_other && $row->reply_to) ? $row->reply_to : ''; ?>" />
3246
- </td>
3247
- </tr>
3248
- <tr valign="top">
3249
- <td class="fm_options_label">
3250
- <label> CC: </label>
3251
- </td>
3252
- <td class="fm_options_value">
3253
- <input type="text" id="mail_cc" name="mail_cc" value="<?php echo $row->mail_cc ?>" style="width:250px;" />
3254
- </td>
3255
- </tr>
3256
- <tr valign="top">
3257
- <td class="fm_options_label">
3258
- <label> BCC: </label>
3259
- </td>
3260
- <td class="fm_options_value">
3261
- <input type="text" id="mail_bcc" name="mail_bcc" value="<?php echo $row->mail_bcc ?>" style="width:250px;" />
3262
- </td>
3263
- </tr>
3264
- <tr valign="top">
3265
- <td class="fm_options_label">
3266
- <label> Subject: </label>
3267
- </td>
3268
- <td class="fm_options_value">
3269
- <input type="text" id="mail_subject" name="mail_subject" value="<?php echo $row->mail_subject ?>" style="width:250px;" />
3270
- <img src="<?php echo WD_FMC_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="document.getElementById('mail_subject_labels').style.display='block';" style="vertical-align: middle;cursor: pointer; display:inline-block; margin:0px; float:none;">
3271
- <?php
3272
- $choise = "document.getElementById('mail_subject')";
3273
- echo '<div style="position:relative; top:-3px;"><div id="mail_subject_labels" class="email_labels" style="display:none;">';
3274
- for($i=0; $i<count($label_label); $i++) {
3275
- if($label_type[$i]=="type_submit_reset" || $label_type[$i]=="type_editor" || $label_type[$i]=="type_map" || $label_type[$i]=="type_mark_map" || $label_type[$i]=="type_captcha"|| $label_type[$i]=="type_recaptcha" || $label_type[$i]=="type_button" || $label_type[$i]=="type_file_upload" || $label_type[$i]=="type_send_copy" || $label_type[$i]=="type_matrix")
3276
- continue;
3277
-
3278
- $param = htmlspecialchars(addslashes($label_label[$i]));
3279
-
3280
- $fld_label = $param;
3281
- if(strlen($fld_label)>30)
3282
- {
3283
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3284
- $fld_label = explode("\n", $fld_label);
3285
- $fld_label = $fld_label[0] . ' ...';
3286
- }
3287
-
3288
- echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_subject_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3289
-
3290
- }
3291
- echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3292
-
3293
- echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3294
- echo '</div></div>';
3295
- ?>
3296
- </td>
3297
- </tr>
3298
- <tr valign="top">
3299
- <td class="fm_options_label" style="vertical-align: middle;">
3300
- <label> Mode: </label>
3301
- </td>
3302
- <td class="fm_options_value">
3303
- <button name="mail_mode"class="fm-checkbox-radio-button <?php echo $row->mail_mode == 1 ? 'fm-text-yes' : 'fm-text-no' ?> medium" onclick="fm_change_radio_checkbox_text(this); return false;" value="<?php echo $row->mail_mode ?>">
3304
- <label><?php echo $row->mail_mode == 1 ? 'HTML' : 'Text' ?></label>
3305
- <span></span>
3306
- </button>
3307
- <input type="hidden" name="mail_mode" value="<?php echo $row->mail_mode; ?>"/>
3308
- </td>
3309
- </tr>
3310
- <tr valign="top">
3311
- <td class="fm_options_label" style="vertical-align: middle;">
3312
- <label> Attach File: </label>
3313
- </td>
3314
- <td class="fm_options_value">
3315
- <div class="error_fm" style="padding: 5px; font-size: 14px;">File attach is disabled in free version.</div>
3316
- <input type="hidden" name="mail_attachment" value="<?php echo $row->mail_attachment; ?>"/>
3317
- </td>
3318
- </tr>
3319
- <tr valign="top">
3320
- <td class="fm_options_label" style="vertical-align: middle;">
3321
- <label> Email empty fields: </label>
3322
- </td>
3323
- <td class="fm_options_value">
3324
- <button class="fm-checkbox-radio-button <?php echo $row->mail_emptyfields == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->mail_emptyfields; ?>">
3325
- <span></span>
3326
- </button>
3327
- <input type="hidden" name="mail_emptyfields" value="<?php echo $row->mail_emptyfields; ?>"/>
3328
- </td>
3329
- </tr>
3330
- <tr>
3331
- <td class="fm_options_label" valign="top">
3332
- <label>Custom Text in Email For Administrator</label>
3333
- </td>
3334
- <td class="fm_options_value">
3335
- <div style="margin-bottom:5px">
3336
- <?php
3337
- $choise = "document.getElementById('script_mail')";
3338
- for ($i = 0; $i < count($label_label); $i++) {
3339
- if ($label_type[$i]=="type_submit_reset" || $label_type[$i]=="type_editor" || $label_type[$i]=="type_map" || $label_type[$i]=="type_mark_map" || $label_type[$i]=="type_captcha"|| $label_type[$i]=="type_recaptcha" || $label_type[$i]=="type_button" || $label_type[$i]=="type_send_copy")
3340
- continue;
3341
-
3342
- $param = htmlspecialchars(addslashes($label_label[$i]));
3343
- $fld_label = $param;
3344
- if(strlen($fld_label)>30) {
3345
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3346
- $fld_label = explode("\n", $fld_label);
3347
- $fld_label = $fld_label[0] . ' ...';
3348
- }
3349
-
3350
- if($label_type[$i]=="type_file_upload")
3351
- $fld_label .= '(as image)';
3352
- ?>
3353
- <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo $fld_label; ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
3354
- <?php
3355
- }
3356
- ?>
3357
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Submission ID" onClick="insertAtCursor(<?php echo $choise; ?>,'subid')" />
3358
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Ip" onClick="insertAtCursor(<?php echo $choise; ?>,'ip')" />
3359
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Username" onClick="insertAtCursor(<?php echo $choise; ?>,'username')" />
3360
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="User Email" onClick="insertAtCursor(<?php echo $choise; ?>,'useremail')" />
3361
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
3362
- </div>
3363
- <?php
3364
- if (user_can_richedit()) {
3365
- wp_editor($row->script_mail, 'script_mail', array('teeny' => FALSE, 'textarea_name' => 'script_mail', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3366
- }
3367
- else {
3368
- ?>
3369
- <textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail; ?></textarea>
3370
- <?php
3371
- }
3372
- ?>
3373
- </td>
3374
- </tr>
3375
- </table>
3376
- </fieldset>
3377
- <fieldset class="fm_mail_options">
3378
- <legend>Email to User</legend>
3379
- <table class="admintable">
3380
- <tr valign="top">
3381
- <td class="fm_options_label">
3382
- <label for="mail">Send to</label>
3383
- </td>
3384
- <td class="fm_options_value">
3385
- <?php
3386
- $fields = explode('*:*id*:*type_submitter_mail*:*type*:*', $row->form_fields);
3387
- $fields_count = count($fields);
3388
- if ($fields_count == 1) { ?>
3389
- There is no email field
3390
- <?php
3391
- }
3392
- else {
3393
- for ($i = 0; $i < $fields_count - 1; $i++) {
3394
- ?>
3395
- <div>
3396
- <input type="checkbox" name="send_to<?php echo $i; ?>" id="send_to<?php echo $i; ?>" value="<?php echo (strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]); ?>" <?php echo (is_numeric(strpos($row->send_to, '*'.(strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]).'*')) ? 'checked="checked"' : '' ); ?> style="margin: 0px 5px 0px 0px;" />
3397
- <label for="send_to<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
3398
- </div>
3399
- <?php
3400
- }
3401
- }
3402
- ?>
3403
- </td>
3404
- </tr>
3405
- <tr valign="top">
3406
- <td class="fm_options_label">
3407
- <label for="mail_from_user">Email From</label>
3408
- </td>
3409
- <td class="fm_options_value">
3410
- <input type="text" id="mail_from_user" name="mail_from_user" value="<?php echo $row->mail_from_user; ?>" style="width: 250px;" />
3411
- </td>
3412
- </tr>
3413
- <tr valign="top">
3414
- <td class="fm_options_label">
3415
- <label for="mail_from_name_user">From Name</label>
3416
- </td>
3417
- <td class="fm_options_value">
3418
- <input type="text" id="mail_from_name_user" name="mail_from_name_user" value="<?php echo $row->mail_from_name_user; ?>" style="width: 250px;"/>
3419
- <img src="<?php echo WD_FMC_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="document.getElementById('mail_from_name_user_labels').style.display='block';" style="vertical-align: middle;cursor: pointer; display:inline-block; margin:0px; float:none;">
3420
- <?php
3421
- $choise = "document.getElementById('mail_from_name_user')";
3422
- echo '<div style="position:relative; top:-3px;"><div id="mail_from_name_user_labels" class="email_labels" style="display:none;">';
3423
- for($i=0; $i<count($label_label); $i++) {
3424
- if($label_type[$i]=="type_submit_reset" || $label_type[$i]=="type_editor" || $label_type[$i]=="type_map" || $label_type[$i]=="type_mark_map" || $label_type[$i]=="type_captcha"|| $label_type[$i]=="type_recaptcha" || $label_type[$i]=="type_button" || $label_type[$i]=="type_file_upload" || $label_type[$i]=="type_send_copy")
3425
- continue;
3426
-
3427
- $param = htmlspecialchars(addslashes($label_label[$i]));
3428
- $fld_label = $param;
3429
- if(strlen($fld_label)>30) {
3430
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3431
- $fld_label = explode("\n", $fld_label);
3432
- $fld_label = $fld_label[0] . ' ...';
3433
- }
3434
-
3435
- echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3436
- }
3437
- echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3438
- echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3439
- echo '</div></div>';
3440
- ?>
3441
- </td>
3442
- </tr>
3443
- <tr valign="top">
3444
- <td class="fm_options_label">
3445
- <label for="reply_to_user">Reply to<br />(if different from "Email Form")</label>
3446
- </td>
3447
- <td class="fm_options_value">
3448
- <input type="text" id="reply_to_user" name="reply_to_user" value="<?php echo $row->reply_to_user; ?>" style="width:250px;"/>
3449
- </td>
3450
- </tr>
3451
- <tr valign="top">
3452
- <td class="fm_options_label">
3453
- <label> CC: </label>
3454
- </td>
3455
- <td class="fm_options_value">
3456
- <input type="text" id="mail_cc_user" name="mail_cc_user" value="<?php echo $row->mail_cc_user ?>" style="width:250px;" />
3457
- </td>
3458
- </tr>
3459
- <tr valign="top">
3460
- <td class="fm_options_label">
3461
- <label> BCC: </label>
3462
- </td>
3463
- <td class="fm_options_value">
3464
- <input type="text" id="mail_bcc_user" name="mail_bcc_user" value="<?php echo $row->mail_bcc_user ?>" style="width:250px;" />
3465
- </td>
3466
- </tr>
3467
- <tr valign="top">
3468
- <td class="fm_options_label">
3469
- <label> Subject: </label>
3470
- </td>
3471
- <td class="fm_options_value">
3472
- <input type="text" id="mail_subject_user" name="mail_subject_user" value="<?php echo $row->mail_subject_user ?>" style="width:250px;" />
3473
- <img src="<?php echo WD_FMC_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="document.getElementById('mail_subject_user_labels').style.display='block';" style="vertical-align: middle; cursor: pointer; display:inline-block; margin:0px; float:none;">
3474
- <?php
3475
- $choise = "document.getElementById('mail_subject_user')";
3476
- echo '<div style="position:relative; top:-3px;"><div id="mail_subject_user_labels" class="email_labels" style="display:none;">';
3477
- for($i=0; $i<count($label_label); $i++)
3478
- {
3479
- if($label_type[$i]=="type_submit_reset" || $label_type[$i]=="type_editor" || $label_type[$i]=="type_map" || $label_type[$i]=="type_mark_map" || $label_type[$i]=="type_captcha"|| $label_type[$i]=="type_recaptcha" || $label_type[$i]=="type_button" || $label_type[$i]=="type_file_upload" || $label_type[$i]=="type_send_copy")
3480
- continue;
3481
-
3482
- $param = htmlspecialchars(addslashes($label_label[$i]));
3483
-
3484
- $fld_label = $param;
3485
- if(strlen($fld_label)>30)
3486
- {
3487
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3488
- $fld_label = explode("\n", $fld_label);
3489
- $fld_label = $fld_label[0] . ' ...';
3490
- }
3491
-
3492
- echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_subject_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3493
-
3494
- }
3495
- echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3496
-
3497
- echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3498
- echo '</div></div>';
3499
- ?>
3500
- </td>
3501
- </tr>
3502
- <tr valign="top">
3503
- <td class="fm_options_label" style="vertical-align: middle;">
3504
- <label> Mode: </label>
3505
- </td>
3506
- <td class="fm_options_value">
3507
- <button name="mail_mode_user" class="fm-checkbox-radio-button <?php echo $row->mail_mode_user == 1 ? 'fm-text-yes' : 'fm-text-no' ?> medium" onclick="fm_change_radio_checkbox_text(this); return false;" value="<?php echo $row->mail_mode_user == 1 ? '1' : '0' ?>">
3508
- <label><?php echo $row->mail_mode_user == 1 ? 'HTML' : 'Text' ?></label>
3509
- <span></span>
3510
- </button>
3511
- <input type="hidden" name="mail_mode_user" value="<?php echo $row->mail_mode_user; ?>"/>
3512
- </td>
3513
- </tr>
3514
- <tr valign="top">
3515
- <td class="fm_options_label" style="vertical-align: middle;">
3516
- <label> Attach File: </label>
3517
- </td>
3518
- <td class="fm_options_value">
3519
- <div class="error_fm" style="padding: 5px; font-size: 14px;">File attach is disabled in free version.</div>
3520
- <input type="hidden" name="mail_attachment_user" value="<?php echo $row->mail_attachment_user; ?>"/>
3521
- </td>
3522
- </tr>
3523
- <tr valign="top">
3524
- <td class="fm_options_label" style="vertical-align: middle;">
3525
- <label> Email verification: </label>
3526
- </td>
3527
- <td class="fm_options_value">
3528
- <button name="mail_verify" class="fm-checkbox-radio-button <?php echo $row->mail_verify == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->mail_verify; ?>">
3529
- <span></span>
3530
- </button>
3531
- <input type="hidden" name="mail_verify" value="<?php echo $row->mail_verify; ?>"/>
3532
- </td>
3533
- </tr>
3534
- <tr valign="top" class="expire_link" <?php echo ($row->mail_verify==0 ? 'style="display:none;"' : '')?>>
3535
- <td class="fm_options_label" valign="top">
3536
- <label> Verification link expires in: </label>
3537
- </td>
3538
- <td class="fm_options_value">
3539
- <input class="inputbox" type="text" name="mail_verify_expiretime" maxlength="10" value = "<?php echo ($row->mail_verify_expiretime ? $row->mail_verify_expiretime : 0); ?>" style="width:95px;" onkeypress="return check_isnum_point(event)"/><small> -- hours (0 - never expires).</small>
3540
- </td>
3541
- </tr>
3542
- <tr>
3543
- <td class="fm_options_label" valign="top">
3544
- <label>Custom Text in Email For User</label>
3545
- </td>
3546
- <td class="fm_options_value">
3547
- <div style="margin-bottom:5px">
3548
- <?php
3549
- $choise = "document.getElementById('script_mail_user')";
3550
- for ($i = 0; $i < count($label_label); $i++) {
3551
- if ($label_type[$i] == "type_submit_reset" || $label_type[$i] == "type_editor" || $label_type[$i] == "type_map" || $label_type[$i] == "type_mark_map" || $label_type[$i] == "type_captcha" || $label_type[$i] == "type_recaptcha" || $label_type[$i] == "type_button" || $label_type[$i] == "type_file_upload" || $label_type[$i] == "type_send_copy")
3552
- continue;
3553
-
3554
- $param = htmlspecialchars(addslashes($label_label[$i]));
3555
- $fld_label = $param;
3556
- if(strlen($fld_label)>30) {
3557
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3558
- $fld_label = explode("\n", $fld_label);
3559
- $fld_label = $fld_label[0] . ' ...';
3560
- }
3561
- if($label_type[$i]=="type_file_upload")
3562
- $fld_label .= '(as image)';
3563
- ?>
3564
- <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo $fld_label; ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
3565
- <?php
3566
- }
3567
- ?>
3568
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Submission ID" onClick="insertAtCursor(<?php echo $choise; ?>,'subid')" />
3569
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Ip" onClick="insertAtCursor(<?php echo $choise; ?>,'ip')" />
3570
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Username" onClick="insertAtCursor(<?php echo $choise; ?>,'username')" />
3571
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="User Email" onClick="insertAtCursor(<?php echo $choise; ?>,'useremail')" />
3572
- <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
3573
- <div class="verification_div" <?php echo ($row->mail_verify==0 ? 'style="display:none;"' : '')?>><input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="Verification link" onClick="insertAtCursor(<?php echo $choise; ?>,'Verification link')" /> </div>
3574
- </div>
3575
- <?php
3576
- if (user_can_richedit()) {
3577
- wp_editor($row->script_mail_user, 'script_mail_user', array('teeny' => FALSE, 'textarea_name' => 'script_mail_user', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3578
- }
3579
- else {
3580
- ?>
3581
- <textarea name="script_mail_user" id="script_mail_user" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail_user; ?></textarea>
3582
- <?php
3583
- }
3584
- ?>
3585
- </td>
3586
- </tr>
3587
- </table>
3588
- </fieldset>
3589
- </fieldset>
3590
- <fieldset id="actions_fieldset" class="adminform fm_fieldset_deactive">
3591
- <legend>Actions after submission</legend>
3592
- <table class="admintable">
3593
- <tr valign="top">
3594
- <td class="fm_options_label">
3595
- <label>Action type</label>
3596
- </td>
3597
- <td class="fm_options_value">
3598
- <div>
3599
- <input type="radio" name="submit_text_type" id="text_type_none" onclick="set_type('none')" value="1" <?php echo ($row->submit_text_type != 2 && $row->submit_text_type != 3 && $row->submit_text_type != 4 && $row->submit_text_type != 5) ? "checked" : ""; ?> />
3600
- <label for="text_type_none">Stay on Form</label>
3601
- </div>
3602
- <div>
3603
- <input type="radio" name="submit_text_type" id="text_type_post" onclick="set_type('post')" value="2" <?php echo ($row->submit_text_type == 2) ? "checked" : ""; ?> />
3604
- <label for="text_type_post">Post</label>
3605
- </div>
3606
- <div>
3607
- <input type="radio" name="submit_text_type" id="text_type_page" onclick="set_type('page')" value="5" <?php echo ($row->submit_text_type == 5) ? "checked" : ""; ?> />
3608
- <label for="text_type_page">Page</label>
3609
- </div>
3610
- <div>
3611
- <input type="radio" name="submit_text_type" id="text_type_custom_text" onclick="set_type('custom_text')" value="3" <?php echo ($row->submit_text_type == 3 ) ? "checked" : ""; ?> />
3612
- <label for="text_type_custom_text">Custom Text</label>
3613
- </div>
3614
- <div>
3615
- <input type="radio" name="submit_text_type" id="text_type_url" onclick="set_type('url')" value="4" <?php echo ($row->submit_text_type == 4) ? "checked" : ""; ?> />
3616
- <label for="text_type_url">URL</label>
3617
- </div>
3618
- </td>
3619
- </tr>
3620
- <tr id="none" <?php echo (($row->submit_text_type == 2 || $row->submit_text_type == 3 || $row->submit_text_type == 4 || $row->submit_text_type == 5) ? 'style="display:none"' : ''); ?>>
3621
- <td class="fm_options_label">
3622
- <label>Stay on Form</label>
3623
- </td>
3624
- <td class="fm_options_value">
3625
- <img src="<?php echo WD_FMC_URL . '/images/verified.png'; ?>" border="0">
3626
- </td>
3627
- </tr>
3628
- <tr id="post" <?php echo (($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
3629
- <td class="fm_options_label">
3630
- <label for="post_name">Post</label>
3631
- </td>
3632
- <td class="fm_options_value">
3633
- <select id="post_name" name="post_name">
3634
- <option value="0">- Select Post -</option>
3635
- <?php
3636
- $args = array('posts_per_page' => 10000);
3637
- query_posts($args);
3638
- while (have_posts()) : the_post(); ?>
3639
- <option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php echo (($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
3640
- <?php
3641
- endwhile;
3642
- wp_reset_query();
3643
- ?>
3644
- </select>
3645
- </td>
3646
- </tr>
3647
- <tr id="page" <?php echo (($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
3648
- <td class="fm_options_label">
3649
- <label for="page_name">Page</label>
3650
- </td>
3651
- <td class="fm_options_value">
3652
- <select id="page_name" name="page_name">
3653
- <option value="0">- Select Page -</option>
3654
- <?php
3655
- $pages = get_pages();
3656
- foreach ($pages as $page) {
3657
- $page_id = get_page_link($page->ID);
3658
- ?>
3659
- <option value="<?php echo $page_id; ?>" <?php echo (($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
3660
- <?php
3661
- }
3662
- wp_reset_query();
3663
- ?>
3664
- </select>
3665
- </td>
3666
- </tr>
3667
- <tr id="custom_text" <?php echo (($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
3668
- <td class="fm_options_label">
3669
- <label for="submit_text">Text</label>
3670
- </td>
3671
- <td class="fm_options_value">
3672
- <?php $choise = "document.getElementById('submit_text')";
3673
- for ($i = 0; $i < count($label_label); $i++) {
3674
- if ($label_type[$i]=="type_submit_reset" || $label_type[$i]=="type_editor" || $label_type[$i]=="type_map" || $label_type[$i]=="type_mark_map" || $label_type[$i]=="type_captcha"|| $label_type[$i]=="type_recaptcha" || $label_type[$i]=="type_button" || $label_type[$i]=="type_send_copy" || $label_type[$i]=="type_file_upload")
3675
- continue;
3676
-
3677
- $param = htmlspecialchars(addslashes($label_label[$i]));
3678
- $fld_label = $param;
3679
- if(strlen($fld_label)>30) {
3680
- $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3681
- $fld_label = explode("\n", $fld_label);
3682
- $fld_label = $fld_label[0] . ' ...';
3683
- }
3684
-
3685
- ?>
3686
- <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo $fld_label; ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
3687
- <?php
3688
- }
3689
- ?>
3690
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Submission ID" onClick="insertAtCursor(<?php echo $choise; ?>,'subid')" />
3691
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Ip" onClick="insertAtCursor(<?php echo $choise; ?>,'ip')" />
3692
- <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="User Id" onClick="insertAtCursor(<?php echo $choise; ?>, 'userid')" />
3693
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Username" onClick="insertAtCursor(<?php echo $choise; ?>,'username')" />
3694
- <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="User Email" onClick="insertAtCursor(<?php echo $choise; ?>,'useremail')" />
3695
- <?php
3696
- if (user_can_richedit()) {
3697
- wp_editor($row->submit_text, 'submit_text', array('teeny' => FALSE, 'textarea_name' => 'submit_text', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3698
- }
3699
- else {
3700
- ?>
3701
- <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical;">
3702
- <?php echo $row->submit_text; ?>
3703
- </textarea>
3704
- <?php
3705
- }
3706
- ?>
3707
- </td>
3708
- </tr>
3709
- <tr id="url" <?php echo (($row->submit_text_type != 4 ) ? 'style="display:none"' : ''); ?>>
3710
- <td class="fm_options_label">
3711
- <label for="url">URL</label>
3712
- </td>
3713
- <td class="fm_options_value">
3714
- <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url; ?>" />
3715
- </td>
3716
- </tr>
3717
- </table>
3718
- </fieldset>
3719
- <fieldset id="payment_fieldset" class="adminform fm_fieldset_deactive">
3720
- <legend>Payment Options</legend>
3721
- <table class="admintable">
3722
- <tr>
3723
- <td colspan="2">
3724
- <div class="error_fm" style="padding: 5px; font-size: 14px;">Paypal Options are disabled in free version.</div>
3725
- </td>
3726
- </tr>
3727
- <tr valign="top">
3728
- <td class="fm_options_label">
3729
- <label>Turn Paypal On</label>
3730
- </td>
3731
- <td class="fm_options_value">
3732
- <button name="paypal_mode" class="fm-checkbox-radio-button <?php echo $row->paypal_mode == 1 ? 'fm-text-yes' : 'fm-text-no' ?> small" onclick="fm_change_radio_checkbox_text(this); return false;" value="<?php echo $row->paypal_mode == 1 ? '1' : '0' ?>" disabled="disabled">
3733
- <label><?php echo $row->paypal_mode == 1 ? 'On' : 'Off' ?></label>
3734
- <span></span>
3735
- </button>
3736
- <input type="hidden" name="paypal_mode" value="<?php echo $row->paypal_mode; ?>"/>
3737
- </td>
3738
- </tr>
3739
- <tr valign="top">
3740
- <td class="fm_options_label">
3741
- <label>Checkout Mode</label>
3742
- </td>
3743
- <td class="fm_options_value">
3744
- <button name="checkout_mode" class="fm-checkbox-radio-button <?php echo $row->checkout_mode == 1 ? 'fm-text-yes' : 'fm-text-no' ?> large" onclick="fm_change_radio_checkbox_text(this); return false;" value="<?php echo $row->checkout_mode == 1 ? '1' : '0' ?>" disabled="disabled">
3745
- <label><?php echo $row->checkout_mode == 1 ? 'Production' : 'Testmode' ?></label>
3746
- <span></span>
3747
- </button>
3748
- <input type="hidden" name="checkout_mode" value="<?php echo $row->checkout_mode; ?>"/>
3749
- </td>
3750
- </tr>
3751
- <tr valign="top">
3752
- <td class="fm_options_label">
3753
- <label for="paypal_email">Paypal email</label>
3754
- </td>
3755
- <td class="fm_options_value">
3756
- <input type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px" disabled="disabled">
3757
- </td>
3758
- </tr>
3759
- <tr valign="top">
3760
- <td class="fm_options_label">
3761
- <label for="payment_currency">Payment Currency</label>
3762
- </td>
3763
- <td class="fm_options_value">
3764
- <select id="payment_currency" name="payment_currency" disabled="disabled">
3765
- <option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ &#8226; U.S. Dollar</option>
3766
- <option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>&#8364; &#8226; Euro</option>
3767
- <option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>&#163; &#8226; Pound Sterling</option>
3768
- <option value="JPY" <?php echo (($row->payment_currency == 'JPY') ? 'selected' : ''); ?>>&#165; &#8226; Japanese Yen</option>
3769
- <option value="CAD" <?php echo (($row->payment_currency == 'CAD') ? 'selected' : ''); ?>>C$ &#8226; Canadian Dollar</option>
3770
- <option value="MXN" <?php echo (($row->payment_currency == 'MXN') ? 'selected' : ''); ?>>Mex$ &#8226; Mexican Peso</option>
3771
- <option value="HKD" <?php echo (($row->payment_currency == 'HKD') ? 'selected' : ''); ?>>HK$ &#8226; Hong Kong Dollar</option>
3772
- <option value="HUF" <?php echo (($row->payment_currency == 'HUF') ? 'selected' : ''); ?>>Ft &#8226; Hungarian Forint</option>
3773
- <option value="NOK" <?php echo (($row->payment_currency == 'NOK') ? 'selected' : ''); ?>>kr &#8226; Norwegian Kroner</option>
3774
- <option value="NZD" <?php echo (($row->payment_currency == 'NZD') ? 'selected' : ''); ?>>NZ$ &#8226; New Zealand Dollar</option>
3775
- <option value="SGD" <?php echo (($row->payment_currency == 'SGD') ? 'selected' : ''); ?>>S$ &#8226; Singapore Dollar</option>
3776
- <option value="SEK" <?php echo (($row->payment_currency == 'SEK') ? 'selected' : ''); ?>>kr &#8226; Swedish Kronor</option>
3777
- <option value="PLN" <?php echo (($row->payment_currency == 'PLN') ? 'selected' : ''); ?>>zl &#8226; Polish Zloty</option>
3778
- <option value="AUD" <?php echo (($row->payment_currency == 'AUD') ? 'selected' : ''); ?>>A$ &#8226; Australian Dollar</option>
3779
- <option value="DKK" <?php echo (($row->payment_currency == 'DKK') ? 'selected' : ''); ?>>kr &#8226; Danish Kroner</option>
3780
- <option value="CHF" <?php echo (($row->payment_currency == 'CHF') ? 'selected' : ''); ?>>CHF &#8226; Swiss Francs</option>
3781
- <option value="CZK" <?php echo (($row->payment_currency == 'CZK') ? 'selected' : ''); ?>>Kc &#8226; Czech Koruny</option>
3782
- <option value="ILS" <?php echo (($row->payment_currency == 'ILS') ? 'selected' : ''); ?>>&#8362; &#8226; Israeli Sheqel</option>
3783
- <option value="BRL" <?php echo (($row->payment_currency == 'BRL') ? 'selected' : ''); ?>>R$ &#8226; Brazilian Real</option>
3784
- <option value="TWD" <?php echo (($row->payment_currency == 'TWD') ? 'selected' : ''); ?>>NT$ &#8226; Taiwan New Dollars</option>
3785
- <option value="MYR" <?php echo (($row->payment_currency == 'MYR') ? 'selected' : ''); ?>>RM &#8226; Malaysian Ringgit</option>
3786
- <option value="PHP" <?php echo (($row->payment_currency == 'PHP') ? 'selected' : ''); ?>>&#8369; &#8226; Philippine Peso</option>
3787
- <option value="THB" <?php echo (($row->payment_currency == 'THB') ? 'selected' : ''); ?>>&#xe3f; &#8226; Thai Bahtv</option>
3788
- </select>
3789
- </td>
3790
- </tr>
3791
- <tr valign="top">
3792
- <td class="fm_options_label">
3793
- <label for="tax">Tax</label>
3794
- </td>
3795
- <td class="fm_options_value">
3796
- <input type="text" name="tax" id="tax" value="<?php echo $row->tax; ?>" class="text_area" style="width: 40px;" onKeyPress="return check_isnum_point(event)" disabled="disabled"> %
3797
- </td>
3798
- </tr>
3799
- </table>
3800
- </fieldset>
3801
- <fieldset id="javascript_fieldset" class="adminform fm_fieldset_deactive">
3802
- <legend>JavaScript</legend>
3803
- <table class="admintable">
3804
- <tr valign="top">
3805
- <td class="fm_options_label">
3806
- <label for="javascript">Javascript</label>
3807
- </td>
3808
- <td class="fm_options_value" style="width:650px;">
3809
- <textarea style="margin: 0px; height: 400px; width: 600px;" cols="60" rows="30" name="javascript" id="form_javascript"><?php echo $row->javascript; ?></textarea>
3810
- </td>
3811
- </tr>
3812
- </table>
3813
- </fieldset>
3814
- <fieldset id="conditions_fieldset" class="adminform fm_fieldset_deactive">
3815
- <?php
3816
- $ids = array();
3817
- $types = array();
3818
- $labels = array();
3819
- $paramss = array();
3820
- $all_ids = array();
3821
- $all_labels = array();
3822
-
3823
- $select_and_input = array("type_text", "type_password", "type_textarea", "type_name", "type_number", "type_phone", "type_submitter_mail", "type_address", "type_spinner", "type_checkbox", "type_radio", "type_own_select", "type_paypal_price", "type_paypal_select", "type_paypal_checkbox", "type_paypal_radio", "type_paypal_shipping");
3824
- $select_type_fields = array("type_address", "type_checkbox", "type_radio", "type_own_select", "type_paypal_select", "type_paypal_checkbox", "type_paypal_radio", "type_paypal_shipping");
3825
-
3826
- $fields=explode('*:*new_field*:*',$row->form_fields);
3827
- $fields = array_slice($fields,0, count($fields)-1);
3828
- foreach($fields as $field) {
3829
- $temp=explode('*:*id*:*',$field);
3830
- array_push($ids, $temp[0]);
3831
- array_push($all_ids, $temp[0]);
3832
- $temp=explode('*:*type*:*',$temp[1]);
3833
- array_push($types, $temp[0]);
3834
- $temp=explode('*:*w_field_label*:*',$temp[1]);
3835
- array_push($labels, $temp[0]);
3836
- array_push($all_labels, $temp[0]);
3837
- array_push($paramss, $temp[1]);
3838
-
3839
- }
3840
-
3841
- foreach($types as $key=>$value){
3842
- if(!in_array($types[$key],$select_and_input)){
3843
- unset($ids[$key]);
3844
- unset($labels[$key]);
3845
- unset($types[$key]);
3846
- unset($paramss[$key]);
3847
- }
3848
- }
3849
-
3850
- $ids = array_values($ids);
3851
- $labels = array_values($labels);
3852
- $types = array_values($types);
3853
- $paramss = array_values($paramss);
3854
-
3855
- $chose_ids = implode('@@**@@',$ids);
3856
- $chose_labels = implode('@@**@@',$labels);
3857
- $chose_types = implode('@@**@@',$types);
3858
- $chose_paramss = implode('@@**@@',$paramss);
3859
-
3860
- $all_ids_cond = implode('@@**@@',$all_ids);
3861
- $all_labels_cond = implode('@@**@@',$all_labels);
3862
-
3863
- $show_hide = array();
3864
- $field_label = array();
3865
- $all_any = array();
3866
- $condition_params = array();
3867
-
3868
- $count_of_conditions=0;
3869
- if($row->condition!="") {
3870
- $conditions=explode('*:*new_condition*:*',$row->condition);
3871
- $conditions = array_slice($conditions,0, count($conditions)-1);
3872
- $count_of_conditions = count($conditions);
3873
-
3874
- foreach($conditions as $condition) {
3875
- $temp=explode('*:*show_hide*:*',$condition);
3876
- array_push($show_hide, $temp[0]);
3877
- $temp=explode('*:*field_label*:*',$temp[1]);
3878
- array_push($field_label, $temp[0]);
3879
- $temp=explode('*:*all_any*:*',$temp[1]);
3880
- array_push($all_any, $temp[0]);
3881
- array_push($condition_params, $temp[1]);
3882
- }
3883
- }
3884
- else {
3885
- $show_hide[0]=1;
3886
- $all_any[0]='and';
3887
- $condition_params[0]='';
3888
- if($all_ids)
3889
- $field_label[0] = $all_ids[0];
3890
- }
3891
- ?>
3892
- <div>
3893
- <button class="fm-button add-button large" onclick="add_condition('<?php echo $chose_ids; ?>', '<?php echo htmlspecialchars(addslashes($chose_labels)); ?>', '<?php echo $chose_types; ?>', '<?php echo htmlspecialchars(addslashes($chose_paramss)); ?>', '<?php echo $all_ids_cond; ?>', '<?php echo htmlspecialchars(addslashes($all_labels_cond)); ?>'); return false;">
3894
- Add Condition
3895
- <span></span>
3896
- </button>
3897
- </div>
3898
- <?php
3899
- for($k=0; $k<$count_of_conditions; $k++) {
3900
- if(in_array($field_label[$k],$all_ids)) : ?>
3901
- <div id="condition<?php echo $k; ?>" class="fm-condition">
3902
- <div id="conditional_fileds<?php echo $k; ?>">
3903
- <select id="show_hide<?php echo $k; ?>" name="show_hide<?php echo $k; ?>" style="width:80px; ">
3904
- <option value="1" <?php if($show_hide[$k]==1) echo 'selected="selected"'; ?>>show</option>
3905
- <option value="0" <?php if($show_hide[$k]==0) echo 'selected="selected"'; ?>>hide</option>
3906
- </select>
3907
- <select id="fields<?php echo $k; ?>" name="fields<?php echo $k; ?>" style="width:300px; " onChange="" >
3908
- <?php
3909
- foreach($all_labels as $key => $value) {
3910
- if($field_label[$k]==$all_ids[$key])
3911
- $selected = 'selected="selected"';
3912
- else
3913
- $selected ='';
3914
- echo '<option value="'.$all_ids[$key].'" '.$selected.'>'.$value.'</option>';
3915
- }
3916
- ?>
3917
- </select>
3918
- <span>if</span>
3919
- <select id="all_any<?php echo $k; ?>" name="all_any<?php echo $k; ?>" style="width:60px; ">
3920
- <option value="and" <?php if($all_any[$k]=="and") echo 'selected="selected"'; ?>>all</option>
3921
- <option value="or" <?php if($all_any[$k]=="or") echo 'selected="selected"'; ?>>any</option>
3922
- </select>
3923
- <span>of the following match:</span>
3924
- <img src="<?php echo WD_FMC_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" title="add" onclick="add_condition_fields(<?php echo $k; ?>,'<?php echo $chose_ids; ?>', '<?php echo htmlspecialchars(addslashes($chose_labels)); ?>', '<?php echo $chose_types; ?>', '<?php echo htmlspecialchars(addslashes($chose_paramss)); ?>')" style="cursor: pointer; vertical-align: middle;">
3925
- <img src="<?php echo WD_FMC_URL . '/images/page_delete.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="delete_condition('<?php echo $k; ?>')" style="cursor: pointer; vertical-align: middle;">
3926
- </div>
3927
- <?php
3928
- if($condition_params[$k]) {
3929
- $_params = explode('*:*next_condition*:*',$condition_params[$k]);
3930
- $_params = array_slice($_params,0, count($_params)-1);
3931
-
3932
- foreach($_params as $key=>$_param) {
3933
- $key_select_or_input ='';
3934
- $param_values = explode('***',$_param);
3935
- $multiselect = explode('@@@',$param_values[2]);
3936
-
3937
- if(in_array($param_values[0],$ids)): ?>
3938
- <div id="condition_div<?php echo $k; ?>_<?php echo $key; ?>">
3939
- <select id="field_labels<?php echo $k; ?>_<?php echo $key; ?>" onchange="change_choices(this.options[this.selectedIndex].id+'_<?php echo $key; ?>','<?php echo $chose_ids; ?>', '<?php echo $chose_types; ?>', '<?php echo htmlspecialchars(addslashes($chose_paramss)); ?>')" style="width:300px;"/>
3940
- <?php
3941
- foreach($labels as $key1 => $value)
3942
- {
3943
- if($param_values[0]==$ids[$key1])
3944
- {
3945
- $selected = 'selected="selected"';
3946
- if ($types[$key1]=="type_checkbox" || $types[$key1]=="type_paypal_checkbox")
3947
- $multiple = 'multiple="multiple" class="multiple_select"';
3948
- else
3949
- $multiple ='';
3950
-
3951
- $key_select_or_input = $key1;
3952
- }
3953
- else
3954
- $selected ='';
3955
- if($field_label[$k]!=$ids[$key1])
3956
- echo '<option id="'.$k.'_'.$key1.'" value="'.$ids[$key1].'" '.$selected.'>'.$value.'</option>';
3957
-
3958
- }
3959
-
3960
- ?>
3961
- </select>
3962
-
3963
- <select id="is_select<?php echo $k; ?>_<?php echo $key; ?>" style="vertical-align: top; width:94px;">
3964
- <option value="==" <?php if($param_values[1]=="==") echo 'selected="selected"'; ?>>is</option>
3965
- <option value="!=" <?php if($param_values[1]=="!=") echo 'selected="selected"'; ?>>is not</option>
3966
- <option value="%" <?php if($param_values[1]=="%") echo 'selected="selected"'; ?>>like</option>
3967
-
3968
- <option value="!%" <?php if($param_values[1]=="!%") echo 'selected="selected"'; ?>>not like</option>
3969
-
3970
- <option value="=" <?php if($param_values[1]=="=") echo 'selected="selected"'; ?>>empty</option>
3971
-
3972
- <option value="!" <?php if($param_values[1]=="!") echo 'selected="selected"'; ?>>not empty</option>
3973
-
3974
- </select>
3975
-
3976
- <?php if ($key_select_or_input !== '' && in_array($types[$key_select_or_input],$select_type_fields)) : ?>
3977
- <select id="field_value<?php echo $k; ?>_<?php echo $key; ?>" <?php echo $multiple; ?> style="width: 200px;">
3978
- <?php
3979
- switch($types[$key_select_or_input])
3980
- {
3981
- case "type_own_select":
3982
- case "type_paypal_select":
3983
- $w_size = explode('*:*w_size*:*',$paramss[$key_select_or_input]);
3984
- break;
3985
-
3986
- case "type_radio":
3987
- case "type_checkbox":
3988
- case "type_paypal_radio":
3989
- case "type_paypal_checkbox":
3990
- case "type_paypal_shipping":
3991
- $w_size = explode('*:*w_flow*:*',$paramss[$key_select_or_input]);
3992
- break;
3993
- }
3994
-
3995
- $w_choices = explode('*:*w_choices*:*',$w_size[1]);
3996
- $w_choices_array = explode('***',$w_choices[0]);
3997
-
3998
- $w_choices_price = explode('*:*w_choices_price*:*',$w_choices[1]);
3999
- $w_choices_price_array = explode('***',$w_choices_price[0]);
4000
-
4001
- for($m=0; $m<count($w_choices_array); $m++)
4002
- {
4003
- if($types[$key_select_or_input]=="type_paypal_checkbox" || $types[$key_select_or_input]=="type_paypal_radio" || $types[$key_select_or_input]=="type_paypal_shipping" || $types[$key_select_or_input]=="type_paypal_select")
4004
- $w_choice = $w_choices_array[$m].'*:*value*:*'.$w_choices_price_array[$m];
4005
- else
4006
- $w_choice = $w_choices_array[$m];
4007
-
4008
- if(in_array(esc_html($w_choice),$multiselect))
4009
- {
4010
- $selected = 'selected="selected"';
4011
- }
4012
- else
4013
- $selected ='';
4014
-
4015
- if(strpos($w_choices_array[$m], '[') === false && strpos($w_choices_array[$m], ']') === false && strpos($w_choices_array[$m], ':') === false) {
4016
- echo '<option id="choise_'.$k.'_'.$m.'" value="'.$w_choice.'" '.$selected.'>'.$w_choices_array[$m].'</option>';
4017
- }
4018
- }
4019
-
4020
- if($types[$key_select_or_input]=="type_address")
4021
- {
4022
- $w_countries = array("","Afghanistan","Albania","Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombia","Comoros","Congo (Brazzaville)","Congo","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor (Timor Timur)","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Fiji","Finland","France","Gabon","Gambia, The","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea, North","Korea, South","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia and Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe");
4023
- $w_options = '';
4024
- foreach($w_countries as $w_country)
4025
- {
4026
- if(in_array($w_country,$multiselect))
4027
- {
4028
- $selected = 'selected="selected"';
4029
- }
4030
- else
4031
- $selected ='';
4032
-
4033
- echo '<option value="'.$w_country.'" '.$selected.'>'.$w_country.'</option>';
4034
- }
4035
- }
4036
-
4037
- ?>
4038
- </select>
4039
- <?php else :
4040
- if($key_select_or_input != '' && ($types[$key_select_or_input]=="type_number" || $types[$key_select_or_input]=="type_phone"))
4041
- $onkeypress_function = "onkeypress='return check_isnum_space(event)'";
4042
- else
4043
- if($key_select_or_input != '' && $types[$key_select_or_input]=="type_paypal_price")
4044
- $onkeypress_function = "onkeypress='return check_isnum_point(event)'";
4045
- else
4046
- $onkeypress_function = "";
4047
- ?>
4048
- <input id="field_value<?php echo $k; ?>_<?php echo $key; ?>" type="text" value="<?php echo $param_values[2];?>" <?php echo $onkeypress_function; ?> style=" width: 200px;"><?php endif; ?>
4049
-
4050
- <img src="<?php echo WD_FMC_URL . '/images/delete.png?ver='. get_option("wd_form_maker_version").''; ?>" id="delete_condition<?php echo $k; ?>_<?php echo $key; ?>" onclick="delete_field_condition('<?php echo $k; ?>_<?php echo $key; ?>')" style="vertical-align: middle;">
4051
- </div>
4052
- <?php endif;
4053
- }
4054
- }
4055
-
4056
- ?>
4057
- </div>
4058
- <?php endif;
4059
- }
4060
- ?>
4061
- <input type="hidden" id="condition" name="condition" value="<?php echo $row->condition; ?>" />
4062
- </fieldset>
4063
-
4064
- </div>
4065
- <input type="hidden" name="boxchecked" value="0">
4066
- <input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo WDW_FMC_Library::get('fieldset_id', 'general'); ?>" />
4067
- <input type="hidden" id="task" name="task" value=""/>
4068
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
4069
- </form>
4070
- <script>
4071
- jQuery(window).load(function () {
4072
- form_maker_options_tabs(jQuery("#fieldset_id").val());
4073
- fm_popup();
4074
- function hide_email_labels(event) {
4075
- var e = event.toElement || event.relatedTarget;
4076
- if (e.parentNode == this || e == this) {
4077
- return;
4078
- }
4079
- this.style.display="none";
4080
- }
4081
- if(document.getElementById('mail_from_labels')) {
4082
- document.getElementById('mail_from_labels').addEventListener('mouseout',hide_email_labels,true);
4083
- }
4084
- if(document.getElementById('mail_subject_labels')) {
4085
- document.getElementById('mail_subject_labels').addEventListener('mouseout',hide_email_labels,true);
4086
- }
4087
- if(document.getElementById('mail_from_name_user_labels')) {
4088
- document.getElementById('mail_from_name_user_labels').addEventListener('mouseout',hide_email_labels,true);
4089
- }
4090
- if(document.getElementById('mail_subject_user_labels')) {
4091
- document.getElementById('mail_subject_user_labels').addEventListener('mouseout',hide_email_labels,true);
4092
- }
4093
- if(document.getElementById('post_title_labels')) {
4094
- document.getElementById('post_title_labels').addEventListener('mouseout',hide_email_labels,true);
4095
- }
4096
- if(document.getElementById('post_tags_labels')) {
4097
- document.getElementById('post_tags_labels').addEventListener('mouseout',hide_email_labels,true);
4098
- }
4099
- if(document.getElementById('post_featured_image_labels')) {
4100
- document.getElementById('post_featured_image_labels').addEventListener('mouseout',hide_email_labels,true);
4101
- }
4102
- if(document.getElementById('dbox_upload_dir_labels')) {
4103
- document.getElementById('dbox_upload_dir_labels').addEventListener('mouseout',hide_email_labels,true);
4104
- }
4105
- });
4106
- function wd_fm_apply_options(task) {
4107
- set_condition();
4108
- fm_set_input_value('task', task);
4109
- document.getElementById('adminForm').submit();
4110
- }
4111
- </script>
4112
- <?php
4113
- }
4114
-
4115
- public function form_layout($id) {
4116
- $row = $this->model->get_row_data($id);
4117
- $ids = array();
4118
- $types = array();
4119
- $labels = array();
4120
- $fields = explode('*:*new_field*:*', $row->form_fields);
4121
- $fields = array_slice($fields, 0, count($fields) - 1);
4122
- foreach ($fields as $field) {
4123
- $temp = explode('*:*id*:*', $field);
4124
- array_push($ids, $temp[0]);
4125
- $temp = explode('*:*type*:*', $temp[1]);
4126
- array_push($types, $temp[0]);
4127
- $temp = explode('*:*w_field_label*:*', $temp[1]);
4128
- array_push($labels, $temp[0]);
4129
- }
4130
- ?>
4131
- <script>
4132
- var form_front = '<?php echo addslashes($row->form_front);?>';
4133
- var custom_front = '<?php echo addslashes($row->custom_front);?>';
4134
- if (custom_front == '') {
4135
- custom_front = form_front;
4136
- }
4137
- function submitbutton() {
4138
- if (jQuery('#autogen_layout').is(':checked')) {
4139
- jQuery('#custom_front').val(custom_front.replace(/\s+/g, ' ').replace(/> </g, '><'));
4140
- }
4141
- else {
4142
- jQuery('#custom_front').val(editor.getValue().replace(/\s+/g, ' ').replace(/> </g, '><'));
4143
- }
4144
- }
4145
- function insertAtCursor_form(myId, myLabel) {
4146
- if (jQuery('#autogen_layout').is(':checked')) {
4147
- alert("Uncheck the Auto-Generate Layout box.");
4148
- return;
4149
- }
4150
- myValue = '<div wdid="' + myId + '" class="wdform_row">%' + myId + ' - ' + myLabel + '%</div>';
4151
- line = editor.getCursor().line;
4152
- ch = editor.getCursor().ch;
4153
- text = editor.getLine(line);
4154
- text1 = text.substr(0, ch);
4155
- text2 = text.substr(ch);
4156
- text = text1 + myValue + text2;
4157
- editor.setLine(line, text);
4158
- editor.focus();
4159
- }
4160
- function autogen(status) {
4161
- if (status) {
4162
- custom_front = editor.getValue();
4163
- editor.setValue(form_front);
4164
- editor.setOption('readOnly', true);
4165
- autoFormat();
4166
- }
4167
- else {
4168
- editor.setValue(custom_front);
4169
- editor.setOption('readOnly', false);
4170
- autoFormat();
4171
- }
4172
- }
4173
- function autoFormat() {
4174
- CodeMirror.commands["selectAll"](editor);
4175
- editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
4176
- editor.scrollTo(0,0);
4177
- }
4178
- </script>
4179
-
4180
- <div class="fm_layout">
4181
- <form action="admin.php?page=manage_fmc" method="post" name="adminForm" enctype="multipart/form-data">
4182
- <?php wp_nonce_field('nonce_fmc', 'nonce_fmc'); ?>
4183
- <div class="fm-layout-actions">
4184
- <div class="fm-page-actions">
4185
- <button class="fm-button save-button small" onclick="submitbutton(); fm_set_input_value('task', 'save_layout');">
4186
- Save
4187
- <span></span>
4188
- </button>
4189
- <button class="fm-button apply-button small" onclick="submitbutton(); fm_set_input_value('task', 'apply_layout');">
4190
- Apply
4191
- <span></span>
4192
- </button>
4193
- <button class="fm-button cancel-button small" onclick="fm_set_input_value('task', 'cancel_options');">
4194
- Cancel
4195
- <span></span>
4196
- </button>
4197
- </div>
4198
- </div>
4199
- <div class="fm-layout-content">
4200
- <h2 style="clear: both;">Description</h2>
4201
- <p>To customize the layout of the form fields uncheck the Auto-Generate Layout box and edit the HTML.</p>
4202
- <p>You can change positioning, add in-line styles and etc. Click on the provided buttons to add the corresponding field.<br /> This will add the following line:
4203
- <b><span class="cm-tag">&lt;div</span> <span class="cm-attribute">wdid</span>=<span class="cm-string">"example_id"</span> <span class="cm-attribute">class</span>=<span class="cm-string">"wdform_row"</span><span class="cm-tag">&gt;</span>%example_id - Example%<span class="cm-tag">&lt;/div&gt;</span></b>
4204
- , where <b><span class="cm-tag">&lt;div&gt;</span></b> is used to set a row.</p>
4205
- <p>To return to the default settings you should check Auto-Generate Layout box.</p>
4206
- <h3 style="color:red">Notice</h3>
4207
- <p>Make sure not to publish the same field twice. This will cause malfunctioning of the form.</p>
4208
- <hr/>
4209
- <label for="autogen_layout" style="font-size: 20px; line-height: 45px; margin-left: 10px;">Auto Generate Layout? </label>
4210
- <input type="checkbox" value="1" name="autogen_layout" id="autogen_layout" <?php echo (($row->autogen_layout) ? 'checked="checked"' : ''); ?> />
4211
- <input type="hidden" name="custom_front" id="custom_front" value="" />
4212
- <input type="hidden" id="task" name="task" value=""/>
4213
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
4214
- <br/>
4215
- <?php
4216
- foreach($ids as $key => $id) {
4217
- if ($types[$key] != "type_section_break") {
4218
- ?>
4219
- <button onClick="insertAtCursor_form('<?php echo $ids[$key]; ?>','<?php echo $labels[$key]; ?>')" class="fm_label_buttons" title="<?php echo $labels[$key]; ?>"><?php echo $labels[$key]; ?></button>
4220
- <?php
4221
- }
4222
- }
4223
- ?>
4224
- </form>
4225
- </div>
4226
- <br /><br />
4227
- <button class="fm_submit_layout button button-secondary button-hero" onclick="autoFormat()"><strong>Apply Source Formatting</strong> <em>(ctrl-enter)</em></button>
4228
- <textarea id="source" name="source" style="display: none;"></textarea>
4229
- </div>
4230
- <script>
4231
- var editor = CodeMirror.fromTextArea(document.getElementById("source"), {
4232
- lineNumbers: true,
4233
- lineWrapping: true,
4234
- mode: "htmlmixed",
4235
- value: form_front
4236
- });
4237
- if (jQuery('#autogen_layout').is(':checked')) {
4238
- editor.setOption('readOnly', true);
4239
- editor.setValue(form_front);
4240
- }
4241
- else {
4242
- editor.setOption('readOnly', false);
4243
- editor.setValue(custom_front);
4244
- }
4245
- jQuery('#autogen_layout').click(function() {
4246
- autogen(jQuery(this).is(':checked'));
4247
- });
4248
- autoFormat();
4249
- </script>
4250
- <?php
4251
- }
4252
-
4253
- ////////////////////////////////////////////////////////////////////////////////////////
4254
- // Getters & Setters //
4255
- ////////////////////////////////////////////////////////////////////////////////////////
4256
- ////////////////////////////////////////////////////////////////////////////////////////
4257
- // Private Methods //
4258
- ////////////////////////////////////////////////////////////////////////////////////////
4259
- ////////////////////////////////////////////////////////////////////////////////////////
4260
- // Listeners //
4261
- ////////////////////////////////////////////////////////////////////////////////////////
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4262
  }
1
+ <?php
2
+
3
+ class FMViewManage_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $rows_data = $this->model->get_rows_data();
27
+ $page_nav = $this->model->page_nav();
28
+ $search_value = ((isset($_POST['search_value'])) ? esc_html($_POST['search_value']) : '');
29
+ $search_select_value = ((isset($_POST['search_select_value'])) ? (int) $_POST['search_select_value'] : 0);
30
+ $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
31
+ $order_by_array = array('id', 'title', 'mail');
32
+ $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
33
+ $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
34
+ $ids_string = '';
35
+ ?>
36
+ <div class="fm-user-manual">
37
+ This section allows you to create, edit forms.
38
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
39
+ </div>
40
+ <div class="fm-upgrade-pro">
41
+ <a target="_blank" href="https://web-dorado.com/files/fromContactForm.php">
42
+ <div class="fm-upgrade-img">
43
+ UPGRADE TO PRO VERSION
44
+ <span></span>
45
+ </div>
46
+ </a>
47
+ </div>
48
+ <div class="fm-clear"></div>
49
+ <form onkeypress="fm_doNothing(event)" class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fmc" style="width:99%;">
50
+ <?php wp_nonce_field('nonce_fmc', 'nonce_fmc'); ?>
51
+ <div class="fm-page-banner">
52
+ <div class="fm-logo">
53
+ </div>
54
+ <div class="fm-logo-title">Contact Form</br>Maker</div>
55
+ <button class="fm-button add-button medium" onclick="fm_set_input_value('task', 'add'); fm_form_submit(event, 'manage_form')">
56
+ <span></span>
57
+ Add New
58
+ </button>
59
+ </div>
60
+ <div class="tablenav top">
61
+ <?php
62
+ WDW_FMC_Library::search('Title', $search_value, 'manage_form');
63
+ WDW_FMC_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'manage_form');
64
+ ?>
65
+ </div>
66
+ <table class="wp-list-table widefat fixed pages">
67
+ <thead>
68
+ <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;"/></th>
69
+ <th class="table_small_col <?php if ($order_by == 'id') { echo $order_class; } ?>">
70
+ <a onclick="fm_set_input_value('task', ''); fm_set_input_value('order_by', 'id'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'manage_form')" href="">
71
+ <span>ID</span><span class="sorting-indicator"></span></a>
72
+ </th>
73
+ <th class="<?php if ($order_by == 'title') { echo $order_class; } ?>">
74
+ <a onclick="fm_set_input_value('task', ''); fm_set_input_value('order_by', 'title'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'title' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'manage_form')" href="">
75
+ <span>Title</span><span class="sorting-indicator"></span></a>
76
+ </th>
77
+ <th class="<?php if ($order_by == 'mail') { echo $order_class; } ?>">
78
+ <a onclick="fm_set_input_value('task', ''); fm_set_input_value('order_by', 'mail'); fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'mail' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'manage_form')" href="">
79
+ <span>Email to send submissions to</span><span class="sorting-indicator"></span></a>
80
+ </th>
81
+ <th class="table_big_col">Shortcode</th>
82
+ <th class="table_large_col">PHP function</th>
83
+ <th class="table_small_col">Edit</th>
84
+ <th class="table_small_col">
85
+ <a title="Delete selected items" href="" onclick="if (confirm('Do you want to delete selected items?')) { fm_set_input_value('task', 'delete_all'); fm_form_submit(event, 'manage_form'); } else { return false; }">Delete</a>
86
+ </th>
87
+ </thead>
88
+ <tbody id="tbody_arr">
89
+ <?php
90
+ if ($rows_data) {
91
+ foreach ($rows_data as $row_data) {
92
+ $alternate = (!isset($alternate) || $alternate == '') ? 'class="alternate"' : '';
93
+ $old = '';
94
+ if (isset($row_data->form) && ($row_data->form != '')) {
95
+ $old = '_old';
96
+ }
97
+ ?>
98
+ <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
99
+ <td class="table_small_col check-column">
100
+ <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox"/>
101
+ </td>
102
+ <td class="table_small_col"><?php echo $row_data->id; ?></td>
103
+ <td>
104
+ <a onclick="fm_set_input_value('task', 'edit<?php echo $old; ?>'); fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'manage_form')" href="" title="Edit"><?php echo $row_data->title; ?></a>
105
+ </td>
106
+ <td><?php echo $row_data->mail; ?></td>
107
+ <td class="table_big_col" style="padding-left: 0; padding-right: 0;">
108
+ <input type="text" value='[wd_contact_form id="<?php echo $row_data->id; ?>"]' onclick="fm_select_value(this)" size="12" readonly="readonly" style="padding-left: 1px; padding-right: 1px;"/>
109
+ </td>
110
+ <td class="table_large_col" style="padding-left: 0; padding-right: 0;">
111
+ <input type="text" value='&#60;?php wd_contact_form_maker(<?php echo $row_data->id; ?>); ?&#62;' onclick="fm_select_value(this)" readonly="readonly" style="padding-left: 1px; padding-right: 1px;"/>
112
+ </td>
113
+ <td class="table_small_col">
114
+ <button class="fm-icon edit-icon" onclick="fm_set_input_value('task', 'edit<?php echo $old; ?>'); fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'manage_form')">
115
+ <span></span>
116
+ </button>
117
+ </td>
118
+ <td class="table_small_col">
119
+ <button class="fm-icon delete-icon" onclick="if (confirm('Do you want to delete selected item(s)?')) { fm_set_input_value('task', 'delete'); fm_set_input_value('current_id', '<?php echo $row_data->id; ?>'); fm_form_submit(event, 'manage_form'); } else { return false; }">
120
+ <span></span>
121
+ </button>
122
+ </td>
123
+ </tr>
124
+ <?php
125
+ $ids_string .= $row_data->id . ',';
126
+ }
127
+ }
128
+ ?>
129
+ </tbody>
130
+ </table>
131
+ <input id="task" name="task" type="hidden" value=""/>
132
+ <input id="current_id" name="current_id" type="hidden" value=""/>
133
+ <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>"/>
134
+ <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc"/>
135
+ <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>"/>
136
+ </form>
137
+ <?php
138
+ }
139
+
140
+ public function edit($id) {
141
+ ?>
142
+ <img src="<?php echo WD_FMC_URL . '/images/buttons.png'; ?>" style="display:none;"/>
143
+ <?php
144
+ $row = $this->model->get_row_data_new($id);
145
+ $themes = $this->model->get_theme_rows_data();
146
+ $labels = array();
147
+ $label_id = array();
148
+ $label_order_original = array();
149
+ $label_type = array();
150
+ $label_all = explode('#****#', $row->label_order);
151
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
152
+ foreach ($label_all as $key => $label_each) {
153
+ $label_id_each = explode('#**id**#', $label_each);
154
+ array_push($label_id, $label_id_each[0]);
155
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
156
+ array_push($label_order_original, addslashes($label_oder_each[0]));
157
+ array_push($label_type, $label_oder_each[1]);
158
+ }
159
+ $labels['id'] = '"' . implode('","', $label_id) . '"';
160
+ $labels['label'] = '"' . implode('","', $label_order_original) . '"';
161
+ $labels['type'] = '"' . implode('","', $label_type) . '"';
162
+ $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
163
+ ?>
164
+ <script type="text/javascript">
165
+ var plugin_url = "<?php echo WD_FMC_URL; ?>";
166
+ var field_limitation = "<?php echo get_option("wd_cfield_limit", ''); ?>";
167
+ </script>
168
+ <script src="<?php echo WD_FMC_URL . '/js/formmaker_div_free.js'; ?>?ver=<?php echo get_option("wd_form_maker_version"); ?>" type="text/javascript"></script>
169
+ <script type="text/javascript">
170
+ form_view = 1;
171
+ form_view_count = 1;
172
+ form_view_max = 1;
173
+ function submitbutton() {
174
+ <?php if ($id) { ?>
175
+ if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
176
+ alert('Please wait while page loading.');
177
+ return false;
178
+ }
179
+ <?php } ?>
180
+ tox = '';
181
+ form_fields = '';
182
+ document.getElementById('take').style.display = "none";
183
+ document.getElementById('page_bar').style.display = "none";
184
+ jQuery('#saving').html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>');
185
+ jQuery('.wdform_section').each(function() {
186
+ var this2 = this;
187
+ jQuery(this2).find('.wdform_column').each(function() {
188
+ if(!jQuery(this).html() && jQuery(this2).children().length>1)
189
+ jQuery(this).remove();
190
+ });
191
+ });
192
+ remove_whitespace(document.getElementById('take'));
193
+ l_id_array = [<?php echo $labels['id']?>];
194
+ l_label_array = [<?php echo $labels['label']?>];
195
+ l_type_array = [<?php echo $labels['type']?>];
196
+ l_id_removed = [];
197
+ for (x = 0; x < l_id_array.length; x++) {
198
+ l_id_removed[l_id_array[x]] = true;
199
+ }
200
+ for (t = 1; t <= form_view_max; t++) {
201
+ if (document.getElementById('form_id_tempform_view' + t)) {
202
+ wdform_page = document.getElementById('form_id_tempform_view' + t);
203
+ remove_whitespace(wdform_page);
204
+ n = wdform_page.childNodes.length - 2;
205
+ for (q = 0; q <= n; q++) {
206
+ if (!wdform_page.childNodes[q].getAttribute("wdid")) {
207
+ wdform_section = wdform_page.childNodes[q];
208
+ for (x = 0; x < wdform_section.childNodes.length; x++) {
209
+ wdform_column = wdform_section.childNodes[x];
210
+ if (wdform_column.firstChild) {
211
+ for (y=0; y < wdform_column.childNodes.length; y++) {
212
+ is_in_old = false;
213
+ wdform_row = wdform_column.childNodes[y];
214
+ if (wdform_row.nodeType == 3) {
215
+ continue;
216
+ }
217
+ wdid = wdform_row.getAttribute("wdid");
218
+ if (!wdid) {
219
+ continue;
220
+ }
221
+ l_id = wdid;
222
+ l_label = document.getElementById(wdid + '_element_labelform_id_temp').innerHTML;
223
+ l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
224
+ wdtype = wdform_row.firstChild.getAttribute('type');
225
+
226
+ for (var z = 0; z < l_id_array.length; z++) {
227
+ if (l_type_array[z] == "type_address") {
228
+ if (document.getElementById(l_id + "_mini_label_street1") || document.getElementById(l_id + "_mini_label_street2") || document.getElementById(l_id + "_mini_label_city") || document.getElementById(l_id + "_mini_label_state") || document.getElementById(l_id+"_mini_label_postal") || document.getElementById(l_id+"_mini_label_country")) {
229
+ l_id_removed[l_id_array[z]] = false;
230
+ }
231
+ }
232
+ else {
233
+ if (l_id_array[z] == wdid) {
234
+ l_id_removed[l_id] = false;
235
+ }
236
+ }
237
+
238
+ }
239
+
240
+ if (wdtype == "type_address") {
241
+ addr_id = parseInt(wdid);
242
+ id_for_country = addr_id;
243
+ if (document.getElementById(id_for_country + "_mini_label_street1"))
244
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_street1").innerHTML + '#**label**#type_address#****#';
245
+ addr_id++;
246
+ if (document.getElementById(id_for_country + "_mini_label_street2"))
247
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_street2").innerHTML + '#**label**#type_address#****#';
248
+ addr_id++;
249
+ if (document.getElementById(id_for_country+"_mini_label_city"))
250
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_city").innerHTML + '#**label**#type_address#****#';
251
+ addr_id++;
252
+ if (document.getElementById(id_for_country + "_mini_label_state"))
253
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_state").innerHTML + '#**label**#type_address#****#';
254
+ addr_id++;
255
+ if (document.getElementById(id_for_country + "_mini_label_postal"))
256
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_postal").innerHTML + '#**label**#type_address#****#';
257
+ addr_id++;
258
+ if (document.getElementById(id_for_country+"_mini_label_country")) {
259
+ tox=tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_country").innerHTML + '#**label**#type_address#****#';
260
+ }
261
+
262
+ }
263
+ else {
264
+ tox = tox + wdid + '#**id**#' + l_label + '#**label**#' + wdtype + '#****#';
265
+ }
266
+
267
+ id = wdid;
268
+ form_fields += wdid + "*:*id*:*";
269
+ form_fields += wdtype + "*:*type*:*";
270
+ w_choices = new Array();
271
+ w_choices_value=new Array();
272
+ w_choices_checked = new Array();
273
+ w_choices_disabled = new Array();
274
+ w_choices_params =new Array();
275
+ w_allow_other_num = 0;
276
+ w_property = new Array();
277
+ w_property_type = new Array();
278
+ w_property_values = new Array();
279
+ w_choices_price = new Array();
280
+ if (document.getElementById(id+'_element_labelform_id_temp').innerHTML) {
281
+ w_field_label = document.getElementById(id + '_element_labelform_id_temp').innerHTML.replace(/(\r\n|\n|\r)/gm," ");
282
+ }
283
+ else {
284
+ w_field_label = " ";
285
+ }
286
+ if (document.getElementById(id + '_label_sectionform_id_temp')) {
287
+ if (document.getElementById(id + '_label_sectionform_id_temp').style.display == "block") {
288
+ w_field_label_pos = "top";
289
+ }
290
+ else {
291
+ w_field_label_pos = "left";
292
+ }
293
+ }
294
+ if (document.getElementById(id + "_elementform_id_temp")) {
295
+ s = document.getElementById(id + "_elementform_id_temp").style.width;
296
+ w_size=s.substring(0,s.length - 2);
297
+ }
298
+ if (document.getElementById(id + "_label_sectionform_id_temp")) {
299
+ s = document.getElementById(id + "_label_sectionform_id_temp").style.width;
300
+ w_field_label_size = s.substring(0, s.length - 2);
301
+ }
302
+ if (document.getElementById(id + "_requiredform_id_temp")) {
303
+ w_required = document.getElementById(id + "_requiredform_id_temp").value;
304
+ }
305
+ if (document.getElementById(id + "_uniqueform_id_temp")) {
306
+ w_unique = document.getElementById(id + "_uniqueform_id_temp").value;
307
+ }
308
+ if (document.getElementById(id + '_label_sectionform_id_temp')) {
309
+ w_class = document.getElementById(id + '_label_sectionform_id_temp').getAttribute("class");
310
+ if (!w_class) {
311
+ w_class = "";
312
+ }
313
+ }
314
+ gen_form_fields();
315
+ wdform_row.innerHTML = "%" + id + " - " + l_label + "%";
316
+ }
317
+ }
318
+ }
319
+ }
320
+ else {
321
+ id = wdform_page.childNodes[q].getAttribute("wdid");
322
+ w_editor = document.getElementById(id + "_element_sectionform_id_temp").innerHTML;
323
+ form_fields += id + "*:*id*:*";
324
+ form_fields += "type_section_break" + "*:*type*:*";
325
+ form_fields += "custom_" + id + "*:*w_field_label*:*";
326
+ form_fields += w_editor + "*:*w_editor*:*";
327
+ form_fields += "*:*new_field*:*";
328
+ wdform_page.childNodes[q].innerHTML = "%" + id + " - " + "custom_" + id + "%";
329
+ }
330
+ }
331
+ }
332
+ }
333
+ document.getElementById('label_order_current').value = tox;
334
+
335
+ for (x = 0; x < l_id_array.length; x++) {
336
+ if (l_id_removed[l_id_array[x]]) {
337
+ tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
338
+ }
339
+ }
340
+
341
+ document.getElementById('label_order').value = tox;
342
+ document.getElementById('form_fields').value = form_fields;
343
+ refresh_();
344
+ document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
345
+ document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
346
+ document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
347
+ return true;
348
+ }
349
+
350
+ gen = <?php echo (($id != 0) ? $row->counter : 1); ?>;
351
+
352
+ function enable() {
353
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
354
+ for (x = 0; x < 14; x++) {
355
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png?ver=<?php echo get_option("wd_form_maker_version"); ?>";
356
+ }
357
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
358
+ jQuery('#formMakerDiv').slideToggle(200);
359
+ }
360
+ else {
361
+ jQuery('#formMakerDiv').slideToggle(400);
362
+ }
363
+
364
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
365
+ jQuery('#formMakerDiv1').slideToggle(200);
366
+ }
367
+ else {
368
+ jQuery('#formMakerDiv1').slideToggle(400);
369
+ }
370
+ document.getElementById('when_edit').style.display = 'none';
371
+ }
372
+
373
+ function enable2() {
374
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
375
+ for (x = 0; x < 14; x++) {
376
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png?ver=<?php echo get_option("wd_form_maker_version"); ?>";
377
+ }
378
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
379
+ jQuery('#formMakerDiv').slideToggle(200);
380
+ }
381
+ else {
382
+ jQuery('#formMakerDiv').slideToggle(400);
383
+ }
384
+
385
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
386
+ jQuery('#formMakerDiv1').slideToggle(200);
387
+ }
388
+ else {
389
+ jQuery('#formMakerDiv1').slideToggle(400);
390
+ }
391
+ document.getElementById('when_edit').style.display = 'block';
392
+ if (document.getElementById('field_types').offsetWidth) {
393
+ document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
394
+ }
395
+ if (document.getElementById('field_types').offsetHeight) {
396
+ document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
397
+ }
398
+ }
399
+ </script>
400
+ <div class="fm-user-manual">
401
+ This section allows you to add fields to your form.
402
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-4.html">Read More in User Manual</a>
403
+ </div>
404
+ <div class="fm-upgrade-pro">
405
+ <a target="_blank" href="https://web-dorado.com/files/fromContactForm.php">
406
+ <div class="fm-upgrade-img">
407
+ UPGRADE TO PRO VERSION
408
+ <span></span>
409
+ </div>
410
+ </a>
411
+ </div>
412
+ <div class="fm-clear"></div>
413
+ <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fmc" style="width:99%;">
414
+ <?php wp_nonce_field('nonce_fmc', 'nonce_fmc'); ?>
415
+ <h2 class="fm-h2-message"></h2>
416
+ <div class="fm-page-header">
417
+ <!-- <div class="fm-page-title">
418
+ <?php echo $page_title; ?>
419
+ </div> -->
420
+ <div style="float:left;">
421
+ <div class="fm-logo-edit-page"></div>
422
+ <div class="fm-title-edit-page">Contact Form</br>Maker</div>
423
+ </div>
424
+ <div class="fm-page-actions">
425
+ <button class="fm-button form-options-button medium" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_options');">
426
+ <span></span>
427
+ Form Options
428
+ </button>
429
+ <button class="fm-button form-layout-button medium" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_layout');">
430
+ <span></span>
431
+ Form Layout
432
+ </button>
433
+ <div style="height:40px; border-right: 1px solid #848484; display: inline-block; width: 5px; vertical-align: bottom; margin-right: 5px;"></div>
434
+ <?php
435
+ if(isset($row->backup_id) )
436
+ if($row->backup_id!="") {
437
+ global $wpdb;
438
+ $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id > ".$row->backup_id." AND id = ".$row->id." ORDER BY backup_id ASC LIMIT 0 , 1 ";
439
+ $backup_id = $wpdb->get_var($query);
440
+ if($backup_id) { ?>
441
+ <button class="fm-button redo-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; jQuery('#saving_text').html('Redo');fm_set_input_value('task', 'redo');">
442
+ <span></span>
443
+ Redo
444
+ </button>
445
+ <?php
446
+ }
447
+ $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id < ".$row->backup_id." AND id = ".$row->id." ORDER BY backup_id DESC LIMIT 0 , 1 ";
448
+ $backup_id = $wpdb->get_var($query);
449
+
450
+ if($backup_id) { ?>
451
+ <button class="fm-button undo-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; jQuery('#saving_text').html('Undo');fm_set_input_value('task', 'undo');">
452
+ <span></span>
453
+ Undo
454
+ </button>
455
+ <?php
456
+ }
457
+ }
458
+ ?>
459
+
460
+ <?php if ($id) { ?>
461
+ <button class="fm-button save-as-copy-button medium" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save_as_copy');">
462
+ <span></span>
463
+ Save as Copy
464
+ </button>
465
+ <?php } ?>
466
+ <button class="fm-button save-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save');">
467
+ <span></span>
468
+ Save
469
+ </button>
470
+ <button class="fm-button apply-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'apply');">
471
+ <span></span>
472
+ Apply
473
+ </button>
474
+ <button class="fm-button cancel-button small" onclick="fm_set_input_value('task', 'cancel');">
475
+ <span></span>
476
+ Cancel
477
+ </button>
478
+ </div>
479
+ <div class="fm-clear"></div>
480
+ </div>
481
+ <div class="fm-title">
482
+ <span style="">Form title:&nbsp;</span>
483
+ <input id="title" name="title" value="<?php echo $row->title; ?>"/>
484
+ </div>
485
+ <div class="fm-clear"></div>
486
+ <br/>
487
+ <div class="fm-theme-banner">
488
+ <div class="fm-theme" style="float:left;">
489
+
490
+ <span style="">Theme:&nbsp;</span>
491
+ <select id="theme" name="theme" onChange="set_preview()">
492
+ <?php
493
+ foreach ($themes as $theme) {
494
+ ?>
495
+ <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
496
+ <?php
497
+ }
498
+ ?>
499
+ </select>
500
+ <button id="preview_form" class="fm-button preview-button small" onclick="tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'form_id' => $row->id, 'test_theme' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>'); return false;">
501
+ <span></span>
502
+ Preview
503
+ </button>
504
+ <button id="edit_css" class="fm-button options-edit-button small" onclick="tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS_fmc', 'id' => $row->theme, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>'); return false;">
505
+ <span></span>
506
+ Edit CSS
507
+ </button>
508
+ </div>
509
+ <div style="float:right;">
510
+ <button class="fm-button add-new-button large" onclick="enable(); Enable(); return false;">
511
+ Add a New Field
512
+ <span></span>
513
+ </button>
514
+ </div>
515
+ </div>
516
+ <div class="fm-clear"></div>
517
+ <div id="formMakerDiv" onclick="close_window()"></div>
518
+ <div id="formMakerDiv1">
519
+ <table class="formMakerDiv1_table" border="0" width="100%" cellpadding="0" cellspacing="0" height="100%">
520
+ <tr>
521
+ <td style="padding:0px">
522
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" >
523
+ <tr valign="top">
524
+ <td width="20%" height="100%" id="field_types">
525
+ <div id="when_edit" style="display: none;"></div>
526
+ <table border="0" cellpadding="0" cellspacing="3" width="100%" style="border-collapse: separate; border-spacing: 3px;">
527
+ <tbody>
528
+ <tr>
529
+ <td align="center" onclick="addRow('customHTML')" class="field_buttons" id="table_editor">
530
+ <img src="<?php echo WD_FMC_URL; ?>/images/customHTML.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_customHTML">
531
+ <div>Custom HTML</div>
532
+ </td>
533
+ <td align="center" onclick="addRow('text')" class="field_buttons" id="table_text">
534
+ <img src="<?php echo WD_FMC_URL; ?>/images/text.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_text">
535
+ <div>Text input</div>
536
+ </td>
537
+ </tr>
538
+ <tr>
539
+ <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" class="field_buttons field_disabled" id="table_checkbox">
540
+ <img src="<?php echo WD_FMC_URL; ?>/images/checkbox.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_checkbox">
541
+ <div>Multiple Choice</div>
542
+ </td>
543
+ <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" class="field_buttons field_disabled" id="table_radio">
544
+ <img src="<?php echo WD_FMC_URL; ?>/images/radio.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_radio">
545
+ <div>Single Choice</div>
546
+ </td>
547
+ </tr>
548
+ <tr>
549
+ <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" class="field_buttons field_disabled" id="table_survey">
550
+ <img src="<?php echo WD_FMC_URL; ?>/images/survey.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_survey">
551
+ <div>Survey Tools</div>
552
+ </td>
553
+ <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" class="field_buttons field_disabled" id="table_time_and_date">
554
+ <img src="<?php echo WD_FMC_URL; ?>/images/time_and_date.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_time_and_date">
555
+ <div>Time and Date</div>
556
+ </td>
557
+ </tr>
558
+ <tr>
559
+ <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" class="field_buttons field_disabled" id="table_select">
560
+ <img src="<?php echo WD_FMC_URL; ?>/images/select.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_select">
561
+ <div>Select Box</div>
562
+ </td>
563
+ <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" class="field_buttons field_disabled" id="table_file_upload">
564
+ <img src="<?php echo WD_FMC_URL; ?>/images/file_upload.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_file_upload">
565
+ <div>File Upload</div>
566
+ </td>
567
+ </tr>
568
+ <tr>
569
+ <td align="center" onclick="addRow('section_break')" class="field_buttons" id="table_section_break">
570
+ <img src="<?php echo WD_FMC_URL; ?>/images/section_break.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_section_break">
571
+ <div>Section Break</div>
572
+ </td>
573
+ <td align="center" onclick="addRow('page_break')" class="field_buttons" id="table_page_break">
574
+ <img src="<?php echo WD_FMC_URL; ?>/images/page_break.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_page_break">
575
+ <div>Page Break</div>
576
+ </td>
577
+ </tr>
578
+ <tr>
579
+ <td align="center" onclick="addRow('map')" class="field_buttons" id="table_map">
580
+ <img src="<?php echo WD_FMC_URL; ?>/images/map.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_map">
581
+ <div>Map</div>
582
+ </td>
583
+ <td align="center" onclick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" id="table_paypal" class="field_buttons field_disabled">
584
+ <img src="<?php echo WD_FMC_URL; ?>/images/paypal.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_paypal">
585
+ <div>PayPal</div>
586
+ </td>
587
+ </tr>
588
+ <tr>
589
+ <td align="center" onclick="addRow('captcha')" class="field_buttons" id="table_captcha">
590
+ <img src="<?php echo WD_FMC_URL; ?>/images/captcha.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_captcha">
591
+ <div>Captcha</div>
592
+ </td>
593
+ <td align="center" onclick="addRow('button')" id="table_button" class="field_buttons">
594
+ <img src="<?php echo WD_FMC_URL; ?>/images/button.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" style="margin:5px" id="img_button">
595
+ <div>Button</div>
596
+ </td>
597
+ </tr>
598
+ </tbody>
599
+ </table>
600
+ </td>
601
+ <td width="40%" height="100%" align="left">
602
+ <div id="edit_table"></div>
603
+ </td>
604
+ <td align="center" valign="top" style="background: url("<?php echo WD_FMC_URL . '/images/border2.png'; ?>") repeat-y;">&nbsp;</td>
605
+ <td style="padding:15px;">
606
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" >
607
+ <tr>
608
+ <td align="right">
609
+ <input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
610
+ At The End
611
+ <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
612
+ At The Beginning
613
+ <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
614
+ Before
615
+ <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" onclick="change_before()" disabled="disabled"></select>
616
+ <br>
617
+ <button class="fm-button field-save-button small" onclick="add(0, false); return false;">
618
+ Save
619
+ <span></span>
620
+ </button>
621
+ <button class="fm-button cancel-button small" onclick="close_window(); return false;">
622
+ Cancel
623
+ <span></span>
624
+ </button>
625
+ <hr style="margin-bottom:10px" />
626
+ </td>
627
+ </tr>
628
+ <tr height="100%" valign="top">
629
+ <td id="show_table"></td>
630
+ </tr>
631
+ </table>
632
+ </td>
633
+ </tr>
634
+ </table>
635
+ </td>
636
+ </tr>
637
+ </table>
638
+ <input type="hidden" id="old" />
639
+ <input type="hidden" id="old_selected" />
640
+ <input type="hidden" id="element_type" />
641
+ <input type="hidden" id="editing_id" />
642
+ <input type="hidden" value="<?php echo WD_FMC_URL; ?>" id="form_plugins_url" />
643
+ <div id="main_editor" style="position: fixed; display: none; z-index: 140;">
644
+ <?php if (user_can_richedit()) {
645
+ wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
646
+ }
647
+ else { ?>
648
+ <textarea name="form_maker_editor" id="form_maker_editor" cols="40" rows="5" style="width: 440px; height: 350px;" class="mce_editable" aria-hidden="true"></textarea>
649
+ <?php
650
+ }
651
+ ?>
652
+ </div>
653
+ </div>
654
+ <?php if (!function_exists('the_editor')) { ?>
655
+ <iframe id="tinymce" style="display: none;"></iframe>
656
+ <?php } ?>
657
+
658
+ <div class="fm-edit-content">
659
+ <div class="fm-drag-and-drop">
660
+ <div>
661
+ <label for="enable_sortable">Enable Drag & Drop</label>
662
+ <button name="sortable" id="enable_sortable" class="fm-checkbox-radio-button <?php echo $row->sortable == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="enable_drag(this); return false;" value="<?php echo $row->sortable; ?>">
663
+ <span></span>
664
+ </button>
665
+ <input type="hidden" name="sortable" id="sortable_hidden" value="<?php echo $row->sortable; ?>"/>
666
+ </div>
667
+ <div>
668
+ You can use drag and drop to move the fields up/down for the change of the order and left/right for creating columns within the form.
669
+ </div>
670
+ </div>
671
+ <fieldset>
672
+ <legend></legend>
673
+ <?php if ($id) { ?>
674
+ <div style="margin: 8px; display: table; width: 100%;" id="page_bar">
675
+ <div id="page_navigation" style="display: table-row;">
676
+ <div align="center" id="pages" show_title="<?php echo $row->show_title; ?>" show_numbers="<?php echo $row->show_numbers; ?>" type="<?php echo $row->pagination; ?>" style="display: table-cell; width:90%;"></div>
677
+ <div align="left" id="edit_page_navigation" style="display: table-cell; vertical-align: middle;"></div>
678
+ </div>
679
+ </div>
680
+ <div id="take" class="main">
681
+ <?php echo $row->form_front; ?>
682
+ </div>
683
+ <?php } else { ?>
684
+ <div style="margin:8px; display:table; width:100%" id="page_bar">
685
+ <div id="page_navigation" style="display:table-row">
686
+ <div align="center" id="pages" show_title="false" show_numbers="true" type="none" style="display:table-cell; width:90%"></div>
687
+ <div align="left" id="edit_page_navigation" style="display:table-cell; vertical-align: middle;"></div>
688
+ </div>
689
+ </div>
690
+ <div id="take" class="main">
691
+ <div class="wdform-page-and-images" style="display:table; border-top:0px solid black;">
692
+ <div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false">
693
+ <div class="wdform_section">
694
+ <div class="wdform_column"></div>
695
+ </div>
696
+ <div valign="top" class="wdform_footer" style="width: 100%;">
697
+ <div style="width: 100%;">
698
+ <div style="width: 100%; display: table; padding-top:10px;">
699
+ <div style="display: table-row-group;">
700
+ <div id="form_id_temppage_nav1" style="display: table-row;"></div>
701
+ </div>
702
+ </div>
703
+ </div>
704
+ </div>
705
+ </div>
706
+ <div id="form_id_tempform_view_img1" style="float: right;">
707
+ <div>
708
+ <img src="<?php echo WD_FMC_URL . '/images/minus.png?ver='. get_option("wd_form_maker_version"); ?>" title="Show or hide the page" class="page_toolbar" onClick="show_or_hide('1')" onMouseOver="chnage_icons_src(this,'minus')" onmouseout="chnage_icons_src(this,'minus')" id="show_page_img_1"/>
709
+ <img src="<?php echo WD_FMC_URL . '/images/page_delete.png?ver='. get_option("wd_form_maker_version"); ?>" title="Delete the page" class="page_toolbar" onClick="remove_page('1')" onMouseOver="chnage_icons_src(this,'page_delete')" onmouseout="chnage_icons_src(this,'page_delete')"/>
710
+ <img src="<?php echo WD_FMC_URL . '/images/page_delete_all.png?ver='. get_option("wd_form_maker_version"); ?>" title="Delete the page with fields" class="page_toolbar" onClick="remove_page_all('1')" onMouseOver="chnage_icons_src(this,'page_delete_all')" onmouseout="chnage_icons_src(this,'page_delete_all')"/>
711
+ <img src="<?php echo WD_FMC_URL . '/images/page_edit.png?ver='. get_option("wd_form_maker_version"); ?>" title="Edit the page" class="page_toolbar" onClick="edit_page_break('1')" onMouseOver="chnage_icons_src(this,'page_edit')" onmouseout="chnage_icons_src(this,'page_edit')"/>
712
+ </div>
713
+ </div>
714
+ </div>
715
+ </div>
716
+ <?php } ?>
717
+ </fieldset>
718
+ </div>
719
+ <input type="hidden" name="form_front" id="form_front" />
720
+ <input type="hidden" name="form_fields" id="form_fields" />
721
+ <input type="hidden" name="pagination" id="pagination" />
722
+ <input type="hidden" name="show_title" id="show_title" />
723
+ <input type="hidden" name="show_numbers" id="show_numbers" />
724
+ <input type="hidden" name="public_key" id="public_key" />
725
+ <input type="hidden" name="private_key" id="private_key" />
726
+ <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
727
+ <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order; ?>" />
728
+ <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
729
+ <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
730
+ <input type="hidden" id="araqel" value="0" />
731
+ <input type="hidden" name="backup_id" id="backup_id" value="<?php echo $row->backup_id;?>">
732
+
733
+ <?php if ($id) { ?>
734
+ <script type="text/javascript">
735
+ function set_preview() {
736
+ jQuery("#preview_form").attr("onclick", "tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&test_theme=" + jQuery('#theme').val() + "&width=1000&height=500&TB_iframe=1'); return false;");
737
+ jQuery("#edit_css").attr("onclick", "tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id=" + jQuery('#theme').val() + "&width=800&height=500&TB_iframe=1'); return false;");
738
+ }
739
+ function formOnload() {
740
+ for (t = 0; t < <?php echo $row->counter; ?>; t++) {
741
+ if (document.getElementById(t + "_typeform_id_temp")) {
742
+ if (document.getElementById(t + "_typeform_id_temp").value == "type_map" || document.getElementById(t + "_typeform_id_temp").value == "type_mark_map") {
743
+ if_gmap_init(t);
744
+ for (q = 0; q < 20; q++) {
745
+ if (document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q)) {
746
+ w_long = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q));
747
+ w_lat = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("lat" + q));
748
+ w_info = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("info" + q));
749
+ add_marker_on_map(t, q, w_long, w_lat, w_info, false);
750
+ }
751
+ }
752
+ }
753
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_date") {
754
+ // Calendar.setup({
755
+ // inputField:t + "_elementform_id_temp",
756
+ // ifFormat:document.getElementById(t + "_buttonform_id_temp").getAttribute('format'),
757
+ // button:t + "_buttonform_id_temp",
758
+ // align:"Tl",
759
+ // singleClick:true,
760
+ // firstDay:0
761
+ // });
762
+ }
763
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_name") {
764
+ var myu = t;
765
+ jQuery(document).ready(function () {
766
+ jQuery("#" + myu + "_mini_label_first").click(function () {
767
+ if (jQuery(this).children('input').length == 0) {
768
+ var first = "<input type='text' id='first' class='first' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
769
+ jQuery(this).html(first);
770
+ jQuery("input.first").focus();
771
+ jQuery("input.first").blur(function () {
772
+ var id_for_blur = document.getElementById('first').parentNode.id.split('_');
773
+ var value = jQuery(this).val();
774
+ jQuery("#" + id_for_blur[0] + "_mini_label_first").text(value);
775
+ });
776
+ }
777
+ });
778
+ jQuery("label#" + myu + "_mini_label_last").click(function () {
779
+ if (jQuery(this).children('input').length == 0) {
780
+ var last = "<input type='text' id='last' class='last' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
781
+ jQuery(this).html(last);
782
+ jQuery("input.last").focus();
783
+ jQuery("input.last").blur(function () {
784
+ var id_for_blur = document.getElementById('last').parentNode.id.split('_');
785
+ var value = jQuery(this).val();
786
+ jQuery("#" + id_for_blur[0] + "_mini_label_last").text(value);
787
+ });
788
+ }
789
+ });
790
+ jQuery("label#" + myu + "_mini_label_title").click(function () {
791
+ if (jQuery(this).children('input').length == 0) {
792
+ var title_ = "<input type='text' id='title_' class='title_' style='outline:none; border:none; background:none; width:50px;' value=\"" + jQuery(this).text() + "\">";
793
+ jQuery(this).html(title_);
794
+ jQuery("input.title_").focus();
795
+ jQuery("input.title_").blur(function () {
796
+ var id_for_blur = document.getElementById('title_').parentNode.id.split('_');
797
+ var value = jQuery(this).val();
798
+ jQuery("#" + id_for_blur[0] + "_mini_label_title").text(value);
799
+ });
800
+ }
801
+ });
802
+ jQuery("label#" + myu + "_mini_label_middle").click(function () {
803
+ if (jQuery(this).children('input').length == 0) {
804
+ var middle = "<input type='text' id='middle' class='middle' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
805
+ jQuery(this).html(middle);
806
+ jQuery("input.middle").focus();
807
+ jQuery("input.middle").blur(function () {
808
+ var id_for_blur = document.getElementById('middle').parentNode.id.split('_');
809
+ var value = jQuery(this).val();
810
+ jQuery("#" + id_for_blur[0] + "_mini_label_middle").text(value);
811
+ });
812
+ }
813
+ });
814
+ });
815
+ }
816
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_phone") {
817
+ var myu = t;
818
+ jQuery(document).ready(function () {
819
+ jQuery("label#" + myu + "_mini_label_area_code").click(function () {
820
+ if (jQuery(this).children('input').length == 0) {
821
+ var area_code = "<input type='text' id='area_code' class='area_code' size='10' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
822
+ jQuery(this).html(area_code);
823
+ jQuery("input.area_code").focus();
824
+ jQuery("input.area_code").blur(function () {
825
+ var id_for_blur = document.getElementById('area_code').parentNode.id.split('_');
826
+ var value = jQuery(this).val();
827
+ jQuery("#" + id_for_blur[0] + "_mini_label_area_code").text(value);
828
+ });
829
+ }
830
+ });
831
+ jQuery("label#" + myu + "_mini_label_phone_number").click(function () {
832
+ if (jQuery(this).children('input').length == 0) {
833
+ var phone_number = "<input type='text' id='phone_number' class='phone_number' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
834
+ jQuery(this).html(phone_number);
835
+ jQuery("input.phone_number").focus();
836
+ jQuery("input.phone_number").blur(function () {
837
+ var id_for_blur = document.getElementById('phone_number').parentNode.id.split('_');
838
+ var value = jQuery(this).val();
839
+ jQuery("#" + id_for_blur[0] + "_mini_label_phone_number").text(value);
840
+ });
841
+ }
842
+ });
843
+ });
844
+ }
845
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_date_fields") {
846
+ var myu = t;
847
+ jQuery(document).ready(function () {
848
+ jQuery("label#" + myu + "_day_label").click(function () {
849
+ if (jQuery(this).children('input').length == 0) {
850
+ var day = "<input type='text' id='day' class='day' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
851
+ jQuery(this).html(day);
852
+ jQuery("input.day").focus();
853
+ jQuery("input.day").blur(function () {
854
+ var id_for_blur = document.getElementById('day').parentNode.id.split('_');
855
+ var value = jQuery(this).val();
856
+ jQuery("#" + id_for_blur[0] + "_day_label").text(value);
857
+ });
858
+ }
859
+ });
860
+ jQuery("label#" + myu + "_month_label").click(function () {
861
+ if (jQuery(this).children('input').length == 0) {
862
+ var month = "<input type='text' id='month' class='month' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
863
+ jQuery(this).html(month);
864
+ jQuery("input.month").focus();
865
+ jQuery("input.month").blur(function () {
866
+ var id_for_blur = document.getElementById('month').parentNode.id.split('_');
867
+ var value = jQuery(this).val();
868
+ jQuery("#" + id_for_blur[0] + "_month_label").text(value);
869
+ });
870
+ }
871
+ });
872
+ jQuery("label#" + myu + "_year_label").click(function () {
873
+ if (jQuery(this).children('input').length == 0) {
874
+ var year = "<input type='text' id='year' class='year' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
875
+ jQuery(this).html(year);
876
+ jQuery("input.year").focus();
877
+ jQuery("input.year").blur(function () {
878
+ var id_for_blur = document.getElementById('year').parentNode.id.split('_');
879
+ var value = jQuery(this).val();
880
+ jQuery("#" + id_for_blur[0] + "_year_label").text(value);
881
+ });
882
+ }
883
+ });
884
+ });
885
+ }
886
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_time") {
887
+ var myu = t;
888
+ jQuery(document).ready(function () {
889
+ jQuery("label#" + myu + "_mini_label_hh").click(function () {
890
+ if (jQuery(this).children('input').length == 0) {
891
+ var hh = "<input type='text' id='hh' class='hh' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
892
+ jQuery(this).html(hh);
893
+ jQuery("input.hh").focus();
894
+ jQuery("input.hh").blur(function () {
895
+ var id_for_blur = document.getElementById('hh').parentNode.id.split('_');
896
+ var value = jQuery(this).val();
897
+ jQuery("#" + id_for_blur[0] + "_mini_label_hh").text(value);
898
+ });
899
+ }
900
+ });
901
+ jQuery("label#" + myu + "_mini_label_mm").click(function () {
902
+ if (jQuery(this).children('input').length == 0) {
903
+ var mm = "<input type='text' id='mm' class='mm' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
904
+ jQuery(this).html(mm);
905
+ jQuery("input.mm").focus();
906
+ jQuery("input.mm").blur(function () {
907
+ var id_for_blur = document.getElementById('mm').parentNode.id.split('_');
908
+ var value = jQuery(this).val();
909
+ jQuery("#" + id_for_blur[0] + "_mini_label_mm").text(value);
910
+ });
911
+ }
912
+ });
913
+ jQuery("label#" + myu + "_mini_label_ss").click(function () {
914
+ if (jQuery(this).children('input').length == 0) {
915
+ var ss = "<input type='text' id='ss' class='ss' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
916
+ jQuery(this).html(ss);
917
+ jQuery("input.ss").focus();
918
+ jQuery("input.ss").blur(function () {
919
+ var id_for_blur = document.getElementById('ss').parentNode.id.split('_');
920
+ var value = jQuery(this).val();
921
+ jQuery("#" + id_for_blur[0] + "_mini_label_ss").text(value);
922
+ });
923
+ }
924
+ });
925
+ jQuery("label#" + myu + "_mini_label_am_pm").click(function () {
926
+ if (jQuery(this).children('input').length == 0) {
927
+ var am_pm = "<input type='text' id='am_pm' class='am_pm' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
928
+ jQuery(this).html(am_pm);
929
+ jQuery("input.am_pm").focus();
930
+ jQuery("input.am_pm").blur(function () {
931
+ var id_for_blur = document.getElementById('am_pm').parentNode.id.split('_');
932
+ var value = jQuery(this).val();
933
+ jQuery("#" + id_for_blur[0] + "_mini_label_am_pm").text(value);
934
+ });
935
+ }
936
+ });
937
+ });
938
+ }
939
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_paypal_price") {
940
+ var myu = t;
941
+ jQuery(document).ready(function () {
942
+ jQuery("#" + myu + "_mini_label_dollars").click(function () {
943
+ if (jQuery(this).children('input').length == 0) {
944
+ var dollars = "<input type='text' id='dollars' class='dollars' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
945
+ jQuery(this).html(dollars);
946
+ jQuery("input.dollars").focus();
947
+ jQuery("input.dollars").blur(function () {
948
+ var id_for_blur = document.getElementById('dollars').parentNode.id.split('_');
949
+ var value = jQuery(this).val();
950
+ jQuery("#" + id_for_blur[0] + "_mini_label_dollars").text(value);
951
+ });
952
+ }
953
+ });
954
+ jQuery("label#" + myu + "_mini_label_cents").click(function () {
955
+ if (jQuery(this).children('input').length == 0) {
956
+ var cents = "<input type='text' id='cents' class='cents' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
957
+ jQuery(this).html(cents);
958
+ jQuery("input.cents").focus();
959
+ jQuery("input.cents").blur(function () {
960
+ var id_for_blur = document.getElementById('cents').parentNode.id.split('_');
961
+ var value = jQuery(this).val();
962
+ jQuery("#" + id_for_blur[0] + "_mini_label_cents").text(value);
963
+ });
964
+ }
965
+ });
966
+ });
967
+ }
968
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_address") {
969
+ var myu = t;
970
+ jQuery(document).ready(function () {
971
+ jQuery("label#" + myu + "_mini_label_street1").click(function () {
972
+ if (jQuery(this).children('input').length == 0) {
973
+ var street1 = "<input type='text' id='street1' class='street1' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
974
+ jQuery(this).html(street1);
975
+ jQuery("input.street1").focus();
976
+ jQuery("input.street1").blur(function () {
977
+ var id_for_blur = document.getElementById('street1').parentNode.id.split('_');
978
+ var value = jQuery(this).val();
979
+ jQuery("#" + id_for_blur[0] + "_mini_label_street1").text(value);
980
+ });
981
+ }
982
+ });
983
+ jQuery("label#" + myu + "_mini_label_street2").click(function () {
984
+ if (jQuery(this).children('input').length == 0) {
985
+ var street2 = "<input type='text' id='street2' class='street2' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
986
+ jQuery(this).html(street2);
987
+ jQuery("input.street2").focus();
988
+ jQuery("input.street2").blur(function () {
989
+ var id_for_blur = document.getElementById('street2').parentNode.id.split('_');
990
+ var value = jQuery(this).val();
991
+ jQuery("#" + id_for_blur[0] + "_mini_label_street2").text(value);
992
+ });
993
+ }
994
+ });
995
+ jQuery("label#" + myu + "_mini_label_city").click(function () {
996
+ if (jQuery(this).children('input').length == 0) {
997
+ var city = "<input type='text' id='city' class='city' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
998
+ jQuery(this).html(city);
999
+ jQuery("input.city").focus();
1000
+ jQuery("input.city").blur(function () {
1001
+ var id_for_blur = document.getElementById('city').parentNode.id.split('_');
1002
+ var value = jQuery(this).val();
1003
+ jQuery("#" + id_for_blur[0] + "_mini_label_city").text(value);
1004
+ });
1005
+ }
1006
+ });
1007
+ jQuery("label#" + myu + "_mini_label_state").click(function () {
1008
+ if (jQuery(this).children('input').length == 0) {
1009
+ var state = "<input type='text' id='state' class='state' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
1010
+ jQuery(this).html(state);
1011
+ jQuery("input.state").focus();
1012
+ jQuery("input.state").blur(function () {
1013
+ var id_for_blur = document.getElementById('state').parentNode.id.split('_');
1014
+ var value = jQuery(this).val();
1015
+ jQuery("#" + id_for_blur[0] + "_mini_label_state").text(value);
1016
+ });
1017
+ }
1018
+ });
1019
+ jQuery("label#" + myu + "_mini_label_postal").click(function () {
1020
+ if (jQuery(this).children('input').length == 0) {
1021
+ var postal = "<input type='text' id='postal' class='postal' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
1022
+ jQuery(this).html(postal);
1023
+ jQuery("input.postal").focus();
1024
+ jQuery("input.postal").blur(function () {
1025
+ var id_for_blur = document.getElementById('postal').parentNode.id.split('_');
1026
+ var value = jQuery(this).val();
1027
+ jQuery("#" + id_for_blur[0] + "_mini_label_postal").text(value);
1028
+ });
1029
+ }
1030
+ });
1031
+ jQuery("label#" + myu + "_mini_label_country").click(function () {
1032
+ if (jQuery(this).children('input').length == 0) {
1033
+ var country = "<input type='country' id='country' class='country' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
1034
+ jQuery(this).html(country);
1035
+ jQuery("input.country").focus();
1036
+ jQuery("input.country").blur(function () {
1037
+ var id_for_blur = document.getElementById('country').parentNode.id.split('_');
1038
+ var value = jQuery(this).val();
1039
+ jQuery("#" + id_for_blur[0] + "_mini_label_country").text(value);
1040
+ });
1041
+ }
1042
+ });
1043
+ });
1044
+ }
1045
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_scale_rating") {
1046
+ var myu = t;
1047
+ jQuery(document).ready(function () {
1048
+ jQuery("#" + myu + "_mini_label_worst").click(function () {
1049
+ if (jQuery(this).children('input').length == 0) {
1050
+ var worst = "<input type='text' id='worst' class='worst' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
1051
+ jQuery(this).html(worst);
1052
+ jQuery("input.worst").focus();
1053
+ jQuery("input.worst").blur(function () {
1054
+ var id_for_blur = document.getElementById('worst').parentNode.id.split('_');
1055
+ var value = jQuery(this).val();
1056
+ jQuery("#" + id_for_blur[0] + "_mini_label_worst").text(value);
1057
+ });
1058
+ }
1059
+ });
1060
+ jQuery("label#" + myu + "_mini_label_best").click(function () {
1061
+ if (jQuery(this).children('input').length == 0) {
1062
+ var best = "<input type='text' id='best' class='best' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
1063
+ jQuery(this).html(best);
1064
+ jQuery("input.best").focus();
1065
+ jQuery("input.best").blur(function () {
1066
+ var id_for_blur = document.getElementById('best').parentNode.id.split('_');
1067
+ var value = jQuery(this).val();
1068
+ jQuery("#" + id_for_blur[0] + "_mini_label_best").text(value);
1069
+ });
1070
+ }
1071
+ });
1072
+ });
1073
+ }
1074
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_spinner") {
1075
+ var spinner_value = document.getElementById(t + "_elementform_id_temp").value;
1076
+ var spinner_min_value = document.getElementById(t + "_min_valueform_id_temp").value;
1077
+ var spinner_max_value = document.getElementById(t + "_max_valueform_id_temp").value;
1078
+ var spinner_step = document.getElementById(t + "_stepform_id_temp").value;
1079
+ jQuery("#" + t + "_elementform_id_temp")[0].spin = null;
1080
+ spinner = jQuery("#" + t + "_elementform_id_temp").spinner();
1081
+ spinner.spinner("value", spinner_value);
1082
+ jQuery("#" + t + "_elementform_id_temp").spinner({ min:spinner_min_value});
1083
+ jQuery("#" + t + "_elementform_id_temp").spinner({ max:spinner_max_value});
1084
+ jQuery("#" + t + "_elementform_id_temp").spinner({ step:spinner_step});
1085
+ }
1086
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_slider") {
1087
+ var slider_value = document.getElementById(t + "_slider_valueform_id_temp").value;
1088
+ var slider_min_value = document.getElementById(t + "_slider_min_valueform_id_temp").value;
1089
+ var slider_max_value = document.getElementById(t + "_slider_max_valueform_id_temp").value;
1090
+ var slider_element_value = document.getElementById(t + "_element_valueform_id_temp");
1091
+ var slider_value_save = document.getElementById(t + "_slider_valueform_id_temp");
1092
+ jQuery("#" + t + "_elementform_id_temp")[0].slide = null;
1093
+ jQuery(function () {
1094
+ jQuery("#" + t + "_elementform_id_temp").slider({
1095
+ range:"min",
1096
+ value:eval(slider_value),
1097
+ min:eval(slider_min_value),
1098
+ max:eval(slider_max_value),
1099
+ slide:function (event, ui) {
1100
+ slider_element_value.innerHTML = "" + ui.value;
1101
+ slider_value_save.value = "" + ui.value;
1102
+ }
1103
+ });
1104
+ });
1105
+ }
1106
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_range") {
1107
+ var spinner_value0 = document.getElementById(t + "_elementform_id_temp0").value;
1108
+ var spinner_step = document.getElementById(t + "_range_stepform_id_temp").value;
1109
+ jQuery("#" + t + "_elementform_id_temp0")[0].spin = null;
1110
+ jQuery("#" + t + "_elementform_id_temp1")[0].spin = null;
1111
+ spinner0 = jQuery("#" + t + "_elementform_id_temp0").spinner();
1112
+ spinner0.spinner("value", spinner_value0);
1113
+ jQuery("#" + t + "_elementform_id_temp0").spinner({ step:spinner_step});
1114
+ var spinner_value1 = document.getElementById(t + "_elementform_id_temp1").value;
1115
+ spinner1 = jQuery("#" + t + "_elementform_id_temp1").spinner();
1116
+ spinner1.spinner("value", spinner_value1);
1117
+ jQuery("#" + t + "_elementform_id_temp1").spinner({ step:spinner_step});
1118
+ var myu = t;
1119
+ jQuery(document).ready(function () {
1120
+ jQuery("#" + myu + "_mini_label_from").click(function () {
1121
+ if (jQuery(this).children('input').length == 0) {
1122
+ var from = "<input type='text' id='from' class='from' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
1123
+ jQuery(this).html(from);
1124
+ jQuery("input.from").focus();
1125
+ jQuery("input.from").blur(function () {
1126
+ var id_for_blur = document.getElementById('from').parentNode.id.split('_');
1127
+ var value = jQuery(this).val();
1128
+ jQuery("#" + id_for_blur[0] + "_mini_label_from").text(value);
1129
+ });
1130
+ }
1131
+ });
1132
+ jQuery("label#" + myu + "_mini_label_to").click(function () {
1133
+ if (jQuery(this).children('input').length == 0) {
1134
+ var to = "<input type='text' id='to' class='to' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
1135
+ jQuery(this).html(to);
1136
+ jQuery("input.to").focus();
1137
+ jQuery("input.to").blur(function () {
1138
+ var id_for_blur = document.getElementById('to').parentNode.id.split('_');
1139
+ var value = jQuery(this).val();
1140
+ jQuery("#" + id_for_blur[0] + "_mini_label_to").text(value);
1141
+ });
1142
+ }
1143
+ });
1144
+ });
1145
+ }
1146
+ }
1147
+ }
1148
+
1149
+ remove_whitespace(document.getElementById('take'));
1150
+ form_view = 1;
1151
+ form_view_count = 0;
1152
+
1153
+ for (i = 1; i <= 30; i++) {
1154
+ if (document.getElementById('form_id_tempform_view' + i)) {
1155
+ form_view_count++;
1156
+ form_view_max = i;
1157
+ tbody_img = document.createElement('div');
1158
+ tbody_img.setAttribute('id', 'form_id_tempform_view_img' + i);
1159
+ tbody_img.style.cssText = "float:right";
1160
+ tr_img = document.createElement('div');
1161
+ var img = document.createElement('img');
1162
+ img.setAttribute('src', '<?php echo WD_FMC_URL; ?>/images/minus.png?ver=<?php echo get_option("wd_form_maker_version"); ?>');
1163
+ img.setAttribute('title', 'Show or hide the page');
1164
+ img.setAttribute("class", "page_toolbar");
1165
+ img.setAttribute('id', 'show_page_img_' + i);
1166
+ img.setAttribute('onClick', 'show_or_hide("' + i + '")');
1167
+ img.setAttribute("onmouseover", 'chnage_icons_src(this,"minus")');
1168
+ img.setAttribute("onmouseout", 'chnage_icons_src(this,"minus")');
1169
+ var img_X = document.createElement("img");
1170
+ img_X.setAttribute("src", "<?php echo WD_FMC_URL; ?>/images/page_delete.png?ver=<?php echo get_option("wd_form_maker_version"); ?>");
1171
+ img_X.setAttribute('title', 'Delete the page');
1172
+ img_X.setAttribute("class", "page_toolbar");
1173
+ img_X.setAttribute("onclick", 'remove_page("' + i + '")');
1174
+ img_X.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete")');
1175
+ img_X.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete")');
1176
+ var img_X_all = document.createElement("img");
1177
+ img_X_all.setAttribute("src", "<?php echo WD_FMC_URL; ?>/images/page_delete_all.png?ver=<?php echo get_option("wd_form_maker_version"); ?>");
1178
+ img_X_all.setAttribute('title', 'Delete the page with fields');
1179
+ img_X_all.setAttribute("class", "page_toolbar");
1180
+ img_X_all.setAttribute("onclick", 'remove_page_all("' + i + '")');
1181
+ img_X_all.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete_all")');
1182
+ img_X_all.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete_all")');
1183
+ var img_EDIT = document.createElement("img");
1184
+ img_EDIT.setAttribute("src", "<?php echo WD_FMC_URL; ?>/images/page_edit.png?ver=<?php echo get_option("wd_form_maker_version"); ?>");
1185
+ img_EDIT.setAttribute('title', 'Edit the page');
1186
+ img_EDIT.setAttribute("class", "page_toolbar");
1187
+ img_EDIT.setAttribute("onclick", 'edit_page_break("' + i + '")');
1188
+ img_EDIT.setAttribute("onmouseover", 'chnage_icons_src(this,"page_edit")');
1189
+ img_EDIT.setAttribute("onmouseout", 'chnage_icons_src(this,"page_edit")');
1190
+ tr_img.appendChild(img);
1191
+ tr_img.appendChild(img_X);
1192
+ tr_img.appendChild(img_X_all);
1193
+ tr_img.appendChild(img_EDIT);
1194
+ tbody_img.appendChild(tr_img);
1195
+ document.getElementById('form_id_tempform_view' + i).parentNode.appendChild(tbody_img);
1196
+ }
1197
+ }
1198
+
1199
+ if (form_view_count > 1) {
1200
+ for (i = 1; i <= form_view_max; i++) {
1201
+ if (document.getElementById('form_id_tempform_view' + i)) {
1202
+ first_form_view = i;
1203
+ break;
1204
+ }
1205
+ }
1206
+ form_view = form_view_max;
1207
+ need_enable = false;
1208
+ generate_page_nav(first_form_view);
1209
+ var img_EDIT = document.createElement("img");
1210
+ img_EDIT.setAttribute("src", "<?php echo WD_FMC_URL . '/images/edit.png?ver='.get_option("wd_form_maker_version"); ?>");
1211
+ img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
1212
+ img_EDIT.setAttribute("onclick", 'el_page_navigation()');
1213
+ var td_EDIT = document.getElementById("edit_page_navigation");
1214
+ td_EDIT.appendChild(img_EDIT);
1215
+ document.getElementById('page_navigation').appendChild(td_EDIT);
1216
+ }
1217
+ document.getElementById('araqel').value = 1;
1218
+ }
1219
+ jQuery(window).load(function () {
1220
+ formOnload();
1221
+ });
1222
+ jQuery(function() {
1223
+ jQuery('.wdform_section .wdform_column:last-child').each(function() {
1224
+ jQuery(this).parent().append(jQuery('<div></div>').addClass("wdform_column"));
1225
+ });
1226
+
1227
+ sortable_columns();
1228
+ if(<?php echo $row->sortable ?>==1) {
1229
+ jQuery( ".wdform_arrows" ).hide();
1230
+ all_sortable_events();
1231
+ }
1232
+ else
1233
+ jQuery('.wdform_column').sortable( "disable" );
1234
+
1235
+ });
1236
+ </script>
1237
+ <?php
1238
+ } else { ?>
1239
+ <script type="text/javascript">
1240
+ jQuery(function() {
1241
+ jQuery('.wdform_section .wdform_column:last-child').each(function() {
1242
+ jQuery(this).parent().append(jQuery('<div></div>').addClass("wdform_column"));
1243
+ });
1244
+ sortable_columns();
1245
+ all_sortable_events();
1246
+ });
1247
+ </script>
1248
+ <?php } ?>
1249
+ <input type="hidden" name="option" value="com_formmaker" />
1250
+ <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
1251
+ <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
1252
+ <input type="hidden" id="task" name="task" value=""/>
1253
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
1254
+ </form>
1255
+ <?php
1256
+ }
1257
+
1258
+ public function edit_old($id) {
1259
+ // header("X-XSS-Protection: 0");
1260
+ $row = $this->model->get_row_data($id);
1261
+ $themes = $this->model->get_theme_rows_data('old');
1262
+ $labels = array();
1263
+ $label_id = array();
1264
+ $label_order_original = array();
1265
+ $label_type = array();
1266
+ $label_all = explode('#****#', $row->label_order);
1267
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
1268
+ foreach ($label_all as $key => $label_each) {
1269
+ $label_id_each = explode('#**id**#', $label_each);
1270
+ array_push($label_id, $label_id_each[0]);
1271
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
1272
+ array_push($label_order_original, addslashes($label_oder_each[0]));
1273
+ array_push($label_type, $label_oder_each[1]);
1274
+ }
1275
+ $labels['id'] = '"' . implode('","', $label_id) . '"';
1276
+ $labels['label'] = '"' . implode('","', $label_order_original) . '"';
1277
+ $labels['type'] = '"' . implode('","', $label_type) . '"';
1278
+
1279
+ $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
1280
+ ?>
1281
+ <script type="text/javascript">
1282
+ var plugin_url = "<?php echo WD_FMC_URL; ?>";
1283
+ </script>
1284
+ <script src="<?php echo WD_FMC_URL . '/js/formmaker_free.js'; ?>?ver=<?php echo get_option("wd_form_maker_version"); ?>" type="text/javascript"></script>
1285
+ <script type="text/javascript">
1286
+ function submitbutton() {
1287
+ if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
1288
+ alert('Please wait while page loading.');
1289
+ return false;
1290
+ }
1291
+ tox = '';
1292
+ l_id_array = [<?php echo $labels['id']?>];
1293
+ l_label_array = [<?php echo $labels['label']?>];
1294
+ l_type_array = [<?php echo $labels['type']?>];
1295
+ l_id_removed = [];
1296
+ for (x=0; x< l_id_array.length; x++) {
1297
+ l_id_removed[l_id_array[x]]=true;
1298
+ }
1299
+ for (t=1;t<=form_view_max;t++) {
1300
+ if (document.getElementById('form_id_tempform_view'+t)) {
1301
+ form_view_element=document.getElementById('form_id_tempform_view'+t);
1302
+ n=form_view_element.childNodes.length-2;
1303
+ for(q=0;q<=n;q++) {
1304
+ if (form_view_element.childNodes[q].nodeType!=3) {
1305
+ if (!form_view_element.childNodes[q].id) {
1306
+ GLOBAL_tr=form_view_element.childNodes[q];
1307
+ for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
1308
+ table=GLOBAL_tr.firstChild.childNodes[x];
1309
+ tbody=table.firstChild;
1310
+ for (y=0; y < tbody.childNodes.length; y++) {
1311
+ is_in_old=false;
1312
+ tr=tbody.childNodes[y];
1313
+ l_id=tr.id;
1314
+ l_label=document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
1315
+ l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
1316
+ l_type=tr.getAttribute('type');
1317
+ for (z = 0; z < l_id_array.length; z++) {
1318
+ if (l_id_array[z] == l_id) {
1319
+ if (l_type_array[z] == "type_address") {
1320
+ if (document.getElementById(l_id + "_mini_label_street1")) {
1321
+ l_id_removed[l_id_array[z]] = false;
1322
+ }
1323
+ if (document.getElementById(l_id+"_mini_label_street2")) {
1324
+ l_id_removed[parseInt(l_id_array[z]) + 1] = false;
1325
+ }
1326
+ if (document.getElementById(l_id+"_mini_label_city")) {
1327
+ l_id_removed[parseInt(l_id_array[z]) + 2] = false;
1328
+ }
1329
+ if (document.getElementById(l_id+"_mini_label_state")) {
1330
+ l_id_removed[parseInt(l_id_array[z]) + 3] = false;
1331
+ }
1332
+ if (document.getElementById(l_id+"_mini_label_postal")) {
1333
+ l_id_removed[parseInt(l_id_array[z]) + 4] = false;
1334
+ }
1335
+ if (document.getElementById(l_id+"_mini_label_country")) {
1336
+ l_id_removed[parseInt(l_id_array[z]) + 5] = false;
1337
+ }
1338
+ z = z + 5;
1339
+ }
1340
+ else {
1341
+ l_id_removed[l_id] = false;
1342
+ }
1343
+ }
1344
+ }
1345
+ if (tr.getAttribute('type')=="type_address") {
1346
+ addr_id=parseInt(tr.id);
1347
+ id_for_country= addr_id;
1348
+ if(document.getElementById(id_for_country+"_mini_label_street1"))
1349
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street1").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1350
+ if(document.getElementById(id_for_country+"_mini_label_street2"))
1351
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street2").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1352
+ if(document.getElementById(id_for_country+"_mini_label_city"))
1353
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_city").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1354
+ if(document.getElementById(id_for_country+"_mini_label_state"))
1355
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_state").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1356
+ if(document.getElementById(id_for_country+"_mini_label_postal"))
1357
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_postal").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1358
+ if(document.getElementById(id_for_country+"_mini_label_country"))
1359
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_country").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';
1360
+ }
1361
+ else {
1362
+ tox = tox+l_id+'#**id**#'+l_label+'#**label**#'+l_type+'#****#';
1363
+ }
1364
+ }
1365
+ }
1366
+ }
1367
+ }
1368
+ }
1369
+ }
1370
+ }
1371
+ document.getElementById('label_order_current').value = tox;
1372
+ for (x = 0; x < l_id_array.length; x++) {
1373
+ if (l_id_removed[l_id_array[x]]) {
1374
+ tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
1375
+ }
1376
+ }
1377
+ document.getElementById('label_order').value = tox;
1378
+ refresh_old();
1379
+ document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
1380
+ document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
1381
+ document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
1382
+ return true;
1383
+ }
1384
+
1385
+ gen = <?php echo (($id != 0) ? $row->counter : 1); ?>;
1386
+
1387
+ function enable() {
1388
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1389
+ for (x = 0; x < 14; x++) {
1390
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png?ver=<?php echo get_option("wd_form_maker_version"); ?>";
1391
+ }
1392
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
1393
+ jQuery('#formMakerDiv').slideToggle(200);
1394
+ }
1395
+ else {
1396
+ jQuery('#formMakerDiv').slideToggle(400);
1397
+ }
1398
+
1399
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
1400
+ jQuery('#formMakerDiv1').slideToggle(200);
1401
+ }
1402
+ else {
1403
+ jQuery('#formMakerDiv1').slideToggle(400);
1404
+ }
1405
+ document.getElementById('when_edit').style.display = 'none';
1406
+ }
1407
+
1408
+ function enable2() {
1409
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1410
+ for (x = 0; x < 14; x++) {
1411
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png?ver=<?php echo get_option("wd_form_maker_version"); ?>";
1412
+ }
1413
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
1414
+ jQuery('#formMakerDiv').slideToggle(200);
1415
+ }
1416
+ else {
1417
+ jQuery('#formMakerDiv').slideToggle(400);
1418
+ }
1419
+
1420
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
1421
+ jQuery('#formMakerDiv1').slideToggle(200);
1422
+ }
1423
+ else {
1424
+ jQuery('#formMakerDiv1').slideToggle(400);
1425
+ }
1426
+ document.getElementById('when_edit').style.display = 'block';
1427
+ if (document.getElementById('field_types').offsetWidth) {
1428
+ document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
1429
+ }
1430
+ if (document.getElementById('field_types').offsetHeight) {
1431
+ document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
1432
+ }
1433
+ }
1434
+ </script>
1435
+ <div style="font-size: 14px; font-weight: bold;">
1436
+ This section allows you to add fields to your form.
1437
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-4.html">Read More in User Manual</a>
1438
+ </div>
1439
+ <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fmc" style="width:99%;">
1440
+ <?php wp_nonce_field('nonce_fmc', 'nonce_fmc'); ?>
1441
+ <div class="fm-page-header">
1442
+ <!-- <div class="fm-page-title">
1443
+ <?php echo $page_title; ?>
1444
+ </div> -->
1445
+ <div style="float:left;">
1446
+ <div class="fm-logo-edit-page"></div>
1447
+ <div class="fm-title-edit-page">Form</br>Maker</div>
1448
+ </div>
1449
+ <div class="fm-page-actions">
1450
+ <button class="fm-button form-options-button medium" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'form_options_old');">
1451
+ <span></span>
1452
+ Form Options
1453
+ </button>
1454
+ <div style="height:40px; border-right: 1px solid #848484; display: inline-block; width: 5px; vertical-align: bottom; margin-right: 5px;"></div>
1455
+ <?php if ($id) { ?>
1456
+ <button class="fm-button save-as-copy-button medium" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save_as_copy_old');">
1457
+ <span></span>
1458
+ Save as Copy
1459
+ </button>
1460
+ <?php } ?>
1461
+ <button class="fm-button save-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'save_old');">
1462
+ <span></span>
1463
+ Save
1464
+ </button>
1465
+ <button class="fm-button apply-button small" onclick="if (fm_check_required('title', 'Form title') || !submitbutton()) {return false;}; fm_set_input_value('task', 'apply_old');">
1466
+ <span></span>
1467
+ Apply
1468
+ </button>
1469
+ <button class="fm-button cancel-button small" onclick="fm_set_input_value('task', 'cancel');">
1470
+ <span></span>
1471
+ Cancel
1472
+ </button>
1473
+ </div>
1474
+ <div class="fm-clear"></div>
1475
+ </div>
1476
+ <div class="fm-theme-banner">
1477
+ <div style="float:left;">
1478
+ <span style="">Form title:&nbsp;</span>
1479
+ <input id="title" name="title" value="<?php echo $row->title; ?>"/>
1480
+ </div>
1481
+ <div style="float:right;">
1482
+ <button class="fm-button add-new-button large" onclick="enable(); Enable(); return false;">
1483
+ Add a New Field
1484
+ <span></span>
1485
+ </button>
1486
+ </div>
1487
+ </div>
1488
+ <div class="fm-clear"></div>
1489
+ <div id="formMakerDiv" onclick="close_window()"></div>
1490
+ <div id="formMakerDiv1" style="padding-top: 20px;" align="center">
1491
+ <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" class="formMakerDiv1_table">
1492
+ <tr>
1493
+ <td style="padding:0px">
1494
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1495
+ <tr valign="top">
1496
+ <td width="15%" height="100%" style="border-right: dotted black 1px;" id="field_types">
1497
+ <div id="when_edit" style="display: none;"></div>
1498
+ <table border="0" cellpadding="0" cellspacing="3" width="100%">
1499
+ <tr>
1500
+ <td align="center" onClick="addRow('customHTML')" style="cursor:pointer" id="table_editor" class="field_buttons">
1501
+ <img src="<?php echo WD_FMC_URL . '/images/customHTML.png'; ?>" style="margin:5px" id="img_customHTML"/>
1502
+ </td>
1503
+ <td align="center" onClick="addRow('text')" style="cursor:pointer" id="table_text" class="field_buttons">
1504
+ <img src="<?php echo WD_FMC_URL . '/images/text.png'; ?>" style="margin:5px" id="img_text"/>
1505
+ </td>
1506
+ </tr>
1507
+ <tr>
1508
+ <td align="center" onClick="addRow('time_and_date')" style="cursor:pointer" id="table_time_and_date" class="field_buttons">
1509
+ <img src="<?php echo WD_FMC_URL . '/images/time_and_date.png'; ?>" style="margin:5px" id="img_time_and_date"/>
1510
+ </td>
1511
+ <td align="center" onClick="addRow('select')" style="cursor:pointer" id="table_select" class="field_buttons">
1512
+ <img src="<?php echo WD_FMC_URL . '/images/select.png'; ?>" style="margin:5px" id="img_select"/>
1513
+ </td>
1514
+ </tr>
1515
+ <tr>
1516
+ <td align="center" onClick="addRow('checkbox')" style="cursor:pointer" id="table_checkbox" class="field_buttons">
1517
+ <img src="<?php echo WD_FMC_URL . '/images/checkbox.png'; ?>" style="margin:5px" id="img_checkbox"/>
1518
+ </td>
1519
+ <td align="center" onClick="addRow('radio')" style="cursor:pointer" id="table_radio" class="field_buttons">
1520
+ <img src="<?php echo WD_FMC_URL . '/images/radio.png'; ?>" style="margin:5px" id="img_radio"/>
1521
+ </td>
1522
+ </tr>
1523
+ <tr>
1524
+ <td align="center" onClick="addRow('file_upload')" style="cursor:pointer" id="table_file_upload" class="field_buttons">
1525
+ <img src="<?php echo WD_FMC_URL . '/images/file_upload.png'; ?>" style="margin:5px" id="img_file_upload"/>
1526
+ </td>
1527
+ <td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha" class="field_buttons">
1528
+ <img src="<?php echo WD_FMC_URL . '/images/captcha.png'; ?>" style="margin:5px" id="img_captcha"/>
1529
+ </td>
1530
+ </tr>
1531
+ <tr>
1532
+ <td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break" class="field_buttons">
1533
+ <img src="<?php echo WD_FMC_URL . '/images/page_break.png'; ?>" style="margin:5px" id="img_page_break"/>
1534
+ </td>
1535
+ <td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break" class="field_buttons">
1536
+ <img src="<?php echo WD_FMC_URL . '/images/section_break.png'; ?>" style="margin:5px" id="img_section_break"/>
1537
+ </td>
1538
+ </tr>
1539
+ <tr>
1540
+ <td align="center" onClick="addRow('map')" style="cursor:pointer" id="table_map" class="field_buttons">
1541
+ <img src="<?php echo WD_FMC_URL . '/images/map.png'; ?>" style="margin:5px" id="img_map"/>
1542
+ </td>
1543
+ <td align="center" onClick="addRow('paypal')" id="table_paypal" class="field_buttons">
1544
+ <img src="<?php echo WD_FMC_URL . '/images/paypal.png'; ?>" style="margin:5px" id="img_paypal"/>
1545
+ </td>
1546
+ </tr>
1547
+ <tr>
1548
+ <td align="center" onClick="addRow('survey')" class="field_buttons" id="table_survey">
1549
+ <img src="<?php echo WD_FMC_URL . '/images/survey.png'; ?>" style="margin:5px" id="img_survey"/>
1550
+ </td>
1551
+ <td align="center" onClick="addRow('button')" id="table_button" class="field_buttons">
1552
+ <img src="<?php echo WD_FMC_URL . '/images/button.png'; ?>" style="margin:5px" id="img_button"/>
1553
+ </td>
1554
+ </tr>
1555
+ </table>
1556
+ </td>
1557
+ <td width="35%" height="100%" align="left">
1558
+ <div id="edit_table" style="padding:0px; overflow-y:scroll; height:575px"></div>
1559
+ </td>
1560
+ <td align="center" valign="top" style="background: url("<?php echo WD_FMC_URL . '/images/border2.png'; ?>") repeat-y;">&nbsp;</td>
1561
+ <td style="padding:15px">
1562
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1563
+ <tr>
1564
+ <td align="right">
1565
+ <input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
1566
+ At The End
1567
+ <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
1568
+ At The Beginning
1569
+ <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
1570
+ Before
1571
+ <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" disabled="disabled"></select>
1572
+ <button class="fm-button field-save-button small" onclick="add(0, false); return false;">
1573
+ Save
1574
+ <span></span>
1575
+ </button>
1576
+ <button class="fm-button cancel-button small" onclick="close_window(); return false;">
1577
+ Cancel
1578
+ <span></span>
1579
+ </button>
1580
+ <hr style=" margin-bottom:10px" />
1581
+ </td>
1582
+ </tr>
1583
+ <tr height="100%" valign="top">
1584
+ <td id="show_table"></td>
1585
+ </tr>
1586
+ </table>
1587
+ </td>
1588
+ </tr>
1589
+ </table>
1590
+ </td>
1591
+ </tr>
1592
+ </table>
1593
+ <input type="hidden" id="old" />
1594
+ <input type="hidden" id="old_selected" />
1595
+ <input type="hidden" id="element_type" />
1596
+ <input type="hidden" id="editing_id" />
1597
+ <input type="hidden" value="<?php echo WD_FMC_URL; ?>" id="form_plugins_url" />
1598
+ <div id="main_editor" style="position: fixed; display: none; z-index: 140;">
1599
+ <?php
1600
+ if (user_can_richedit()) {
1601
+ wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
1602
+ }
1603
+ else {
1604
+ ?>
1605
+ <textarea cols="36" rows="5" id="form_maker_editor" name="form_maker_editor" style="width: 440px; height: 350px; resize: vertical;" class="mce_editable" aria-hidden="true"></textarea>
1606
+ <?php
1607
+ }
1608
+ ?>
1609
+ </div>
1610
+ </div>
1611
+ <?php
1612
+ if (!function_exists('the_editor')) {
1613
+ ?>
1614
+ <iframe id="tinymce" style="display: none;"></iframe>
1615
+ <?php
1616
+ }
1617
+ ?>
1618
+ <br />
1619
+ <br />
1620
+ <fieldset>
1621
+ <legend><h2 style="color: #00aeef;">Form</h2></legend>
1622
+ <table width="100%" style="margin:8px">
1623
+ <tr id="page_navigation">
1624
+ <td align="center" width="90%" id="pages" show_title="<?php echo $row->show_title; ?>" show_numbers="<?php echo $row->show_numbers; ?>" type="<?php echo $row->pagination; ?>"></td>
1625
+ <td align="left" id="edit_page_navigation"></td>
1626
+ </tr>
1627
+ </table>
1628
+ <div id="take">
1629
+ <?php
1630
+ if ($row->form) {
1631
+ echo $row->form;
1632
+ }
1633
+ else {
1634
+ ?>
1635
+ <table border="0" cellpadding="4" cellspacing="0" class="wdform_table1" style="width: 100%;">
1636
+ <tbody id="form_id_tempform_view1" class="wdform_tbody1" page_title="Untitled page" next_title="Next" next_type="button" next_class="wdform_page_button" next_checkable="false" previous_title="Previous" previous_type="button" previous_class="wdform_page_button" previous_checkable="false">
1637
+ <tr class="wdform_tr1">
1638
+ <td class="wdform_td1" >
1639
+ <table class="wdform_table2">
1640
+ <tbody class="wdform_tbody2"></tbody>
1641
+ </table>
1642
+ </td>
1643
+ </tr>
1644
+ <tr class="wdform_footer">
1645
+ <td colspan="100" valign="top">
1646
+ <table width="100%" style="padding-right:170px">
1647
+ <tbody>
1648
+ <tr id="form_id_temppage_nav1">
1649
+ </tr>
1650
+ </tbody>
1651
+ </table>
1652
+ </td>
1653
+ </tr>
1654
+ <tbody id="form_id_tempform_view_img1" style="float: right !important;" >
1655
+ <tr>
1656
+ <td width="0%"></td>
1657
+ <td align="right">
1658
+ <img src="<?php echo WD_FMC_URL . '/images/minus.png?ver='. get_option("wd_form_maker_version").''; ?>" title="Show or hide the page" class="page_toolbar" onclick="show_or_hide('1')" onmouseover="chnage_icons_src(this,'minus')" onmouseout="chnage_icons_src(this,'minus')" id="show_page_img_1" />
1659
+ </td>
1660
+ <td>
1661
+ <img src="<?php echo WD_FMC_URL . '/images/page_delete.png?ver='. get_option("wd_form_maker_version").''; ?>" title="Delete the page" class="page_toolbar" onclick="remove_page('1')" onmouseover="chnage_icons_src(this,'page_delete')" onmouseout="chnage_icons_src(this,'page_delete')" />
1662
+ </td>
1663
+ <td>
1664
+ <img src="<?php echo WD_FMC_URL . '/images/page_delete_all.png?ver='. get_option("wd_form_maker_version").''; ?>" title="Delete the page with fields" class="page_toolbar" onclick="remove_page_all('1')" onmouseover="chnage_icons_src(this,'page_delete_all')" onmouseout="chnage_icons_src(this,'page_delete_all')" />
1665
+ </td>
1666
+ <td>
1667
+ <img src="<?php echo WD_FMC_URL . '/images/page_edit.png?ver='. get_option("wd_form_maker_version").''; ?>" title="Edit the page" class="page_toolbar" onclick="edit_page_break('1')" onmouseover="chnage_icons_src(this,'page_edit')" onmouseout="chnage_icons_src(this,'page_edit')" />
1668
+ </td>
1669
+ </tr>
1670
+ </tbody>
1671
+ </table>
1672
+ <?php
1673
+ }
1674
+ ?>
1675
+ </div>
1676
+ </fieldset>
1677
+ <input type="hidden" name="form" id="form" />
1678
+ <input type="hidden" name="form_front" id="form_front" />
1679
+ <input type="hidden" name="pagination" id="pagination" />
1680
+ <input type="hidden" name="show_title" id="show_title" />
1681
+ <input type="hidden" name="show_numbers" id="show_numbers" />
1682
+ <input type="hidden" name="public_key" id="public_key" />
1683
+ <input type="hidden" name="private_key" id="private_key" />
1684
+ <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
1685
+ <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order; ?>" />
1686
+ <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
1687
+ <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
1688
+ <input type="hidden" id="araqel" value="0" />
1689
+ <script type="text/javascript">
1690
+ form_view = 1;
1691
+ form_view_count = 1;
1692
+ form_view_max = 1;
1693
+ function formOnload() {
1694
+ // Enable maps.
1695
+ for (t = 0; t < <?php echo $row->counter;?>; t++)
1696
+ if (document.getElementById(t+"_typeform_id_temp")) {
1697
+ if (document.getElementById(t+"_typeform_id_temp").value=="type_map" || document.getElementById(t+"_typeform_id_temp").value=="type_mark_map") {
1698
+ if_gmap_init(t);
1699
+ for (q = 0; q < 20; q++) {
1700
+ if (document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q)) {
1701
+ w_long=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q));
1702
+ w_lat=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("lat"+q));
1703
+ w_info=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("info"+q));
1704
+ add_marker_on_map(t,q, w_long, w_lat, w_info, false);
1705
+ }
1706
+ }
1707
+ }
1708
+ else
1709
+ if (document.getElementById(t+"_typeform_id_temp").value == "type_date") {
1710
+ // Calendar.setup({
1711
+ // inputField: t+"_elementform_id_temp",
1712
+ // ifFormat: document.getElementById(t+"_buttonform_id_temp").getAttribute('format'),
1713
+ // button: t+"_buttonform_id_temp",
1714
+ // align: "Tl",
1715
+ // singleClick: true,
1716
+ // firstDay: 0
1717
+ // });
1718
+ }
1719
+ else
1720
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_spinner") {
1721
+ var spinner_value = jQuery("#" + t + "_elementform_id_temp").get( "aria-valuenow" );
1722
+ var spinner_min_value = document.getElementById(t+"_min_valueform_id_temp").value;
1723
+ var spinner_max_value = document.getElementById(t+"_max_valueform_id_temp").value;
1724
+ var spinner_step = document.getElementById(t+"_stepform_id_temp").value;
1725
+
1726
+ jQuery( "#"+t+"_elementform_id_temp" ).removeClass( "ui-spinner-input" )
1727
+ .prop( "disabled", false )
1728
+ .removeAttr( "autocomplete" )
1729
+ .removeAttr( "role" )
1730
+ .removeAttr( "aria-valuemin" )
1731
+ .removeAttr( "aria-valuemax" )
1732
+ .removeAttr( "aria-valuenow" );
1733
+
1734
+ span_ui= document.getElementById(t+"_elementform_id_temp").parentNode;
1735
+ span_ui.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp"));
1736
+ span_ui.parentNode.removeChild(span_ui);
1737
+
1738
+ jQuery("#"+t+"_elementform_id_temp")[0].spin = null;
1739
+
1740
+ spinner = jQuery( "#"+t+"_elementform_id_temp" ).spinner();
1741
+ spinner.spinner( "value", spinner_value );
1742
+ jQuery( "#"+t+"_elementform_id_temp" ).spinner({ min: spinner_min_value});
1743
+ jQuery( "#"+t+"_elementform_id_temp" ).spinner({ max: spinner_max_value});
1744
+ jQuery( "#"+t+"_elementform_id_temp" ).spinner({ step: spinner_step});
1745
+
1746
+ }
1747
+ else
1748
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_slider") {
1749
+
1750
+ var slider_value = document.getElementById(t+"_slider_valueform_id_temp").value;
1751
+ var slider_min_value = document.getElementById(t+"_slider_min_valueform_id_temp").value;
1752
+ var slider_max_value = document.getElementById(t+"_slider_max_valueform_id_temp").value;
1753
+
1754
+ var slider_element_value = document.getElementById( t+"_element_valueform_id_temp" );
1755
+ var slider_value_save = document.getElementById( t+"_slider_valueform_id_temp" );
1756
+
1757
+ document.getElementById(t+"_elementform_id_temp").innerHTML = "";
1758
+ document.getElementById(t+"_elementform_id_temp").removeAttribute( "class" );
1759
+ document.getElementById(t+"_elementform_id_temp").removeAttribute( "aria-disabled" );
1760
+
1761
+ jQuery("#"+t+"_elementform_id_temp")[0].slide = null;
1762
+
1763
+ jQuery(function() {
1764
+ jQuery( "#"+t+"_elementform_id_temp").slider({
1765
+ range: "min",
1766
+ value: eval(slider_value),
1767
+ min: eval(slider_min_value),
1768
+ max: eval(slider_max_value),
1769
+ slide: function( event, ui ) {
1770
+ slider_element_value.innerHTML = "" + ui.value ;
1771
+ slider_value_save.value = "" + ui.value;
1772
+
1773
+ }
1774
+ });
1775
+
1776
+
1777
+ });
1778
+
1779
+
1780
+ }
1781
+ else
1782
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_range"){
1783
+ var spinner_value0 = jQuery("#" + t+"_elementform_id_temp0").get( "aria-valuenow" );
1784
+ var spinner_step = document.getElementById(t+"_range_stepform_id_temp").value;
1785
+
1786
+ jQuery( "#"+t+"_elementform_id_temp0" ).removeClass( "ui-spinner-input" )
1787
+ .prop( "disabled", false )
1788
+ .removeAttr( "autocomplete" )
1789
+ .removeAttr( "role" )
1790
+ .removeAttr( "aria-valuenow" );
1791
+
1792
+ span_ui= document.getElementById(t+"_elementform_id_temp0").parentNode;
1793
+ span_ui.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp0"));
1794
+ span_ui.parentNode.removeChild(span_ui);
1795
+
1796
+
1797
+ jQuery("#"+t+"_elementform_id_temp0")[0].spin = null;
1798
+ jQuery("#"+t+"_elementform_id_temp1")[0].spin = null;
1799
+
1800
+ spinner0 = jQuery( "#"+t+"_elementform_id_temp0" ).spinner();
1801
+ spinner0.spinner( "value", spinner_value0 );
1802
+ jQuery( "#"+t+"_elementform_id_temp0" ).spinner({ step: spinner_step});
1803
+
1804
+
1805
+
1806
+ var spinner_value1 = jQuery("#" + t+"_elementform_id_temp1").get( "aria-valuenow" );
1807
+
1808
+ jQuery( "#"+t+"_elementform_id_temp1" ).removeClass( "ui-spinner-input" )
1809
+ .prop( "disabled", false )
1810
+ .removeAttr( "autocomplete" )
1811
+ .removeAttr( "role" )
1812
+ .removeAttr( "aria-valuenow" );
1813
+
1814
+ span_ui1= document.getElementById(t+"_elementform_id_temp1").parentNode;
1815
+ span_ui1.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp1"));
1816
+ span_ui1.parentNode.removeChild(span_ui1);
1817
+
1818
+ spinner1 = jQuery( "#"+t+"_elementform_id_temp1" ).spinner();
1819
+ spinner1.spinner( "value", spinner_value1 );
1820
+ jQuery( "#"+t+"_elementform_id_temp1" ).spinner({ step: spinner_step});
1821
+
1822
+ var myu = t;
1823
+ jQuery(document).ready(function() {
1824
+
1825
+ jQuery("#"+myu+"_mini_label_from").click(function() {
1826
+ if (jQuery(this).children('input').length == 0) {
1827
+ var from = "<input type='text' id='from' class='from' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
1828
+ jQuery(this).html(from);
1829
+ jQuery("input.from").focus();
1830
+ jQuery("input.from").blur(function() {
1831
+ var id_for_blur = document.getElementById('from').parentNode.id.split('_');
1832
+ var value = jQuery(this).val();
1833
+ jQuery("#"+id_for_blur[0]+"_mini_label_from").text(value);
1834
+ });
1835
+ }
1836
+ });
1837
+
1838
+ jQuery("label#"+myu+"_mini_label_to").click(function() {
1839
+ if (jQuery(this).children('input').length == 0) {
1840
+
1841
+ var to = "<input type='text' id='to' class='to' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
1842
+ jQuery(this).html(to);
1843
+ jQuery("input.to").focus();
1844
+ jQuery("input.to").blur(function() {
1845
+ var id_for_blur = document.getElementById('to').parentNode.id.split('_');
1846
+ var value = jQuery(this).val();
1847
+
1848
+ jQuery("#"+id_for_blur[0]+"_mini_label_to").text(value);
1849
+ });
1850
+
1851
+ }
1852
+ });
1853
+
1854
+
1855
+
1856
+ });
1857
+ }
1858
+
1859
+ else
1860
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_name"){
1861
+ var myu = t;
1862
+ jQuery(document).ready(function() {
1863
+
1864
+ jQuery("#"+myu+"_mini_label_first").click(function() {
1865
+
1866
+ if (jQuery(this).children('input').length == 0) {
1867
+
1868
+ var first = "<input type='text' id='first' class='first' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1869
+ jQuery(this).html(first);
1870
+ jQuery("input.first").focus();
1871
+ jQuery("input.first").blur(function() {
1872
+
1873
+ var id_for_blur = document.getElementById('first').parentNode.id.split('_');
1874
+ var value = jQuery(this).val();
1875
+ jQuery("#"+id_for_blur[0]+"_mini_label_first").text(value);
1876
+ });
1877
+ }
1878
+ });
1879
+
1880
+ jQuery("label#"+myu+"_mini_label_last").click(function() {
1881
+ if (jQuery(this).children('input').length == 0) {
1882
+
1883
+ var last = "<input type='text' id='last' class='last' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1884
+ jQuery(this).html(last);
1885
+ jQuery("input.last").focus();
1886
+ jQuery("input.last").blur(function() {
1887
+ var id_for_blur = document.getElementById('last').parentNode.id.split('_');
1888
+ var value = jQuery(this).val();
1889
+
1890
+ jQuery("#"+id_for_blur[0]+"_mini_label_last").text(value);
1891
+ });
1892
+
1893
+ }
1894
+ });
1895
+
1896
+ jQuery("label#"+myu+"_mini_label_title").click(function() {
1897
+ if (jQuery(this).children('input').length == 0) {
1898
+ var title = "<input type='text' id='title' class='title' size='10' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1899
+ jQuery(this).html(title);
1900
+ jQuery("input.title").focus();
1901
+ jQuery("input.title").blur(function() {
1902
+ var id_for_blur = document.getElementById('title').parentNode.id.split('_');
1903
+ var value = jQuery(this).val();
1904
+
1905
+
1906
+ jQuery("#"+id_for_blur[0]+"_mini_label_title").text(value);
1907
+ });
1908
+ }
1909
+
1910
+ });
1911
+
1912
+
1913
+ jQuery("label#"+myu+"_mini_label_middle").click(function() {
1914
+ if (jQuery(this).children('input').length == 0) {
1915
+ var middle = "<input type='text' id='middle' class='middle' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1916
+ jQuery(this).html(middle);
1917
+ jQuery("input.middle").focus();
1918
+ jQuery("input.middle").blur(function() {
1919
+ var id_for_blur = document.getElementById('middle').parentNode.id.split('_');
1920
+ var value = jQuery(this).val();
1921
+
1922
+ jQuery("#"+id_for_blur[0]+"_mini_label_middle").text(value);
1923
+ });
1924
+ }
1925
+ });
1926
+
1927
+ });
1928
+ }
1929
+ else
1930
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_address"){
1931
+ var myu = t;
1932
+
1933
+ jQuery(document).ready(function() {
1934
+ jQuery("label#"+myu+"_mini_label_street1").click(function() {
1935
+
1936
+ if (jQuery(this).children('input').length == 0) {
1937
+ var street1 = "<input type='text' id='street1' class='street1' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1938
+ jQuery(this).html(street1);
1939
+ jQuery("input.street1").focus();
1940
+ jQuery("input.street1").blur(function() {
1941
+ var id_for_blur = document.getElementById('street1').parentNode.id.split('_');
1942
+ var value = jQuery(this).val();
1943
+ jQuery("#"+id_for_blur[0]+"_mini_label_street1").text(value);
1944
+ });
1945
+ }
1946
+ });
1947
+
1948
+ jQuery("label#"+myu+"_mini_label_street2").click(function() {
1949
+ if (jQuery(this).children('input').length == 0) {
1950
+ var street2 = "<input type='text' id='street2' class='street2' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1951
+ jQuery(this).html(street2);
1952
+ jQuery("input.street2").focus();
1953
+ jQuery("input.street2").blur(function() {
1954
+ var id_for_blur = document.getElementById('street2').parentNode.id.split('_');
1955
+ var value = jQuery(this).val();
1956
+ jQuery("#"+id_for_blur[0]+"_mini_label_street2").text(value);
1957
+ });
1958
+ }
1959
+ });
1960
+
1961
+
1962
+ jQuery("label#"+myu+"_mini_label_city").click(function() {
1963
+ if (jQuery(this).children('input').length == 0) {
1964
+ var city = "<input type='text' id='city' class='city' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1965
+ jQuery(this).html(city);
1966
+ jQuery("input.city").focus();
1967
+ jQuery("input.city").blur(function() {
1968
+ var id_for_blur = document.getElementById('city').parentNode.id.split('_');
1969
+ var value = jQuery(this).val();
1970
+ jQuery("#"+id_for_blur[0]+"_mini_label_city").text(value);
1971
+ });
1972
+ }
1973
+ });
1974
+
1975
+ jQuery("label#"+myu+"_mini_label_state").click(function() {
1976
+ if (jQuery(this).children('input').length == 0) {
1977
+ var state = "<input type='text' id='state' class='state' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1978
+ jQuery(this).html(state);
1979
+ jQuery("input.state").focus();
1980
+ jQuery("input.state").blur(function() {
1981
+ var id_for_blur = document.getElementById('state').parentNode.id.split('_');
1982
+ var value = jQuery(this).val();
1983
+ jQuery("#"+id_for_blur[0]+"_mini_label_state").text(value);
1984
+ });
1985
+ }
1986
+ });
1987
+
1988
+ jQuery("label#"+myu+"_mini_label_postal").click(function() {
1989
+ if (jQuery(this).children('input').length == 0) {
1990
+ var postal = "<input type='text' id='postal' class='postal' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1991
+ jQuery(this).html(postal);
1992
+ jQuery("input.postal").focus();
1993
+ jQuery("input.postal").blur(function() {
1994
+ var id_for_blur = document.getElementById('postal').parentNode.id.split('_');
1995
+ var value = jQuery(this).val();
1996
+ jQuery("#"+id_for_blur[0]+"_mini_label_postal").text(value);
1997
+ });
1998
+ }
1999
+ });
2000
+
2001
+
2002
+ jQuery("label#"+myu+"_mini_label_country").click(function() {
2003
+ if (jQuery(this).children('input').length == 0) {
2004
+ var country = "<input type='country' id='country' class='country' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2005
+ jQuery(this).html(country);
2006
+ jQuery("input.country").focus();
2007
+ jQuery("input.country").blur(function() {
2008
+ var id_for_blur = document.getElementById('country').parentNode.id.split('_');
2009
+ var value = jQuery(this).val();
2010
+ jQuery("#"+id_for_blur[0]+"_mini_label_country").text(value);
2011
+ });
2012
+ }
2013
+ });
2014
+ });
2015
+
2016
+ }
2017
+ else
2018
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_phone"){
2019
+ var myu = t;
2020
+
2021
+ jQuery(document).ready(function() {
2022
+ jQuery("label#"+myu+"_mini_label_area_code").click(function() {
2023
+ if (jQuery(this).children('input').length == 0) {
2024
+
2025
+ var area_code = "<input type='text' id='area_code' class='area_code' size='10' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2026
+
2027
+ jQuery(this).html(area_code);
2028
+ jQuery("input.area_code").focus();
2029
+ jQuery("input.area_code").blur(function() {
2030
+ var id_for_blur = document.getElementById('area_code').parentNode.id.split('_');
2031
+ var value = jQuery(this).val();
2032
+ jQuery("#"+id_for_blur[0]+"_mini_label_area_code").text(value);
2033
+ });
2034
+ }
2035
+ });
2036
+
2037
+
2038
+ jQuery("label#"+myu+"_mini_label_phone_number").click(function() {
2039
+
2040
+ if (jQuery(this).children('input').length == 0) {
2041
+ var phone_number = "<input type='text' id='phone_number' class='phone_number' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2042
+
2043
+ jQuery(this).html(phone_number);
2044
+
2045
+ jQuery("input.phone_number").focus();
2046
+ jQuery("input.phone_number").blur(function() {
2047
+ var id_for_blur = document.getElementById('phone_number').parentNode.id.split('_');
2048
+ var value = jQuery(this).val();
2049
+ jQuery("#"+id_for_blur[0]+"_mini_label_phone_number").text(value);
2050
+ });
2051
+ }
2052
+ });
2053
+
2054
+ });
2055
+ }
2056
+ else
2057
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_date_fields"){
2058
+ var myu = t;
2059
+
2060
+ jQuery(document).ready(function() {
2061
+ jQuery("label#"+myu+"_day_label").click(function() {
2062
+ if (jQuery(this).children('input').length == 0) {
2063
+ var day = "<input type='text' id='day' class='day' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2064
+ jQuery(this).html(day);
2065
+ jQuery("input.day").focus();
2066
+ jQuery("input.day").blur(function() {
2067
+ var id_for_blur = document.getElementById('day').parentNode.id.split('_');
2068
+ var value = jQuery(this).val();
2069
+
2070
+ jQuery("#"+id_for_blur[0]+"_day_label").text(value);
2071
+ });
2072
+ }
2073
+ });
2074
+
2075
+
2076
+ jQuery("label#"+myu+"_month_label").click(function() {
2077
+ if (jQuery(this).children('input').length == 0) {
2078
+ var month = "<input type='text' id='month' class='month' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2079
+ jQuery(this).html(month);
2080
+ jQuery("input.month").focus();
2081
+ jQuery("input.month").blur(function() {
2082
+ var id_for_blur = document.getElementById('month').parentNode.id.split('_');
2083
+ var value = jQuery(this).val();
2084
+
2085
+ jQuery("#"+id_for_blur[0]+"_month_label").text(value);
2086
+ });
2087
+ }
2088
+ });
2089
+
2090
+ jQuery("label#"+myu+"_year_label").click(function() {
2091
+ if (jQuery(this).children('input').length == 0) {
2092
+ var year = "<input type='text' id='year' class='year' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2093
+ jQuery(this).html(year);
2094
+ jQuery("input.year").focus();
2095
+ jQuery("input.year").blur(function() {
2096
+ var id_for_blur = document.getElementById('year').parentNode.id.split('_');
2097
+ var value = jQuery(this).val();
2098
+
2099
+ jQuery("#"+id_for_blur[0]+"_year_label").text(value);
2100
+ });
2101
+ }
2102
+ });
2103
+
2104
+ });
2105
+
2106
+
2107
+ }
2108
+ else
2109
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_time"){
2110
+ var myu = t;
2111
+
2112
+ jQuery(document).ready(function() {
2113
+ jQuery("label#"+myu+"_mini_label_hh").click(function() {
2114
+ if (jQuery(this).children('input').length == 0) {
2115
+ var hh = "<input type='text' id='hh' class='hh' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2116
+ jQuery(this).html(hh);
2117
+ jQuery("input.hh").focus();
2118
+ jQuery("input.hh").blur(function() {
2119
+ var id_for_blur = document.getElementById('hh').parentNode.id.split('_');
2120
+ var value = jQuery(this).val();
2121
+
2122
+
2123
+ jQuery("#"+id_for_blur[0]+"_mini_label_hh").text(value);
2124
+ });
2125
+ }
2126
+ });
2127
+
2128
+
2129
+ jQuery("label#"+myu+"_mini_label_mm").click(function() {
2130
+ if (jQuery(this).children('input').length == 0) {
2131
+ var mm = "<input type='text' id='mm' class='mm' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2132
+ jQuery(this).html(mm);
2133
+ jQuery("input.mm").focus();
2134
+ jQuery("input.mm").blur(function() {
2135
+ var id_for_blur = document.getElementById('mm').parentNode.id.split('_');
2136
+ var value = jQuery(this).val();
2137
+
2138
+ jQuery("#"+id_for_blur[0]+"_mini_label_mm").text(value);
2139
+ });
2140
+ }
2141
+ });
2142
+
2143
+ jQuery("label#"+myu+"_mini_label_ss").click(function() {
2144
+ if (jQuery(this).children('input').length == 0) {
2145
+ var ss = "<input type='text' id='ss' class='ss' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2146
+ jQuery(this).html(ss);
2147
+ jQuery("input.ss").focus();
2148
+ jQuery("input.ss").blur(function() {
2149
+ var id_for_blur = document.getElementById('ss').parentNode.id.split('_');
2150
+ var value = jQuery(this).val();
2151
+
2152
+ jQuery("#"+id_for_blur[0]+"_mini_label_ss").text(value);
2153
+ });
2154
+ }
2155
+ });
2156
+
2157
+ jQuery("label#"+myu+"_mini_label_am_pm").click(function() {
2158
+ if (jQuery(this).children('input').length == 0) {
2159
+ var am_pm = "<input type='text' id='am_pm' class='am_pm' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2160
+ jQuery(this).html(am_pm);
2161
+ jQuery("input.am_pm").focus();
2162
+ jQuery("input.am_pm").blur(function() {
2163
+ var id_for_blur = document.getElementById('am_pm').parentNode.id.split('_');
2164
+ var value = jQuery(this).val();
2165
+
2166
+ jQuery("#"+id_for_blur[0]+"_mini_label_am_pm").text(value);
2167
+ });
2168
+ }
2169
+ });
2170
+ });
2171
+
2172
+ }
2173
+
2174
+ else
2175
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_paypal_price"){
2176
+ var myu = t;
2177
+ jQuery(document).ready(function() {
2178
+
2179
+ jQuery("#"+myu+"_mini_label_dollars").click(function() {
2180
+
2181
+ if (jQuery(this).children('input').length == 0) {
2182
+
2183
+ var dollars = "<input type='text' id='dollars' class='dollars' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2184
+ jQuery(this).html(dollars);
2185
+ jQuery("input.dollars").focus();
2186
+ jQuery("input.dollars").blur(function() {
2187
+
2188
+ var id_for_blur = document.getElementById('dollars').parentNode.id.split('_');
2189
+ var value = jQuery(this).val();
2190
+ jQuery("#"+id_for_blur[0]+"_mini_label_dollars").text(value);
2191
+ });
2192
+ }
2193
+ });
2194
+
2195
+ jQuery("label#"+myu+"_mini_label_cents").click(function() {
2196
+ if (jQuery(this).children('input').length == 0) {
2197
+
2198
+ var cents = "<input type='text' id='cents' class='cents' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2199
+ jQuery(this).html(cents);
2200
+ jQuery("input.cents").focus();
2201
+ jQuery("input.cents").blur(function() {
2202
+ var id_for_blur = document.getElementById('cents').parentNode.id.split('_');
2203
+ var value = jQuery(this).val();
2204
+
2205
+ jQuery("#"+id_for_blur[0]+"_mini_label_cents").text(value);
2206
+ });
2207
+
2208
+ }
2209
+ });
2210
+ });
2211
+ }
2212
+ else
2213
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_scale_rating"){
2214
+ var myu = t;
2215
+ jQuery(document).ready(function() {
2216
+
2217
+ jQuery("#"+myu+"_mini_label_worst").click(function() {
2218
+
2219
+ if (jQuery(this).children('input').length == 0) {
2220
+
2221
+ var worst = "<input type='text' id='worst' class='worst' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
2222
+ jQuery(this).html(worst);
2223
+ jQuery("input.worst").focus();
2224
+ jQuery("input.worst").blur(function() {
2225
+
2226
+ var id_for_blur = document.getElementById('worst').parentNode.id.split('_');
2227
+ var value = jQuery(this).val();
2228
+ jQuery("#"+id_for_blur[0]+"_mini_label_worst").text(value);
2229
+ });
2230
+ }
2231
+ });
2232
+
2233
+ jQuery("label#"+myu+"_mini_label_best").click(function() {
2234
+ if (jQuery(this).children('input').length == 0) {
2235
+
2236
+ var best = "<input type='text' id='best' class='best' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
2237
+ jQuery(this).html(best);
2238
+ jQuery("input.best").focus();
2239
+ jQuery("input.best").blur(function() {
2240
+ var id_for_blur = document.getElementById('best').parentNode.id.split('_');
2241
+ var value = jQuery(this).val();
2242
+
2243
+ jQuery("#"+id_for_blur[0]+"_mini_label_best").text(value);
2244
+ });
2245
+
2246
+ }
2247
+ });
2248
+
2249
+
2250
+
2251
+ });
2252
+ }
2253
+ }
2254
+ form_view = 1;
2255
+ form_view_count = 0;
2256
+ for (i = 1; i <= 30; i++) {
2257
+ if (document.getElementById('form_id_tempform_view'+i)) {
2258
+ form_view_count++;
2259
+ form_view_max=i;
2260
+ }
2261
+ }
2262
+ if (form_view_count > 1) {
2263
+ for (i=1; i<=form_view_max; i++) {
2264
+ if (document.getElementById('form_id_tempform_view'+i)) {
2265
+ first_form_view=i;
2266
+ break;
2267
+ }
2268
+ }
2269
+ form_view=form_view_max;
2270
+ generate_page_nav(first_form_view);
2271
+ var img_EDIT = document.createElement("img");
2272
+ img_EDIT.setAttribute("src", "<?php echo WD_FMC_URL . '/images/edit.png'; ?>");
2273
+ img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
2274
+ img_EDIT.setAttribute("onclick", 'el_page_navigation()');
2275
+ var td_EDIT = document.getElementById("edit_page_navigation");
2276
+ td_EDIT.appendChild(img_EDIT);
2277
+ document.getElementById('page_navigation').appendChild(td_EDIT);
2278
+ }
2279
+ //if(document.getElementById('take').innerHTML.indexOf('up_row(')==-1) location.reload(true);
2280
+ //else
2281
+
2282
+ document.getElementById('form').value=document.getElementById('take').innerHTML;
2283
+ document.getElementById('araqel').value = 1;
2284
+ }
2285
+ jQuery(window).load(function () {
2286
+ formOnload();
2287
+ });
2288
+ </script>
2289
+
2290
+ <input type="hidden" name="option" value="com_formmaker" />
2291
+ <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
2292
+ <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
2293
+
2294
+ <input type="hidden" id="task" name="task" value=""/>
2295
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
2296
+ </form>
2297
+ <script>
2298
+ jQuery(window).load(function() {
2299
+ fm_popup();
2300
+ });
2301
+ </script>
2302
+ <?php
2303
+ }
2304
+
2305
+ public function form_options_old($id) {
2306
+ $row = $this->model->get_row_data($id);
2307
+ $themes = $this->model->get_theme_rows_data('_old');
2308
+ $page_title = $row->title . ' form options';
2309
+ $label_id = array();
2310
+ $label_label = array();
2311
+ $label_type = array();
2312
+ $label_all = explode('#****#', $row->label_order_current);
2313
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
2314
+ foreach ($label_all as $key => $label_each) {
2315
+ $label_id_each = explode('#**id**#', $label_each);
2316
+ array_push($label_id, $label_id_each[0]);
2317
+ $label_order_each = explode('#**label**#', $label_id_each[1]);
2318
+ array_push($label_label, $label_order_each[0]);
2319
+ array_push($label_type, $label_order_each[1]);
2320
+ }
2321
+ ?>
2322
+ <script>
2323
+ gen = "<?php echo $row->counter; ?>";
2324
+ form_view_max = 20;
2325
+ function set_preview() {
2326
+ document.getElementById('preview_form').href = '<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id='+document.getElementById('theme').value+'&width=1000&height=500&TB_iframe=1';
2327
+ }
2328
+ </script>
2329
+ <div style="font-size: 14px; font-weight: bold;">
2330
+ This section allows you to edit form options.
2331
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-3.html">Read More in User Manual</a>
2332
+ </div>
2333
+ <form class="wrap" method="post" action="admin.php?page=manage_fmc" style="width:99%;" name="adminForm" id="adminForm">
2334
+ <?php wp_nonce_field('nonce_fmc', 'nonce_fmc'); ?>
2335
+ <h2><?php echo $page_title; ?></h2>
2336
+ <div style="float: right; margin: 0 5px 0 0;">
2337
+ <input class="button-secondary" type="submit" onclick="if (fm_check_email('mail') ||
2338
+ fm_check_email('from_mail') ||
2339
+ fm_check_email('paypal_email')) {return false;}; fm_set_input_value('task', 'save_options_old')" value="Save"/>
2340
+ <input class="button-secondary" type="submit" onclick="if (fm_check_email('mail') ||
2341
+ fm_check_email('from_mail') ||
2342
+ fm_check_email('paypal_email')) {return false;}; fm_set_input_value('task', 'apply_options_old')" value="Apply"/>
2343
+ <input class="button-secondary" type="submit" onclick="fm_set_input_value('task', 'cancel_options_old')" value="Cancel"/>
2344
+ </div>
2345
+ <input type="hidden" name="take" id="take" value="<?php $row->form ?>">
2346
+ <div class="submenu-box" style="width: 99%; float: left; margin: 15px 0 0 0;">
2347
+ <div class="submenu-pad">
2348
+ <ul id="submenu" class="configuration">
2349
+ <li>
2350
+ <a id="general" class="fm_fieldset_tab" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
2351
+ </li>
2352
+ <li>
2353
+ <a id="actions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
2354
+ </li>
2355
+ <li>
2356
+ <a id="payment" class="fm_fieldset_tab" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
2357
+ </li>
2358
+ <li>
2359
+ <a id="javascript" class="fm_fieldset_tab" onclick="form_maker_options_tabs('javascript')" href="#">JavaScript</a>
2360
+ </li>
2361
+ <li>
2362
+ <a id="custom" class="fm_fieldset_tab" onclick="form_maker_options_tabs('custom')" href="#">Custom Text in Email</a>
2363
+ </li>
2364
+ </ul>
2365
+ </div>
2366
+ </div>
2367
+ <fieldset id="actions_fieldset" class="adminform fm_fieldset_deactive">
2368
+ <legend style="color:#0B55C4;font-weight: bold;">Actions after submission</legend>
2369
+ <table class="admintable">
2370
+ <tr valign="top">
2371
+ <td class="fm_options_label">
2372
+ <label>Action type</label>
2373
+ </td>
2374
+ <td class="fm_options_value">
2375
+ <div><input type="radio" name="submit_text_type" id="text_type_none" onclick="set_type('none')" value="1" <?php echo ($row->submit_text_type != 2 && $row->submit_text_type != 3 && $row->submit_text_type != 4 && $row->submit_text_type != 5) ? "checked" : ""; ?> /><label for="text_type_none">Stay on Form</label></div>
2376
+ <div><input type="radio" name="submit_text_type" id="text_type_post" onclick="set_type('post')" value="2" <?php echo ($row->submit_text_type == 2) ? "checked" : ""; ?> /><label for="text_type_post">Post</label></label></div>
2377
+ <div><input type="radio" name="submit_text_type" id="text_type_page" onclick="set_type('page')" value="5" <?php echo ($row->submit_text_type == 5) ? "checked" : ""; ?> /><label for="text_type_page">Page</label></label></div>
2378
+ <div><input type="radio" name="submit_text_type" id="text_type_custom_text" onclick="set_type('custom_text')" value="3" <?php echo ($row->submit_text_type == 3 ) ? "checked" : ""; ?> /><label for="text_type_custom_text">Custom Text</label></label></div>
2379
+ <div><input type="radio" name="submit_text_type" id="text_type_url" onclick="set_type('url')" value="4" <?php echo ($row->submit_text_type == 4) ? "checked" : ""; ?> /><label for="text_type_url">URL</div>
2380
+ </td>
2381
+ </tr>
2382
+ <tr id="none" <?php echo (($row->submit_text_type == 2 || $row->submit_text_type == 3 || $row->submit_text_type == 4 || $row->submit_text_type == 5) ? 'style="display:none"' : ''); ?>>
2383
+ <td class="fm_options_label">
2384
+ <label>Stay on Form</label>
2385
+ </td>
2386
+ <td class="fm_options_value">
2387
+ <img src="<?php echo WD_FMC_URL . '/images/tick.png'; ?>" border="0">
2388
+ </td>
2389
+ </tr>
2390
+ <tr id="post" <?php echo (($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
2391
+ <td class="fm_options_label">
2392
+ <label for="post_name">Post</label>
2393
+ </td>
2394
+ <td class="fm_options_value">
2395
+ <select id="post_name" name="post_name">
2396
+ <option value="0">- Select Post -</option>
2397
+ <?php
2398
+ // The Query.
2399
+ $args = array('posts_per_page' => 10000);
2400
+ query_posts($args);
2401
+ // The Loop.
2402
+ while (have_posts()) : the_post(); ?>
2403
+ <option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php echo (($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
2404
+ <?php
2405
+ endwhile;
2406
+ // Reset Query.
2407
+ wp_reset_query();
2408
+ ?>
2409
+ </select>
2410
+ </td>
2411
+ </tr>
2412
+ <tr id="page" <?php echo (($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
2413
+ <td class="fm_options_label">
2414
+ <label for="page_name">Page</label>
2415
+ </td>
2416
+ <td class="fm_options_value">
2417
+ <select id="page_name" name="page_name" style="width:153px; font-size:11px;">
2418
+ <option value="0">- Select Page -</option>
2419
+ <?php
2420
+ // The Query.
2421
+ $pages = get_pages();
2422
+ // The Loop.
2423
+ foreach ($pages as $page) {
2424
+ $page_id = get_page_link($page->ID);
2425
+ ?>
2426
+ <option value="<?php echo $page_id; ?>" <?php echo (($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
2427
+ <?php
2428
+ }
2429
+ // Reset Query.
2430
+ wp_reset_query();
2431
+ ?>
2432
+ </select>
2433
+ </td>
2434
+ </tr>
2435
+ <tr id="custom_text" <?php echo (($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
2436
+ <td class="fm_options_label">
2437
+ <label for="submit_text">Text</label>
2438
+ </td>
2439
+ <td class="fm_options_value">
2440
+ <?php
2441
+ if (user_can_richedit()) {
2442
+ wp_editor($row->submit_text, 'submit_text', array('teeny' => FALSE, 'textarea_name' => 'submit_text', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2443
+ }
2444
+ else {
2445
+ ?>
2446
+ <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical;">
2447
+ <?php echo $row->submit_text; ?>
2448
+ </textarea>
2449
+ <?php
2450
+ }
2451
+ ?>
2452
+ </td>
2453
+ </tr>
2454
+ <tr id="url" <?php echo (($row->submit_text_type != 4 ) ? 'style="display:none"' : ''); ?>>
2455
+ <td class="fm_options_label">
2456
+ <label for="url">URL</label>
2457
+ </td>
2458
+ <td class="fm_options_value">
2459
+ <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url; ?>" />
2460
+ </td>
2461
+ </tr>
2462
+ </table>
2463
+ </fieldset>
2464
+ <fieldset id="custom_fieldset" class="adminform fm_fieldset_deactive">
2465
+ <legend style="color:#0B55C4;font-weight: bold;">Custom text in email</legend>
2466
+ <table class="admintable">
2467
+ <tr>
2468
+ <td class="fm_options_label" valign="top">
2469
+ <label>For Administrator</label>
2470
+ </td>
2471
+ <td class="fm_options_value">
2472
+ <div style="margin-bottom:5px">
2473
+ <?php
2474
+ $choise = "document.getElementById('script_mail')";
2475
+ for ($i = 0; $i < count($label_label); $i++) {
2476
+ if ($label_type[$i] == "type_submit_reset" || $label_type[$i] == "type_editor" || $label_type[$i] == "type_map" || $label_type[$i] == "type_mark_map" || $label_type[$i] == "type_captcha" || $label_type[$i] == "type_recaptcha" || $label_type[$i] == "type_button") {
2477
+ continue;
2478
+ }
2479
+ $param = htmlspecialchars(addslashes($label_label[$i]));
2480
+ ?>
2481
+ <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo htmlspecialchars(addslashes($label_label[$i])); ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
2482
+ <?php
2483
+ }
2484
+ ?>
2485
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2486
+ </div>
2487
+ <?php
2488
+ if (user_can_richedit()) {
2489
+ wp_editor($row->script_mail, 'script_mail', array('teeny' => FALSE, 'textarea_name' => 'script_mail', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2490
+ }
2491
+ else {
2492
+ ?>
2493
+ <textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail; ?></textarea>
2494
+ <?php
2495
+ }
2496
+ ?>
2497
+ </td>
2498
+ </tr>
2499
+ <tr>
2500
+ <td valign="top" height="30"></td>
2501
+ <td valign="top"></td>
2502
+ </tr>
2503
+ <tr>
2504
+ <td class="fm_options_label" valign="top">
2505
+ <label>For User</label>
2506
+ </td>
2507
+ <td class="fm_options_value">
2508
+ <div style="margin-bottom:5px">
2509
+ <?php
2510
+ $choise = "document.getElementById('script_mail_user')";
2511
+ for ($i = 0; $i < count($label_label); $i++) {
2512
+ if ($label_type[$i] == "type_submit_reset" || $label_type[$i] == "type_editor" || $label_type[$i] == "type_map" || $label_type[$i] == "type_mark_map" || $label_type[$i] == "type_captcha" || $label_type[$i] == "type_recaptcha" || $label_type[$i] == "type_button") {
2513
+ continue;
2514
+ }
2515
+ $param = htmlspecialchars(addslashes($label_label[$i]));
2516
+ ?>
2517
+ <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo htmlspecialchars(addslashes($label_label[$i])); ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
2518
+ <?php
2519
+ }
2520
+ ?>
2521
+ <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2522
+ </div>
2523
+ <?php
2524
+ if (user_can_richedit()) {
2525
+ wp_editor($row->script_mail_user, 'script_mail_user', array('teeny' => FALSE, 'textarea_name' => 'script_mail_user', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2526
+ }
2527
+ else {
2528
+ ?>
2529
+ <textarea name="script_mail_user" id="script_mail_user" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail_user; ?></textarea>
2530
+ <?php
2531
+ }
2532
+ ?>
2533
+ </td>
2534
+ </tr>
2535
+ </table>
2536
+ </fieldset>
2537
+ <fieldset id="general_fieldset" class="adminform fm_fieldset_deactive">
2538
+ <legend style="color:#0B55C4;font-weight: bold;">General Options</legend>
2539
+ <table class="admintable" style="float:left">
2540
+ <tr valign="top">
2541
+ <td class="fm_options_label">
2542
+ <label for="mail">Email to send submissions to</label>
2543
+ </td>
2544
+ <td class="fm_options_value">
2545
+ <input id="mail" name="mail" value="<?php echo $row->mail; ?>" style="width:250px;" />
2546
+ </td>
2547
+ </tr>
2548
+ <tr valign="top">
2549
+ <td class="fm_options_label">
2550
+ <label for="from_mail">From Email</label>
2551
+ </td>
2552
+ <td class="fm_options_value">
2553
+ <input id="from_mail" name="from_mail" value="<?php echo $row->from_mail; ?>" style="width:250px;" />
2554
+ </td>
2555
+ </tr>
2556
+ <tr valign="top">
2557
+ <td class="fm_options_label">
2558
+ <label for="from_name">From Name</label>
2559
+ </td>
2560
+ <td class="fm_options_value">
2561
+ <input id="from_name" name="from_name" value="<?php echo $row->from_name; ?>" style="width:250px;"/>
2562
+ </td>
2563
+ </tr>
2564
+ <tr valign="top">
2565
+ <td class="fm_options_label">
2566
+ <label for="theme">Theme</label>
2567
+ </td>
2568
+ <td class="fm_options_value">
2569
+ <select id="theme" name="theme" style="width:260px;" onChange="set_preview()">
2570
+ <?php
2571
+ foreach ($themes as $theme) {
2572
+ ?>
2573
+ <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
2574
+ <?php
2575
+ }
2576
+ ?>
2577
+ </select>
2578
+ <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'id' => $row->theme, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="preview_form" title="Form Preview" onclick="return false;">
2579
+ Preview
2580
+ </a>
2581
+ </td>
2582
+ </tr>
2583
+ </table>
2584
+ </fieldset>
2585
+ <fieldset id="payment_fieldset" class="adminform fm_fieldset_deactive">
2586
+ <legend style="color:#0B55C4;font-weight: bold;">Payment Options</legend>
2587
+ <table class="admintable">
2588
+ <tr valign="top">
2589
+ <td class="fm_options_label">
2590
+ <label>Turn Paypal On</label>
2591
+ </td>
2592
+ <td class="fm_options_value">
2593
+ <div><input type="radio" name="paypal_mode" id="paypal_mode1" value="1" <?php echo ($row->paypal_mode == "1") ? "checked" : ""; ?> /><label for="paypal_mode1">On</label></div>
2594
+ <div><input type="radio" name="paypal_mode" id="paypal_mode2" value="0" <?php echo ($row->paypal_mode != "1") ? "checked" : ""; ?> /><label for="paypal_mode2">Off</label></div>
2595
+ </td>
2596
+ </tr>
2597
+ <tr valign="top">
2598
+ <td class="fm_options_label">
2599
+ <label>Checkout Mode</label>
2600
+ </td>
2601
+ <td class="fm_options_value">
2602
+ <div><input type="radio" name="checkout_mode" id="checkout_mode1" value="production" <?php echo ($row->checkout_mode == "production") ? "checked" : ""; ?> /><label for="checkout_mode1">Production</label></div>
2603
+ <div><input type="radio" name="checkout_mode" id="checkout_mode2" value="testmode" <?php echo ($row->checkout_mode != "production") ? "checked" : ""; ?> /><label for="checkout_mode2">Testmode</label></div>
2604
+ </td>
2605
+ </tr>
2606
+ <tr valign="top">
2607
+ <td class="fm_options_label">
2608
+ <label for="paypal_email">Paypal email</label>
2609
+ </td>
2610
+ <td class="fm_options_value">
2611
+ <input type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px">
2612
+ </td>
2613
+ </tr>
2614
+ <tr valign="top">
2615
+ <td class="fm_options_label">
2616
+ <label for="payment_currency">Payment Currency</label>
2617
+ </td>
2618
+ <td class="fm_options_value">
2619
+ <select id="payment_currency" name="payment_currency" style="width:253px">
2620
+ <option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ &#8226; U.S. Dollar</option>
2621
+ <option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>&#8364; &#8226; Euro</option>
2622
+ <option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>&#163; &#8226; Pound Sterling</option>
2623
+ <option value="JPY" <?php echo (($row->payment_currency == 'JPY') ? 'selected' : ''); ?>>&#165; &#8226; Japanese Yen</option>
2624
+ <option value="CAD" <?php echo (($row->payment_currency == 'CAD') ? 'selected' : ''); ?>>C$ &#8226; Canadian Dollar</option>
2625
+ <option value="MXN" <?php echo (($row->payment_currency == 'MXN') ? 'selected' : ''); ?>>Mex$ &#8226; Mexican Peso</option>
2626
+ <option value="HKD" <?php echo (($row->payment_currency == 'HKD') ? 'selected' : ''); ?>>HK$ &#8226; Hong Kong Dollar</option>
2627
+ <option value="HUF" <?php echo (($row->payment_currency == 'HUF') ? 'selected' : ''); ?>>Ft &#8226; Hungarian Forint</option>
2628
+ <option value="NOK" <?php echo (($row->payment_currency == 'NOK') ? 'selected' : ''); ?>>kr &#8226; Norwegian Kroner</option>
2629
+ <option value="NZD" <?php echo (($row->payment_currency == 'NZD') ? 'selected' : ''); ?>>NZ$ &#8226; New Zealand Dollar</option>
2630
+ <option value="SGD" <?php echo (($row->payment_currency == 'SGD') ? 'selected' : ''); ?>>S$ &#8226; Singapore Dollar</option>
2631
+ <option value="SEK" <?php echo (($row->payment_currency == 'SEK') ? 'selected' : ''); ?>>kr &#8226; Swedish Kronor</option>
2632
+ <option value="PLN" <?php echo (($row->payment_currency == 'PLN') ? 'selected' : ''); ?>>zl &#8226; Polish Zloty</option>
2633
+ <option value="AUD" <?php echo (($row->payment_currency == 'AUD') ? 'selected' : ''); ?>>A$ &#8226; Australian Dollar</option>
2634
+ <option value="DKK" <?php echo (($row->payment_currency == 'DKK') ? 'selected' : ''); ?>>kr &#8226; Danish Kroner</option>
2635
+ <option value="CHF" <?php echo (($row->payment_currency == 'CHF') ? 'selected' : ''); ?>>CHF &#8226; Swiss Francs</option>
2636
+ <option value="CZK" <?php echo (($row->payment_currency == 'CZK') ? 'selected' : ''); ?>>Kc &#8226; Czech Koruny</option>
2637
+ <option value="ILS" <?php echo (($row->payment_currency == 'ILS') ? 'selected' : ''); ?>>&#8362; &#8226; Israeli Sheqel</option>
2638
+ <option value="BRL" <?php echo (($row->payment_currency == 'BRL') ? 'selected' : ''); ?>>R$ &#8226; Brazilian Real</option>
2639
+ <option value="TWD" <?php echo (($row->payment_currency == 'TWD') ? 'selected' : ''); ?>>NT$ &#8226; Taiwan New Dollars</option>
2640
+ <option value="MYR" <?php echo (($row->payment_currency == 'MYR') ? 'selected' : ''); ?>>RM &#8226; Malaysian Ringgit</option>
2641
+ <option value="PHP" <?php echo (($row->payment_currency == 'PHP') ? 'selected' : ''); ?>>&#8369; &#8226; Philippine Peso</option>
2642
+ <option value="THB" <?php echo (($row->payment_currency == 'THB') ? 'selected' : ''); ?>>&#xe3f; &#8226; Thai Bahtv</option>
2643
+ </select>
2644
+ </td>
2645
+ </tr>
2646
+ <tr valign="top">
2647
+ <td class="fm_options_label">
2648
+ <label for="tax">Tax</label>
2649
+ </td>
2650
+ <td class="fm_options_value">
2651
+ <input type="text" name="tax" id="tax" value="<?php echo $row->tax; ?>" class="text_area" style="width: 40px;" onKeyPress="return check_isnum_point(event)"> %
2652
+ </td>
2653
+ </tr>
2654
+ </table>
2655
+ </fieldset>
2656
+ <fieldset id="javascript_fieldset" class="adminform fm_fieldset_deactive">
2657
+ <legend style="color:#0B55C4;font-weight: bold;">JavaScript</legend>
2658
+ <table class="admintable">
2659
+ <tr valign="top">
2660
+ <td class="fm_options_label">
2661
+ <label for="javascript">Javascript</label>
2662
+ </td>
2663
+ <td class="fm_options_value">
2664
+ <textarea style="margin: 0px;" cols="60" rows="30" name="javascript" id="javascript"><?php echo $row->javascript; ?></textarea>
2665
+ </td>
2666
+ </tr>
2667
+ </table>
2668
+ </fieldset>
2669
+ <input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo WDW_FMC_Library::get('fieldset_id', 'general'); ?>" />
2670
+ <input type="hidden" id="task" name="task" value=""/>
2671
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
2672
+ </form>
2673
+ <script>
2674
+ jQuery(window).load(function () {
2675
+ form_maker_options_tabs(jQuery("#fieldset_id").val());
2676
+ fm_popup();
2677
+ });
2678
+ </script>
2679
+ <?php
2680
+ }
2681
+
2682
+ public function form_options($id) {
2683
+
2684
+
2685
+ $row = $this->model->get_row_data($id);
2686
+ $themes = $this->model->get_theme_rows_data();
2687
+ $queries = $this->model->get_queries_rows_data($id);
2688
+ $userGroups = get_editable_roles();
2689
+ $page_title = $row->title . ' form options';
2690
+ $label_id = array();
2691
+ $label_label = array();
2692
+ $label_type = array();
2693
+ $label_all = explode('#****#', $row->label_order_current);
2694
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
2695
+ foreach ($label_all as $key => $label_each) {
2696
+ $label_id_each = explode('#**id**#', $label_each);
2697
+ array_push($label_id, $label_id_each[0]);
2698
+ $label_order_each = explode('#**label**#', $label_id_each[1]);
2699
+ array_push($label_label, $label_order_each[0]);
2700
+ array_push($label_type, $label_order_each[1]);
2701
+ }
2702
+ $fields = explode('*:*id*:*type_submitter_mail*:*type*:*', $row->form_fields);
2703
+ $fields_count = count($fields);
2704
+ ?>
2705
+ <script>
2706
+ function fm_change_radio_checkbox_text(elem) {
2707
+ var labels_array = [];
2708
+ labels_array['paypal_mode'] = ['Off', 'On'];
2709
+ labels_array['checkout_mode'] = ['Testmode', 'Production'];
2710
+ labels_array['mail_mode'] = ['Text', 'HTML'];
2711
+ labels_array['mail_mode_user'] = ['Text', 'HTML'];
2712
+ labels_array['value'] = ['1', '0'];
2713
+
2714
+ jQuery(elem).val(labels_array['value'][jQuery(elem).val()]);
2715
+ jQuery(elem).next().val(jQuery(elem).val());
2716
+
2717
+ var clicked_element = labels_array[jQuery(elem).attr('name')];
2718
+ jQuery(elem).find('label').html(clicked_element[jQuery(elem).val()]);
2719
+ if(jQuery( elem ).hasClass( "fm-text-yes" )) {
2720
+ jQuery( elem ).removeClass('fm-text-yes').addClass('fm-text-no');
2721
+ jQuery(elem).find("span").animate({
2722
+ right: parseInt(jQuery( elem ).css( "width")) - 14 + 'px'
2723
+ }, 400, function() {
2724
+ });
2725
+ }
2726
+ else {
2727
+ jQuery( elem ).removeClass('fm-text-no').addClass('fm-text-yes');
2728
+ jQuery(elem).find("span").animate({
2729
+ right: 0
2730
+ }, 400, function() {
2731
+ });
2732
+ }
2733
+ }
2734
+
2735
+ gen = "<?php echo $row->counter; ?>";
2736
+ form_view_max = 20;
2737
+ function set_preview() {
2738
+ jQuery("#preview_form").attr("onclick", "tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&test_theme=" + jQuery('#theme').val() + "&width=1000&height=500&TB_iframe=1'); return false;");
2739
+ jQuery("#edit_css").attr("onclick", "tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id=" + jQuery('#theme').val() + "&width=800&height=500&TB_iframe=1'); return false;");
2740
+ }
2741
+
2742
+ function set_condition() {
2743
+ field_condition = '';
2744
+ for(i=0;i<500;i++) {
2745
+ conditions = '';
2746
+ if(document.getElementById("condition"+i)) {
2747
+ field_condition+=document.getElementById("show_hide"+i).value+"*:*show_hide*:*";
2748
+ field_condition+=document.getElementById("fields"+i).value+"*:*field_label*:*";
2749
+ field_condition+=document.getElementById("all_any"+i).value+"*:*all_any*:*";
2750
+ for(k=0;k<500;k++) {
2751
+ if(document.getElementById("condition_div"+i+"_"+k)) {
2752
+ conditions+=document.getElementById("field_labels"+i+"_"+k).value+"***";
2753
+ conditions+=document.getElementById("is_select"+i+"_"+k).value+"***";
2754
+ if(document.getElementById("field_value"+i+"_"+k).tagName=="SELECT" ) {
2755
+ if(document.getElementById("field_value"+i+"_"+k).getAttribute('multiple')) {
2756
+ var sel = document.getElementById("field_value"+i+"_"+k);
2757
+ var selValues = '';
2758
+ for(m=0; m < sel.length; m++) {
2759
+ if(sel.options[m].selected)
2760
+
2761
+ selValues += sel.options[m].value+"@@@";
2762
+ }
2763
+ conditions+=selValues;
2764
+ } else {
2765
+ conditions+=document.getElementById("field_value"+i+"_"+k).value;
2766
+ }
2767
+ }
2768
+ else
2769
+ conditions+=document.getElementById("field_value"+i+"_"+k).value;
2770
+ conditions+="*:*next_condition*:*";
2771
+ }
2772
+ }
2773
+ field_condition+=conditions;
2774
+ field_condition+="*:*new_condition*:*";
2775
+ }
2776
+ }
2777
+ document.getElementById('condition').value = field_condition;
2778
+ }
2779
+
2780
+ function show_verify_options(s){
2781
+ if(s){
2782
+ jQuery(".verification_div").removeAttr( "style" );
2783
+ jQuery(".expire_link").removeAttr( "style" );
2784
+
2785
+ } else{
2786
+ jQuery(".verification_div").css( 'display', 'none' );
2787
+ jQuery(".expire_link").css( 'display', 'none' );
2788
+ }
2789
+ }
2790
+ </script>
2791
+ <style>
2792
+ .CodeMirror {
2793
+ border: 1px solid #ccc;
2794
+ font-size: 12px;
2795
+ margin-bottom: 6px;
2796
+ background: white;
2797
+ }
2798
+ </style>
2799
+ <div class="fm-user-manual">
2800
+ This section allows you to edit form options.
2801
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker-guide-3.html">Read More in User Manual</a>
2802
+ </div>
2803
+ <div class="fm-upgrade-pro">
2804
+ <a target="_blank" href="https://web-dorado.com/files/fromContactForm.php">
2805
+ <div class="fm-upgrade-img">
2806
+ UPGRADE TO PRO VERSION
2807
+ <span></span>
2808
+ </div>
2809
+ </a>
2810
+ </div>
2811
+ <div class="fm-clear"></div>
2812
+ <form class="wrap" method="post" action="admin.php?page=manage_fmc" style="width:99%;" name="adminForm" id="adminForm">
2813
+ <?php wp_nonce_field('nonce_fmc', 'nonce_fmc'); ?>
2814
+ <div class="fm-page-header">
2815
+ <div class="fm-page-title" style="width: inherit;">
2816
+ <?php echo $page_title; ?>
2817
+ </div>
2818
+ <div class="fm-page-actions">
2819
+ <button class="fm-button save-button small" onclick="if (fm_check_email('mailToAdd') ||fm_check_email('from_mail') || fm_check_email('reply_to') || fm_check_email('mail_from_user') || fm_check_email('reply_to_user') || fm_check_email('mail_from_other') || fm_check_email('reply_to_other') || fm_check_email('paypal_email')) {return false;}; set_condition(); wd_fm_apply_options('save_options');">
2820
+ <span></span>
2821
+ Save
2822
+ </button>
2823
+ <button class="fm-button apply-button small" onclick="if (fm_check_email('mailToAdd') || fm_check_email('from_mail') || fm_check_email('reply_to') || fm_check_email('mail_from_user') || fm_check_email('reply_to_user') || fm_check_email('mail_from_other') || fm_check_email('reply_to_other') || fm_check_email('paypal_email')) {return false;}; set_condition(); wd_fm_apply_options('apply_options');">
2824
+ <span></span>
2825
+ Apply
2826
+ </button>
2827
+ <button class="fm-button cancel-button small" onclick="fm_set_input_value('task', 'cancel_options');">
2828
+ <span></span>
2829
+ Cancel
2830
+ </button>
2831
+ </div>
2832
+ <div class="fm-clear"></div>
2833
+ </div>
2834
+ <div class="fm-form-options">
2835
+ <div class="submenu-box">
2836
+ <div class="submenu-pad">
2837
+ <ul id="submenu" class="configuration">
2838
+ <li>
2839
+ <a id="general" class="fm_fieldset_tab" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
2840
+ </li>
2841
+ <li>
2842
+ <a id="custom" class="fm_fieldset_tab" onclick="form_maker_options_tabs('custom')" href="#">Email Options</a>
2843
+ </li>
2844
+ <li>
2845
+ <a id="actions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
2846
+ </li>
2847
+ <li>
2848
+ <a id="payment" class="fm_fieldset_tab" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
2849
+ </li>
2850
+ <li>
2851
+ <a id="javascript" class="fm_fieldset_tab" onclick="form_maker_options_tabs('javascript'); codemirror_for_javascript();" href="#">JavaScript</a>
2852
+ </li>
2853
+ <li>
2854
+ <a id="conditions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('conditions')" href="#">Conditional Fields</a>
2855
+ </li>
2856
+
2857
+ </ul>
2858
+ </div>
2859
+ </div>
2860
+ <fieldset id="general_fieldset" class="adminform fm_fieldset_deactive">
2861
+ <legend>General Options</legend>
2862
+ <table class="admintable" >
2863
+ <tr valign="top">
2864
+ <td class="fm_options_label">
2865
+ <label>Published</label>
2866
+ </td>
2867
+ <td class="fm_options_value">
2868
+ <button class="fm-checkbox-radio-button <?php echo $row->published == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->published; ?>">
2869
+ <span></span>
2870
+ </button>
2871
+ <input type="hidden" name="published" value="<?php echo $row->published; ?>"/>
2872
+ </td>
2873
+ </tr>
2874
+ <tr valign="top">
2875
+ <td class="fm_options_label">
2876
+ <label>Save data(to database)</label>
2877
+ </td>
2878
+ <td class="fm_options_value">
2879
+ <button class="fm-checkbox-radio-button <?php echo $row->savedb == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->savedb; ?>">
2880
+ <span></span>
2881
+ </button>
2882
+ <input type="hidden" name="savedb" value="<?php echo $row->savedb; ?>"/>
2883
+ </td>
2884
+ </tr>
2885
+ <tr valign="top">
2886
+ <td class="fm_options_label">
2887
+ <label for="theme">Theme</label>
2888
+ </td>
2889
+ <td class="fm_options_value">
2890
+ <select id="theme" name="theme" onChange="set_preview()">
2891
+ <?php
2892
+ foreach ($themes as $theme) {
2893
+ ?>
2894
+ <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
2895
+ <?php
2896
+ }
2897
+ ?>
2898
+ </select>
2899
+ <button id="preview_form" class="fm-button preview-button small" onclick="tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'form_id' => $row->id, 'test_theme' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>'); return false;">
2900
+ <span></span>
2901
+ Preview
2902
+ </button>
2903
+ <button id="edit_css" class="fm-button options-edit-button small" onclick="tb_show('', '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS_fmc', 'id' => $row->theme, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>'); return false;">
2904
+ <span></span>
2905
+ Edit CSS
2906
+ </button>
2907
+ </td>
2908
+ </tr>
2909
+ <tr valign="top">
2910
+ <td class="fm_options_label">
2911
+ <label for="requiredmark">Required fields mark</label>
2912
+ </td>
2913
+ <td class="fm_options_value">
2914
+ <input type="text" id="requiredmark" name="requiredmark" value="<?php echo $row->requiredmark; ?>" style="width:250px;" />
2915
+ </td>
2916
+ </tr>
2917
+ <tr valign="top">
2918
+ <td class="fm_options_label">
2919
+ <label>Save Uploads</label>
2920
+ </td>
2921
+ <td class="fm_options_value">
2922
+ <button class="fm-checkbox-radio-button <?php echo $row->save_uploads == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->save_uploads; ?>">
2923
+ <span></span>
2924
+ </button>
2925
+ <input type="hidden" name="save_uploads" value="<?php echo $row->save_uploads; ?>"/>
2926
+ </td>
2927
+ </tr>
2928
+ </table>
2929
+ <br/>
2930
+ <div class="error_fm" style="padding: 5px; font-size: 14px;">Front end submissions are disabled in free version.</div>
2931
+ <fieldset class="adminform">
2932
+ <legend>Front end submissions access level</legend>
2933
+ <table>
2934
+ <tr>
2935
+ <td class="key">
2936
+ <label for="name">Allow User to see submissions:</label>
2937
+ </td>
2938
+ <td>
2939
+ <?php
2940
+ $checked_UserGroup=explode(',',$row->user_id_wd);
2941
+ $i = 0;
2942
+ foreach($userGroups as $val => $uG) {
2943
+ echo '<input type="checkbox" value="'.$val .'" id="user_'.$i.'"';
2944
+ if(in_array($val ,$checked_UserGroup))
2945
+ echo 'checked="checked"';
2946
+ echo 'onchange="acces_level('.count($userGroups).')" disabled/><label for="user_'.$i.'">'.$uG["name"].'</label><br>';
2947
+ $i++;
2948
+ }
2949
+ ?>
2950
+ <input type="checkbox" value="guest" id="user_<?php echo $i; ?>" onchange="acces_level(<?php echo count($userGroups); ?>)"<?php echo (in_array('guest', $checked_UserGroup) ? 'checked="checked"' : '') ?> disabled/><label for="user_<?php echo $i; ?>">Guest</label>
2951
+ <input type="hidden" name="user_id_wd" value="<?php echo $row->user_id_wd ?>" id="user_id_wd" />
2952
+ </td>
2953
+ </tr>
2954
+ </table>
2955
+ </fieldset>
2956
+ <?php
2957
+ $labels_for_submissions = $this->model->get_labels($id);
2958
+ $payment_info = $this->model->is_paypal($id);
2959
+ $labels_id_for_submissions= array();
2960
+ $label_titles_for_submissions=array();
2961
+ $labels_type_for_submissions= array();
2962
+ if($labels_for_submissions) {
2963
+ $label_id_for_submissions= array();
2964
+ $label_order_original_for_submissions= array();
2965
+ $label_type_for_submissions= array();
2966
+
2967
+ if(strpos($row->label_order, 'type_paypal_')) {
2968
+ $row->label_order=$row->label_order."item_total#**id**#Item Total#**label**#type_paypal_payment_total#****#total#**id**#Total#**label**#type_paypal_payment_total#****#0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
2969
+ }
2970
+
2971
+ $label_all_for_submissions = explode('#****#',$row->label_order);
2972
+ $label_all_for_submissions = array_slice($label_all_for_submissions,0, count($label_all_for_submissions)-1);
2973
+ foreach($label_all_for_submissions as $key => $label_each) {
2974
+ $label_id_each=explode('#**id**#',$label_each);
2975
+ array_push($label_id_for_submissions, $label_id_each[0]);
2976
+ $label_order_each=explode('#**label**#', $label_id_each[1]);
2977
+ array_push($label_order_original_for_submissions, $label_order_each[0]);
2978
+ array_push($label_type_for_submissions, $label_order_each[1]);
2979
+ }
2980
+
2981
+ foreach($label_id_for_submissions as $key => $label) {
2982
+ if(in_array($label, $labels_for_submissions)) {
2983
+ array_push($labels_type_for_submissions, $label_type_for_submissions[$key]);
2984
+ array_push($labels_id_for_submissions, $label);
2985
+ array_push($label_titles_for_submissions, $label_order_original_for_submissions[$key]);
2986
+ }
2987
+ }
2988
+ }
2989
+
2990
+ $stats_labels = array();
2991
+ $stats_labels_ids = array();
2992
+ foreach($labels_type_for_submissions as $key => $label_type_cur) {
2993
+ if($label_type_cur=="type_checkbox" || $label_type_cur=="type_radio" || $label_type_cur=="type_own_select" || $label_type_cur=="type_country" || $label_type_cur=="type_paypal_select" || $label_type_cur=="type_paypal_radio" || $label_type_cur=="type_paypal_checkbox" || $label_type_cur=="type_paypal_shipping") {
2994
+ $stats_labels_ids[] = $labels_id_for_submissions[$key];
2995
+ $stats_labels[] = $label_titles_for_submissions[$key];
2996
+ }
2997
+ }
2998
+ ?>
2999
+ <script type="text/javascript">
3000
+ function inArray(needle, myarray) {
3001
+ var length = myarray.length;
3002
+ for(var i = 0; i < length; i++) {
3003
+ if(myarray[i] == needle) return true;
3004
+ }
3005
+ return false;
3006
+ }
3007
+
3008
+ function checked_labels(class_name) {
3009
+ var checked_ids ='';
3010
+ jQuery('.'+class_name).each(function() {
3011
+ if(this.checked) {
3012
+ checked_ids += this.value+',';
3013
+ }
3014
+ });
3015
+
3016
+ if(class_name == 'filed_label') {
3017
+ document.getElementById("frontend_submit_fields").value = checked_ids ;
3018
+ if(checked_ids == document.getElementById("all_fields").value)
3019
+ document.getElementById("all_fields").checked = true;
3020
+ else
3021
+ document.getElementById("all_fields").checked = false;
3022
+ }
3023
+ else {
3024
+ document.getElementById("frontend_submit_stat_fields").value = checked_ids ;
3025
+ if(checked_ids == document.getElementById("all_stats_fields").value)
3026
+ document.getElementById("all_stats_fields").checked = true;
3027
+ else
3028
+ document.getElementById("all_stats_fields").checked = false;
3029
+ }
3030
+ }
3031
+
3032
+ jQuery(document).ready(function () {
3033
+ jQuery('.filed_label').each(function() {
3034
+ if(document.getElementById("frontend_submit_fields").value == document.getElementById("all_fields").value)
3035
+ document.getElementById("all_fields").checked = true;
3036
+ if(inArray(this.value, document.getElementById("frontend_submit_fields").value.split(","))) {
3037
+ this.checked = true;
3038
+ }
3039
+ });
3040
+
3041
+ jQuery('.stats_filed_label').each(function() {
3042
+ if(document.getElementById("frontend_submit_stat_fields").value == document.getElementById("all_stats_fields").value)
3043
+ document.getElementById("all_stats_fields").checked = true;
3044
+ if(inArray(this.value, document.getElementById("frontend_submit_stat_fields").value.split(","))) {
3045
+ this.checked = true;
3046
+ }
3047
+ });
3048
+
3049
+ jQuery(document).on('change','input[name="all_fields"]',function() {
3050
+ jQuery('.filed_label').prop("checked" , this.checked);
3051
+ });
3052
+
3053
+ jQuery(document).on('change','input[name="all_stats_fields"]',function() {
3054
+ jQuery('.stats_filed_label').prop("checked" , this.checked);
3055
+ });
3056
+ });
3057
+ </script>
3058
+ <style>
3059
+ li{
3060
+ list-style-type: none;
3061
+ }
3062
+
3063
+ .simple_table {
3064
+ padding-left: 0px !important;
3065
+ }
3066
+
3067
+ .simple_table input, .simple_table label, .simple_table img {
3068
+ display:inline-block !important;
3069
+ float:none !important;
3070
+ }
3071
+ </style>
3072
+ <fieldset class="adminform">
3073
+ <legend>Fields to hide in frontend submissions</legend>
3074
+ <?php if(count($label_titles_for_submissions)): ?>
3075
+ <table style="margin-left:-3px;">
3076
+ <tr>
3077
+ <td>
3078
+ <label>Select fields:</label>
3079
+ </td>
3080
+ <td class="simple_table">
3081
+ <ul id="form_fields">
3082
+ <li>
3083
+ <input type="checkbox" name="all_fields" id="all_fields" value="submit_id,<?php echo implode(',',$labels_id_for_submissions)."," . ($payment_info ? "payment_info" : ""); ?>" onclick="checked_labels('filed_label')" disabled/>
3084
+ <label for="all_fields">Select All</label>
3085
+ </li>
3086
+ <?php
3087
+ echo "<li><input type=\"checkbox\" id=\"submit_id\" name=\"submit_id\" value=\"submit_id\" class=\"filed_label\" onclick=\"checked_labels('filed_label')\" disabled><label for=\"submit_id\">ID</label></li>";
3088
+
3089
+ for($i=0, $n=count($label_titles_for_submissions); $i < $n ; $i++)
3090
+ {
3091
+ $field_label = $label_titles_for_submissions[$i];
3092
+
3093
+ echo "<li><input type=\"checkbox\" id=\"filed_label".$i."\" name=\"filed_label".$i."\" value=\"".$labels_id_for_submissions[$i]."\" class=\"filed_label\" onclick=\"checked_labels('filed_label')\" disabled><label for=\"filed_label".$i."\">".(strlen($field_label) > 80 ? substr ($field_label ,0, 80).'...' : $field_label)."</label></li>";
3094
+
3095
+ }
3096
+ if($payment_info)
3097
+ echo "<li><input type=\"checkbox\" id=\"payment_info\" name=\"payment_info\" value=\"payment_info\" class=\"filed_label\" onclick=\"checked_labels('filed_label')\" disabled><label for=\"payment_info\">Payment Info</label></li>";
3098
+ ?>
3099
+ </ul>
3100
+ <input type="hidden" name="frontend_submit_fields" value="<?php echo $row->frontend_submit_fields ?>" id="frontend_submit_fields" />
3101
+ </td>
3102
+ </tr>
3103
+ <?php if($stats_labels): ?>
3104
+ <tr id="stats">
3105
+ <td>
3106
+ <label>Stats fields:</label>
3107
+ </td>
3108
+ <td class="simple_table">
3109
+ <ul id="stats_fields">
3110
+ <li>
3111
+ <input type="checkbox" name="all_stats_fields" id="all_stats_fields" value="<?php echo implode(',',$stats_labels_ids).","; ?>" onclick="checked_labels('stats_filed_label')" disabled>
3112
+ <label for="all_stats_fields">Select All</label>
3113
+ </li>
3114
+ <?php
3115
+ for($i=0, $n=count($stats_labels); $i < $n ; $i++)
3116
+ {
3117
+ $field_label = $stats_labels[$i];
3118
+ echo "<li><input type=\"checkbox\" id=\"stats_filed_label".$i."\" name=\"stats_filed_label".$i."\" value=\"".$stats_labels_ids[$i]."\" class=\"stats_filed_label\" onclick=\"checked_labels('stats_filed_label')\" disabled><label for=\"stats_filed_label".$i."\" >".(strlen($field_label) > 80 ? substr ($field_label ,0, 80).'...' : $field_label)."</label></li>";
3119
+ }
3120
+ ?>
3121
+ </ul>
3122
+ <input type="hidden" name="frontend_submit_stat_fields" value="<?php echo $row->frontend_submit_stat_fields ?>" id="frontend_submit_stat_fields" />
3123
+ </td>
3124
+ </tr>
3125
+ <?php endif; ?>
3126
+ </table>
3127
+ <?php endif; ?>
3128
+ </fieldset>
3129
+ </fieldset>
3130
+ <fieldset id="custom_fieldset" class="adminform fm_fieldset_deactive">
3131
+ <legend>Email Options</legend>
3132
+ <table class="admintable">
3133
+ <tr valign="top">
3134
+ <td style="width: 75px; vertical-align: middle;">
3135
+ <label>Send E-mail</label>
3136
+ </td>
3137
+ <td style="padding: 15px;">
3138
+ <button class="fm-checkbox-radio-button <?php echo $row->sendemail == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->sendemail; ?>">
3139
+ <span></span>
3140
+ </button>
3141
+ <input type="hidden" name="sendemail" value="<?php echo $row->sendemail; ?>"/>
3142
+ </td>
3143
+ </tr>
3144
+ </table>
3145
+ <fieldset class="adminform fm_mail_options">
3146
+ <legend>Email to Administrator</legend>
3147
+ <table class="admintable">
3148
+ <tr valign="top">
3149
+ <td class="fm_options_label">
3150
+ <label for="mailToAdd">Email to send submissions to</label>
3151
+ </td>
3152
+ <td class="fm_options_value">
3153
+ <input type="text" id="mailToAdd" name="mailToAdd" style="width: 250px;" />
3154
+ <input type="hidden" id="mail" name="mail" value="<?php echo $row->mail . ($row->mail && (substr($row->mail, -1) != ',') ? ',' : ''); ?>" />
3155
+ <img src="<?php echo WD_FMC_URL . '/images/add.png?ver='. get_option("wd_form_maker_version"); ?>" style="vertical-align: middle; cursor: pointer;" title="Add more emails" onclick="if (fm_check_email('mailToAdd')) {return false;};cfm_create_input('mail', 'mailToAdd', 'cfm_mail_div', '<?php echo WD_FMC_URL; ?>')" />
3156
+ <div id="cfm_mail_div">
3157
+ <?php
3158
+ $mail_array = explode(',', $row->mail);
3159
+ foreach ($mail_array as $mail) {
3160
+ if ($mail && $mail != ',') {
3161
+ ?>
3162
+ <div class="fm_mail_input">
3163
+ <?php echo $mail; ?>
3164
+ <img src="<?php echo WD_FMC_URL; ?>/images/delete.png?ver=<?php echo get_option("wd_form_maker_version"); ?>" class="fm_delete_img" onclick="fm_delete_mail(this, '<?php echo $mail; ?>')" title="Delete Email" />
3165
+ </div>
3166
+ <?php
3167
+ }
3168
+ }
3169
+ ?>
3170
+ </div>
3171
+ </td>
3172
+ </tr>
3173
+ <tr valign="top">
3174
+ <td class="fm_options_label">
3175
+ <label for="from_mail">Email From</label>
3176
+ </td>
3177
+ <td class="fm_options_value">
3178
+ <?php
3179
+ $is_other = TRUE;
3180
+ for ($i = 0; $i < $fields_count - 1; $i++) {
3181
+ ?>
3182
+ <div>
3183
+ <input type="radio" name="from_mail" id="from_mail<?php echo $i; ?>" value="<?php echo (strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]); ?>" <?php echo ((strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]) == $row->from_mail ? 'checked="checked"' : '' ); ?> onclick="wdhide('mail_from_other')" />
3184
+ <label for="from_mail<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
3185
+ </div>
3186
+ <?php
3187
+ if(strlen($fields[$i])!=1) {
3188
+ if (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) == $row->from_mail) {
3189
+ $is_other = FALSE;
3190
+ }
3191
+ }
3192
+ else {
3193
+ if($fields[$i] == $row->from_mail)
3194
+ $is_other=false;
3195
+ }
3196
+ }
3197
+ ?>
3198
+ <div style="<?php echo ($fields_count == 1) ? 'display:none;' : ''; ?>">
3199
+ <input type="radio" id="other" name="from_mail" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('mail_from_other')" />
3200
+ <label for="other">Other</label>
3201
+ </div>
3202
+ <input type="text" style="width: <?php echo ($fields_count == 1) ? '250px' : '235px; margin-left: 15px' ?>; display: <?php echo ($is_other) ? 'block;' : 'none;'; ?>" id="mail_from_other" name="mail_from_other" value="<?php echo ($is_other) ? $row->from_mail : ''; ?>" />
3203
+ </td>
3204
+ </tr>
3205
+ <tr valign="top">
3206
+ <td class="fm_options_label">
3207
+ <label for="from_name">From Name</label>
3208
+ </td>
3209
+ <td class="fm_options_value">
3210
+ <input type="text" id="from_name" name="from_name" value="<?php echo $row->from_name; ?>" style="width: 250px;" />
3211
+ <img src="<?php echo WD_FMC_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="document.getElementById('mail_from_labels').style.display='block';" style="vertical-align: middle; cursor: pointer;display:inline-block; margin:0px; float:none;">
3212
+ <?php
3213
+ $choise = "document.getElementById('from_name')";
3214
+ echo '<div style="position:relative; top:-3px;"><div id="mail_from_labels" class="email_labels" style="display:none;">';
3215
+ echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3216
+ for($i=0; $i<count($label_label); $i++) {
3217
+ if($label_type[$i]=="type_submit_reset" || $label_type[$i]=="type_editor" || $label_type[$i]=="type_map" || $label_type[$i]=="type_mark_map" || $label_type[$i]=="type_captcha"|| $label_type[$i]=="type_recaptcha" || $label_type[$i]=="type_button" || $label_type[$i]=="type_file_upload" || $label_type[$i]=="type_send_copy" || $label_type[$i]=="type_matrix")
3218
+ continue;
3219
+
3220
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3221
+ $fld_label = $param;
3222
+ if(strlen($fld_label)>30) {
3223
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3224
+ $fld_label = explode("\n", $fld_label);
3225
+ $fld_label = $fld_label[0] . ' ...';
3226
+ }
3227
+
3228
+ echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_from_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3229
+ }
3230
+ echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3231
+
3232
+ echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3233
+ echo '</div></div>';
3234
+ ?>
3235
+ </td>
3236
+ </tr>
3237
+ <tr valign="top">
3238
+ <td class="fm_options_label">
3239
+ <label for="reply_to">Reply to<br/>(if different from "Email From") </label>
3240
+ </td>
3241
+ <td class="fm_options_value">
3242
+ <?php
3243
+ $is_other = TRUE;
3244
+ for ($i = 0; $i < $fields_count - 1; $i++) {
3245
+ ?>
3246
+ <div>
3247
+ <input type="radio" name="reply_to" id="reply_to<?php echo $i; ?>" value="<?php echo (strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]); ?>" <?php echo ((strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]) == $row->reply_to ? 'checked="checked"' : '' ); ?> onclick="wdhide('reply_to_other')" />
3248
+ <label for="reply_to<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
3249
+ </div>
3250
+ <?php
3251
+ if(strlen($fields[$i])!=1) {
3252
+ if (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) == $row->reply_to) {
3253
+ $is_other = FALSE;
3254
+ }
3255
+ }
3256
+ else {
3257
+ if($fields[$i] == $row->reply_to)
3258
+ $is_other=false;
3259
+ }
3260
+ }
3261
+ ?>
3262
+ <div style="<?php echo ($fields_count == 1) ? 'display: none;' : ''; ?>">
3263
+ <input type="radio" id="other1" name="reply_to" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('reply_to_other')" />
3264
+ <label for="other1">Other</label>
3265
+ </div>
3266
+ <input type="text" style="width: <?php echo ($fields_count == 1) ? '250px' : '235px; margin-left: 15px'; ?>; display: <?php echo ($is_other) ? 'block;' : 'none;'; ?>" id="reply_to_other" name="reply_to_other" value="<?php echo ($is_other && $row->reply_to) ? $row->reply_to : ''; ?>" />
3267
+ </td>
3268
+ </tr>
3269
+ <tr valign="top">
3270
+ <td class="fm_options_label">
3271
+ <label> CC: </label>
3272
+ </td>
3273
+ <td class="fm_options_value">
3274
+ <input type="text" id="mail_cc" name="mail_cc" value="<?php echo $row->mail_cc ?>" style="width:250px;" />
3275
+ </td>
3276
+ </tr>
3277
+ <tr valign="top">
3278
+ <td class="fm_options_label">
3279
+ <label> BCC: </label>
3280
+ </td>
3281
+ <td class="fm_options_value">
3282
+ <input type="text" id="mail_bcc" name="mail_bcc" value="<?php echo $row->mail_bcc ?>" style="width:250px;" />
3283
+ </td>
3284
+ </tr>
3285
+ <tr valign="top">
3286
+ <td class="fm_options_label">
3287
+ <label> Subject: </label>
3288
+ </td>
3289
+ <td class="fm_options_value">
3290
+ <input type="text" id="mail_subject" name="mail_subject" value="<?php echo $row->mail_subject ?>" style="width:250px;" />
3291
+ <img src="<?php echo WD_FMC_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="document.getElementById('mail_subject_labels').style.display='block';" style="vertical-align: middle;cursor: pointer; display:inline-block; margin:0px; float:none;">
3292
+ <?php
3293
+ $choise = "document.getElementById('mail_subject')";
3294
+ echo '<div style="position:relative; top:-3px;"><div id="mail_subject_labels" class="email_labels" style="display:none;">';
3295
+ for($i=0; $i<count($label_label); $i++) {
3296
+ if($label_type[$i]=="type_submit_reset" || $label_type[$i]=="type_editor" || $label_type[$i]=="type_map" || $label_type[$i]=="type_mark_map" || $label_type[$i]=="type_captcha"|| $label_type[$i]=="type_recaptcha" || $label_type[$i]=="type_button" || $label_type[$i]=="type_file_upload" || $label_type[$i]=="type_send_copy" || $label_type[$i]=="type_matrix")
3297
+ continue;
3298
+
3299
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3300
+
3301
+ $fld_label = $param;
3302
+ if(strlen($fld_label)>30)
3303
+ {
3304
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3305
+ $fld_label = explode("\n", $fld_label);
3306
+ $fld_label = $fld_label[0] . ' ...';
3307
+ }
3308
+
3309
+ echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_subject_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3310
+
3311
+ }
3312
+ echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3313
+
3314
+ echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3315
+ echo '</div></div>';
3316
+ ?>
3317
+ </td>
3318
+ </tr>
3319
+ <tr valign="top">
3320
+ <td class="fm_options_label" style="vertical-align: middle;">
3321
+ <label> Mode: </label>
3322
+ </td>
3323
+ <td class="fm_options_value">
3324
+ <button name="mail_mode"class="fm-checkbox-radio-button <?php echo $row->mail_mode == 1 ? 'fm-text-yes' : 'fm-text-no' ?> medium" onclick="fm_change_radio_checkbox_text(this); return false;" value="<?php echo $row->mail_mode ?>">
3325
+ <label><?php echo $row->mail_mode == 1 ? 'HTML' : 'Text' ?></label>
3326
+ <span></span>
3327
+ </button>
3328
+ <input type="hidden" name="mail_mode" value="<?php echo $row->mail_mode; ?>"/>
3329
+ </td>
3330
+ </tr>
3331
+ <tr valign="top">
3332
+ <td class="fm_options_label" style="vertical-align: middle;">
3333
+ <label> Attach File: </label>
3334
+ </td>
3335
+ <td class="fm_options_value">
3336
+ <div class="error_fm" style="padding: 5px; font-size: 14px;">File attach is disabled in free version.</div>
3337
+ <input type="hidden" name="mail_attachment" value="<?php echo $row->mail_attachment; ?>"/>
3338
+ </td>
3339
+ </tr>
3340
+ <tr valign="top">
3341
+ <td class="fm_options_label" style="vertical-align: middle;">
3342
+ <label> Email empty fields: </label>
3343
+ </td>
3344
+ <td class="fm_options_value">
3345
+ <button class="fm-checkbox-radio-button <?php echo $row->mail_emptyfields == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->mail_emptyfields; ?>">
3346
+ <span></span>
3347
+ </button>
3348
+ <input type="hidden" name="mail_emptyfields" value="<?php echo $row->mail_emptyfields; ?>"/>
3349
+ </td>
3350
+ </tr>
3351
+ <tr>
3352
+ <td class="fm_options_label" valign="top">
3353
+ <label>Custom Text in Email For Administrator</label>
3354
+ </td>
3355
+ <td class="fm_options_value">
3356
+ <div style="margin-bottom:5px">
3357
+ <?php
3358
+ $choise = "document.getElementById('script_mail')";
3359
+ for ($i = 0; $i < count($label_label); $i++) {
3360
+ if ($label_type[$i]=="type_submit_reset" || $label_type[$i]=="type_editor" || $label_type[$i]=="type_map" || $label_type[$i]=="type_mark_map" || $label_type[$i]=="type_captcha"|| $label_type[$i]=="type_recaptcha" || $label_type[$i]=="type_button" || $label_type[$i]=="type_send_copy")
3361
+ continue;
3362
+
3363
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3364
+ $fld_label = $param;
3365
+ if(strlen($fld_label)>30) {
3366
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3367
+ $fld_label = explode("\n", $fld_label);
3368
+ $fld_label = $fld_label[0] . ' ...';
3369
+ }
3370
+
3371
+ if($label_type[$i]=="type_file_upload")
3372
+ $fld_label .= '(as image)';
3373
+ ?>
3374
+ <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo $fld_label; ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
3375
+ <?php
3376
+ }
3377
+ ?>
3378
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Submission ID" onClick="insertAtCursor(<?php echo $choise; ?>,'subid')" />
3379
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Ip" onClick="insertAtCursor(<?php echo $choise; ?>,'ip')" />
3380
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Username" onClick="insertAtCursor(<?php echo $choise; ?>,'username')" />
3381
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="User Email" onClick="insertAtCursor(<?php echo $choise; ?>,'useremail')" />
3382
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
3383
+ </div>
3384
+ <?php
3385
+ if (user_can_richedit()) {
3386
+ wp_editor($row->script_mail, 'script_mail', array('teeny' => FALSE, 'textarea_name' => 'script_mail', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3387
+ }
3388
+ else {
3389
+ ?>
3390
+ <textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail; ?></textarea>
3391
+ <?php
3392
+ }
3393
+ ?>
3394
+ </td>
3395
+ </tr>
3396
+ </table>
3397
+ </fieldset>
3398
+ <fieldset class="fm_mail_options">
3399
+ <legend>Email to User</legend>
3400
+ <table class="admintable">
3401
+ <tr valign="top">
3402
+ <td class="fm_options_label">
3403
+ <label for="mail">Send to</label>
3404
+ </td>
3405
+ <td class="fm_options_value">
3406
+ <?php
3407
+ $fields = explode('*:*id*:*type_submitter_mail*:*type*:*', $row->form_fields);
3408
+ $fields_count = count($fields);
3409
+ if ($fields_count == 1) { ?>
3410
+ There is no email field
3411
+ <?php
3412
+ }
3413
+ else {
3414
+ for ($i = 0; $i < $fields_count - 1; $i++) {
3415
+ ?>
3416
+ <div>
3417
+ <input type="checkbox" name="send_to<?php echo $i; ?>" id="send_to<?php echo $i; ?>" value="<?php echo (strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]); ?>" <?php echo (is_numeric(strpos($row->send_to, '*'.(strlen($fields[$i])!=1 ? substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) : $fields[$i]).'*')) ? 'checked="checked"' : '' ); ?> style="margin: 0px 5px 0px 0px;" />
3418
+ <label for="send_to<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
3419
+ </div>
3420
+ <?php
3421
+ }
3422
+ }
3423
+ ?>
3424
+ </td>
3425
+ </tr>
3426
+ <tr valign="top">
3427
+ <td class="fm_options_label">
3428
+ <label for="mail_from_user">Email From</label>
3429
+ </td>
3430
+ <td class="fm_options_value">
3431
+ <input type="text" id="mail_from_user" name="mail_from_user" value="<?php echo $row->mail_from_user; ?>" style="width: 250px;" />
3432
+ </td>
3433
+ </tr>
3434
+ <tr valign="top">
3435
+ <td class="fm_options_label">
3436
+ <label for="mail_from_name_user">From Name</label>
3437
+ </td>
3438
+ <td class="fm_options_value">
3439
+ <input type="text" id="mail_from_name_user" name="mail_from_name_user" value="<?php echo $row->mail_from_name_user; ?>" style="width: 250px;"/>
3440
+ <img src="<?php echo WD_FMC_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="document.getElementById('mail_from_name_user_labels').style.display='block';" style="vertical-align: middle;cursor: pointer; display:inline-block; margin:0px; float:none;">
3441
+ <?php
3442
+ $choise = "document.getElementById('mail_from_name_user')";
3443
+ echo '<div style="position:relative; top:-3px;"><div id="mail_from_name_user_labels" class="email_labels" style="display:none;">';
3444
+ for($i=0; $i<count($label_label); $i++) {
3445
+ if($label_type[$i]=="type_submit_reset" || $label_type[$i]=="type_editor" || $label_type[$i]=="type_map" || $label_type[$i]=="type_mark_map" || $label_type[$i]=="type_captcha"|| $label_type[$i]=="type_recaptcha" || $label_type[$i]=="type_button" || $label_type[$i]=="type_file_upload" || $label_type[$i]=="type_send_copy")
3446
+ continue;
3447
+
3448
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3449
+ $fld_label = $param;
3450
+ if(strlen($fld_label)>30) {
3451
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3452
+ $fld_label = explode("\n", $fld_label);
3453
+ $fld_label = $fld_label[0] . ' ...';
3454
+ }
3455
+
3456
+ echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3457
+ }
3458
+ echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3459
+ echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3460
+ echo '</div></div>';
3461
+ ?>
3462
+ </td>
3463
+ </tr>
3464
+ <tr valign="top">
3465
+ <td class="fm_options_label">
3466
+ <label for="reply_to_user">Reply to<br />(if different from "Email Form")</label>
3467
+ </td>
3468
+ <td class="fm_options_value">
3469
+ <input type="text" id="reply_to_user" name="reply_to_user" value="<?php echo $row->reply_to_user; ?>" style="width:250px;"/>
3470
+ </td>
3471
+ </tr>
3472
+ <tr valign="top">
3473
+ <td class="fm_options_label">
3474
+ <label> CC: </label>
3475
+ </td>
3476
+ <td class="fm_options_value">
3477
+ <input type="text" id="mail_cc_user" name="mail_cc_user" value="<?php echo $row->mail_cc_user ?>" style="width:250px;" />
3478
+ </td>
3479
+ </tr>
3480
+ <tr valign="top">
3481
+ <td class="fm_options_label">
3482
+ <label> BCC: </label>
3483
+ </td>
3484
+ <td class="fm_options_value">
3485
+ <input type="text" id="mail_bcc_user" name="mail_bcc_user" value="<?php echo $row->mail_bcc_user ?>" style="width:250px;" />
3486
+ </td>
3487
+ </tr>
3488
+ <tr valign="top">
3489
+ <td class="fm_options_label">
3490
+ <label> Subject: </label>
3491
+ </td>
3492
+ <td class="fm_options_value">
3493
+ <input type="text" id="mail_subject_user" name="mail_subject_user" value="<?php echo $row->mail_subject_user ?>" style="width:250px;" />
3494
+ <img src="<?php echo WD_FMC_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="document.getElementById('mail_subject_user_labels').style.display='block';" style="vertical-align: middle; cursor: pointer; display:inline-block; margin:0px; float:none;">
3495
+ <?php
3496
+ $choise = "document.getElementById('mail_subject_user')";
3497
+ echo '<div style="position:relative; top:-3px;"><div id="mail_subject_user_labels" class="email_labels" style="display:none;">';
3498
+ for($i=0; $i<count($label_label); $i++)
3499
+ {
3500
+ if($label_type[$i]=="type_submit_reset" || $label_type[$i]=="type_editor" || $label_type[$i]=="type_map" || $label_type[$i]=="type_mark_map" || $label_type[$i]=="type_captcha"|| $label_type[$i]=="type_recaptcha" || $label_type[$i]=="type_button" || $label_type[$i]=="type_file_upload" || $label_type[$i]=="type_send_copy")
3501
+ continue;
3502
+
3503
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3504
+
3505
+ $fld_label = $param;
3506
+ if(strlen($fld_label)>30)
3507
+ {
3508
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3509
+ $fld_label = explode("\n", $fld_label);
3510
+ $fld_label = $fld_label[0] . ' ...';
3511
+ }
3512
+
3513
+ echo "<a onClick=\"insertAtCursor(".$choise.",'".$param."'); document.getElementById('mail_subject_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">".$fld_label."</a>";
3514
+
3515
+ }
3516
+ echo "<a onClick=\"insertAtCursor(".$choise.",'subid'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Submission ID</a>";
3517
+
3518
+ echo "<a onClick=\"insertAtCursor(".$choise.",'username'); document.getElementById('mail_from_name_user_labels').style.display='none';\" style=\"display:block; text-decoration:none;\">Username</a>";
3519
+ echo '</div></div>';
3520
+ ?>
3521
+ </td>
3522
+ </tr>
3523
+ <tr valign="top">
3524
+ <td class="fm_options_label" style="vertical-align: middle;">
3525
+ <label> Mode: </label>
3526
+ </td>
3527
+ <td class="fm_options_value">
3528
+ <button name="mail_mode_user" class="fm-checkbox-radio-button <?php echo $row->mail_mode_user == 1 ? 'fm-text-yes' : 'fm-text-no' ?> medium" onclick="fm_change_radio_checkbox_text(this); return false;" value="<?php echo $row->mail_mode_user == 1 ? '1' : '0' ?>">
3529
+ <label><?php echo $row->mail_mode_user == 1 ? 'HTML' : 'Text' ?></label>
3530
+ <span></span>
3531
+ </button>
3532
+ <input type="hidden" name="mail_mode_user" value="<?php echo $row->mail_mode_user; ?>"/>
3533
+ </td>
3534
+ </tr>
3535
+ <tr valign="top">
3536
+ <td class="fm_options_label" style="vertical-align: middle;">
3537
+ <label> Attach File: </label>
3538
+ </td>
3539
+ <td class="fm_options_value">
3540
+ <div class="error_fm" style="padding: 5px; font-size: 14px;">File attach is disabled in free version.</div>
3541
+ <input type="hidden" name="mail_attachment_user" value="<?php echo $row->mail_attachment_user; ?>"/>
3542
+ </td>
3543
+ </tr>
3544
+ <tr valign="top">
3545
+ <td class="fm_options_label" style="vertical-align: middle;">
3546
+ <label> Email verification: </label>
3547
+ </td>
3548
+ <td class="fm_options_value">
3549
+ <button name="mail_verify" class="fm-checkbox-radio-button <?php echo $row->mail_verify == 1 ? 'fm-yes' : 'fm-no' ?>" onclick="fm_change_radio(this); return false;" value="<?php echo $row->mail_verify; ?>">
3550
+ <span></span>
3551
+ </button>
3552
+ <input type="hidden" name="mail_verify" value="<?php echo $row->mail_verify; ?>"/>
3553
+ </td>
3554
+ </tr>
3555
+ <tr valign="top" class="expire_link" <?php echo ($row->mail_verify==0 ? 'style="display:none;"' : '')?>>
3556
+ <td class="fm_options_label" valign="top">
3557
+ <label> Verification link expires in: </label>
3558
+ </td>
3559
+ <td class="fm_options_value">
3560
+ <input class="inputbox" type="text" name="mail_verify_expiretime" maxlength="10" value = "<?php echo ($row->mail_verify_expiretime ? $row->mail_verify_expiretime : 0); ?>" style="width:95px;" onkeypress="return check_isnum_point(event)"/><small> -- hours (0 - never expires).</small>
3561
+ </td>
3562
+ </tr>
3563
+ <tr>
3564
+ <td class="fm_options_label" valign="top">
3565
+ <label>Custom Text in Email For User</label>
3566
+ </td>
3567
+ <td class="fm_options_value">
3568
+ <div style="margin-bottom:5px">
3569
+ <?php
3570
+ $choise = "document.getElementById('script_mail_user')";
3571
+ for ($i = 0; $i < count($label_label); $i++) {
3572
+ if ($label_type[$i] == "type_submit_reset" || $label_type[$i] == "type_editor" || $label_type[$i] == "type_map" || $label_type[$i] == "type_mark_map" || $label_type[$i] == "type_captcha" || $label_type[$i] == "type_recaptcha" || $label_type[$i] == "type_button" || $label_type[$i] == "type_file_upload" || $label_type[$i] == "type_send_copy")
3573
+ continue;
3574
+
3575
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3576
+ $fld_label = $param;
3577
+ if(strlen($fld_label)>30) {
3578
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3579
+ $fld_label = explode("\n", $fld_label);
3580
+ $fld_label = $fld_label[0] . ' ...';
3581
+ }
3582
+ if($label_type[$i]=="type_file_upload")
3583
+ $fld_label .= '(as image)';
3584
+ ?>
3585
+ <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo $fld_label; ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
3586
+ <?php
3587
+ }
3588
+ ?>
3589
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Submission ID" onClick="insertAtCursor(<?php echo $choise; ?>,'subid')" />
3590
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Ip" onClick="insertAtCursor(<?php echo $choise; ?>,'ip')" />
3591
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Username" onClick="insertAtCursor(<?php echo $choise; ?>,'username')" />
3592
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="User Email" onClick="insertAtCursor(<?php echo $choise; ?>,'useremail')" />
3593
+ <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
3594
+ <div class="verification_div" <?php echo ($row->mail_verify==0 ? 'style="display:none;"' : '')?>><input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="Verification link" onClick="insertAtCursor(<?php echo $choise; ?>,'Verification link')" /> </div>
3595
+ </div>
3596
+ <?php
3597
+ if (user_can_richedit()) {
3598
+ wp_editor($row->script_mail_user, 'script_mail_user', array('teeny' => FALSE, 'textarea_name' => 'script_mail_user', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3599
+ }
3600
+ else {
3601
+ ?>
3602
+ <textarea name="script_mail_user" id="script_mail_user" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail_user; ?></textarea>
3603
+ <?php
3604
+ }
3605
+ ?>
3606
+ </td>
3607
+ </tr>
3608
+ </table>
3609
+ </fieldset>
3610
+ </fieldset>
3611
+ <fieldset id="actions_fieldset" class="adminform fm_fieldset_deactive">
3612
+ <legend>Actions after submission</legend>
3613
+ <table class="admintable">
3614
+ <tr valign="top">
3615
+ <td class="fm_options_label">
3616
+ <label>Action type</label>
3617
+ </td>
3618
+ <td class="fm_options_value">
3619
+ <div>
3620
+ <input type="radio" name="submit_text_type" id="text_type_none" onclick="set_type('none')" value="1" <?php echo ($row->submit_text_type != 2 && $row->submit_text_type != 3 && $row->submit_text_type != 4 && $row->submit_text_type != 5) ? "checked" : ""; ?> />
3621
+ <label for="text_type_none">Stay on Form</label>
3622
+ </div>
3623
+ <div>
3624
+ <input type="radio" name="submit_text_type" id="text_type_post" onclick="set_type('post')" value="2" <?php echo ($row->submit_text_type == 2) ? "checked" : ""; ?> />
3625
+ <label for="text_type_post">Post</label>
3626
+ </div>
3627
+ <div>
3628
+ <input type="radio" name="submit_text_type" id="text_type_page" onclick="set_type('page')" value="5" <?php echo ($row->submit_text_type == 5) ? "checked" : ""; ?> />
3629
+ <label for="text_type_page">Page</label>
3630
+ </div>
3631
+ <div>
3632
+ <input type="radio" name="submit_text_type" id="text_type_custom_text" onclick="set_type('custom_text')" value="3" <?php echo ($row->submit_text_type == 3 ) ? "checked" : ""; ?> />
3633
+ <label for="text_type_custom_text">Custom Text</label>
3634
+ </div>
3635
+ <div>
3636
+ <input type="radio" name="submit_text_type" id="text_type_url" onclick="set_type('url')" value="4" <?php echo ($row->submit_text_type == 4) ? "checked" : ""; ?> />
3637
+ <label for="text_type_url">URL</label>
3638
+ </div>
3639
+ </td>
3640
+ </tr>
3641
+ <tr id="none" <?php echo (($row->submit_text_type == 2 || $row->submit_text_type == 3 || $row->submit_text_type == 4 || $row->submit_text_type == 5) ? 'style="display:none"' : ''); ?>>
3642
+ <td class="fm_options_label">
3643
+ <label>Stay on Form</label>
3644
+ </td>
3645
+ <td class="fm_options_value">
3646
+ <img src="<?php echo WD_FMC_URL . '/images/verified.png'; ?>" border="0">
3647
+ </td>
3648
+ </tr>
3649
+ <tr id="post" <?php echo (($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
3650
+ <td class="fm_options_label">
3651
+ <label for="post_name">Post</label>
3652
+ </td>
3653
+ <td class="fm_options_value">
3654
+ <select id="post_name" name="post_name">
3655
+ <option value="0">- Select Post -</option>
3656
+ <?php
3657
+ $args = array('posts_per_page' => 10000);
3658
+ query_posts($args);
3659
+ while (have_posts()) : the_post(); ?>
3660
+ <option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php echo (($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
3661
+ <?php
3662
+ endwhile;
3663
+ wp_reset_query();
3664
+ ?>
3665
+ </select>
3666
+ </td>
3667
+ </tr>
3668
+ <tr id="page" <?php echo (($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
3669
+ <td class="fm_options_label">
3670
+ <label for="page_name">Page</label>
3671
+ </td>
3672
+ <td class="fm_options_value">
3673
+ <select id="page_name" name="page_name">
3674
+ <option value="0">- Select Page -</option>
3675
+ <?php
3676
+ $pages = get_pages();
3677
+ foreach ($pages as $page) {
3678
+ $page_id = get_page_link($page->ID);
3679
+ ?>
3680
+ <option value="<?php echo $page_id; ?>" <?php echo (($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
3681
+ <?php
3682
+ }
3683
+ wp_reset_query();
3684
+ ?>
3685
+ </select>
3686
+ </td>
3687
+ </tr>
3688
+ <tr id="custom_text" <?php echo (($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
3689
+ <td class="fm_options_label">
3690
+ <label for="submit_text">Text</label>
3691
+ </td>
3692
+ <td class="fm_options_value">
3693
+ <?php $choise = "document.getElementById('submit_text')";
3694
+ for ($i = 0; $i < count($label_label); $i++) {
3695
+ if ($label_type[$i]=="type_submit_reset" || $label_type[$i]=="type_editor" || $label_type[$i]=="type_map" || $label_type[$i]=="type_mark_map" || $label_type[$i]=="type_captcha"|| $label_type[$i]=="type_recaptcha" || $label_type[$i]=="type_button" || $label_type[$i]=="type_send_copy" || $label_type[$i]=="type_file_upload")
3696
+ continue;
3697
+
3698
+ $param = htmlspecialchars(addslashes($label_label[$i]));
3699
+ $fld_label = $param;
3700
+ if(strlen($fld_label)>30) {
3701
+ $fld_label = wordwrap(htmlspecialchars(addslashes($label_label[$i])), 30);
3702
+ $fld_label = explode("\n", $fld_label);
3703
+ $fld_label = $fld_label[0] . ' ...';
3704
+ }
3705
+
3706
+ ?>
3707
+ <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo $fld_label; ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
3708
+ <?php
3709
+ }
3710
+ ?>
3711
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Submission ID" onClick="insertAtCursor(<?php echo $choise; ?>,'subid')" />
3712
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Ip" onClick="insertAtCursor(<?php echo $choise; ?>,'ip')" />
3713
+ <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="User Id" onClick="insertAtCursor(<?php echo $choise; ?>, 'userid')" />
3714
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="Username" onClick="insertAtCursor(<?php echo $choise; ?>,'username')" />
3715
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="User Email" onClick="insertAtCursor(<?php echo $choise; ?>,'useremail')" />
3716
+ <?php
3717
+ if (user_can_richedit()) {
3718
+ wp_editor($row->submit_text, 'submit_text', array('teeny' => FALSE, 'textarea_name' => 'submit_text', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3719
+ }
3720
+ else {
3721
+ ?>
3722
+ <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical;">
3723
+ <?php echo $row->submit_text; ?>
3724
+ </textarea>
3725
+ <?php
3726
+ }
3727
+ ?>
3728
+ </td>
3729
+ </tr>
3730
+ <tr id="url" <?php echo (($row->submit_text_type != 4 ) ? 'style="display:none"' : ''); ?>>
3731
+ <td class="fm_options_label">
3732
+ <label for="url">URL</label>
3733
+ </td>
3734
+ <td class="fm_options_value">
3735
+ <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url; ?>" />
3736
+ </td>
3737
+ </tr>
3738
+ </table>
3739
+ </fieldset>
3740
+ <fieldset id="payment_fieldset" class="adminform fm_fieldset_deactive">
3741
+ <legend>Payment Options</legend>
3742
+ <table class="admintable">
3743
+ <tr>
3744
+ <td colspan="2">
3745
+ <div class="error_fm" style="padding: 5px; font-size: 14px;">Paypal Options are disabled in free version.</div>
3746
+ </td>
3747
+ </tr>
3748
+ <tr valign="top">
3749
+ <td class="fm_options_label">
3750
+ <label>Turn Paypal On</label>
3751
+ </td>
3752
+ <td class="fm_options_value">
3753
+ <button name="paypal_mode" class="fm-checkbox-radio-button <?php echo $row->paypal_mode == 1 ? 'fm-text-yes' : 'fm-text-no' ?> small" onclick="fm_change_radio_checkbox_text(this); return false;" value="<?php echo $row->paypal_mode == 1 ? '1' : '0' ?>" disabled="disabled">
3754
+ <label><?php echo $row->paypal_mode == 1 ? 'On' : 'Off' ?></label>
3755
+ <span></span>
3756
+ </button>
3757
+ <input type="hidden" name="paypal_mode" value="<?php echo $row->paypal_mode; ?>"/>
3758
+ </td>
3759
+ </tr>
3760
+ <tr valign="top">
3761
+ <td class="fm_options_label">
3762
+ <label>Checkout Mode</label>
3763
+ </td>
3764
+ <td class="fm_options_value">
3765
+ <button name="checkout_mode" class="fm-checkbox-radio-button <?php echo $row->checkout_mode == 1 ? 'fm-text-yes' : 'fm-text-no' ?> large" onclick="fm_change_radio_checkbox_text(this); return false;" value="<?php echo $row->checkout_mode == 1 ? '1' : '0' ?>" disabled="disabled">
3766
+ <label><?php echo $row->checkout_mode == 1 ? 'Production' : 'Testmode' ?></label>
3767
+ <span></span>
3768
+ </button>
3769
+ <input type="hidden" name="checkout_mode" value="<?php echo $row->checkout_mode; ?>"/>
3770
+ </td>
3771
+ </tr>
3772
+ <tr valign="top">
3773
+ <td class="fm_options_label">
3774
+ <label for="paypal_email">Paypal email</label>
3775
+ </td>
3776
+ <td class="fm_options_value">
3777
+ <input type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px" disabled="disabled">
3778
+ </td>
3779
+ </tr>
3780
+ <tr valign="top">
3781
+ <td class="fm_options_label">
3782
+ <label for="payment_currency">Payment Currency</label>
3783
+ </td>
3784
+ <td class="fm_options_value">
3785
+ <select id="payment_currency" name="payment_currency" disabled="disabled">
3786
+ <option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ &#8226; U.S. Dollar</option>
3787
+ <option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>&#8364; &#8226; Euro</option>
3788
+ <option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>&#163; &#8226; Pound Sterling</option>
3789
+ <option value="JPY" <?php echo (($row->payment_currency == 'JPY') ? 'selected' : ''); ?>>&#165; &#8226; Japanese Yen</option>
3790
+ <option value="CAD" <?php echo (($row->payment_currency == 'CAD') ? 'selected' : ''); ?>>C$ &#8226; Canadian Dollar</option>
3791
+ <option value="MXN" <?php echo (($row->payment_currency == 'MXN') ? 'selected' : ''); ?>>Mex$ &#8226; Mexican Peso</option>
3792
+ <option value="HKD" <?php echo (($row->payment_currency == 'HKD') ? 'selected' : ''); ?>>HK$ &#8226; Hong Kong Dollar</option>
3793
+ <option value="HUF" <?php echo (($row->payment_currency == 'HUF') ? 'selected' : ''); ?>>Ft &#8226; Hungarian Forint</option>
3794
+ <option value="NOK" <?php echo (($row->payment_currency == 'NOK') ? 'selected' : ''); ?>>kr &#8226; Norwegian Kroner</option>
3795
+ <option value="NZD" <?php echo (($row->payment_currency == 'NZD') ? 'selected' : ''); ?>>NZ$ &#8226; New Zealand Dollar</option>
3796
+ <option value="SGD" <?php echo (($row->payment_currency == 'SGD') ? 'selected' : ''); ?>>S$ &#8226; Singapore Dollar</option>
3797
+ <option value="SEK" <?php echo (($row->payment_currency == 'SEK') ? 'selected' : ''); ?>>kr &#8226; Swedish Kronor</option>
3798
+ <option value="PLN" <?php echo (($row->payment_currency == 'PLN') ? 'selected' : ''); ?>>zl &#8226; Polish Zloty</option>
3799
+ <option value="AUD" <?php echo (($row->payment_currency == 'AUD') ? 'selected' : ''); ?>>A$ &#8226; Australian Dollar</option>
3800
+ <option value="DKK" <?php echo (($row->payment_currency == 'DKK') ? 'selected' : ''); ?>>kr &#8226; Danish Kroner</option>
3801
+ <option value="CHF" <?php echo (($row->payment_currency == 'CHF') ? 'selected' : ''); ?>>CHF &#8226; Swiss Francs</option>
3802
+ <option value="CZK" <?php echo (($row->payment_currency == 'CZK') ? 'selected' : ''); ?>>Kc &#8226; Czech Koruny</option>
3803
+ <option value="ILS" <?php echo (($row->payment_currency == 'ILS') ? 'selected' : ''); ?>>&#8362; &#8226; Israeli Sheqel</option>
3804
+ <option value="BRL" <?php echo (($row->payment_currency == 'BRL') ? 'selected' : ''); ?>>R$ &#8226; Brazilian Real</option>
3805
+ <option value="TWD" <?php echo (($row->payment_currency == 'TWD') ? 'selected' : ''); ?>>NT$ &#8226; Taiwan New Dollars</option>
3806
+ <option value="MYR" <?php echo (($row->payment_currency == 'MYR') ? 'selected' : ''); ?>>RM &#8226; Malaysian Ringgit</option>
3807
+ <option value="PHP" <?php echo (($row->payment_currency == 'PHP') ? 'selected' : ''); ?>>&#8369; &#8226; Philippine Peso</option>
3808
+ <option value="THB" <?php echo (($row->payment_currency == 'THB') ? 'selected' : ''); ?>>&#xe3f; &#8226; Thai Bahtv</option>
3809
+ </select>
3810
+ </td>
3811
+ </tr>
3812
+ <tr valign="top">
3813
+ <td class="fm_options_label">
3814
+ <label for="tax">Tax</label>
3815
+ </td>
3816
+ <td class="fm_options_value">
3817
+ <input type="text" name="tax" id="tax" value="<?php echo $row->tax; ?>" class="text_area" style="width: 40px;" onKeyPress="return check_isnum_point(event)" disabled="disabled"> %
3818
+ </td>
3819
+ </tr>
3820
+ </table>
3821
+ </fieldset>
3822
+ <fieldset id="javascript_fieldset" class="adminform fm_fieldset_deactive">
3823
+ <legend>JavaScript</legend>
3824
+ <table class="admintable">
3825
+ <tr valign="top">
3826
+ <td class="fm_options_label">
3827
+ <label for="javascript">Javascript</label>
3828
+ </td>
3829
+ <td class="fm_options_value" style="width:650px;">
3830
+ <textarea style="margin: 0px; height: 400px; width: 600px;" cols="60" rows="30" name="javascript" id="form_javascript"><?php echo $row->javascript; ?></textarea>
3831
+ </td>
3832
+ </tr>
3833
+ </table>
3834
+ </fieldset>
3835
+ <fieldset id="conditions_fieldset" class="adminform fm_fieldset_deactive">
3836
+ <?php
3837
+ $ids = array();
3838
+ $types = array();
3839
+ $labels = array();
3840
+ $paramss = array();
3841
+ $all_ids = array();
3842
+ $all_labels = array();
3843
+
3844
+ $select_and_input = array("type_text", "type_password", "type_textarea", "type_name", "type_number", "type_phone", "type_submitter_mail", "type_address", "type_spinner", "type_checkbox", "type_radio", "type_own_select", "type_paypal_price", "type_paypal_select", "type_paypal_checkbox", "type_paypal_radio", "type_paypal_shipping");
3845
+ $select_type_fields = array("type_address", "type_checkbox", "type_radio", "type_own_select", "type_paypal_select", "type_paypal_checkbox", "type_paypal_radio", "type_paypal_shipping");
3846
+
3847
+ $fields=explode('*:*new_field*:*',$row->form_fields);
3848
+ $fields = array_slice($fields,0, count($fields)-1);
3849
+ foreach($fields as $field) {
3850
+ $temp=explode('*:*id*:*',$field);
3851
+ array_push($ids, $temp[0]);
3852
+ array_push($all_ids, $temp[0]);
3853
+ $temp=explode('*:*type*:*',$temp[1]);
3854
+ array_push($types, $temp[0]);
3855
+ $temp=explode('*:*w_field_label*:*',$temp[1]);
3856
+ array_push($labels, $temp[0]);
3857
+ array_push($all_labels, $temp[0]);
3858
+ array_push($paramss, $temp[1]);
3859
+
3860
+ }
3861
+
3862
+ foreach($types as $key=>$value){
3863
+ if(!in_array($types[$key],$select_and_input)){
3864
+ unset($ids[$key]);
3865
+ unset($labels[$key]);
3866
+ unset($types[$key]);
3867
+ unset($paramss[$key]);
3868
+ }
3869
+ }
3870
+
3871
+ $ids = array_values($ids);
3872
+ $labels = array_values($labels);
3873
+ $types = array_values($types);
3874
+ $paramss = array_values($paramss);
3875
+
3876
+ $chose_ids = implode('@@**@@',$ids);
3877
+ $chose_labels = implode('@@**@@',$labels);
3878
+ $chose_types = implode('@@**@@',$types);
3879
+ $chose_paramss = implode('@@**@@',$paramss);
3880
+
3881
+ $all_ids_cond = implode('@@**@@',$all_ids);
3882
+ $all_labels_cond = implode('@@**@@',$all_labels);
3883
+
3884
+ $show_hide = array();
3885
+ $field_label = array();
3886
+ $all_any = array();
3887
+ $condition_params = array();
3888
+
3889
+ $count_of_conditions=0;
3890
+ if($row->condition!="") {
3891
+ $conditions=explode('*:*new_condition*:*',$row->condition);
3892
+ $conditions = array_slice($conditions,0, count($conditions)-1);
3893
+ $count_of_conditions = count($conditions);
3894
+
3895
+ foreach($conditions as $condition) {
3896
+ $temp=explode('*:*show_hide*:*',$condition);
3897
+ array_push($show_hide, $temp[0]);
3898
+ $temp=explode('*:*field_label*:*',$temp[1]);
3899
+ array_push($field_label, $temp[0]);
3900
+ $temp=explode('*:*all_any*:*',$temp[1]);
3901
+ array_push($all_any, $temp[0]);
3902
+ array_push($condition_params, $temp[1]);
3903
+ }
3904
+ }
3905
+ else {
3906
+ $show_hide[0]=1;
3907
+ $all_any[0]='and';
3908
+ $condition_params[0]='';
3909
+ if($all_ids)
3910
+ $field_label[0] = $all_ids[0];
3911
+ }
3912
+ ?>
3913
+ <div>
3914
+ <button class="fm-button add-button large" onclick="add_condition('<?php echo $chose_ids; ?>', '<?php echo htmlspecialchars(addslashes($chose_labels)); ?>', '<?php echo $chose_types; ?>', '<?php echo htmlspecialchars(addslashes($chose_paramss)); ?>', '<?php echo $all_ids_cond; ?>', '<?php echo htmlspecialchars(addslashes($all_labels_cond)); ?>'); return false;">
3915
+ Add Condition
3916
+ <span></span>
3917
+ </button>
3918
+ </div>
3919
+ <?php
3920
+ for($k=0; $k<$count_of_conditions; $k++) {
3921
+ if(in_array($field_label[$k],$all_ids)) : ?>
3922
+ <div id="condition<?php echo $k; ?>" class="fm-condition">
3923
+ <div id="conditional_fileds<?php echo $k; ?>">
3924
+ <select id="show_hide<?php echo $k; ?>" name="show_hide<?php echo $k; ?>" style="width:80px; ">
3925
+ <option value="1" <?php if($show_hide[$k]==1) echo 'selected="selected"'; ?>>show</option>
3926
+ <option value="0" <?php if($show_hide[$k]==0) echo 'selected="selected"'; ?>>hide</option>
3927
+ </select>
3928
+ <select id="fields<?php echo $k; ?>" name="fields<?php echo $k; ?>" style="width:300px; " onChange="" >
3929
+ <?php
3930
+ foreach($all_labels as $key => $value) {
3931
+ if($field_label[$k]==$all_ids[$key])
3932
+ $selected = 'selected="selected"';
3933
+ else
3934
+ $selected ='';
3935
+ echo '<option value="'.$all_ids[$key].'" '.$selected.'>'.$value.'</option>';
3936
+ }
3937
+ ?>
3938
+ </select>
3939
+ <span>if</span>
3940
+ <select id="all_any<?php echo $k; ?>" name="all_any<?php echo $k; ?>" style="width:60px; ">
3941
+ <option value="and" <?php if($all_any[$k]=="and") echo 'selected="selected"'; ?>>all</option>
3942
+ <option value="or" <?php if($all_any[$k]=="or") echo 'selected="selected"'; ?>>any</option>
3943
+ </select>
3944
+ <span>of the following match:</span>
3945
+ <img src="<?php echo WD_FMC_URL . '/images/add.png?ver='. get_option("wd_form_maker_version").''; ?>" title="add" onclick="add_condition_fields(<?php echo $k; ?>,'<?php echo $chose_ids; ?>', '<?php echo htmlspecialchars(addslashes($chose_labels)); ?>', '<?php echo $chose_types; ?>', '<?php echo htmlspecialchars(addslashes($chose_paramss)); ?>')" style="cursor: pointer; vertical-align: middle;">
3946
+ <img src="<?php echo WD_FMC_URL . '/images/page_delete.png?ver='. get_option("wd_form_maker_version").''; ?>" onclick="delete_condition('<?php echo $k; ?>')" style="cursor: pointer; vertical-align: middle;">
3947
+ </div>
3948
+ <?php
3949
+ if($condition_params[$k]) {
3950
+ $_params = explode('*:*next_condition*:*',$condition_params[$k]);
3951
+ $_params = array_slice($_params,0, count($_params)-1);
3952
+
3953
+ foreach($_params as $key=>$_param) {
3954
+ $key_select_or_input ='';
3955
+ $param_values = explode('***',$_param);
3956
+ $multiselect = explode('@@@',$param_values[2]);
3957
+
3958
+ if(in_array($param_values[0],$ids)): ?>
3959
+ <div id="condition_div<?php echo $k; ?>_<?php echo $key; ?>">
3960
+ <select id="field_labels<?php echo $k; ?>_<?php echo $key; ?>" onchange="change_choices(this.options[this.selectedIndex].id+'_<?php echo $key; ?>','<?php echo $chose_ids; ?>', '<?php echo $chose_types; ?>', '<?php echo htmlspecialchars(addslashes($chose_paramss)); ?>')" style="width:300px;"/>
3961
+ <?php
3962
+ foreach($labels as $key1 => $value)
3963
+ {
3964
+ if($param_values[0]==$ids[$key1])
3965
+ {
3966
+ $selected = 'selected="selected"';
3967
+ if ($types[$key1]=="type_checkbox" || $types[$key1]=="type_paypal_checkbox")
3968
+ $multiple = 'multiple="multiple" class="multiple_select"';
3969
+ else
3970
+ $multiple ='';
3971
+
3972
+ $key_select_or_input = $key1;
3973
+ }
3974
+ else
3975
+ $selected ='';
3976
+ if($field_label[$k]!=$ids[$key1])
3977
+ echo '<option id="'.$k.'_'.$key1.'" value="'.$ids[$key1].'" '.$selected.'>'.$value.'</option>';
3978
+
3979
+ }
3980
+
3981
+ ?>
3982
+ </select>
3983
+
3984
+ <select id="is_select<?php echo $k; ?>_<?php echo $key; ?>" style="vertical-align: top; width:94px;">
3985
+ <option value="==" <?php if($param_values[1]=="==") echo 'selected="selected"'; ?>>is</option>
3986
+ <option value="!=" <?php if($param_values[1]=="!=") echo 'selected="selected"'; ?>>is not</option>
3987
+ <option value="%" <?php if($param_values[1]=="%") echo 'selected="selected"'; ?>>like</option>
3988
+
3989
+ <option value="!%" <?php if($param_values[1]=="!%") echo 'selected="selected"'; ?>>not like</option>
3990
+
3991
+ <option value="=" <?php if($param_values[1]=="=") echo 'selected="selected"'; ?>>empty</option>
3992
+
3993
+ <option value="!" <?php if($param_values[1]=="!") echo 'selected="selected"'; ?>>not empty</option>
3994
+
3995
+ </select>
3996
+
3997
+ <?php if ($key_select_or_input !== '' && in_array($types[$key_select_or_input],$select_type_fields)) : ?>
3998
+ <select id="field_value<?php echo $k; ?>_<?php echo $key; ?>" <?php echo $multiple; ?> style="width: 200px;">
3999
+ <?php
4000
+ switch($types[$key_select_or_input])
4001
+ {
4002
+ case "type_own_select":
4003
+ case "type_paypal_select":
4004
+ $w_size = explode('*:*w_size*:*',$paramss[$key_select_or_input]);
4005
+ break;
4006
+
4007
+ case "type_radio":
4008
+ case "type_checkbox":
4009
+ case "type_paypal_radio":
4010
+ case "type_paypal_checkbox":
4011
+ case "type_paypal_shipping":
4012
+ $w_size = explode('*:*w_flow*:*',$paramss[$key_select_or_input]);
4013
+ break;
4014
+ }
4015
+
4016
+ $w_choices = explode('*:*w_choices*:*',$w_size[1]);
4017
+ $w_choices_array = explode('***',$w_choices[0]);
4018
+
4019
+ $w_choices_price = explode('*:*w_choices_price*:*',$w_choices[1]);
4020
+ $w_choices_price_array = explode('***',$w_choices_price[0]);
4021
+
4022
+ for($m=0; $m<count($w_choices_array); $m++)
4023
+ {
4024
+ if($types[$key_select_or_input]=="type_paypal_checkbox" || $types[$key_select_or_input]=="type_paypal_radio" || $types[$key_select_or_input]=="type_paypal_shipping" || $types[$key_select_or_input]=="type_paypal_select")
4025
+ $w_choice = $w_choices_array[$m].'*:*value*:*'.$w_choices_price_array[$m];
4026
+ else
4027
+ $w_choice = $w_choices_array[$m];
4028
+
4029
+ if(in_array(esc_html($w_choice),$multiselect))
4030
+ {
4031
+ $selected = 'selected="selected"';
4032
+ }
4033
+ else
4034
+ $selected ='';
4035
+
4036
+ if(strpos($w_choices_array[$m], '[') === false && strpos($w_choices_array[$m], ']') === false && strpos($w_choices_array[$m], ':') === false) {
4037
+ echo '<option id="choise_'.$k.'_'.$m.'" value="'.$w_choice.'" '.$selected.'>'.$w_choices_array[$m].'</option>';
4038
+ }
4039
+ }
4040
+
4041
+ if($types[$key_select_or_input]=="type_address")
4042
+ {
4043
+ $w_countries = array("","Afghanistan","Albania","Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombia","Comoros","Congo (Brazzaville)","Congo","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor (Timor Timur)","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Fiji","Finland","France","Gabon","Gambia, The","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea, North","Korea, South","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia and Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe");
4044
+ $w_options = '';
4045
+ foreach($w_countries as $w_country)
4046
+ {
4047
+ if(in_array($w_country,$multiselect))
4048
+ {
4049
+ $selected = 'selected="selected"';
4050
+ }
4051
+ else
4052
+ $selected ='';
4053
+
4054
+ echo '<option value="'.$w_country.'" '.$selected.'>'.$w_country.'</option>';
4055
+ }
4056
+ }
4057
+
4058
+ ?>
4059
+ </select>
4060
+ <?php else :
4061
+ if($key_select_or_input != '' && ($types[$key_select_or_input]=="type_number" || $types[$key_select_or_input]=="type_phone"))
4062
+ $onkeypress_function = "onkeypress='return check_isnum_space(event)'";
4063
+ else
4064
+ if($key_select_or_input != '' && $types[$key_select_or_input]=="type_paypal_price")
4065
+ $onkeypress_function = "onkeypress='return check_isnum_point(event)'";
4066
+ else
4067
+ $onkeypress_function = "";
4068
+ ?>
4069
+ <input id="field_value<?php echo $k; ?>_<?php echo $key; ?>" type="text" value="<?php echo $param_values[2];?>" <?php echo $onkeypress_function; ?> style=" width: 200px;"><?php endif; ?>
4070
+
4071
+ <img src="<?php echo WD_FMC_URL . '/images/delete.png?ver='. get_option("wd_form_maker_version").''; ?>" id="delete_condition<?php echo $k; ?>_<?php echo $key; ?>" onclick="delete_field_condition('<?php echo $k; ?>_<?php echo $key; ?>')" style="vertical-align: middle;">
4072
+ </div>
4073
+ <?php endif;
4074
+ }
4075
+ }
4076
+
4077
+ ?>
4078
+ </div>
4079
+ <?php endif;
4080
+ }
4081
+ ?>
4082
+ <input type="hidden" id="condition" name="condition" value="<?php echo $row->condition; ?>" />
4083
+ </fieldset>
4084
+
4085
+ </div>
4086
+ <input type="hidden" name="boxchecked" value="0">
4087
+ <input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo WDW_FMC_Library::get('fieldset_id', 'general'); ?>" />
4088
+ <input type="hidden" id="task" name="task" value=""/>
4089
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
4090
+ </form>
4091
+ <script>
4092
+ jQuery(window).load(function () {
4093
+ form_maker_options_tabs(jQuery("#fieldset_id").val());
4094
+ fm_popup();
4095
+ function hide_email_labels(event) {
4096
+ var e = event.toElement || event.relatedTarget;
4097
+ if (e.parentNode == this || e == this) {
4098
+ return;
4099
+ }
4100
+ this.style.display="none";
4101
+ }
4102
+ if(document.getElementById('mail_from_labels')) {
4103
+ document.getElementById('mail_from_labels').addEventListener('mouseout',hide_email_labels,true);
4104
+ }
4105
+ if(document.getElementById('mail_subject_labels')) {
4106
+ document.getElementById('mail_subject_labels').addEventListener('mouseout',hide_email_labels,true);
4107
+ }
4108
+ if(document.getElementById('mail_from_name_user_labels')) {
4109
+ document.getElementById('mail_from_name_user_labels').addEventListener('mouseout',hide_email_labels,true);
4110
+ }
4111
+ if(document.getElementById('mail_subject_user_labels')) {
4112
+ document.getElementById('mail_subject_user_labels').addEventListener('mouseout',hide_email_labels,true);
4113
+ }
4114
+ if(document.getElementById('post_title_labels')) {
4115
+ document.getElementById('post_title_labels').addEventListener('mouseout',hide_email_labels,true);
4116
+ }
4117
+ if(document.getElementById('post_tags_labels')) {
4118
+ document.getElementById('post_tags_labels').addEventListener('mouseout',hide_email_labels,true);
4119
+ }
4120
+ if(document.getElementById('post_featured_image_labels')) {
4121
+ document.getElementById('post_featured_image_labels').addEventListener('mouseout',hide_email_labels,true);
4122
+ }
4123
+ if(document.getElementById('dbox_upload_dir_labels')) {
4124
+ document.getElementById('dbox_upload_dir_labels').addEventListener('mouseout',hide_email_labels,true);
4125
+ }
4126
+ });
4127
+ function wd_fm_apply_options(task) {
4128
+ set_condition();
4129
+ fm_set_input_value('task', task);
4130
+ document.getElementById('adminForm').submit();
4131
+ }
4132
+ </script>
4133
+ <?php
4134
+ }
4135
+
4136
+ public function form_layout($id) {
4137
+ $row = $this->model->get_row_data($id);
4138
+ $ids = array();
4139
+ $types = array();
4140
+ $labels = array();
4141
+ $fields = explode('*:*new_field*:*', $row->form_fields);
4142
+ $fields = array_slice($fields, 0, count($fields) - 1);
4143
+ foreach ($fields as $field) {
4144
+ $temp = explode('*:*id*:*', $field);
4145
+ array_push($ids, $temp[0]);
4146
+ $temp = explode('*:*type*:*', $temp[1]);
4147
+ array_push($types, $temp[0]);
4148
+ $temp = explode('*:*w_field_label*:*', $temp[1]);
4149
+ array_push($labels, $temp[0]);
4150
+ }
4151
+ ?>
4152
+ <script>
4153
+ var form_front = '<?php echo addslashes($row->form_front);?>';
4154
+ var custom_front = '<?php echo addslashes($row->custom_front);?>';
4155
+ if (custom_front == '') {
4156
+ custom_front = form_front;
4157
+ }
4158
+ function submitbutton() {
4159
+ if (jQuery('#autogen_layout').is(':checked')) {
4160
+ jQuery('#custom_front').val(custom_front.replace(/\s+/g, ' ').replace(/> </g, '><'));
4161
+ }
4162
+ else {
4163
+ jQuery('#custom_front').val(editor.getValue().replace(/\s+/g, ' ').replace(/> </g, '><'));
4164
+ }
4165
+ }
4166
+ function insertAtCursor_form(myId, myLabel) {
4167
+ if (jQuery('#autogen_layout').is(':checked')) {
4168
+ alert("Uncheck the Auto-Generate Layout box.");
4169
+ return;
4170
+ }
4171
+ myValue = '<div wdid="' + myId + '" class="wdform_row">%' + myId + ' - ' + myLabel + '%</div>';
4172
+ line = editor.getCursor().line;
4173
+ ch = editor.getCursor().ch;
4174
+ text = editor.getLine(line);
4175
+ text1 = text.substr(0, ch);
4176
+ text2 = text.substr(ch);
4177
+ text = text1 + myValue + text2;
4178
+ editor.setLine(line, text);
4179
+ editor.focus();
4180
+ }
4181
+ function autogen(status) {
4182
+ if (status) {
4183
+ custom_front = editor.getValue();
4184
+ editor.setValue(form_front);
4185
+ editor.setOption('readOnly', true);
4186
+ autoFormat();
4187
+ }
4188
+ else {
4189
+ editor.setValue(custom_front);
4190
+ editor.setOption('readOnly', false);
4191
+ autoFormat();
4192
+ }
4193
+ }
4194
+ function autoFormat() {
4195
+ CodeMirror.commands["selectAll"](editor);
4196
+ editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
4197
+ editor.scrollTo(0,0);
4198
+ }
4199
+ </script>
4200
+
4201
+ <div class="fm_layout">
4202
+ <form action="admin.php?page=manage_fmc" method="post" name="adminForm" enctype="multipart/form-data">
4203
+ <?php wp_nonce_field('nonce_fmc', 'nonce_fmc'); ?>
4204
+ <div class="fm-layout-actions">
4205
+ <div class="fm-page-actions">
4206
+ <button class="fm-button save-button small" onclick="submitbutton(); fm_set_input_value('task', 'save_layout');">
4207
+ Save
4208
+ <span></span>
4209
+ </button>
4210
+ <button class="fm-button apply-button small" onclick="submitbutton(); fm_set_input_value('task', 'apply_layout');">
4211
+ Apply
4212
+ <span></span>
4213
+ </button>
4214
+ <button class="fm-button cancel-button small" onclick="fm_set_input_value('task', 'cancel_options');">
4215
+ Cancel
4216
+ <span></span>
4217
+ </button>
4218
+ </div>
4219
+ </div>
4220
+ <div class="fm-layout-content">
4221
+ <h2 style="clear: both;">Description</h2>
4222
+ <p>To customize the layout of the form fields uncheck the Auto-Generate Layout box and edit the HTML.</p>
4223
+ <p>You can change positioning, add in-line styles and etc. Click on the provided buttons to add the corresponding field.<br /> This will add the following line:
4224
+ <b><span class="cm-tag">&lt;div</span> <span class="cm-attribute">wdid</span>=<span class="cm-string">"example_id"</span> <span class="cm-attribute">class</span>=<span class="cm-string">"wdform_row"</span><span class="cm-tag">&gt;</span>%example_id - Example%<span class="cm-tag">&lt;/div&gt;</span></b>
4225
+ , where <b><span class="cm-tag">&lt;div&gt;</span></b> is used to set a row.</p>
4226
+ <p>To return to the default settings you should check Auto-Generate Layout box.</p>
4227
+ <h3 style="color:red">Notice</h3>
4228
+ <p>Make sure not to publish the same field twice. This will cause malfunctioning of the form.</p>
4229
+ <hr/>
4230
+ <label for="autogen_layout" style="font-size: 20px; line-height: 45px; margin-left: 10px;">Auto Generate Layout? </label>
4231
+ <input type="checkbox" value="1" name="autogen_layout" id="autogen_layout" <?php echo (($row->autogen_layout) ? 'checked="checked"' : ''); ?> />
4232
+ <input type="hidden" name="custom_front" id="custom_front" value="" />
4233
+ <input type="hidden" id="task" name="task" value=""/>
4234
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
4235
+ <br/>
4236
+ <?php
4237
+ foreach($ids as $key => $id) {
4238
+ if ($types[$key] != "type_section_break") {
4239
+ ?>
4240
+ <button onClick="insertAtCursor_form('<?php echo $ids[$key]; ?>','<?php echo $labels[$key]; ?>')" class="fm_label_buttons" title="<?php echo $labels[$key]; ?>"><?php echo $labels[$key]; ?></button>
4241
+ <?php
4242
+ }
4243
+ }
4244
+ ?>
4245
+ </form>
4246
+ </div>
4247
+ <br /><br />
4248
+ <button class="fm_submit_layout button button-secondary button-hero" onclick="autoFormat()"><strong>Apply Source Formatting</strong> <em>(ctrl-enter)</em></button>
4249
+ <textarea id="source" name="source" style="display: none;"></textarea>
4250
+ </div>
4251
+ <script>
4252
+ var editor = CodeMirror.fromTextArea(document.getElementById("source"), {
4253
+ lineNumbers: true,
4254
+ lineWrapping: true,
4255
+ mode: "htmlmixed",
4256
+ value: form_front
4257
+ });
4258
+ if (jQuery('#autogen_layout').is(':checked')) {
4259
+ editor.setOption('readOnly', true);
4260
+ editor.setValue(form_front);
4261
+ }
4262
+ else {
4263
+ editor.setOption('readOnly', false);
4264
+ editor.setValue(custom_front);
4265
+ }
4266
+ jQuery('#autogen_layout').click(function() {
4267
+ autogen(jQuery(this).is(':checked'));
4268
+ });
4269
+ autoFormat();
4270
+ </script>
4271
+ <?php
4272
+ }
4273
+
4274
+ ////////////////////////////////////////////////////////////////////////////////////////
4275
+ // Getters & Setters //
4276
+ ////////////////////////////////////////////////////////////////////////////////////////
4277
+ ////////////////////////////////////////////////////////////////////////////////////////
4278
+ // Private Methods //
4279
+ ////////////////////////////////////////////////////////////////////////////////////////
4280
+ ////////////////////////////////////////////////////////////////////////////////////////
4281
+ // Listeners //
4282
+ ////////////////////////////////////////////////////////////////////////////////////////
4283
  }
contact-form-maker.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Contact Form Maker
4
  * Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
5
  * Description: WordPress Contact Form Maker is a simple contact form builder, which allows the user with almost no knowledge of programming to create and edit different type of contact forms.
6
- * Version: 1.8.36
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -176,6 +176,7 @@ function form_maker_admin_ajax_cfm() {
176
  <script>
177
  var form_maker_admin_ajax_cfm = '<?php echo add_query_arg(array('action' => 'formcontactwindow'), admin_url('admin-ajax.php')); ?>';
178
  var plugin_url = '<?php echo WD_FMC_URL; ?>';
 
179
  var admin_url = '<?php echo admin_url('admin.php'); ?>';
180
  </script>
181
  <?php
@@ -248,7 +249,7 @@ function register_fmcemailverification_cpt(){
248
  // Activate plugin.
249
  function form_maker_activate_cfm() {
250
  $version = get_option("wd_form_maker_version");
251
- $new_version = '1.8.36';
252
  global $wpdb;
253
  if (!$version) {
254
  add_option("wd_form_maker_version", $new_version, '', 'no');
3
  * Plugin Name: Contact Form Maker
4
  * Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
5
  * Description: WordPress Contact Form Maker is a simple contact form builder, which allows the user with almost no knowledge of programming to create and edit different type of contact forms.
6
+ * Version: 1.8.37
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
176
  <script>
177
  var form_maker_admin_ajax_cfm = '<?php echo add_query_arg(array('action' => 'formcontactwindow'), admin_url('admin-ajax.php')); ?>';
178
  var plugin_url = '<?php echo WD_FMC_URL; ?>';
179
+ var fmc_plugin_url = '<?php echo WD_FMC_URL; ?>';
180
  var admin_url = '<?php echo admin_url('admin.php'); ?>';
181
  </script>
182
  <?php
249
  // Activate plugin.
250
  function form_maker_activate_cfm() {
251
  $version = get_option("wd_form_maker_version");
252
+ $new_version = '1.8.37';
253
  global $wpdb;
254
  if (!$version) {
255
  add_option("wd_form_maker_version", $new_version, '', 'no');
images/dublicate.png ADDED
Binary file
images/dublicate_hover.png ADDED
Binary file
js/formmaker_free.js CHANGED
@@ -26508,7 +26508,12 @@ function edit(id) {
26508
  w_title=[document.getElementById(id+"_element_firstform_id_temp").title, document.getElementById(id+"_element_lastform_id_temp").title];
26509
  s=document.getElementById(id+"_element_lastform_id_temp").style.width;
26510
  w_size=s.substring(0,s.length-2);
 
 
26511
  w_mini_labels= [document.getElementById(id+"_mini_label_area_code").innerHTML, document.getElementById(id+"_mini_label_phone_number").innerHTML];
 
 
 
26512
  atrs=return_attributes(id+'_element_firstform_id_temp');
26513
  w_attr_name=atrs[0];
26514
  w_attr_value=atrs[1];
@@ -26541,7 +26546,18 @@ function edit(id) {
26541
  else
26542
  w_mini_middle = "Middle";
26543
 
26544
- w_mini_labels = [w_mini_title, document.getElementById(id+"_mini_label_first").innerHTML,document.getElementById(id+"_mini_label_last").innerHTML, w_mini_middle];
 
 
 
 
 
 
 
 
 
 
 
26545
  s=document.getElementById(id+"_element_firstform_id_temp").style.width;
26546
  w_size=s.substring(0,s.length-2);
26547
  atrs=return_attributes(id+'_element_firstform_id_temp');
@@ -26549,7 +26565,7 @@ function edit(id) {
26549
  w_attr_value=atrs[1];
26550
  type_name(id, w_field_label, w_field_label_pos,w_first_val, w_title, w_mini_labels, w_size, w_name_format, w_required, w_unique, w_class, w_attr_name, w_attr_value); break;
26551
  }
26552
- case 'type_paypal_price': {
26553
  w_first_val = [document.getElementById(id+"_element_dollarsform_id_temp").value, document.getElementById(id+"_element_centsform_id_temp").value];
26554
  w_title = [document.getElementById(id+"_element_dollarsform_id_temp").title, document.getElementById(id+"_element_centsform_id_temp").title];
26555
  if (document.getElementById(id+"_td_name_cents").style.display=="none") {
@@ -26572,75 +26588,79 @@ function edit(id) {
26572
  {
26573
  s=document.getElementById(id+"_div_address").style.width;
26574
  w_size=s.substring(0,s.length-2);
26575
- if(document.getElementById(id+"_mini_label_street1")) {
26576
- w_street1= document.getElementById(id+"_mini_label_street1").innerHTML;
26577
- }
26578
- else {
26579
- if (document.getElementById(id+"_street1form_id_temp")) {
26580
- w_street1 = document.getElementById(id+"_street1form_id_temp").value;
26581
- }
26582
- else {
26583
- w_street1 = '';
26584
- }
26585
- }
26586
- if (document.getElementById(id+"_mini_label_street2")) {
26587
- w_street2= document.getElementById(id+"_mini_label_street2").innerHTML;
26588
- }
26589
- else {
26590
- if (document.getElementById(id+"_street2form_id_temp")) {
26591
- w_street2 = document.getElementById(id+"_street2form_id_temp").value;
26592
- }
26593
- else {
26594
- w_street2 = '';
26595
- }
26596
- }
26597
-
26598
- if (document.getElementById(id+"_mini_label_city")) {
26599
- w_city= document.getElementById(id+"_mini_label_city").innerHTML;
26600
- }
26601
- else {
26602
- if (document.getElementById(id+"_cityform_id_temp")) {
26603
- w_city = document.getElementById(id+"_cityform_id_temp").value;
26604
- }
26605
- else {
26606
- w_city = '';
26607
- }
26608
- }
 
 
 
 
26609
 
26610
- if (document.getElementById(id+"_mini_label_state")) {
26611
- w_state= document.getElementById(id+"_mini_label_state").innerHTML;
26612
- }
26613
- else {
26614
- if (document.getElementById(id+"_stateform_id_temp")) {
26615
- w_state = document.getElementById(id+"_stateform_id_temp").value;
26616
- }
26617
- else {
26618
- w_state = '';
26619
- }
26620
- }
26621
- if (document.getElementById(id+"_mini_label_postal")) {
26622
- w_postal= document.getElementById(id+"_mini_label_postal").innerHTML;
26623
- }
26624
- else {
26625
- if (document.getElementById(id+"_postalform_id_temp")) {
26626
- w_postal = document.getElementById(id+"_postalform_id_temp").value;
26627
- }
26628
- else {
26629
- w_postal = '';
26630
- }
26631
- }
26632
-
26633
  if (document.getElementById(id+"_mini_label_country")) {
26634
  w_country= document.getElementById(id+"_mini_label_country").innerHTML;
26635
- }
26636
- else {
26637
- if (document.getElementById(id+"_countryform_id_temp")) {
26638
- w_country = document.getElementById(id+"_countryform_id_temp").value;
26639
- }
26640
- else {
26641
- w_country = '';
26642
- }
26643
- }
26644
  w_mini_labels=[w_street1, w_street2, w_city, w_state, w_postal, w_country];
26645
  var disabled_input = document.getElementById(id+"_disable_fieldsform_id_temp");
26646
 
@@ -26653,7 +26673,13 @@ function edit(id) {
26653
 
26654
 
26655
  w_disabled_fields=[w_street1_dis, w_street2_dis, w_city_dis, w_state_dis, w_postal_dis, w_country_dis];
26656
-
 
 
 
 
 
 
26657
  atrs=return_attributes(id+'_street1form_id_temp');
26658
  w_attr_name=atrs[0];
26659
  w_attr_value=atrs[1];
@@ -26662,6 +26688,8 @@ function edit(id) {
26662
  break;
26663
  }
26664
 
 
 
26665
  case 'type_submitter_mail':
26666
  {
26667
  w_first_val=document.getElementById(id+"_elementform_id_temp").value;
@@ -26689,7 +26717,7 @@ function edit(id) {
26689
  t++;
26690
  v=k;
26691
  }
26692
- if(document.getElementById(id+"_rowcol_numform_id_temp").value)
26693
  {
26694
 
26695
  if(document.getElementById(id+'_table_little').getAttribute('for_hor'))
@@ -26705,13 +26733,14 @@ function edit(id) {
26705
  else
26706
  w_flow="ver";
26707
 
26708
- w_rowcol = '';
26709
  }
26710
  atrs=return_attributes(id+'_elementform_id_temp'+v);
26711
  w_attr_name=atrs[0];
26712
  w_attr_value=atrs[1];
26713
  type_checkbox(id, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_rowcol, w_required, w_randomize, w_allow_other, w_allow_other_num, w_class, w_attr_name, w_attr_value); break;
26714
  }
 
26715
  case 'type_paypal_checkbox': {
26716
  if (document.getElementById(id+'_hor')) {
26717
  w_flow="hor";
@@ -26765,8 +26794,11 @@ function edit(id) {
26765
  w_attr_value=atrs[1];
26766
  type_paypal_checkbox(id, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_price, w_choices_checked, w_required, w_randomize, w_allow_other, w_allow_other_num, w_class, w_attr_name, w_attr_value, w_property, w_property_type, w_property_values,w_quantity); break;
26767
  }
26768
- case 'type_radio': {
26769
- w_randomize=document.getElementById(id+"_randomizeform_id_temp").value;
 
 
 
26770
  w_allow_other=document.getElementById(id+"_allow_otherform_id_temp").value;
26771
 
26772
  v=0;
@@ -26781,7 +26813,8 @@ function edit(id) {
26781
  t++;
26782
  v=k;
26783
  }
26784
- if(document.getElementById(id+"_rowcol_numform_id_temp").value)
 
26785
  {
26786
 
26787
  if(document.getElementById(id+'_table_little').getAttribute('for_hor'))
@@ -26798,12 +26831,12 @@ function edit(id) {
26798
  w_flow="ver";
26799
 
26800
  w_rowcol = '';
26801
- }
26802
  atrs=return_attributes(id+'_elementform_id_temp'+v);
26803
  w_attr_name=atrs[0];
26804
  w_attr_value=atrs[1];
26805
  type_radio(id, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_rowcol, w_required, w_randomize, w_allow_other, w_allow_other_num, w_class, w_attr_name, w_attr_value); break;
26806
- }
26807
  case 'type_paypal_radio':
26808
  {
26809
  if(document.getElementById(id+'_hor'))
@@ -27444,28 +27477,38 @@ function dublicate(id) {
27444
  w_title=[document.getElementById(id+"_element_firstform_id_temp").title, document.getElementById(id+"_element_lastform_id_temp").title];
27445
  s=document.getElementById(id+"_element_lastform_id_temp").style.width;
27446
  w_size=s.substring(0,s.length-2);
 
 
27447
  w_mini_labels= [document.getElementById(id+"_mini_label_area_code").innerHTML, document.getElementById(id+"_mini_label_phone_number").innerHTML];
 
 
 
27448
  atrs=return_attributes(id+'_element_firstform_id_temp');
27449
  w_attr_name=atrs[0];
27450
  w_attr_value=atrs[1];
27451
- // type_phone(gen, w_field_label, w_field_label_pos, w_size, w_first_val, w_title, w_required, w_unique, w_class, w_attr_name, w_attr_value); add(0); break;
27452
- type_phone(gen, w_field_label, w_field_label_pos, w_size, w_first_val, w_title, w_mini_labels, w_required, w_unique, w_class, w_attr_name, w_attr_value);break;
27453
  }
 
27454
  case 'type_name':
27455
  {
27456
  if(document.getElementById(id+'_element_middleform_id_temp'))
27457
  w_name_format="extended";
27458
  else
27459
  w_name_format="normal";
27460
- if (w_name_format == "normal") {
27461
- w_first_val=[document.getElementById(id+"_element_firstform_id_temp").value, document.getElementById(id+"_element_lastform_id_temp").value];
27462
- w_title=[document.getElementById(id+"_element_firstform_id_temp").title, document.getElementById(id+"_element_lastform_id_temp").title];
27463
- }
27464
- else {
27465
- w_first_val=[document.getElementById(id+"_element_firstform_id_temp").value, document.getElementById(id+"_element_lastform_id_temp").value, document.getElementById(id+"_element_titleform_id_temp").value, document.getElementById(id+"_element_middleform_id_temp").value];
27466
- w_title=[document.getElementById(id+"_element_firstform_id_temp").title, document.getElementById(id+"_element_lastform_id_temp").title, document.getElementById(id+"_element_titleform_id_temp").title,
27467
- document.getElementById(id+"_element_middleform_id_temp").title];
27468
- }
 
 
 
 
 
27469
  if(document.getElementById(id+"_mini_label_title"))
27470
  w_mini_title = document.getElementById(id+"_mini_label_title").innerHTML;
27471
  else
@@ -27476,106 +27519,121 @@ function dublicate(id) {
27476
  else
27477
  w_mini_middle = "Middle";
27478
 
27479
- w_mini_labels = [ w_mini_title, document.getElementById(id+"_mini_label_first").innerHTML,document.getElementById(id+"_mini_label_last").innerHTML, w_mini_middle];
 
 
27480
  s=document.getElementById(id+"_element_firstform_id_temp").style.width;
27481
  w_size=s.substring(0,s.length-2);
27482
  atrs=return_attributes(id+'_element_firstform_id_temp');
27483
  w_attr_name=atrs[0];
27484
  w_attr_value=atrs[1];
27485
- // type_name(gen, w_field_label, w_field_label_pos, w_first_val, w_title, w_size, w_name_format, w_required, w_unique, w_class, w_attr_name, w_attr_value); add(0); break;
27486
- type_name(gen, w_field_label, w_field_label_pos, w_first_val, w_title, w_mini_labels, w_size, w_name_format, w_required, w_unique, w_class, w_attr_name, w_attr_value);break;
27487
  }
27488
  case 'type_address':
27489
  {
27490
  s=document.getElementById(id+"_div_address").style.width;
27491
  w_size=s.substring(0,s.length-2);
27492
- if(document.getElementById(id+"_mini_label_street1")) {
27493
- w_street1= document.getElementById(id+"_mini_label_street1").innerHTML;
27494
- }
27495
- else {
27496
- if (document.getElementById(id+"_street1form_id_temp")) {
27497
- w_street1 = document.getElementById(id+"_street1form_id_temp").value;
27498
- }
27499
- else {
27500
- w_street1 = '';
27501
- }
27502
- }
27503
- if (document.getElementById(id+"_mini_label_street2")) {
27504
- w_street2= document.getElementById(id+"_mini_label_street2").innerHTML;
27505
- }
27506
- else {
27507
- if (document.getElementById(id+"_street2form_id_temp")) {
27508
- w_street2 = document.getElementById(id+"_street2form_id_temp").value;
27509
- }
27510
- else {
27511
- w_street2 = '';
27512
- }
27513
- }
27514
-
27515
- if (document.getElementById(id+"_mini_label_city")) {
27516
- w_city= document.getElementById(id+"_mini_label_city").innerHTML;
27517
- }
27518
- else {
27519
- if (document.getElementById(id+"_cityform_id_temp")) {
27520
- w_city = document.getElementById(id+"_cityform_id_temp").value;
27521
- }
27522
- else {
27523
- w_city = '';
27524
- }
27525
- }
 
 
 
 
27526
 
27527
- if (document.getElementById(id+"_mini_label_state")) {
27528
- w_state= document.getElementById(id+"_mini_label_state").innerHTML;
27529
- }
27530
- else {
27531
- if (document.getElementById(id+"_stateform_id_temp")) {
27532
- w_state = document.getElementById(id+"_stateform_id_temp").value;
27533
- }
27534
- else {
27535
- w_state = '';
27536
- }
27537
- }
27538
- if (document.getElementById(id+"_mini_label_postal")) {
27539
- w_postal= document.getElementById(id+"_mini_label_postal").innerHTML;
27540
- }
27541
- else {
27542
- if (document.getElementById(id+"_postalform_id_temp")) {
27543
- w_postal = document.getElementById(id+"_postalform_id_temp").value;
27544
- }
27545
- else {
27546
- w_postal = '';
27547
- }
27548
- }
27549
-
27550
  if (document.getElementById(id+"_mini_label_country")) {
27551
  w_country= document.getElementById(id+"_mini_label_country").innerHTML;
27552
- }
27553
- else {
27554
- if (document.getElementById(id+"_countryform_id_temp")) {
27555
- w_country = document.getElementById(id+"_countryform_id_temp").value;
27556
- }
27557
- else {
27558
- w_country = '';
27559
- }
27560
- }
27561
  w_mini_labels=[w_street1, w_street2, w_city, w_state, w_postal, w_country];
27562
  var disabled_input = document.getElementById(id+"_disable_fieldsform_id_temp");
 
27563
  w_street1_dis= disabled_input.getAttribute('street1');
27564
  w_street2_dis= disabled_input.getAttribute('street2');
27565
  w_city_dis= disabled_input.getAttribute('city');
27566
  w_state_dis= disabled_input.getAttribute('state');
27567
  w_postal_dis= disabled_input.getAttribute('postal');
27568
  w_country_dis= disabled_input.getAttribute('country');
 
 
27569
  w_disabled_fields=[w_street1_dis, w_street2_dis, w_city_dis, w_state_dis, w_postal_dis, w_country_dis];
 
 
 
 
 
 
 
27570
  atrs=return_attributes(id+'_street1form_id_temp');
27571
  w_attr_name=atrs[0];
27572
  w_attr_value=atrs[1];
27573
- // type_address(gen, w_field_label, w_field_label_pos, w_size, w_required, w_class, w_attr_name, w_attr_value); add(0); break;
27574
  type_address(gen, w_field_label, w_field_label_pos, w_size, w_mini_labels, w_disabled_fields, w_required, w_class, w_attr_name, w_attr_value);
27575
  disable_fields(id);
27576
  break;
27577
  }
27578
 
 
27579
  case 'type_submitter_mail':
27580
  {
27581
  w_first_val=document.getElementById(id+"_elementform_id_temp").value;
@@ -27588,8 +27646,7 @@ function dublicate(id) {
27588
  // type_submitter_mail(gen, w_field_label, w_field_label_pos, w_size, w_first_val, w_title, w_send, w_required, w_unique, w_class, w_attr_name, w_attr_value); add(0); break;
27589
  type_submitter_mail(gen, w_field_label, w_field_label_pos, w_size, w_first_val, w_title, w_send, w_required, w_unique, w_class, w_attr_name, w_attr_value);break;
27590
  }
27591
- case 'type_checkbox':
27592
- {
27593
  w_randomize=document.getElementById(id+"_randomizeform_id_temp").value;
27594
  w_allow_other=document.getElementById(id+"_allow_otherform_id_temp").value;
27595
 
@@ -27605,10 +27662,10 @@ function dublicate(id) {
27605
  t++;
27606
  v=k;
27607
  }
27608
- if(document.getElementById(id+"_rowcol_numform_id_temp").value)
27609
  {
27610
-
27611
- if(document.getElementById(id+'_table_little').getAttribute('for_hor'))
27612
  w_flow="hor"
27613
  else
27614
  w_flow="ver";
@@ -27621,13 +27678,12 @@ function dublicate(id) {
27621
  else
27622
  w_flow="ver";
27623
 
27624
- w_rowcol = '';
27625
  }
27626
  atrs=return_attributes(id+'_elementform_id_temp'+v);
27627
  w_attr_name=atrs[0];
27628
  w_attr_value=atrs[1];
27629
- // type_checkbox(gen, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_required, w_randomize, w_allow_other, w_allow_other_num, w_class, w_attr_name, w_attr_value); add(0); break;
27630
- type_checkbox(gen, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_rowcol, w_required, w_randomize, w_allow_other, w_allow_other_num, w_class, w_attr_name, w_attr_value);break;
27631
  }
27632
  case 'type_paypal_price':
27633
  {
@@ -27709,6 +27765,8 @@ function dublicate(id) {
27709
  }
27710
  case 'type_radio':
27711
  {
 
 
27712
  w_randomize=document.getElementById(id+"_randomizeform_id_temp").value;
27713
  w_allow_other=document.getElementById(id+"_allow_otherform_id_temp").value;
27714
 
@@ -27724,7 +27782,8 @@ function dublicate(id) {
27724
  t++;
27725
  v=k;
27726
  }
27727
- if(document.getElementById(id+"_rowcol_numform_id_temp").value)
 
27728
  {
27729
 
27730
  if(document.getElementById(id+'_table_little').getAttribute('for_hor'))
@@ -27741,12 +27800,11 @@ function dublicate(id) {
27741
  w_flow="ver";
27742
 
27743
  w_rowcol = '';
27744
- }
27745
  atrs=return_attributes(id+'_elementform_id_temp'+v);
27746
  w_attr_name=atrs[0];
27747
  w_attr_value=atrs[1];
27748
- // type_radio(gen, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_required, w_randomize, w_allow_other, w_allow_other_num, w_class, w_attr_name, w_attr_value); add(0); break;
27749
- type_radio(gen, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_rowcol, w_required, w_randomize, w_allow_other, w_allow_other_num, w_class, w_attr_name, w_attr_value);break;
27750
  }
27751
  case 'type_paypal_radio':
27752
  {
26508
  w_title=[document.getElementById(id+"_element_firstform_id_temp").title, document.getElementById(id+"_element_lastform_id_temp").title];
26509
  s=document.getElementById(id+"_element_lastform_id_temp").style.width;
26510
  w_size=s.substring(0,s.length-2);
26511
+
26512
+ if(document.getElementById(id+"_mini_label_area_code"))
26513
  w_mini_labels= [document.getElementById(id+"_mini_label_area_code").innerHTML, document.getElementById(id+"_mini_label_phone_number").innerHTML];
26514
+ else
26515
+ w_mini_labels= ['Area Code', 'Phone Number'];
26516
+
26517
  atrs=return_attributes(id+'_element_firstform_id_temp');
26518
  w_attr_name=atrs[0];
26519
  w_attr_value=atrs[1];
26546
  else
26547
  w_mini_middle = "Middle";
26548
 
26549
+ if(document.getElementById(id+"_mini_label_first"))
26550
+ w_mini_first = document.getElementById(id+"_mini_label_first").innerHTML;
26551
+ else
26552
+ w_mini_first = "First";
26553
+
26554
+ if(document.getElementById(id+"_mini_label_last"))
26555
+ w_mini_last = document.getElementById(id+"_mini_label_last").innerHTML;
26556
+ else
26557
+ w_mini_last = "Last";
26558
+
26559
+ w_mini_labels = [w_mini_title, w_mini_first,w_mini_last, w_mini_middle];
26560
+
26561
  s=document.getElementById(id+"_element_firstform_id_temp").style.width;
26562
  w_size=s.substring(0,s.length-2);
26563
  atrs=return_attributes(id+'_element_firstform_id_temp');
26565
  w_attr_value=atrs[1];
26566
  type_name(id, w_field_label, w_field_label_pos,w_first_val, w_title, w_mini_labels, w_size, w_name_format, w_required, w_unique, w_class, w_attr_name, w_attr_value); break;
26567
  }
26568
+ case 'type_paypal_price': {
26569
  w_first_val = [document.getElementById(id+"_element_dollarsform_id_temp").value, document.getElementById(id+"_element_centsform_id_temp").value];
26570
  w_title = [document.getElementById(id+"_element_dollarsform_id_temp").title, document.getElementById(id+"_element_centsform_id_temp").title];
26571
  if (document.getElementById(id+"_td_name_cents").style.display=="none") {
26588
  {
26589
  s=document.getElementById(id+"_div_address").style.width;
26590
  w_size=s.substring(0,s.length-2);
26591
+
26592
+
26593
+ if(document.getElementById(id+"_disable_fieldsform_id_temp"))
26594
+ {
26595
+ if(document.getElementById(id+"_mini_label_street1")) {
26596
+ w_street1= document.getElementById(id+"_mini_label_street1").innerHTML;
26597
+ }
26598
+ else {
26599
+ if (document.getElementById(id+"_street1form_id_temp")) {
26600
+ w_street1 = document.getElementById(id+"_street1form_id_temp").value;
26601
+ }
26602
+ else {
26603
+ w_street1 = '';
26604
+ }
26605
+ }
26606
+ if (document.getElementById(id+"_mini_label_street2")) {
26607
+ w_street2= document.getElementById(id+"_mini_label_street2").innerHTML;
26608
+ }
26609
+ else {
26610
+ if (document.getElementById(id+"_street2form_id_temp")) {
26611
+ w_street2 = document.getElementById(id+"_street2form_id_temp").value;
26612
+ }
26613
+ else {
26614
+ w_street2 = '';
26615
+ }
26616
+ }
26617
+
26618
+ if (document.getElementById(id+"_mini_label_city")) {
26619
+ w_city= document.getElementById(id+"_mini_label_city").innerHTML;
26620
+ }
26621
+ else {
26622
+ if (document.getElementById(id+"_cityform_id_temp")) {
26623
+ w_city = document.getElementById(id+"_cityform_id_temp").value;
26624
+ }
26625
+ else {
26626
+ w_city = '';
26627
+ }
26628
+ }
26629
 
26630
+ if (document.getElementById(id+"_mini_label_state")) {
26631
+ w_state= document.getElementById(id+"_mini_label_state").innerHTML;
26632
+ }
26633
+ else {
26634
+ if (document.getElementById(id+"_stateform_id_temp")) {
26635
+ w_state = document.getElementById(id+"_stateform_id_temp").value;
26636
+ }
26637
+ else {
26638
+ w_state = '';
26639
+ }
26640
+ }
26641
+ if (document.getElementById(id+"_mini_label_postal")) {
26642
+ w_postal= document.getElementById(id+"_mini_label_postal").innerHTML;
26643
+ }
26644
+ else {
26645
+ if (document.getElementById(id+"_postalform_id_temp")) {
26646
+ w_postal = document.getElementById(id+"_postalform_id_temp").value;
26647
+ }
26648
+ else {
26649
+ w_postal = '';
26650
+ }
26651
+ }
26652
+
26653
  if (document.getElementById(id+"_mini_label_country")) {
26654
  w_country= document.getElementById(id+"_mini_label_country").innerHTML;
26655
+ }
26656
+ else {
26657
+ if (document.getElementById(id+"_countryform_id_temp")) {
26658
+ w_country = document.getElementById(id+"_countryform_id_temp").value;
26659
+ }
26660
+ else {
26661
+ w_country = '';
26662
+ }
26663
+ }
26664
  w_mini_labels=[w_street1, w_street2, w_city, w_state, w_postal, w_country];
26665
  var disabled_input = document.getElementById(id+"_disable_fieldsform_id_temp");
26666
 
26673
 
26674
 
26675
  w_disabled_fields=[w_street1_dis, w_street2_dis, w_city_dis, w_state_dis, w_postal_dis, w_country_dis];
26676
+ }
26677
+ else
26678
+ {
26679
+ w_mini_labels=['Street Address', 'Street Address Line 2', 'City', 'State / Province / Region', 'Postal / Zip Code', 'Country',];
26680
+ w_disabled_fields=['no', 'no', 'no', 'no', 'no', 'no'];
26681
+ }
26682
+
26683
  atrs=return_attributes(id+'_street1form_id_temp');
26684
  w_attr_name=atrs[0];
26685
  w_attr_value=atrs[1];
26688
  break;
26689
  }
26690
 
26691
+
26692
+
26693
  case 'type_submitter_mail':
26694
  {
26695
  w_first_val=document.getElementById(id+"_elementform_id_temp").value;
26717
  t++;
26718
  v=k;
26719
  }
26720
+ if(document.getElementById(id+"_rowcol_numform_id_temp") && document.getElementById(id+"_rowcol_numform_id_temp").value)
26721
  {
26722
 
26723
  if(document.getElementById(id+'_table_little').getAttribute('for_hor'))
26733
  else
26734
  w_flow="ver";
26735
 
26736
+ w_rowcol = 1;
26737
  }
26738
  atrs=return_attributes(id+'_elementform_id_temp'+v);
26739
  w_attr_name=atrs[0];
26740
  w_attr_value=atrs[1];
26741
  type_checkbox(id, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_rowcol, w_required, w_randomize, w_allow_other, w_allow_other_num, w_class, w_attr_name, w_attr_value); break;
26742
  }
26743
+
26744
  case 'type_paypal_checkbox': {
26745
  if (document.getElementById(id+'_hor')) {
26746
  w_flow="hor";
26794
  w_attr_value=atrs[1];
26795
  type_paypal_checkbox(id, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_price, w_choices_checked, w_required, w_randomize, w_allow_other, w_allow_other_num, w_class, w_attr_name, w_attr_value, w_property, w_property_type, w_property_values,w_quantity); break;
26796
  }
26797
+ case 'type_radio':
26798
+ {
26799
+
26800
+
26801
+ w_randomize=document.getElementById(id+"_randomizeform_id_temp").value;
26802
  w_allow_other=document.getElementById(id+"_allow_otherform_id_temp").value;
26803
 
26804
  v=0;
26813
  t++;
26814
  v=k;
26815
  }
26816
+
26817
+ if(document.getElementById(id+"_rowcol_numform_id_temp").value)
26818
  {
26819
 
26820
  if(document.getElementById(id+'_table_little').getAttribute('for_hor'))
26831
  w_flow="ver";
26832
 
26833
  w_rowcol = '';
26834
+ }
26835
  atrs=return_attributes(id+'_elementform_id_temp'+v);
26836
  w_attr_name=atrs[0];
26837
  w_attr_value=atrs[1];
26838
  type_radio(id, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_rowcol, w_required, w_randomize, w_allow_other, w_allow_other_num, w_class, w_attr_name, w_attr_value); break;
26839
+ }
26840
  case 'type_paypal_radio':
26841
  {
26842
  if(document.getElementById(id+'_hor'))
27477
  w_title=[document.getElementById(id+"_element_firstform_id_temp").title, document.getElementById(id+"_element_lastform_id_temp").title];
27478
  s=document.getElementById(id+"_element_lastform_id_temp").style.width;
27479
  w_size=s.substring(0,s.length-2);
27480
+
27481
+ if(document.getElementById(id+"_mini_label_area_code"))
27482
  w_mini_labels= [document.getElementById(id+"_mini_label_area_code").innerHTML, document.getElementById(id+"_mini_label_phone_number").innerHTML];
27483
+ else
27484
+ w_mini_labels= ['Area Code', 'Phone Number'];
27485
+
27486
  atrs=return_attributes(id+'_element_firstform_id_temp');
27487
  w_attr_name=atrs[0];
27488
  w_attr_value=atrs[1];
27489
+ type_phone(gen, w_field_label, w_field_label_pos, w_size, w_first_val, w_title, w_mini_labels, w_required, w_unique, w_class, w_attr_name, w_attr_value); break;
 
27490
  }
27491
+
27492
  case 'type_name':
27493
  {
27494
  if(document.getElementById(id+'_element_middleform_id_temp'))
27495
  w_name_format="extended";
27496
  else
27497
  w_name_format="normal";
27498
+
27499
+
27500
+ if(w_name_format=="normal")
27501
+ {
27502
+ w_first_val=[document.getElementById(id+"_element_firstform_id_temp").value, document.getElementById(id+"_element_lastform_id_temp").value];
27503
+ w_title=[document.getElementById(id+"_element_firstform_id_temp").title, document.getElementById(id+"_element_lastform_id_temp").title];
27504
+ }
27505
+ else
27506
+ {
27507
+ w_first_val=[document.getElementById(id+"_element_firstform_id_temp").value, document.getElementById(id+"_element_lastform_id_temp").value, document.getElementById(id+"_element_titleform_id_temp").value, document.getElementById(id+"_element_middleform_id_temp").value];
27508
+ w_title=[document.getElementById(id+"_element_firstform_id_temp").title, document.getElementById(id+"_element_lastform_id_temp").title, document.getElementById(id+"_element_titleform_id_temp").title,
27509
+ document.getElementById(id+"_element_middleform_id_temp").title];
27510
+ }
27511
+
27512
  if(document.getElementById(id+"_mini_label_title"))
27513
  w_mini_title = document.getElementById(id+"_mini_label_title").innerHTML;
27514
  else
27519
  else
27520
  w_mini_middle = "Middle";
27521
 
27522
+ w_mini_labels = [ w_mini_title, document.getElementById(id+"_mini_label_first").innerHTML,document.getElementById(id+"_mini_label_last").innerHTML, w_mini_middle];
27523
+
27524
+
27525
  s=document.getElementById(id+"_element_firstform_id_temp").style.width;
27526
  w_size=s.substring(0,s.length-2);
27527
  atrs=return_attributes(id+'_element_firstform_id_temp');
27528
  w_attr_name=atrs[0];
27529
  w_attr_value=atrs[1];
27530
+ type_name(gen, w_field_label, w_field_label_pos, w_first_val, w_title, w_mini_labels, w_size, w_name_format, w_required, w_unique, w_class, w_attr_name, w_attr_value); break;
 
27531
  }
27532
  case 'type_address':
27533
  {
27534
  s=document.getElementById(id+"_div_address").style.width;
27535
  w_size=s.substring(0,s.length-2);
27536
+
27537
+
27538
+ if(document.getElementById(id+"_disable_fieldsform_id_temp"))
27539
+ {
27540
+ if(document.getElementById(id+"_mini_label_street1")) {
27541
+ w_street1= document.getElementById(id+"_mini_label_street1").innerHTML;
27542
+ }
27543
+ else {
27544
+ if (document.getElementById(id+"_street1form_id_temp")) {
27545
+ w_street1 = document.getElementById(id+"_street1form_id_temp").value;
27546
+ }
27547
+ else {
27548
+ w_street1 = '';
27549
+ }
27550
+ }
27551
+ if (document.getElementById(id+"_mini_label_street2")) {
27552
+ w_street2= document.getElementById(id+"_mini_label_street2").innerHTML;
27553
+ }
27554
+ else {
27555
+ if (document.getElementById(id+"_street2form_id_temp")) {
27556
+ w_street2 = document.getElementById(id+"_street2form_id_temp").value;
27557
+ }
27558
+ else {
27559
+ w_street2 = '';
27560
+ }
27561
+ }
27562
+
27563
+ if (document.getElementById(id+"_mini_label_city")) {
27564
+ w_city= document.getElementById(id+"_mini_label_city").innerHTML;
27565
+ }
27566
+ else {
27567
+ if (document.getElementById(id+"_cityform_id_temp")) {
27568
+ w_city = document.getElementById(id+"_cityform_id_temp").value;
27569
+ }
27570
+ else {
27571
+ w_city = '';
27572
+ }
27573
+ }
27574
 
27575
+ if (document.getElementById(id+"_mini_label_state")) {
27576
+ w_state= document.getElementById(id+"_mini_label_state").innerHTML;
27577
+ }
27578
+ else {
27579
+ if (document.getElementById(id+"_stateform_id_temp")) {
27580
+ w_state = document.getElementById(id+"_stateform_id_temp").value;
27581
+ }
27582
+ else {
27583
+ w_state = '';
27584
+ }
27585
+ }
27586
+ if (document.getElementById(id+"_mini_label_postal")) {
27587
+ w_postal= document.getElementById(id+"_mini_label_postal").innerHTML;
27588
+ }
27589
+ else {
27590
+ if (document.getElementById(id+"_postalform_id_temp")) {
27591
+ w_postal = document.getElementById(id+"_postalform_id_temp").value;
27592
+ }
27593
+ else {
27594
+ w_postal = '';
27595
+ }
27596
+ }
27597
+
27598
  if (document.getElementById(id+"_mini_label_country")) {
27599
  w_country= document.getElementById(id+"_mini_label_country").innerHTML;
27600
+ }
27601
+ else {
27602
+ if (document.getElementById(id+"_countryform_id_temp")) {
27603
+ w_country = document.getElementById(id+"_countryform_id_temp").value;
27604
+ }
27605
+ else {
27606
+ w_country = '';
27607
+ }
27608
+ }
27609
  w_mini_labels=[w_street1, w_street2, w_city, w_state, w_postal, w_country];
27610
  var disabled_input = document.getElementById(id+"_disable_fieldsform_id_temp");
27611
+
27612
  w_street1_dis= disabled_input.getAttribute('street1');
27613
  w_street2_dis= disabled_input.getAttribute('street2');
27614
  w_city_dis= disabled_input.getAttribute('city');
27615
  w_state_dis= disabled_input.getAttribute('state');
27616
  w_postal_dis= disabled_input.getAttribute('postal');
27617
  w_country_dis= disabled_input.getAttribute('country');
27618
+
27619
+
27620
  w_disabled_fields=[w_street1_dis, w_street2_dis, w_city_dis, w_state_dis, w_postal_dis, w_country_dis];
27621
+ }
27622
+ else
27623
+ {
27624
+ w_mini_labels=['Street Address', 'Street Address Line 2', 'City', 'State / Province / Region', 'Postal / Zip Code', 'Country',];
27625
+ w_disabled_fields=['no', 'no', 'no', 'no', 'no', 'no'];
27626
+ }
27627
+
27628
  atrs=return_attributes(id+'_street1form_id_temp');
27629
  w_attr_name=atrs[0];
27630
  w_attr_value=atrs[1];
 
27631
  type_address(gen, w_field_label, w_field_label_pos, w_size, w_mini_labels, w_disabled_fields, w_required, w_class, w_attr_name, w_attr_value);
27632
  disable_fields(id);
27633
  break;
27634
  }
27635
 
27636
+
27637
  case 'type_submitter_mail':
27638
  {
27639
  w_first_val=document.getElementById(id+"_elementform_id_temp").value;
27646
  // type_submitter_mail(gen, w_field_label, w_field_label_pos, w_size, w_first_val, w_title, w_send, w_required, w_unique, w_class, w_attr_name, w_attr_value); add(0); break;
27647
  type_submitter_mail(gen, w_field_label, w_field_label_pos, w_size, w_first_val, w_title, w_send, w_required, w_unique, w_class, w_attr_name, w_attr_value);break;
27648
  }
27649
+ case 'type_checkbox': {
 
27650
  w_randomize=document.getElementById(id+"_randomizeform_id_temp").value;
27651
  w_allow_other=document.getElementById(id+"_allow_otherform_id_temp").value;
27652
 
27662
  t++;
27663
  v=k;
27664
  }
27665
+ if(document.getElementById(id+"_rowcol_numform_id_temp") && document.getElementById(id+"_rowcol_numform_id_temp").value)
27666
  {
27667
+
27668
+ if(document.getElementById(id+'_table_little').getAttribute('for_hor'))
27669
  w_flow="hor"
27670
  else
27671
  w_flow="ver";
27678
  else
27679
  w_flow="ver";
27680
 
27681
+ w_rowcol = 1;
27682
  }
27683
  atrs=return_attributes(id+'_elementform_id_temp'+v);
27684
  w_attr_name=atrs[0];
27685
  w_attr_value=atrs[1];
27686
+ type_checkbox(gen, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_rowcol, w_required, w_randomize, w_allow_other, w_allow_other_num, w_class, w_attr_name, w_attr_value); break;
 
27687
  }
27688
  case 'type_paypal_price':
27689
  {
27765
  }
27766
  case 'type_radio':
27767
  {
27768
+
27769
+
27770
  w_randomize=document.getElementById(id+"_randomizeform_id_temp").value;
27771
  w_allow_other=document.getElementById(id+"_allow_otherform_id_temp").value;
27772
 
27782
  t++;
27783
  v=k;
27784
  }
27785
+
27786
+ if(document.getElementById(id+"_rowcol_numform_id_temp").value)
27787
  {
27788
 
27789
  if(document.getElementById(id+'_table_little').getAttribute('for_hor'))
27800
  w_flow="ver";
27801
 
27802
  w_rowcol = '';
27803
+ }
27804
  atrs=return_attributes(id+'_elementform_id_temp'+v);
27805
  w_attr_name=atrs[0];
27806
  w_attr_value=atrs[1];
27807
+ type_radio(gen, w_field_label, w_field_label_pos, w_flow, w_choices, w_choices_checked, w_rowcol, w_required, w_randomize, w_allow_other, w_allow_other_num, w_class, w_attr_name, w_attr_value); break;
 
27808
  }
27809
  case 'type_paypal_radio':
27810
  {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://web-dorado.com/products/wordpress-contact-form-maker-plugin.
4
  Tags: captcha, contact, contact form, contact forms, custom form, email, feedback, form, form builder, form manager, forms, survey
5
  Requires at least: 3.4
6
  Tested up to: 4.6
7
- Stable tag: 1.8.36
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -146,6 +146,9 @@ If you want to update the plugin while preserving your existing contact forms, y
146
 
147
  == Changelog ==
148
 
 
 
 
149
  = 1.8.36 =
150
  * Changed: Featured Themes page
151
 
4
  Tags: captcha, contact, contact form, contact forms, custom form, email, feedback, form, form builder, form manager, forms, survey
5
  Requires at least: 3.4
6
  Tested up to: 4.6
7
+ Stable tag: 1.8.37
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
146
 
147
  == Changelog ==
148
 
149
+ = 1.8.37 =
150
+ * Fixed: Bug on edit_old() function for old forms.
151
+
152
  = 1.8.36 =
153
  * Changed: Featured Themes page
154