PluginProbe
WP Data Access – App Builder for Tables, Forms, Dashboards, Charts & Maps / 5.5.87
WP Data Access – App Builder for Tables, Forms, Dashboards, Charts & Maps v5.5.87
5.5.87 5.5.85 5.5.84 5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 All 162 releases
wp-data-access / WPDataAccess / Settings / WPDA_Settings_Legacy_DataForms.php

WPDA_Settings_Legacy_DataForms.php in WP Data Access – App Builder for Tables, Forms, Dashboards, Charts & Maps 5.5.87, at WPDataAccess/Settings/WPDA_Settings_Legacy_DataForms.php

96 lines 4.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPDataAccess\Settings {
4
5 use WPDataAccess\Utilities\WPDA_Message_Box;
6 use WPDataAccess\WPDA;
7
8 class WPDA_Settings_Legacy_DataForms extends WPDA_Settings_Legacy_Page {
9
10 public function show() {
11
12 if ( isset( $_REQUEST['action'] ) ) {
13 $action = sanitize_text_field( wp_unslash( $_REQUEST['action'] ) ); // input var okay.
14
15 // Security check.
16 $wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay.
17 if ( ! wp_verify_nonce( $wp_nonce, 'wpda-forms-settings-' . WPDA::get_current_user_login() ) ) {
18 wp_die( esc_attr__( 'ERROR: Not authorized', 'wp-data-access' ) );
19 }
20
21 if ( 'save' === $action ) {
22 WPDA::set_option(
23 WPDA::OPTION_PLUGIN_WPDADATAFORMS_ALLOW_ANONYMOUS_ACCESS,
24 isset( $_REQUEST['allow_anonymous_access'] ) ? 'on' : 'off'
25 );
26 } elseif ( 'setdefaults' === $action ) {
27 // Set all data table settings back to default.
28 WPDA::set_option( WPDA::OPTION_PLUGIN_WPDADATAFORMS_ALLOW_ANONYMOUS_ACCESS );
29 }
30
31 $msg = new WPDA_Message_Box(
32 array(
33 'message_text' => __( 'Settings saved', 'wp-data-access' ),
34 )
35 );
36 $msg->box();
37 }
38
39 $allow_anonymous_access = WPDA::get_option( WPDA::OPTION_PLUGIN_WPDADATAFORMS_ALLOW_ANONYMOUS_ACCESS );
40 ?>
41
42 <form id="wpda_settings_forms" method="post"
43 action="?page=<?php echo esc_attr( $this->page ); ?>&tab=legacy&vtab=dataforms">
44 <table class="wpda-table-settings">
45 <tr style="border-top: 1px solid #ccc">
46 <th><?php esc_html_e( 'Allow anonymous access', 'wp-data-access' ); ?></th>
47 <td>
48 <label>
49 <input type="checkbox" name="allow_anonymous_access" <?php echo 'on' === $allow_anonymous_access ? 'checked' : ''; ?>/>Enabled
50 </label>
51 </td>
52 </tr>
53 <tr>
54 <th><?php esc_html_e( 'Default jQuery UI theme', 'wp-data-access' ); ?></th>
55 <td>
56 <a href="<?php echo esc_url( admin_url( 'options-general.php' ) ); ?>?page=wpdataaccess&tab=frontend">
57 Change default jQuery UI theme
58 </a> (used to style <strong>Data Forms</strong>)
59 </td>
60 </tr>
61 <tr>
62 <th><span class="dashicons dashicons-info" style="float:right;font-size:300%;"></span></th>
63 <td>
64 <span class="dashicons dashicons-yes"></span>
65 <?php esc_html_e( 'Data Forms are styled according to the default jQuery UI theme', 'wp-data-access' ); ?>
66 <br/>
67 <span class="dashicons dashicons-yes"></span>
68 <?php esc_html_e( 'Individual styling per shortcode will be added later', 'wp-data-access' ); ?>
69 </td>
70 </tr>
71 </table>
72 <div class="wpda-table-settings-button">
73 <input type="hidden" name="action" value="save"/>
74 <button type="submit" class="button button-primary">
75 <i class="fas fa-check wpda_icon_on_button"></i>
76 <?php esc_html_e( 'Save Data Forms Settings', 'wp-data-access' ); ?>
77 </button>
78 <a href="javascript:void(0)"
79 onclick="if (confirm('<?php esc_html_e( 'Reset to defaults?', 'wp-data-access' ); ?>')) {
80 jQuery('input[name=&quot;action&quot;]').val('setdefaults');
81 jQuery('#wpda_settings_forms').trigger('submit')
82 }"
83 class="button">
84 <i class="fas fa-times-circle wpda_icon_on_button"></i>
85 <?php esc_html_e( 'Reset Data Forms Settings To Defaults', 'wp-data-access' ); ?>
86 </a>
87 </div>
88 <?php wp_nonce_field( 'wpda-forms-settings-' . WPDA::get_current_user_login(), '_wpnonce', false ); ?>
89 </form>
90
91 <?php
92 }
93
94 }
95
96 }