PluginProbe
TablePress – Tables in WordPress made easy / 3.2
TablePress – Tables in WordPress made easy v3.2
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 2.4.4 All 44 releases
← All changes | views/view-export.php +19 -18 2.23.2 View file →
@@ -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 );
@@ -68,9 +69,9 @@
68 69 </p>
69 70 <p>
70 71 <?php _e( 'To export, select the tables and the desired export format.', 'tablepress' ); ?>
71 72 <?php _e( 'If you choose more than one table, the exported files will automatically be stored in a ZIP archive file.', 'tablepress' ); ?>
72 - <br />
73 + <br>
73 74 <?php _e( 'Be aware that for the CSV and HTML formats only the table data, but no table options are exported!', 'tablepress' ); ?>
74 75 <?php _e( 'For the JSON format, the table data and the table options are exported.', 'tablepress' ); ?>
75 76 </p>
76 77 <?php
@@ -88,9 +89,14 @@
88 89 $add_url = TablePress::url( array( 'action' => 'add' ) );
89 90 $import_url = TablePress::url( array( 'action' => 'import' ) );
90 91 ?>
91 92 <p><?php _e( 'No tables found.', 'tablepress' ); ?></p>
92 - <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>
93 99 <?php
94 100 }
95 101
96 102 /**
@@ -101,25 +107,20 @@
101 107 * @param array<string, mixed> $data Data for this screen.
102 108 * @param array<string, mixed> $box Information about the meta box.
103 109 */
104 110 public function postbox_export_form( array $data, array $box ): void {
105 - $script_data = array(
106 - 'tables' => $this->admin_page->convert_to_json_parse_output( $data['tables'] ),
107 - 'exportFormats' => $this->admin_page->convert_to_json_parse_output( $data['export_formats'] ),
108 - 'csvDelimiters' => $this->admin_page->convert_to_json_parse_output( $data['csv_delimiters'] ),
109 - 'zipSupportAvailable' => $this->admin_page->convert_to_json_parse_output( $data['zip_support_available'] ),
110 - 'selectedTables' => $this->admin_page->convert_to_json_parse_output( $data['export_ids'] ),
111 - 'exportFormat' => $this->admin_page->convert_to_json_parse_output( $data['export_format'] ),
112 - '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 + ),
113 122 );
114 -
115 - echo "<script>\n";
116 - echo "window.tp = window.tp || {};\n";
117 - echo "tp.export = {};\n";
118 - foreach ( $script_data as $variable => $value ) {
119 - echo "tp.export.{$variable} = {$value};\n";
120 - }
121 - echo "</script>\n";
122 123
123 124 echo '<div id="tablepress-export-screen"></div>';
124 125 }
125 126