| @@ -69,9 +69,9 @@ | ||
| 69 | 69 | </p> |
| 70 | 70 | <p> |
| 71 | 71 | <?php _e( 'To export, select the tables and the desired export format.', 'tablepress' ); ?> |
| 72 | 72 | <?php _e( 'If you choose more than one table, the exported files will automatically be stored in a ZIP archive file.', 'tablepress' ); ?> |
| 73 | - <br /> | |
| 73 | + <br> | |
| 74 | 74 | <?php _e( 'Be aware that for the CSV and HTML formats only the table data, but no table options are exported!', 'tablepress' ); ?> |
| 75 | 75 | <?php _e( 'For the JSON format, the table data and the table options are exported.', 'tablepress' ); ?> |
| 76 | 76 | </p> |
| 77 | 77 | <?php |
| @@ -89,9 +89,14 @@ | ||
| 89 | 89 | $add_url = TablePress::url( array( 'action' => 'add' ) ); |
| 90 | 90 | $import_url = TablePress::url( array( 'action' => 'import' ) ); |
| 91 | 91 | ?> |
| 92 | 92 | <p><?php _e( 'No tables found.', 'tablepress' ); ?></p> |
| 93 | - <p><?php printf( __( 'You should <a href="%1$s">add</a> or <a href="%2$s">import</a> a table to get started!', 'tablepress' ), $add_url, $import_url ); ?></p> | |
| 93 | + <p> | |
| 94 | + <?php | |
| 95 | + /* translators: %1$s: URL to add table page, %2$s: URL to import table page */ | |
| 96 | + printf( __( 'You should <a href="%1$s">add</a> or <a href="%2$s">import</a> a table to get started!', 'tablepress' ), $add_url, $import_url ); | |
| 97 | + ?> | |
| 98 | + </p> | |
| 94 | 99 | <?php |
| 95 | 100 | } |
| 96 | 101 | |
| 97 | 102 | /** |
| @@ -102,25 +107,20 @@ | ||
| 102 | 107 | * @param array<string, mixed> $data Data for this screen. |
| 103 | 108 | * @param array<string, mixed> $box Information about the meta box. |
| 104 | 109 | */ |
| 105 | 110 | public function postbox_export_form( array $data, array $box ): void { |
| 106 | - $script_data = array( | |
| 107 | - 'tables' => $this->admin_page->convert_to_json_parse_output( $data['tables'] ), | |
| 108 | - 'exportFormats' => $this->admin_page->convert_to_json_parse_output( $data['export_formats'] ), | |
| 109 | - 'csvDelimiters' => $this->admin_page->convert_to_json_parse_output( $data['csv_delimiters'] ), | |
| 110 | - 'zipSupportAvailable' => $this->admin_page->convert_to_json_parse_output( $data['zip_support_available'] ), | |
| 111 | - 'selectedTables' => $this->admin_page->convert_to_json_parse_output( $data['export_ids'] ), | |
| 112 | - 'exportFormat' => $this->admin_page->convert_to_json_parse_output( $data['export_format'] ), | |
| 113 | - 'csvDelimiter' => $this->admin_page->convert_to_json_parse_output( $data['csv_delimiter'] ), | |
| 111 | + $this->print_script_data_json( | |
| 112 | + 'export', | |
| 113 | + array( | |
| 114 | + 'tables' => $data['tables'], | |
| 115 | + 'exportFormats' => $data['export_formats'], | |
| 116 | + 'csvDelimiters' => $data['csv_delimiters'], | |
| 117 | + 'zipSupportAvailable' => $data['zip_support_available'], | |
| 118 | + 'selectedTables' => $data['export_ids'], | |
| 119 | + 'exportFormat' => $data['export_format'], | |
| 120 | + 'csvDelimiter' => $data['csv_delimiter'], | |
| 121 | + ), | |
| 114 | 122 | ); |
| 115 | - | |
| 116 | - echo "<script>\n"; | |
| 117 | - echo "window.tp = window.tp || {};\n"; | |
| 118 | - echo "tp.export = {};\n"; | |
| 119 | - foreach ( $script_data as $variable => $value ) { | |
| 120 | - echo "tp.export.{$variable} = {$value};\n"; | |
| 121 | - } | |
| 122 | - echo "</script>\n"; | |
| 123 | 123 | |
| 124 | 124 | echo '<div id="tablepress-export-screen"></div>'; |
| 125 | 125 | } |
| 126 | 126 | |