Form Maker by WD – user-friendly drag & drop Form Builder plugin - Version 1.12.40

Version Description

  • Added: WHERE selectors in "Options from database" (Select, Single and Multiple choice fields).
  • Added: Placeholders (User ID, Submitter's IP, etc.) in WHERE clause in "Options from database" and MySQL Mapping.
  • Improved: Parsing images in post content in Post Generation extension.
  • Fixed: Scroll issues on Safari (MacOS).
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Form Maker by WD – user-friendly drag & drop Form Builder plugin
Version 1.12.40
Comparing to
See all releases

Code changes from version 1.12.39 to 1.12.40

admin/controllers/Manage_fm.php CHANGED
@@ -796,14 +796,16 @@ function after_submit() {
796
  $message_id = 2;
797
  $save = $this->model->update_data('formmaker', $data, array( 'id' => $id ));
798
  if ( $save !== FALSE ) {
799
- $this->model->update_data("formmaker_backup", array(
800
- 'theme' => $theme,
801
- ), array( 'id' => $id )); //save theme in backup
802
- $this->model->create_js($id);
 
803
  if ( WDFMInstance(self::PLUGIN)->is_free != 2 ) {
804
  $save_addon = do_action('fm_save_addon_init', $id);
805
  }
806
- $message_id = 8;
 
807
  }
808
 
809
  return $message_id;
796
  $message_id = 2;
797
  $save = $this->model->update_data('formmaker', $data, array( 'id' => $id ));
798
  if ( $save !== FALSE ) {
799
+ $this->model->update_data("formmaker_backup",
800
+ array('theme' => $theme),
801
+ array( 'id' => $id )
802
+ );
803
+ //save theme in backup
804
  if ( WDFMInstance(self::PLUGIN)->is_free != 2 ) {
805
  $save_addon = do_action('fm_save_addon_init', $id);
806
  }
807
+ $this->model->create_js($id);
808
+ $message_id = 8;
809
  }
810
 
811
  return $message_id;
admin/controllers/Select_data_from_db.php CHANGED
@@ -88,6 +88,18 @@ class FMControllerSelect_data_from_db extends FMAdminController {
88
  $params['field_type'] = $field_type;
89
  $params['label'] = $label;
90
  $params['table_struct'] = $table_struct;
 
 
 
 
 
 
 
 
 
 
 
 
91
  $this->view->db_table_struct_select($params);
92
  }
93
  }
88
  $params['field_type'] = $field_type;
89
  $params['label'] = $label;
90
  $params['table_struct'] = $table_struct;
91
+ // Set placeholders.
92
+ $user_fields = array(
93
+ "ip" => "Submitter's IP",
94
+ "userid" => "User ID",
95
+ "username" => "Username",
96
+ "useremail" => "User Email"
97
+ );
98
+ $html_placeholders = '';
99
+ foreach ( $user_fields as $user_key => $user_field ) {
100
+ $html_placeholders .= '<a onclick="insert_placeholder(\'' . $user_key . '\'); jQuery(\'#fm-placeholder\').hide();" style="display:block; text-decoration:none;">' . $user_field . "</a>\r\n";
101
+ }
102
+ $params['html_placeholders'] = $html_placeholders;
103
  $this->view->db_table_struct_select($params);
104
  }
105
  }
admin/controllers/Uninstall_fm.php CHANGED
@@ -22,11 +22,10 @@ class FMControllerUninstall_fm extends FMAdminController {
22
  $this->model = new FMModelUninstall_fm();
23
  require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Uninstall_fm.php";
24
  $this->view = new FMViewUninstall_fm();
25
-
26
  if ( WDFMInstance(self::PLUGIN)->is_free ) {
27
  global $fm_options;
28
  global $cfm_options;
29
- if (!class_exists("DoradoWebConfig")) {
30
  include_once(WDFMInstance(self::PLUGIN)->plugin_dir . "/wd/config.php");
31
  }
32
  $config = new DoradoWebConfig();
@@ -47,12 +46,11 @@ class FMControllerUninstall_fm extends FMAdminController {
47
  }
48
  }
49
 
50
- public function display() {
51
  $params = array();
52
  $params['addons'] = $this->addons;
53
  $params['page_title'] = sprintf(__('Uninstall %s', WDFMInstance(self::PLUGIN)->prefix), WDFMInstance(self::PLUGIN)->nicename);
54
  $params['tables'] = $this->get_tables();
55
-
56
  $this->view->display($params);
57
  }
58
 
@@ -82,15 +80,11 @@ class FMControllerUninstall_fm extends FMAdminController {
82
  public function uninstall() {
83
  $params['tables'] = $this->get_tables();
84
  $this->model->delete_db_tables();
85
- global $wpdb;
86
- $params = array();
87
- $params['prefix'] = $wpdb->prefix;
88
- $params['addons'] = $this->addons;
89
- // Deactivate all addons
90
- WDW_FM_Library(self::PLUGIN)->deactivate_all_addons();
91
- $params['page_title'] = sprintf(__('Uninstall %s', WDFMInstance(self::PLUGIN)->prefix), WDFMInstance(self::PLUGIN)->nicename);
92
- $params['deactivate'] = TRUE;
93
 
94
- $this->view->display($params);
 
 
 
 
95
  }
96
  }
22
  $this->model = new FMModelUninstall_fm();
23
  require_once WDFMInstance(self::PLUGIN)->plugin_dir . "/admin/views/Uninstall_fm.php";
24
  $this->view = new FMViewUninstall_fm();
 
25
  if ( WDFMInstance(self::PLUGIN)->is_free ) {
26
  global $fm_options;
27
  global $cfm_options;
28
+ if ( !class_exists("DoradoWebConfig") ) {
29
  include_once(WDFMInstance(self::PLUGIN)->plugin_dir . "/wd/config.php");
30
  }
31
  $config = new DoradoWebConfig();
46
  }
47
  }
48
 
49
+ public function display() {
50
  $params = array();
51
  $params['addons'] = $this->addons;
52
  $params['page_title'] = sprintf(__('Uninstall %s', WDFMInstance(self::PLUGIN)->prefix), WDFMInstance(self::PLUGIN)->nicename);
53
  $params['tables'] = $this->get_tables();
 
54
  $this->view->display($params);
55
  }
56
 
80
  public function uninstall() {
81
  $params['tables'] = $this->get_tables();
82
  $this->model->delete_db_tables();
 
 
 
 
 
 
 
 
83
 
84
+ // Deactivate all add-ons and form maker.
85
+ WDW_FM_Library(self::PLUGIN)->deactivate_all_addons(WDFMInstance(self::PLUGIN)->main_file);
86
+
87
+ wp_redirect(admin_url('plugins.php'));
88
+ exit();
89
  }
