| @@ -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 | /** |
| @@ -37,17 +39,16 @@ | ||
| 37 | 39 | $this->action = 'options'; |
| 38 | 40 | $this->data = $data; |
| 39 | 41 | |
| 40 | 42 | // Set page title. |
| 43 | + /* translators: %1$s: Page title, %2$s: Plugin name */ | |
| 41 | 44 | $GLOBALS['title'] = sprintf( __( '%1$s ‹ %2$s', 'tablepress' ), $this->data['view_actions'][ $this->action ]['page_title'], 'TablePress' ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited |
| 42 | 45 | |
| 43 | - $this->add_header_message( '<strong>' . __( 'Attention: Further action is required to save the changes to your “Custom CSS”!', 'tablepress' ) . '</strong>', 'notice-success' ); | |
| 46 | + add_filter( 'admin_footer_text', array( $this, 'add_admin_footer_text' ) ); | |
| 44 | 47 | |
| 45 | - // Admin page helpers, like script/style loading, could be moved to view. | |
| 46 | - $this->admin_page = TablePress::load_class( 'TablePress_Admin_Page', 'class-admin-page-helper.php', 'classes' ); | |
| 47 | - $this->admin_page->enqueue_style( 'common' ); | |
| 48 | + $this->add_header_message( '<strong>' . __( 'Attention: Further action is required to save the changes to your “Custom CSS”!', 'tablepress' ) . '</strong>', 'is-warning notice-warning' ); | |
| 48 | 49 | |
| 49 | - $this->admin_page->add_admin_footer_text(); | |
| 50 | + TablePress::enqueue_style( 'common', array( 'wp-components' ) ); | |
| 50 | 51 | |
| 51 | 52 | $this->add_text_box( 'explanation-text', array( $this, 'textbox_explanation_text' ), 'normal' ); |
| 52 | 53 | $this->add_text_box( 'credentials-form', array( $this, 'textbox_credentials_form' ), 'normal' ); |
| 53 | 54 | $this->add_text_box( 'proceed-no-file-saving', array( $this, 'textbox_proceed_no_file_saving' ), 'submit' ); |
| @@ -65,8 +66,10 @@ | ||
| 65 | 66 | <?php |
| 66 | 67 | $this->print_nav_tab_menu(); |
| 67 | 68 | ?> |
| 68 | 69 | <div id="tablepress-body"> |
| 70 | + <hr class="wp-header-end"> | |
| 71 | + <script>document.querySelectorAll('.notice:has(~#tablepress-page)').forEach(e=>document.querySelector('.wp-header-end').after(e));</script> | |
| 69 | 72 | <?php |
| 70 | 73 | // Print all header messages. |
| 71 | 74 | foreach ( $this->header_messages as $message ) { |
| 72 | 75 | echo $message; |
| @@ -95,9 +98,9 @@ | ||
| 95 | 98 | $this->do_meta_boxes( 'side' ); |
| 96 | 99 | ?> |
| 97 | 100 | </div> |
| 98 | 101 | </div> |
| 99 | - <br class="clear" /> | |
| 102 | + <br class="clear"> | |
| 100 | 103 | </div> |
| 101 | 104 | </div> |
| 102 | 105 | </div> |
| 103 | 106 | <?php |
| @@ -114,9 +117,12 @@ | ||
| 114 | 117 | public function textbox_explanation_text( array $data, array $box ): void { |
| 115 | 118 | ?> |
| 116 | 119 | <p> |
| 117 | 120 | <?php _e( 'Due to the configuration of your server, TablePress was not able to automatically save your “Custom CSS” to a file.', 'tablepress' ); ?> |
| 118 | - <?php printf( __( 'To try again with the same method that you use for updating plugins or themes, please fill out the “%s” form below.', 'tablepress' ), __( 'Connection Information', 'default' ) ); ?> | |
| 121 | + <?php | |
| 122 | + /* translators: %s: Connection information form label */ | |
| 123 | + printf( __( 'To try again with the same method that you use for updating plugins or themes, please fill out the “%s” form below.', 'tablepress' ), __( 'Connection Information', 'default' ) ); | |
| 124 | + ?> | |
| 119 | 125 | </p> |
| 120 | 126 | <?php |
| 121 | 127 | } |
| 122 | 128 | |
| @@ -146,9 +152,9 @@ | ||
| 146 | 152 | <p> |
| 147 | 153 | <?php _e( 'To proceed without trying to save the “Custom CSS” to a file, click the button below.', 'tablepress' ); ?> |
| 148 | 154 | <?php _e( 'Your “Custom CSS” will then be loaded inline.', 'tablepress' ); ?> |
| 149 | 155 | </p><p> |
| 150 | - <a href="<?php echo TablePress::url( array( 'action' => 'options', 'message' => 'success_save_error_custom_css' ) ); ?>" class="button button-large"><?php _e( 'Proceed without saving “Custom CSS” to a file', 'tablepress' ); ?></a> | |
| 156 | + <a href="<?php echo TablePress::url( array( 'action' => 'options', 'message' => 'success_save_error_custom_css' ) ); ?>" class="components-button is-secondary"><?php _e( 'Proceed without saving “Custom CSS” to a file', 'tablepress' ); ?></a> | |
| 151 | 157 | </p> |
| 152 | 158 | <?php |
| 153 | 159 | } |
| 154 | 160 | |