PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 5.5.84
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v5.5.84
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 5.5.41 5.5.42 All 160 releases
wp-data-access / WPDataAccess / Settings / WPDA_Settings_Apps.php

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

82 lines 3.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\WPDA;
6
7 class WPDA_Settings_Apps extends WPDA_Settings {
8
9 /**
10 * Add back-end tab content
11 *
12 * See class documentation for flow explanation.
13 *
14 * @since 5.5.71
15 */
16 protected function add_content() {
17
18 if ( isset( $_REQUEST['action'] ) ) {
19 $action = sanitize_text_field(wp_unslash($_REQUEST['action'])); // input var okay.
20
21 // Security check.
22 $wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay.
23 if ( ! wp_verify_nonce( $wp_nonce, 'wpda-apps-settings' ) ) {
24 wp_die( esc_attr__( 'ERROR: Not authorized', 'wp-data-access' ) );
25 }
26
27 if ( 'save' === $action ) {
28
29 if (
30 isset( $_REQUEST['scroll_offset'] ) &&
31 '' !== $_REQUEST['scroll_offset']
32 ) {
33 $scroll_offset = sanitize_text_field( wp_unslash( $_REQUEST['scroll_offset'] ) ); // input var okay.
34 update_option( 'wpda_apps_scroll_offset', $scroll_offset );
35 }
36
37 } elseif ( 'setdefaults' === $action ) {
38
39 WPDA::set_option( WPDA::OPTION_APPS_SCROLL_OFFSET );
40
41 }
42 }
43
44 $scroll_offset = WPDA::get_option( WPDA::OPTION_APPS_SCROLL_OFFSET );
45
46 ?>
47 <form id="wpda_settings_backend" method="post"
48 action="?page=<?php echo esc_attr( $this->page ); ?>&tab=apps">
49 <table class="wpda-table-settings">
50 <tr>
51 <th><?php esc_html_e( 'Scroll Offset', 'wp-data-access' ); ?></th>
52 <td>
53 <input
54 type="number" step="1" min="0" max="999" name="scroll_offset" maxlength="3"
55 value="<?php echo esc_attr( $scroll_offset ); ?>">
56 </td>
57 </tr>
58 </table>
59 <div class="wpda-table-settings-button">
60 <input type="hidden" name="action" value="save"/>
61 <button type="submit" class="button button-primary">
62 <i class="fas fa-check wpda_icon_on_button"></i>
63 <?php esc_html_e( 'Save Apps Settings', 'wp-data-access' ); ?>
64 </button>
65 <a href="javascript:void(0)"
66 onclick="if (confirm('<?php esc_html_e( 'Reset to defaults?', 'wp-data-access' ); ?>')) {
67 jQuery('input[name=&quot;action&quot;]').val('setdefaults');
68 jQuery('#wpda_settings_backend').trigger('submit')
69 }"
70 class="button">
71 <i class="fas fa-times-circle wpda_icon_on_button"></i>
72 <?php esc_html_e( 'Reset Apps Settings To Defaults', 'wp-data-access' ); ?>
73 </a>
74 </div>
75 <?php esc_attr( wp_nonce_field( 'wpda-apps-settings', '_wpnonce', false ) ); ?>
76 </form>
77 <?php
78
79 }
80 }
81
82 }