90
  }
admin/views/FMSelectDataFromDb.php CHANGED
@@ -228,12 +228,15 @@ class FMViewSelect_data_from_db extends FMAdminView {
228
  $field_type = $params['field_type'];
229
  $table_struct = $params['table_struct'];
230
  $label = $params['label'];
 
231
  $cond = '<div id="condid"><select id="sel_condid" style="width: 130px">';
232
  foreach ( $table_struct as $col ) {
233
  $cond .= '<option>' . $col->Field . '</option>';
234
  }
235
  $cond .= '</select>';
236
- $cond .= '<select id="op_condid" style="width: 110px"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">&gt;</option><option value="<">&lt;</option><option value=">=">&gt;=</option><option value="<=">&lt;=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" type="text" /><select id="andor_condid" style="visibility: hidden; width:70px;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WDFMInstance(self::PLUGIN)->plugin_url . '/images/delete.png?ver=' . WDFMInstance(self::PLUGIN)->plugin_version . '" onclick="delete_cond(&quot;condid&quot;)" style="vertical-align: middle;"></div>';
 
 
237
  ?>
238
  <script>
239
  var selected_field = '';
@@ -246,35 +249,80 @@ class FMViewSelect_data_from_db extends FMAdminView {
246
  if (jQuery('#value_disabled').val() == 'no') {
247
  jQuery('.ch_rad_value_disabled').hide();
248
  }
249
- function dis(id, x) {
250
- if (x) {
251
- jQuery('#' + id).removeAttr('disabled');
252
- }
253
- else {
254
- jQuery('#' + id).attr('disabled', 'disabled');
255
- }
256
- }
257
- function update_vis() {
258
- previous = 0;
259
- for (i = 1; i < cond_id; i++) {
260
- if (jQuery('#' + i).html()) {
261
- jQuery('#andor_' + i).css('visibility', 'hidden');
262
- if (previous) {
263
- jQuery('#andor_' + previous).css('visibility', 'visible');
264
- }
265
- previous = i;
266
- }
267
- }
268
- }
269
- function delete_cond(id) {
270
- jQuery('#' + id).remove();
271
- update_vis();
272
- }
273
- jQuery('.add_cond').on("click", function () {
274
- jQuery('.cols').append(conds.replace(/condid/g, cond_id++));
275
- update_vis();
276
- });
277
- function save_query() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  str = '';
279
  plugin_url = '<?php echo WDFMInstance(self::PLUGIN)->plugin_url; ?>';
280
  plugin_version = '<?php echo WDFMInstance(self::PLUGIN)->plugin_version; ?>';
@@ -462,7 +510,7 @@ class FMViewSelect_data_from_db extends FMAdminView {
462
  }
463
  return false;
464
  }
465
- function gen_query() {
466
  query = "";
467
  query_price = "";
468
  where = "";
@@ -544,6 +592,31 @@ class FMViewSelect_data_from_db extends FMAdminView {
544
  <textarea id="where" name="where"></textarea>
545
  <textarea id="order" name="order"></textarea>
546
  </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
547
  <?php endif;
548
  die();
549
  }
228
  $field_type = $params['field_type'];
229
  $table_struct = $params['table_struct'];
230
  $label = $params['label'];
231
+ $html_placeholders = $params['html_placeholders'];
232
  $cond = '<div id="condid"><select id="sel_condid" style="width: 130px">';
233
  foreach ( $table_struct as $col ) {
234
  $cond .= '<option>' . $col->Field . '</option>';
235
  }
236
  $cond .= '</select>';
237
+ $cond .= '<select id="op_condid" style="width: 110px"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">&gt;</option><option value="<">&lt;</option><option value=">=">&gt;=</option><option value="<=">&lt;=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select>';
238
+ $cond .= '<input id="val_condid" type="text" class="fm-where-input" />';
239
+ $cond .= '<select id="andor_condid" style="visibility: hidden; width:70px;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WDFMInstance(self::PLUGIN)->plugin_url . '/images/delete.png?ver=' . WDFMInstance(self::PLUGIN)->plugin_version . '" onclick="delete_cond(&quot;condid&quot;)" style="vertical-align: middle;"></div>';
240
  ?>
241
  <script>
242
  var selected_field = '';
249
  if (jQuery('#value_disabled').val() == 'no') {
250
  jQuery('.ch_rad_value_disabled').hide();
251
  }
252
+ jQuery('.add_cond').on("click", function () {
253
+ jQuery('.cols').append(conds.replace(/condid/g, cond_id++));
254
+ update_vis();
255
+ });
256
+
257
+ jQuery('html').click(function () {
258
+ if ( jQuery("#fm-placeholder").css('display') == "block" ) {
259
+ jQuery("#fm-placeholder").hide();
260
+ }
261
+ });
262
+
263
+ jQuery('#fm-placeholder').click(function (event) {
264
+ event.stopPropagation();
265
+ });
266
+
267
+ jQuery(document).on("click", ".fm-where-input", function(e) {
268
+ e.stopPropagation();
269
+ jQuery("#fm-placeholder").css("top", jQuery(this).offset().top + jQuery(this).height() + 12);
270
+ jQuery("#fm-placeholder").css("left", jQuery(this).offset().left);
271
+ jQuery("#fm-placeholder").slideDown('fast');
272
+ selected_field = this.id;
273
+ });
274
+
275
+ function dis(id, x) {
276
+ if (x) {
277
+ jQuery('#' + id).removeAttr('disabled');
278
+ }
279
+ else {
280
+ jQuery('#' + id).attr('disabled', 'disabled');
281
+ }
282
+ }
283
+
284
+ function update_vis() {
285
+ previous = 0;
286
+ for (i = 1; i < cond_id; i++) {
287
+ if (jQuery('#' + i).html()) {
288
+ jQuery('#andor_' + i).css('visibility', 'hidden');
289
+ if (previous) {
290
+ jQuery('#andor_' + previous).css('visibility', 'visible');
291
+ }
292
+ previous = i;
293
+ }
294
+ }
295
+ }
296
+
297
+ function insert_placeholder(key) {
298
+ if (!selected_field) {
299
+ return;
300
+ }
301
+ myField = document.getElementById(selected_field);
302
+ if (document.selection) {
303
+ myField.focus();
304
+ sel = document.selection.createRange();
305
+ sel.text = key;
306
+ }
307
+ else {
308
+ if (myField.selectionStart || myField.selectionStart == '0') {
309
+ var startPos = myField.selectionStart;
310
+ var endPos = myField.selectionEnd;
311
+ myField.value = myField.value.substring(0, startPos)
312
+ + "{" + key + "}"
313
+ + myField.value.substring(endPos, myField.value.length);
314
+ }
315
+ else {
316
+ myField.value += "{" + key + "}";
317
+ }
318
+ }
319
+ }
320
+
321
+ function delete_cond( id ) {
322
+ jQuery('#' + id).remove();
323
+ update_vis();
324
+ }
325
+ function save_query() {
326
  str = '';
327
  plugin_url = '<?php echo WDFMInstance(self::PLUGIN)->plugin_url; ?>';
328
  plugin_version = '<?php echo WDFMInstance(self::PLUGIN)->plugin_version; ?>';
510
  }
511
  return false;
512
  }
513
+ function gen_query() {
514
  query = "";
515
  query_price = "";
516
  where = "";
592
  <textarea id="where" name="where"></textarea>
593
  <textarea id="order" name="order"></textarea>
594
  </form>
595
+ <div id="fm-placeholder">
596
+ <?php echo $html_placeholders ?>
597
+ </div>
598
+ <style>
599
+ #fm-placeholder {
600
+ display: none;
601
+ position: absolute;
602
+ width: 225px;
603
+ background: #fff;
604
+ border: solid 1px #c7c7c7;
605
+ top: 0;
606
+ left: 0;
607
+ z-index: 1000;
608
+ }
609
+ #fm-placeholder a {
610
+ padding: 5px;
611
+ cursor: pointer;
612
+ overflow: hidden;
613
+ white-space: nowrap;
614
+ text-overflow: ellipsis;
615
+ }
616
+ #fm-placeholder a:hover {
617
+ background: #ccc;
618
+ }
619
+ </style>
620
  <?php endif;
