| @@ -28,8 +28,9 @@ | ||
| 28 | 28 | * |
| 29 | 29 | * @param string $action Action for this view. |
| 30 | 30 | * @param array<string, mixed> $data Data for this view. |
| 31 | 31 | */ |
| 32 | + #[\Override] | |
| 32 | 33 | public function setup( /* string */ $action, array $data ) /* : void */ { |
| 33 | 34 | // Don't use type hints in the method declaration to prevent PHP errors, as the method is inherited. |
| 34 | 35 | |
| 35 | 36 | parent::setup( $action, $data ); |
| @@ -51,9 +52,12 @@ | ||
| 51 | 52 | $this->admin_page->enqueue_style( 'codemirror', array( 'code-editor' ) ); |
| 52 | 53 | $this->admin_page->enqueue_script( 'codemirror' ); |
| 53 | 54 | } |
| 54 | 55 | |
| 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' ); | |
| 56 | + if ( ! TABLEPRESS_IS_PLAYGROUND_PREVIEW ) { | |
| 57 | + /* translators: %s: Premium badge HTML or empty string */ | |
| 58 | + $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' ); | |
| 59 | + } | |
| 56 | 60 | $this->add_meta_box( 'frontend-options', __( 'Custom Styling', 'tablepress' ), array( $this, 'postbox_frontend_options' ), 'normal' ); |
| 57 | 61 | } |
| 58 | 62 | $this->add_meta_box( 'user-options', __( 'User Options', 'tablepress' ), array( $this, 'postbox_user_options' ), 'normal' ); |
| 59 | 63 | $this->add_text_box( 'submit', array( $this, 'textbox_submit_button' ), 'submit' ); |
| @@ -103,9 +107,9 @@ | ||
| 103 | 107 | <span class="dashicons dashicons-arrow-right-alt"></span> |
| 104 | 108 | </a> |
| 105 | 109 | </div> |
| 106 | 110 | </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> | |
| 111 | + <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 | 112 | </div> |
| 109 | 113 | <?php |
| 110 | 114 | endif; |
| 111 | 115 | } |
| @@ -122,9 +126,9 @@ | ||
| 122 | 126 | ?> |
| 123 | 127 | <table class="tablepress-postbox-table fixed"> |
| 124 | 128 | <tr> |
| 125 | 129 | <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 “Custom CSS” code to change the table styling:', 'tablepress' ); ?></label> | |
| 130 | + <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 “Custom CSS” code to change the table styling:', 'tablepress' ); ?></label> | |
| 127 | 131 | </td> |
| 128 | 132 | </tr> |
| 129 | 133 | <tr> |
| 130 | 134 | <td class="column-1"></td> |
| @@ -200,12 +204,13 @@ | ||
| 200 | 204 | * |
| 201 | 205 | * @param array<string, mixed> $data Data for this screen. |
| 202 | 206 | * @param array<string, mixed> $box Information about the text box. |
| 203 | 207 | */ |
| 208 | + #[\Override] | |
| 204 | 209 | public function textbox_submit_button( array $data, array $box ): void { |
| 205 | 210 | ?> |
| 206 | 211 | <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' ) ); ?>" /> | |
| 212 | + <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 | 213 | </p> |
| 209 | 214 | <?php |
| 210 | 215 | } |
| 211 | 216 | |
| @@ -221,15 +226,15 @@ | ||
| 221 | 226 | ?> |
| 222 | 227 | <h1 style="margin-top:40px;"><?php _e( 'Uninstall TablePress', 'tablepress' ); ?></h1> |
| 223 | 228 | <p> |
| 224 | 229 | <?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’s files from the plugin folder afterwards.', 'tablepress' ) . '<br />' | |
| 230 | + echo __( 'Uninstalling <strong>will permanently delete</strong> all TablePress tables and options from the database.', 'tablepress' ) . '<br>' | |
| 231 | + . __( '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>' | |
| 232 | + . __( 'You will manually need to remove the plugin’s files from the plugin folder afterwards.', 'tablepress' ) . '<br>' | |
| 228 | 233 | . __( 'Be very careful with this and only click the button if you know what you are doing!', 'tablepress' ); |
| 229 | 234 | ?> |
| 230 | 235 | </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> | |
| 236 | + <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 | 237 | <?php |
| 233 | 238 | } |
| 234 | 239 | |
| 235 | 240 | } // class TablePress_Options_View |