PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 4.3.13
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v4.3.13
6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 3.6.66 All 195 releases
fluentform / app / Modules / Form / Settings / EntryColumnViewSettings.php

EntryColumnViewSettings.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 4.3.13, at app/Modules/Form/Settings/EntryColumnViewSettings.php

70 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Modules\Form\Settings;
4
5 class EntryColumnViewSettings
6 {
7
8 /**
9 * Save settings for visible entry columns
10 * @return void
11 */
12 public function saveVisibleColumnsAjax()
13 {
14 $formId = absint($_REQUEST['form_id']);
15 $columns = wp_unslash($_REQUEST['visible_columns']);
16
17 $this->store ($formId, '_visible_columns',$columns);
18
19 wp_send_json_success();
20 }
21
22 /**
23 * Save settings for entry column display order
24 */
25 public function saveEntryColumnsOrderAjax()
26 {
27
28 $formId = absint($_REQUEST['form_id']);
29 $columns = wp_unslash($_REQUEST['columns_order']);
30
31 $this->store ($formId, '_columns_order',$columns);
32
33 wp_send_json_success();
34 }
35
36 /**
37 * Reset column display order settings
38 */
39 public function resetEntryDisplaySettings()
40 {
41 $formId = absint($_REQUEST['form_id']);
42 $this->store ($formId, '_columns_order',NULL);
43 wp_send_json_success();
44 }
45
46 protected function store($formId, $metaKey, $metaValue)
47 {
48 $row = wpFluent()->table('fluentform_form_meta')
49 ->where('form_id', $formId)
50 ->where('meta_key', $metaKey)
51 ->first();
52
53 if (!$row) {
54 return wpFluent()->table('fluentform_form_meta')
55 ->insert([
56 'form_id' => $formId,
57 'meta_key' => $metaKey,
58 'value' => $metaValue
59 ]);
60 }
61
62 return wpFluent()->table('fluentform_form_meta')
63 ->where('id', $row->id)
64 ->update([
65 'value' => $metaValue
66 ]);
67 }
68
69 }
70