621
  die();
622
  }
admin/views/FMSqlMapping.php CHANGED
@@ -91,7 +91,10 @@ class FMViewFormMakerSQLMapping extends FMAdminView {
91
  $cond .= '<option>' . str_replace("'", "SingleQuot", $col->Field) . '</option>';
92
  }
93
  $cond .= '</select>';
94
- $cond .= '<select id="op_condid"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">&gt;</option><option value="<">&lt;</option><option value=">=">&gt;=</option><option value="<=">&lt;=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" style="width:170px" type="text" /><select id="andor_condid" style="visibility: hidden;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WDFMInstance(self::PLUGIN)->plugin_dir . '/images/delete.png?ver=' . WDFMInstance(self::PLUGIN)->plugin_version . '" onclick="delete_cond(&quot;condid&quot;)" style="vertical-align: middle;"></div>';
 
 
 
95
  ?>
96
  <script>
97
  jQuery(document).ready(function() {
@@ -866,7 +869,7 @@ class FMViewFormMakerSQLMapping extends FMAdminView {
866
  $temp = explode('***val***', $temp[1]);
867
  $val = $temp[0];
868
  $andor = $temp[1];
869
- echo 'jQuery(".cols").append(conds.replace(/condid/g, cond_id++).replace(\'SingleQuot\', "\'")); update_vis();
870
  jQuery("#sel_"+(cond_id-1)).val("' . html_entity_decode($sel, ENT_QUOTES) . '");
871
  jQuery("#op_"+(cond_id-1)).val("' . $op . '");
872
  jQuery("#val_"+(cond_id-1)).val("' . $val . '");
@@ -1275,7 +1278,10 @@ class FMViewFormMakerSQLMapping extends FMAdminView {
1275
  $cond .= '<option>' . str_replace("'", "SingleQuot", $col->Field) . '</option>';
1276
  }
1277
  $cond .= '</select>';
1278
- $cond .= '<select id="op_condid"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">&gt;</option><option value="<">&lt;</option><option value=">=">&gt;=</option><option value="<=">&lt;=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" style="width:170px" type="text" /><select id="andor_condid" style="visibility: hidden;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WDFMInstance(self::PLUGIN)->plugin_url . '/images/delete.png?ver=' . WDFMInstance(self::PLUGIN)->plugin_version . '" onclick="delete_cond(&quot;condid&quot;)" style="vertical-align: middle;"></div>';
 
 
 
1279
  ?>
1280
  <script>
1281
  jQuery(document).ready(function() {
@@ -1323,7 +1329,7 @@ class FMViewFormMakerSQLMapping extends FMAdminView {
1323
  }
1324
  });
1325
  }
1326
- });
1327
  var selected_field = '';
1328
  var isvisible = 1;
1329
  var cond_id = 1;
@@ -1357,36 +1363,45 @@ class FMViewFormMakerSQLMapping extends FMAdminView {
1357
  }
1358
  }
1359
  }
1360
- function delete_cond(id) {
 
1361
  jQuery('#' + id).remove();
1362
  update_vis();
1363
  }
1364
- jQuery('.add_cond').click(function () {
1365
- jQuery('.cols').append(conds.replace(/condid/g, cond_id++).replace('SingleQuot', "'"));
1366
- update_vis();
1367
- });
1368
- jQuery('html').click(function () {
1369
- if (jQuery("#fieldlist").css('display') == "block") {
1370
- jQuery("#fieldlist").hide();
1371
- }
1372
- });
1373
- jQuery('.cols input[type="text"]').on('click', function (event) {
1374
- event.stopPropagation();
1375
- jQuery("#fieldlist").css("top", jQuery(this).offset().top + jQuery(this).height() + 2);
1376
- jQuery("#fieldlist").css("left", jQuery(this).offset().left);
1377
- jQuery("#fieldlist").slideDown('fast');
1378
- selected_field = this.id;
1379
- });
1380
- jQuery('#query_txt').click(function (event) {
1381
- event.stopPropagation();
1382
- jQuery("#fieldlist").css("top", jQuery(this).offset().top + jQuery(this).height() + 2);
1383
- jQuery("#fieldlist").css("left", jQuery(this).offset().left);
1384
- jQuery("#fieldlist").slideDown('fast');
1385
- selected_field = this.id;
1386
- });
1387
- jQuery('#fieldlist').click(function (event) {
1388
- event.stopPropagation();
1389
- });
 
 
 
 
 
 
 
 
1390
  function save_query() {
1391
  con_type = jQuery('input[name=con_type]:checked').val();
1392
  con_method = jQuery('input[name=con_method]:checked').val();
@@ -1430,7 +1445,7 @@ class FMViewFormMakerSQLMapping extends FMAdminView {
1430
  success: function (data) {
1431
  window.parent.wd_fm_apply_options('apply_form_options');
1432
  window.parent.tb_remove();
1433
- window.parent.document.getElementById('adminForm').submit();
1434
  }
1435
  });
