PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
← All changes | views/view-options.php +19 -11 2.2.1 → 3.4 View file →
@@ -7,8 +7,10 @@
7 7 * @author Tobias Bäthge
8 8 * @since 1.0.0
9 9 */
10 10
11 +declare(strict_types=1);
12 +
11 13 // Prohibit direct script loading.
12 14 defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
13 15
14 16 /**
@@ -28,14 +30,16 @@
28 30 *
29 31 * @param string $action Action for this view.
30 32 * @param array<string, mixed> $data Data for this view.
31 33 */
34 + #[\Override]
32 35 public function setup( /* string */ $action, array $data ) /* : void */ {
33 36 // Don't use type hints in the method declaration to prevent PHP errors, as the method is inherited.
34 37
35 38 parent::setup( $action, $data );
36 39
37 - $this->admin_page->enqueue_script( 'options' );
40 + TablePress::enqueue_script( 'common', array( 'jquery-core', 'postbox' ) );
41 + TablePress::enqueue_script( 'options' );
38 42
39 43 $this->process_action_messages( array(
40 44 'success_save' => __( 'Options saved successfully.', 'tablepress' ),
41 45 'success_save_error_custom_css' => __( 'Options saved successfully, but &#8220;Custom CSS&#8221; was not saved to file.', 'tablepress' ),
@@ -47,13 +51,16 @@
47 51 // Enqueue WordPress copy of CodeMirror, with CSS linting, etc., for the "Custom CSS" textarea, which is only shown to admins.
48 52 $codemirror_settings = wp_enqueue_code_editor( array( 'type' => 'text/css' ) );
49 53 if ( ! empty( $codemirror_settings ) ) {
50 54 // Load CSS adjustments for CodeMirror and the added vertical resizing.
51 - $this->admin_page->enqueue_style( 'codemirror', array( 'code-editor' ) );
52 - $this->admin_page->enqueue_script( 'codemirror' );
55 + TablePress::enqueue_style( 'codemirror', array( 'code-editor' ) );
56 + TablePress::enqueue_script( 'codemirror' );
53 57 }
54 58
55 - $this->add_meta_box( 'default-style', sprintf( __( 'Default Styling %s', 'tablepress' ), '<span class="beta-label">' . ( tb_tp_fs()->is_free_plan() ? __( 'Premium', 'tablepress' ) : __( 'beta', 'tablepress' ) ) . '</span>' ), array( $this, 'postbox_default_style_customizer_screen' ), 'normal' );
59 + if ( ! TABLEPRESS_IS_PLAYGROUND_PREVIEW ) {
60 + /* translators: %s: Premium badge HTML or empty string */
61 + $this->add_meta_box( 'default-style', sprintf( __( 'Default Styling %s', 'tablepress' ), tb_tp_fs()->is_free_plan() ? '<span class="pill-label">' . __( 'Premium', 'tablepress' ) . '</span>' : '' ), array( $this, 'postbox_default_style_customizer_screen' ), 'normal' );
62 + }
56 63 $this->add_meta_box( 'frontend-options', __( 'Custom Styling', 'tablepress' ), array( $this, 'postbox_frontend_options' ), 'normal' );
57 64 }
58 65 $this->add_meta_box( 'user-options', __( 'User Options', 'tablepress' ), array( $this, 'postbox_user_options' ), 'normal' );
59 66 $this->add_text_box( 'submit', array( $this, 'textbox_submit_button' ), 'submit' );
@@ -103,9 +110,9 @@
103 110 <span class="dashicons dashicons-arrow-right-alt"></span>
104 111 </a>
105 112 </div>
106 113 </div>
107 - <a href="https://tablepress.org/modules/default-style-customizer/?utm_source=plugin&utm_medium=textlink&utm_content=options-screen"><img src="<?php echo esc_url( plugins_url( 'admin/img/default-style-customizer.png', TABLEPRESS__FILE__ ) ); ?>" width="305" height="172" alt="<?php esc_attr_e( 'Screenshot of the Default Style Customizer that is part of the TablePress premium versions.', 'tablepress' ); ?>" /></a>
114 + <a href="https://tablepress.org/modules/default-style-customizer/?utm_source=plugin&utm_medium=textlink&utm_content=options-screen"><img src="<?php echo esc_url( plugins_url( 'admin/img/default-style-customizer.png', TABLEPRESS__FILE__ ) ); ?>" width="305" height="172" alt="<?php esc_attr_e( 'Screenshot of the Default Style Customizer that is part of the TablePress premium versions.', 'tablepress' ); ?>"></a>
108 115 </div>
109 116 <?php
110 117 endif;
111 118 }
@@ -122,9 +129,9 @@
122 129 ?>
123 130 <table class="tablepress-postbox-table fixed">
124 131 <tr>
125 132 <th class="column-1" scope="row"><label for="option-custom-css"><?php _e( 'Custom CSS', 'tablepress' ); ?></label>:</th>
126 - <td class="column-2"><label for="option-use-custom-css"><input type="checkbox" id="option-use-custom-css" name="options[use_custom_css]" value="true"<?php checked( $data['frontend_options']['use_custom_css'] ); ?> /> <?php _e( 'Load this &#8220;Custom CSS&#8221; code to change the table styling:', 'tablepress' ); ?></label>
133 + <td class="column-2"><label><input type="checkbox" id="option-use-custom-css" name="options[use_custom_css]" value="true"<?php checked( $data['frontend_options']['use_custom_css'] ); ?>> <?php _e( 'Load this &#8220;Custom CSS&#8221; code to change the table styling:', 'tablepress' ); ?></label>
127 134 </td>
128 135 </tr>
129 136 <tr>
130 137 <td class="column-1"></td>
@@ -200,12 +207,13 @@
200 207 *
201 208 * @param array<string, mixed> $data Data for this screen.
202 209 * @param array<string, mixed> $box Information about the text box.
203 210 */
211 + #[\Override]
204 212 public function textbox_submit_button( array $data, array $box ): void {
205 213 ?>
206 214 <p class="submit">
207 - <input type="submit" id="tablepress-options-save-changes" class="button button-primary button-large button-save-changes" value="<?php esc_attr_e( 'Save Changes', 'tablepress' ); ?>" data-shortcut="<?php echo esc_attr( _x( '%1$sS', 'keyboard shortcut for Save Changes', 'tablepress' ) ); ?>" />
215 + <input type="submit" id="tablepress-options-save-changes" class="components-button is-primary button-save-changes" value="<?php esc_attr_e( 'Save Changes', 'tablepress' ); ?>" data-shortcut="<?php echo esc_attr( _x( '%1$sS', 'keyboard shortcut for Save Changes', 'tablepress' ) ); ?>">
208 216 </p>
209 217 <?php
210 218 }
211 219
@@ -221,15 +229,15 @@
221 229 ?>
222 230 <h1 style="margin-top:40px;"><?php _e( 'Uninstall TablePress', 'tablepress' ); ?></h1>
223 231 <p>
224 232 <?php
225 - echo __( 'Uninstalling <strong>will permanently delete</strong> all TablePress tables and options from the database.', 'tablepress' ) . '<br />'
226 - . __( 'It is recommended that you create a backup of the tables (by exporting the tables in the JSON format), in case you later change your mind.', 'tablepress' ) . '<br />'
227 - . __( 'You will manually need to remove the plugin&#8217;s files from the plugin folder afterwards.', 'tablepress' ) . '<br />'
233 + echo __( 'Uninstalling <strong>will permanently delete</strong> all TablePress tables and options from the database.', 'tablepress' ) . '<br>'
234 + . __( 'It is recommended that you create a backup of the tables (by exporting the tables in the JSON format), in case you later change your mind.', 'tablepress' ) . '<br>'
235 + . __( 'You will manually need to remove the plugin&#8217;s files from the plugin folder afterwards.', 'tablepress' ) . '<br>'
228 236 . __( 'Be very careful with this and only click the button if you know what you are doing!', 'tablepress' );
229 237 ?>
230 238 </p>
231 - <p><a href="<?php echo TablePress::url( array( 'action' => 'uninstall_tablepress' ), true, 'admin-post.php' ); ?>" id="uninstall-tablepress" class="button"><?php _e( 'Uninstall TablePress', 'tablepress' ); ?></a></p>
239 + <p><a href="<?php echo TablePress::url( array( 'action' => 'uninstall_tablepress' ), true, 'admin-post.php' ); ?>" id="uninstall-tablepress" class="components-button is-secondary is-destructive"><?php _e( 'Uninstall TablePress', 'tablepress' ); ?></a></p>
232 240 <?php
233 241 }
234 242
235 243 } // class TablePress_Options_View