1436
  }
91
  $cond .= '<option>' . str_replace("'", "SingleQuot", $col->Field) . '</option>';
92
  }
93
  $cond .= '</select>';
94
+ $cond .= '<select id="op_condid"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">&gt;</option><option value="<">&lt;</option><option value=">=">&gt;=</option><option value="<=">&lt;=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select>';
95
+ $cond .= '<input id="val_condid" style="width:170px" type="text" class="fm-where-input" />';
96
+ $cond .= '<select id="andor_condid" style="visibility: hidden;"><option value="AND">AND</option><option value="OR">OR</option></select>';
97
+ $cond .= '<img src="' . WDFMInstance(self::PLUGIN)->plugin_dir . '/images/delete.png?ver=' . WDFMInstance(self::PLUGIN)->plugin_version . '" onclick="delete_cond(&quot;condid&quot;)" style="vertical-align: middle;"></div>';
98
  ?>
99
  <script>
100
  jQuery(document).ready(function() {
869
  $temp = explode('***val***', $temp[1]);
870
  $val = $temp[0];
871
  $andor = $temp[1];
872
+ echo 'jQuery(".cols").append(conds.replace(/condid/g, cond_id++).replace(\'SingleQuot\', "\'")); update_vis();
873
  jQuery("#sel_"+(cond_id-1)).val("' . html_entity_decode($sel, ENT_QUOTES) . '");
874
  jQuery("#op_"+(cond_id-1)).val("' . $op . '");
875
  jQuery("#val_"+(cond_id-1)).val("' . $val . '");
1278
  $cond .= '<option>' . str_replace("'", "SingleQuot", $col->Field) . '</option>';
1279
  }
1280
  $cond .= '</select>';
1281
+ $cond .= '<select id="op_condid"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">&gt;</option><option value="<">&lt;</option><option value=">=">&gt;=</option><option value="<=">&lt;=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select>';
1282
+ $cond .= '<input id="val_condid" style="width:170px" class="fm-where-input" type="text" />';
1283
+ $cond .= '<select id="andor_condid" style="visibility: hidden;"><option value="AND">AND</option><option value="OR">OR</option></select>';
1284
+ $cond .= '<img src="' . WDFMInstance(self::PLUGIN)->plugin_url . '/images/delete.png?ver=' . WDFMInstance(self::PLUGIN)->plugin_version . '" onclick="delete_cond(&quot;condid&quot;)" style="vertical-align: middle;"></div>';
1285
  ?>
1286
  <script>
1287
  jQuery(document).ready(function() {
1329
  }
1330
  });
1331
  }
1332
+ });
1333
  var selected_field = '';
1334
  var isvisible = 1;
1335
  var cond_id = 1;
1363
  }
1364
  }
1365
  }
1366
+
1367
+ function delete_cond(id) {
1368
  jQuery('#' + id).remove();
1369
  update_vis();
1370
  }
1371
+
1372
+ jQuery('.add_cond').click(function () {
1373
+ jQuery('.cols').append(conds.replace(/condid/g, cond_id++).replace('SingleQuot', "'"));
1374
+ update_vis();
1375
+ });
1376
+ jQuery('html').click(function () {
1377
+ if (jQuery("#fieldlist").css('display') == "block") {
1378
+ jQuery("#fieldlist").hide();
1379
+ }
1380
+ });
1381
+ jQuery(document).on("click", ".fm-where-input", function(e) {
1382
+ e.stopPropagation();
1383
+ jQuery("#fieldlist").css("top", jQuery(this).offset().top + jQuery(this).height() + 2);
1384
+ jQuery("#fieldlist").css("left", jQuery(this).offset().left);
1385
+ jQuery("#fieldlist").slideDown('fast');
1386
+ selected_field = this.id;
1387
+ });
1388
+ jQuery('.cols input[type="text"]').on('click', function (event) {
1389
+ event.stopPropagation();
1390
+ jQuery("#fieldlist").css("top", jQuery(this).offset().top + jQuery(this).height() + 2);
1391
+ jQuery("#fieldlist").css("left", jQuery(this).offset().left);
1392
+ jQuery("#fieldlist").slideDown('fast');
1393
+ selected_field = this.id;
1394
+ });
1395
+ jQuery('#query_txt').click(function (event) {
1396
+ event.stopPropagation();
1397
+ jQuery("#fieldlist").css("top", jQuery(this).offset().top + jQuery(this).height() + 2);
1398
+ jQuery("#fieldlist").css("left", jQuery(this).offset().left);
1399
+ jQuery("#fieldlist").slideDown('fast');
1400
+ selected_field = this.id;
1401
+ });
1402
+ jQuery('#fieldlist').click(function (event) {
1403
+ event.stopPropagation();
1404
+ });
1405
  function save_query() {
1406
  con_type = jQuery('input[name=con_type]:checked').val();
1407
  con_method = jQuery('input[name=con_method]:checked').val();
1445
  success: function (data) {
1446
  window.parent.wd_fm_apply_options('apply_form_options');
1447
  window.parent.tb_remove();
1448
+ window.parent.document.getElementById('adminForm').submit();
1449
  }
1450
  });
1451
  }
admin/views/Uninstall_fm.php CHANGED
@@ -37,25 +37,11 @@ class FMViewUninstall_fm extends FMAdminView {
37
  * @param $params
38
  */
39
  public function body( $params = array() ) {
40
- $deactivate_url = add_query_arg(array(
41
- 'action' => 'deactivate',
42
- 'plugin' => WDFMInstance(self::PLUGIN)->main_file,
43
- ), admin_url('plugins.php'));
44
- $deactivate_url = wp_nonce_url($deactivate_url, 'deactivate-plugin_' . WDFMInstance(self::PLUGIN)->main_file);
45
  echo $this->title(array(
46
  'title' => $params['page_title'],
47
  'title_class' => 'wd-header',
48
  'add_new_button' => FALSE,
49
  ));
50
-
51
- if ( isset($params['deactivate']) && $params['deactivate'] == TRUE ) {
52
- ?>
53
- <p><strong><?php echo sprintf(__("%s to Finish the Uninstallation and %s will be Deactivated Automatically.", WDFMInstance(self::PLUGIN)->prefix), '<a href="' . $deactivate_url . '" class="bwg_deactivate_link" data-uninstall="1">' . __("Click Here", WDFMInstance(self::PLUGIN)->prefix) . '</a>', WDFMInstance(self::PLUGIN)->nicename); ?></strong></p>
54
- <?php
55
-
56
- return;
57
- }
58
-
59
  ?>
60
  <div class="goodbye-text">
61
  <?php
37
  * @param $params
38
  */
39
  public function body( $params = array() ) {
 
 
 
 
 
40
  echo $this->title(array(
41
  'title' => $params['page_title'],
42
  'title_class' => 'wd-header',
43
  'add_new_button' => FALSE,
44
  ));
 
 
 
 
 
 
 
 
 
45
  ?>
46
  <div class="goodbye-text">
47
  <?php
form-maker.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://web-dorado.com/products/form-maker-wordpress.html
5
  * Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
- * Version: 1.12.39
7
  * Author: WebDorado Form Builder Team
8
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -95,8 +95,8 @@ final class WDFM {
95
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
96
  $this->front_urls = $this->get_front_urls();
97
  $this->main_file = plugin_basename(__FILE__);
98
- $this->plugin_version = '1.12.39';
99
- $this->db_version = '2.12.38';
100
  $this->menu_postfix = ($this->is_free == 2 ? '_fmc' : '_fm');
101
  $this->plugin_postfix = ($this->is_free == 2 ? '_fmc' : '');
102
  $this->menu_slug = 'manage' . $this->menu_postfix;
@@ -1212,7 +1212,7 @@ final class WDFM {
1212
  $url = add_query_arg(array('action' => 'FMShortocde' . $this->plugin_postfix, 'task' => 'submissions', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
1213
  ?>
1214
  <a onclick="tb_click.call(this); fm_set_shortcode_popup_dimensions(520, 570); return false;" href="<?php echo $url; ?>" class="button" title="<?php _e('Insert submissions', $this->prefix); ?>">
1215
- <span class="wp-media-buttons-icon" style="background: url('<?php echo $this->plugin_url; ?>/images/fm-media-submissions-button.png') no-repeat scroll left top rgba(0, 0, 0, 0);"></span>
1216
  <?php _e('Add Submissions', $this->prefix); ?>
1217
  </a>
1218
  <?php
@@ -1239,7 +1239,7 @@ final class WDFM {
1239
  'form-maker-dropbox-integration' => array('version' => '1.1.1', 'file' => 'fm_dropbox_integration.php'),
1240
  'form-maker-gdrive-integration' => array('version' => '1.0.0', 'file' => 'fm_gdrive_integration.php'),
1241
  'form-maker-pdf-integration' => array('version' => '1.1.3', 'file' => 'fm_pdf_integration.php'),
1242
- 'form-maker-stripe' => array('version' => '1.1.3', 'file' => 'fm_stripe.php'),
1243
  'form-maker-calculator' => array('version' => '1.0.3', 'file' => 'fm_calculator.php'),
1244
  );
1245
 
@@ -1251,7 +1251,7 @@ final class WDFM {
1251
  if (is_plugin_active($add_on_key . '/' . $add_on_value['file'])) {
1252
  $addon = get_plugin_data($addon_path); // array
1253
  if (version_compare($addon['Version'], $add_on_value['version'], '<=')) { //compare versions
1254
- // deactivate_plugins($addon_path);
1255
  array_push($add_ons_notice, $addon['Name']);
1256
  }
1257
  }
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://web-dorado.com/products/form-maker-wordpress.html
5
  * Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
+ * Version: 1.12.40
7
  * Author: WebDorado Form Builder Team
8
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
95
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
96
  $this->front_urls = $this->get_front_urls();
97
  $this->main_file = plugin_basename(__FILE__);
98
+ $this->plugin_version = '1.12.40';
99
+ $this->db_version = '2.12.40';
100
  $this->menu_postfix = ($this->is_free == 2 ? '_fmc' : '_fm');
101
  $this->plugin_postfix = ($this->is_free == 2 ? '_fmc' : '');
102
  $this->menu_slug = 'manage' . $this->menu_postfix;
1212
  $url = add_query_arg(array('action' => 'FMShortocde' . $this->plugin_postfix, 'task' => 'submissions', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
1213
  ?>
1214
  <a onclick="tb_click.call(this); fm_set_shortcode_popup_dimensions(520, 570); return false;" href="<?php echo $url; ?>" class="button" title="<?php _e('Insert submissions', $this->prefix); ?>">
1215
+ <span class="wp-media-buttons-icon" style="background: url(<?php echo $this->plugin_url; ?>/images/fm-media-submissions-button.png) no-repeat scroll left top rgba(0, 0, 0, 0);"></span>
1216
  <?php _e('Add Submissions', $this->prefix); ?>
1217
  </a>
1218
  <?php
1239
  'form-maker-dropbox-integration' => array('version' => '1.1.1', 'file' => 'fm_dropbox_integration.php'),
1240
  'form-maker-gdrive-integration' => array('version' => '1.0.0', 'file' => 'fm_gdrive_integration.php'),
1241
  'form-maker-pdf-integration' => array('version' => '1.1.3', 'file' => 'fm_pdf_integration.php'),
1242
+ 'form-maker-stripe' => array('version' => '1.1.5', 'file' => 'fm_stripe.php'),
1243
  'form-maker-calculator' => array('version' => '1.0.3', 'file' => 'fm_calculator.php'),
1244
  );
1245
 
1251
  if (is_plugin_active($add_on_key . '/' . $add_on_value['file'])) {
1252
  $addon = get_plugin_data($addon_path); // array
1253
  if (version_compare($addon['Version'], $add_on_value['version'], '<=')) { //compare versions
1254
+ // deactivate_plugins($addon_path);
1255
  array_push($add_ons_notice, $addon['Name']);
1256
  }
1257
  }
framework/WDW_FM_Library.php CHANGED
@@ -980,7 +980,14 @@ class WDW_FM_Library {
980
  }
981
  $form_currency = apply_filters('fm_form_currency', $form_currency, $form_id);
982
  $form_currency = self::replace_currency_code( $form_currency );
983
- $form_paypal_tax = $row->tax;
 
 
 
 
 
 
 
984
  $is_type = array();
985
  $id1s = array();
986
  $types = array();
@@ -4252,19 +4259,23 @@ class WDW_FM_Library {
4252
  'form-maker-stripe/fm_stripe.php',
4253
  'form-maker-calculator/fm_calculator.php'
4254
  );
 
4255
  return $addons;
4256
  }
4257
 
4258
  /**
4259
- * Deactivate all addons.
4260
  *
4261
- * @return bool $addon
4262
  */
4263
- public static function deactivate_all_addons() {
4264
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
4265
  $addons = self::get_all_addons_path();
 
 
 
4266
  foreach ( $addons as $addon ) {
4267
- if( is_plugin_active( $addon ) ) {
4268
  deactivate_plugins( $addon );
4269
  }
4270
  }
980
  }
981
  $form_currency = apply_filters('fm_form_currency', $form_currency, $form_id);
982
  $form_currency = self::replace_currency_code( $form_currency );
983
+ $form_paypal_tax = 0;
984
+ if ( $row->paypal_mode && $row->paypal_mode == 1 ) {
985
+ $form_paypal_tax = $row->tax;
986
+ }
987
+ if ( $row->paypal_mode && $row->paypal_mode == 2 ) {
988
+ $stripe_data = apply_filters('fm_addon_stripe_get_data_init', array('form_id' => $form_id));
989
+ $form_paypal_tax = $stripe_data->stripe_tax;
990
+ }
991
  $is_type = array();
992
  $id1s = array();
993
  $types = array();
4259
  'form-maker-stripe/fm_stripe.php',
4260
  'form-maker-calculator/fm_calculator.php'
4261
  );
4262
+
4263
  return $addons;
4264
  }
4265
 
4266
  /**
4267
+ * Deactivate all addons with given additional plugin.
4268
  *
4269
+ * @param bool $additional_plugin
4270
  */
4271
+ public static function deactivate_all_addons($additional_plugin = FALSE) {
4272
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
4273
  $addons = self::get_all_addons_path();
4274
+ if ( $additional_plugin ) {
4275
+ array_push($addons, $additional_plugin);
4276
+ }
4277
  foreach ( $addons as $addon ) {
4278
+ if ( is_plugin_active( $addon ) ) {
4279
  deactivate_plugins( $addon );
4280
  }
4281
  }
frontend/models/form_maker.php CHANGED
@@ -1336,7 +1336,7 @@ class FMModelForm_maker {
1336
  $chgnac = TRUE;
1337
  $paypal = array();
1338
  $all_files = array();
1339
- $frontend_parmas = array();
1340
  $paypal['item_name'] = array();
1341
  $paypal['quantity'] = array();
1342
  $paypal['amount'] = array();
@@ -2147,6 +2147,10 @@ class FMModelForm_maker {
2147
  $fvals[ '{' . $i . '}' ] = rtrim( $fvals[ '{' . $i . '}' ], ', ' );
2148
  }
2149
 
 
 
 
 
2150
  if ( $form->savedb ) {
2151
  $submition_data = array(
2152
  'form_id' => $id,
@@ -2204,7 +2208,7 @@ class FMModelForm_maker {
2204
  $database = $temp[ 0 ];
2205
  $query = str_replace( array_keys( $fvals ), $fvals, $query->query );
2206
  foreach ( $user_fields as $user_key => $user_field ) {
2207
- $query = str_replace( '{' . $user_key . '}', $user_field, $query );
2208
  }
2209
  if ( $con_type == 'remote' ) {
2210
  $wpdb_temp = new wpdb( $username, $password, $database, $host );
@@ -2220,7 +2224,15 @@ class FMModelForm_maker {
2220
  $stripeToken = WDW_FM_Library(self::PLUGIN)->get( $stripe_post_key, '' );
2221
  if ( $is_amount && $stripeToken ) {
2222
  $wdstripe_products_data = new stdClass();
2223
- $tax = $form->tax;
 
 
 
 
 
 
 
 
2224
  $total = $total + ($total * $tax) / 100;
2225
  $shipping = isset( $paypal[ 'shipping' ] ) ? $paypal[ 'shipping' ] : 0;
2226
  $total = $total + $shipping;
@@ -2399,6 +2411,7 @@ class FMModelForm_maker {
2399
  }
2400
  }
2401
  }
 
2402
  $frontend_parmas['user_email'] = ( is_email($user_email) !== FALSE ) ? $user_email : '';
2403
  do_action( 'fm_addon_frontend_init', $frontend_parmas );
2404
  }
1336
  $chgnac = TRUE;
1337
  $paypal = array();
1338
  $all_files = array();
1339
+ $frontend_parmas = array();
1340
  $paypal['item_name'] = array();
1341
  $paypal['quantity'] = array();
1342
  $paypal['amount'] = array();
2147
  $fvals[ '{' . $i . '}' ] = rtrim( $fvals[ '{' . $i . '}' ], ', ' );
2148
  }
2149
 
2150
+ if ( $type == "type_file_upload" ) {
2151
+ $fvals['{' . $i . '(link)}'] = rtrim( $fvals['{' . $i . '}'], ', ' );
2152
+ }
2153
+
2154
  if ( $form->savedb ) {
2155
  $submition_data = array(
2156
  'form_id' => $id,
2208
  $database = $temp[ 0 ];
2209
  $query = str_replace( array_keys( $fvals ), $fvals, $query->query );
2210
  foreach ( $user_fields as $user_key => $user_field ) {
2211
+ $query = str_replace('{' . $user_key . '}', $user_field, $query );
2212
  }
2213
  if ( $con_type == 'remote' ) {
2214
  $wpdb_temp = new wpdb( $username, $password, $database, $host );
2224
  $stripeToken = WDW_FM_Library(self::PLUGIN)->get( $stripe_post_key, '' );
2225
  if ( $is_amount && $stripeToken ) {
2226
  $wdstripe_products_data = new stdClass();
2227
+ $tax = 0;
2228
+ if ( $form->paypal_mode && $form->paypal_mode == 1 ) {
2229
+ $tax = $form->tax;
2230
+ }
2231
+ if ( $form->paypal_mode && $form->paypal_mode == 2 ) {
2232
+ $stripe_data = apply_filters('fm_addon_stripe_get_data_init', array('form_id' => $id));
2233
+ $tax = $stripe_data->stripe_tax;
2234
+ }
2235
+
2236
  $total = $total + ($total * $tax) / 100;
2237
  $shipping = isset( $paypal[ 'shipping' ] ) ? $paypal[ 'shipping' ] : 0;
2238
  $total = $total + $shipping;
2411
  }
2412
  }
2413
  }
2414
+
2415
  $frontend_parmas['user_email'] = ( is_email($user_email) !== FALSE ) ? $user_email : '';
2416
  do_action( 'fm_addon_frontend_init', $frontend_parmas );
2417
  }
frontend/views/form_maker.php CHANGED
@@ -278,22 +278,22 @@ class FMViewForm_maker {
278
  $input_active = (isset($_POST['wdform_' . $id1 . '_element' . $form_id]) ? "checked='checked'" : "");
279
  }
280
  $param['id'] = $id1;
281
- $param['w_class'] = ' checkbox-div wd-flex-row wd-align-items-center';
282
 
283
  // Use label size as field size.
284
  $param['w_size'] = $param['w_field_label_size'];
285
-
286
- $html = '<label for="wdform_' . $id1 . '_element' . $form_id . '" class="wdform-label">' . $param['label'] . '</label>';
287
- if ( isset($param['w_required']) && $param['w_required'] == "yes" ) {
288
- $requiredmark = isset($row->requiredmark) ? $row->requiredmark : '';
289
- $html .= '<span class="wdform-required">' . $requiredmark . '</span>';
290
- }
291
- $html .= '&nbsp;<input type="checkbox"
292
  class="wd-flex-row"
293
  id="wdform_' . $id1 . '_element' . $form_id . '"
294
  name="wdform_' . $id1 . '_element' . $form_id . '"
295
  ' . $input_active . '
296
  ' . $param['attributes'] . ' />';
 
 
 
 
 
 
297
 
298
  // Generate field.
299
  $rep = $this->wdform_field($type, $param, $row, $html, FALSE);
@@ -2085,7 +2085,9 @@ class FMViewForm_maker {
2085
  * @return string
2086
  */
2087
  private function type_checkbox( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
2088
- $params_names = array(
 
 
2089
  'w_field_label_size',
2090
  'w_field_label_pos',
2091
  'w_flow',
@@ -2172,10 +2174,12 @@ class FMViewForm_maker {
2172
  $key1 = $key + $total_queries;
2173
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2174
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2175
- $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array(
2176
- '[',
2177
- ']',
2178
- ), '', $w_choices_params[0]) : '');
 
 
2179
  $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2180
  $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
2181
  $db_info = $w_choices_params[1];
@@ -2249,6 +2253,8 @@ class FMViewForm_maker {
2249
  * @return string
2250
  */
2251
  private function type_radio( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
 
 
2252
  $params_names = array(
2253
  'w_field_label_size',
2254
  'w_field_label_pos',
@@ -2338,7 +2344,12 @@ class FMViewForm_maker {
2338
  $key1 = $key + $total_queries;
2339
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2340
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2341
- $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array('[', ']'), '', $w_choices_params[0]) : '');
 
 
 
 
 
2342
  $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2343
  $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
2344
  $db_info = $w_choices_params[1];
@@ -2419,7 +2430,9 @@ class FMViewForm_maker {
2419
  * @return string
2420
  */
2421
  private function type_own_select( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
2422
- $params_names = array(
 
 
2423
  'w_field_label_size',
2424
  'w_field_label_pos',
2425
  'w_size',
@@ -2486,12 +2499,16 @@ class FMViewForm_maker {
2486
  $post_value = isset($_POST["counter" . $form_id]) ? esc_html($_POST["counter" . $form_id]) : NULL;
2487
  $param['id'] = $id1;
2488
  $param['w_class'] .= ' wd-flex-row';
2489
-
2490
  $html = '<select class="wd-width-100" id="wdform_' . $id1 . '_element' . $form_id . '" name="wdform_' . $id1 . '_element' . $form_id . '" ' . $param['attributes'] . '>';
2491
  foreach ( $param['w_choices'] as $key => $choice ) {
2492
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2493
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2494
- $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array('[', ']'), '', $w_choices_params[0]) : '');
 
 
 
 
 
2495
  $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2496
  $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
2497
  $db_info = $w_choices_params[1];
@@ -3758,4 +3775,29 @@ class FMViewForm_maker {
3758
 
3759
  return ob_get_clean();
3760
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3761
  }
278
  $input_active = (isset($_POST['wdform_' . $id1 . '_element' . $form_id]) ? "checked='checked'" : "");
279
  }
280
  $param['id'] = $id1;
281
+ $param['w_class'] = ' checkbox-div wd-flex-row-reverse wd-align-items-center wd-justify-content-right';
282
 
283
  // Use label size as field size.
284
  $param['w_size'] = $param['w_field_label_size'];
285
+ $html = '<input type="checkbox"
 
 
 
 
 
 
286
  class="wd-flex-row"
287
  id="wdform_' . $id1 . '_element' . $form_id . '"
288
  name="wdform_' . $id1 . '_element' . $form_id . '"
289
  ' . $input_active . '
290
  ' . $param['attributes'] . ' />';
291
+ $html .= '<label class="wd-align-items-center wd-flex wd-flex-row-reverse" for="wdform_' . $id1 . '_element' . $form_id . '" class="wdform-label"><span></span>' . $param['label'] . '</label>';
292
+ if ( isset($param['w_required']) && $param['w_required'] == "yes" ) {
293
+ $requiredmark = isset($row->requiredmark) ? $row->requiredmark : '';
294
+ $html .= '<span class="wdform-required">' . $requiredmark . '</span>';
295
+ }
296
+
297
 
298
  // Generate field.
299
  $rep = $this->wdform_field($type, $param, $row, $html, FALSE);
2085
  * @return string
2086
  */
2087
  private function type_checkbox( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
2088
+ //ToDo custom_fields add to params array key next version.
2089
+ $custom_fields = $this->get_custom_fields();
2090
+ $params_names = array(
2091
  'w_field_label_size',
2092
  'w_field_label_pos',
2093
  'w_flow',
2174
  $key1 = $key + $total_queries;
2175
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2176
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2177
+ $where_str = $w_choices_params[0];
2178
+ foreach ( $custom_fields as $custom_key => $custom_val ) {
2179
+ $key_replace = array( '%' . $custom_key . '%', '{' . $custom_key . '}' );
2180
+ $where_str = str_replace( $key_replace, $custom_val, $where_str );
2181
+ }
2182
+ $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array('[',']',), '', $where_str) : '');
2183
  $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2184
  $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
2185
  $db_info = $w_choices_params[1];
2253
  * @return string
2254
  */
2255
  private function type_radio( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
2256
+ //ToDo custom_fields add to params array key next version.
2257
+ $custom_fields = $this->get_custom_fields();
2258
  $params_names = array(
2259
  'w_field_label_size',
2260
  'w_field_label_pos',
2344
  $key1 = $key + $total_queries;
2345
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2346
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2347
+ $where_str = $w_choices_params[0];
2348
+ foreach ( $custom_fields as $custom_key => $custom_val ) {
2349
+ $key_replace = array( '%' . $custom_key . '%', '{' . $custom_key . '}' );
2350
+ $where_str = str_replace( $key_replace, $custom_val, $where_str );
2351
+ }
2352
+ $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array('[', ']'), '', $where_str) : '');
2353
  $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2354
  $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
2355
  $db_info = $w_choices_params[1];
2430
  * @return string
2431
  */
2432
  private function type_own_select( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
2433
+ //ToDo custom_fields add to params array key next version.
2434
+ $custom_fields = $this->get_custom_fields();
2435
+ $params_names = array(
2436
  'w_field_label_size',
2437
  'w_field_label_pos',
2438
  'w_size',
2499
  $post_value = isset($_POST["counter" . $form_id]) ? esc_html($_POST["counter" . $form_id]) : NULL;
2500
  $param['id'] = $id1;
2501
  $param['w_class'] .= ' wd-flex-row';
 
2502
  $html = '<select class="wd-width-100" id="wdform_' . $id1 . '_element' . $form_id . '" name="wdform_' . $id1 . '_element' . $form_id . '" ' . $param['attributes'] . '>';
2503
  foreach ( $param['w_choices'] as $key => $choice ) {
2504
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
2505
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
2506
+ $where_str = $w_choices_params[0];
2507
+ foreach ( $custom_fields as $custom_key => $custom_val ) {
2508
+ $key_replace = array( '%' . $custom_key . '%', '{' . $custom_key . '}' );
2509
+ $where_str = str_replace( $key_replace, $custom_val, $where_str );
2510
+ }
2511
+ $where = (str_replace(array( '[', ']' ), '', $w_choices_params[0]) ? ' WHERE ' . str_replace(array('[', ']'), '', $where_str) : '');
2512
  $w_choices_params = explode('[db_info]', $w_choices_params[1]);
2513
  $order_by = str_replace(array( '[', ']' ), '', $w_choices_params[0]);
2514
  $db_info = $w_choices_params[1];
3775
 
3776
  return ob_get_clean();
3777
  }
3778
+
3779
+ /**
3780
+ * Get custom fields
3781
+ * @return array
3782
+ */
3783
+ private function get_custom_fields() {
3784
+ $userid = '';
3785
+ $username = '';
3786
+ $useremail = '';
3787
+ $adminemail = get_option( 'admin_email' );
3788
+ $current_user = wp_get_current_user();
3789
+ if ( $current_user->ID != 0 ) {
3790
+ $userid = $current_user->ID;
3791
+ $username = $current_user->display_name;
3792
+ $useremail = $current_user->user_email;
3793
+ }
3794
+ $custom_fields = array(
3795
+ "ip" => $_SERVER['REMOTE_ADDR'],
3796
+ "userid" => $userid,
3797
+ 'adminemail' => $adminemail,
3798
+ "useremail" => $useremail,
3799
+ "username" => $username
3800
+ );
3801
+ return $custom_fields;
3802
+ }
3803
  }
js/form_maker_admin.js CHANGED
@@ -24,10 +24,12 @@ jQuery(document).ready(function () {
24
 
25
  jQuery(".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view").each(function () {
26
  jQuery(this).attr("title", form_maker.add_placeholder);
27
- jQuery(this).on("click", function () {
28
- fm_placeholders_popup(jQuery(this).data("id"));
29
- });
30
  });
 
 
 
 
 
31
 
32
  fm_disabled_uninstall_btn();
33
  jQuery('.fm-uninstall-form #check_yes').on("click", function () {
24
 
25
  jQuery(".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view").each(function () {
26
  jQuery(this).attr("title", form_maker.add_placeholder);
 
 
 
27
  });
28
+
29
+ jQuery(document).on("click", ".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view", function(){
30
+ fm_placeholders_popup(jQuery(this).data("id"));
31
+ });
32
+
33
 
34
  fm_disabled_uninstall_btn();
35
  jQuery('.fm-uninstall-form #check_yes').on("click", function () {
js/main_div_front_end.js CHANGED
@@ -117,7 +117,7 @@ function set_total_value(form_id) {
117
  }
118
  });
119
  var FormPaypalTax = eval("FormPaypalTax_" + form_id);
120
- if(FormPaypalTax != 0) {
121
  div_paypal_tax.html('Tax: ' + FormCurrency + (((total)*FormPaypalTax) / 100).toFixed(2));
122
  }
123
  jQuery('.div_total'+form_id).html(FormCurrency + (parseFloat((total *(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2));
117
  }
118
  });
119
  var FormPaypalTax = eval("FormPaypalTax_" + form_id);
120
+ if ( FormPaypalTax != 0 ) {
121
  div_paypal_tax.html('Tax: ' + FormCurrency + (((total)*FormPaypalTax) / 100).toFixed(2));
122
  }
123
  jQuery('.div_total'+form_id).html(FormCurrency + (parseFloat((total *(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2));
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: webdorado,10web,wdsupport,formmakersupport
3
  Tags: form, forms, form builder, contact form, feedback, custom form, contact, web contact form, captcha, email, form manager, survey
4
  Requires at least: 4.6
5
  Tested up to: 4.9
6
- Stable tag: 1.12.39
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -451,6 +451,13 @@ Where **{{field_id}}** is the ID of the field you wish to prefill. Also, **{{par
451
 
452
 
453
  == Changelog ==
 
 
 
 
 
 
 
454
  = 1.12.39 =
455
  * Added: Drag & Drop of Columns in form editor
456
  * Added: Drag & Drop of Pages in form editor
3
  Tags: form, forms, form builder, contact form, feedback, custom form, contact, web contact form, captcha, email, form manager, survey
4
  Requires at least: 4.6
5
  Tested up to: 4.9
6
+ Stable tag: 1.12.40
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
451
 
452
 
453
  == Changelog ==
454
+
455
+ = 1.12.40 =
456
+ * Added: WHERE selectors in "Options from database" (Select, Single and Multiple choice fields).
457
+ * Added: Placeholders (User ID, Submitter's IP, etc.) in WHERE clause in "Options from database" and MySQL Mapping.
458
+ * Improved: Parsing images in post content in Post Generation extension.
459
+ * Fixed: Scroll issues on Safari (MacOS).
460
+
461
  = 1.12.39 =
462
  * Added: Drag & Drop of Columns in form editor
463
  * Added: Drag & Drop of Pages in form editor