PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 2.0.13
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v2.0.13
5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 5.5.41 5.5.42 5.5.43 All 159 releases
wp-data-access / admin / class-wp-data-access-admin.php

class-wp-data-access-admin.php in WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards 2.0.13, at admin/class-wp-data-access-admin.php

743 lines 20.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Suppress "error - 0 - No summary was found for this file" on phpdoc generation
4 *
5 * @package plugin\admin
6 */
7
8 use WPDataAccess\Design_Table\WPDA_Design_Table_Model;
9 use WPDataAccess\List_Table\WPDA_List_View;
10 use WPDataAccess\Settings\WPDA_Settings;
11 use WPDataAccess\User_Menu\WPDA_User_Menu_Model;
12 use WPDataAccess\WPDA;
13 use WPDataAccess\Documentation\WPDA_Documentation;
14 use WPDataAccess\Backup\WPDA_Data_Export;
15
16 /**
17 * Class WP_Data_Access_Admin
18 *
19 * Defines admin specific functionality for plugin WP Data Access.
20 *
21 * @package plugin\admin
22 * @author Peter Schulz
23 * @since 1.0.0
24 */
25 class WP_Data_Access_Admin {
26
27 /**
28 * Menu slug for main page
29 */
30 const PAGE_MAIN = 'wpda';
31
32 /**
33 * Menu slug for setting page
34 */
35 const PAGE_SETTINGS = 'wpda_settings';
36
37 /**
38 * Menu slug for export import page
39 */
40 const PAGE_BACKUP = 'wpda_backup';
41
42 /**
43 * Menu slug for explorer page
44 */
45 const PAGE_EXPLORER = 'wpda_explorer';
46
47 /**
48 * Menu slug for designer page
49 */
50 const PAGE_DESIGNER = 'wpda_designer';
51
52 /**
53 * Menu slug for my tables page
54 */
55 const PAGE_MY_TABLES = 'wpda_my_tables';
56
57 /**
58 * Menu slug for help page
59 */
60 const PAGE_HELP = 'wpda_help';
61
62 /**
63 * Page hook suffix to Data Explorer page or false
64 *
65 * @var string|false
66 */
67 protected $wpda_data_explorer_menu;
68
69 /**
70 * Page hook suffix to Data Designer page or false
71 *
72 * @var string|false
73 */
74 protected $wpda_data_designer_menu;
75
76 /**
77 * Reference to list view for Data Explorer page
78 *
79 * @var WPDA_List_View
80 */
81 protected $wpda_data_explorer_view;
82
83 /**
84 * Reference to list view for Data Designer page
85 *
86 * @var WPDA_List_View
87 */
88 protected $wpda_data_designer_view;
89
90 /**
91 * Array of page hook suffixes to user defined sub menus
92 *
93 * @var array
94 */
95 protected $wpda_my_table_list_menu = [];
96
97 /**
98 * Array of list view for user defined sub menus
99 *
100 * @var array
101 */
102 protected $wpda_my_table_list_view = [];
103
104 /**
105 * Page hook suffix help page or false
106 *
107 * @var string|false
108 */
109 protected $wpda_help;
110
111 /**
112 * Main menu title (dynamically set to support translations)
113 *
114 * @var string
115 */
116 protected $title_menu_menu;
117
118 /**
119 * Data explorer sub menu title (dynamically set to support translations)
120 *
121 * @var string
122 */
123 protected $title_submenu_explorer;
124
125 /**
126 * Data designer sub menu title (dynamically set to support translations)
127 *
128 * @var string
129 */
130 protected $title_submenu_designer;
131
132 /**
133 * Settings page sub menu title (dynamically set to support translations)
134 *
135 * @var string
136 */
137 protected $title_submenu_settings;
138
139 /**
140 * Settings page sub menu title (dynamically set to support translations)
141 *
142 * @var string
143 */
144 protected $title_submenu_backup;
145
146 /**
147 * Menu slug or null
148 *
149 * @var null
150 */
151 protected $page = null;
152
153 /**
154 * My tables sub menu title (dynamically set to support translations)
155 *
156 * @var string
157 */
158 protected $title_menu_my_tables;
159
160 /**
161 * Help sub menu title (dynamically set to support translations)
162 *
163 * @var string
164 */
165 protected $title_submenu_help;
166
167 /**
168 * WP_Data_Access_Admin constructor
169 *
170 * @since 1.0.0
171 */
172 public function __construct() {
173
174 if ( isset( $_REQUEST['page'] ) ) {
175 $this->page = sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ); // input var okay.
176 }
177
178 }
179
180 /**
181 * Handle plugin cookies
182 *
183 * Cookies are use to remember values during navigation: (max 1 hour)
184 * 1) SCHEMA NAME
185 * The schema name is saved as a cookie when changed in the Data Explorer. As long as the user stays within the
186 * page the saved schema is used. When the user moves to another page the value is destroyed. The user gets the
187 * default value on the next visit.
188 * 2) FAVOURITE SELECTION
189 * The favourite selection is saved as cookie when changed in the Data Explorer. As long as the user stays within
190 * the page the saved selection is used. When the user moves to another page the value is destroyed. The user gets
191 * the default value on the next visit.
192 * 3) SEARCH ARGUMENT
193 * Search arguments are saved as cookies per table. As long as the user stays within the same page the saved
194 * search value is used. When the user moves to another page the value is destroyed. This allows users to navigate
195 * between pages without losing the search value.
196 *
197 * @since 1.6.0
198 */
199 public function handle_plugin_cookies() {
200 if ( $this->page === self::PAGE_MAIN ) {
201 // Handle Data Explorer cookies (search cookie is handled in next section).
202 // Handle cookie to remember active schema.
203 $cookie_name = self::PAGE_MAIN . '_schema_name';
204 if ( isset( $_REQUEST['wpda_main_db_schema'] ) && '' !== $_REQUEST['wpda_main_db_schema'] ) {
205 $requested_db_schema = sanitize_text_field( wp_unslash( $_REQUEST['wpda_main_db_schema'] ) ); // input var okay.
206 setcookie($cookie_name, $requested_db_schema, time() + 3600 );
207 } else {
208 // Check referer: clear cookie on new page request.
209 $url = parse_url( wp_get_referer() );
210 if ( isset( $url['query'] ) ) {
211 parse_str( $url['query'], $path );
212 if ( isset( $path['page'] ) ) {
213 $page = $path['page'];
214 if ( $this->page !== $page ) {
215 // New page request: reset cookie.
216 setcookie($cookie_name, '', time() - 3600 );
217 unset( $_COOKIE[ $cookie_name ] );
218 }
219 }
220 }
221 }
222
223 // Handle cookie to remember favourite selection.
224 $cookie_name = $this->page . '_favourites';
225 if ( isset( $_REQUEST['wpda_main_favourites'] ) ) {
226 $favourites = sanitize_text_field( wp_unslash( $_REQUEST['wpda_main_favourites'] ) ); // input var okay.
227 setcookie($cookie_name, $favourites, time() + 3600 );
228 } else {
229 // Check referer: clear cookie on new page request.
230 $url = parse_url( wp_get_referer() );
231 if ( isset( $url['query'] ) ) {
232 parse_str( $url['query'], $path );
233 if ( isset( $path['page'] ) ) {
234 $page = $path['page'];
235 if ( $this->page !== $page ) {
236 // New page request: reset cookie.
237 setcookie($cookie_name, '', time() - 3600 );
238 unset( $_COOKIE[ $cookie_name ] );
239 }
240 }
241 }
242 }
243 }
244
245 // Handle cookie for search value.
246 $table_name =
247 isset( $_REQUEST['table_name'] ) ?
248 sanitize_text_field( wp_unslash( $_REQUEST['table_name'] ) ) :
249 \WPDataAccess\List_Table\WPDA_List_Table::LIST_BASE_TABLE; // input var okay.
250 $cookie_name = $this->page . '_search_' . str_replace( '.', '_', $table_name );
251 if ( isset( $_REQUEST['s'] ) ) { // input var okay.
252 $search_argument = sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ); // input var okay.
253 if ( '' !== $search_argument ) {
254 setcookie( $cookie_name, $search_argument, time() + 3600 );
255 } else {
256 setcookie( $cookie_name, '', time() - 3600 );
257 unset( $_COOKIE[ $cookie_name ] );
258 }
259 } else {
260 // Check referer: clear cookie on new page request.
261 $url = parse_url( wp_get_referer() );
262 if ( isset( $url['query'] ) ) {
263 parse_str( $url['query'], $path );
264 if ( isset( $path['page'] ) ) {
265 $page = $path['page'];
266 if ( $this->page !== $page ) {
267 // New page request: reset cookie and all cookies for subpages.
268 foreach ( $_COOKIE as $key => $value ) {
269 if ( $this->page . '_search_' === substr( $key, 0, strlen( $this->page . '_search_' ) ) ) {
270 setcookie( $key, '', time() - 3600 );
271 unset( $_COOKIE[ $key ] );
272 }
273 }
274 }
275 }
276 }
277 }
278
279 }
280
281 /**
282 * Add stylesheets to back-end
283 *
284 * The following stylesheets are added:
285 * + Plugin stylesheet
286 * + Visual editor stylesheet
287 *
288 * The plugin stylesheet is used to style the setting forms {@see WPDA_Settings}, simple forms
289 * {@see \WPDataAccess\Simple_Form\WPDA_Simple_Form} and the user menu edit form
290 * {@see \WPDataAccess\User_Menu\WPDA_User_Menu_Form}. The visual editor stysheets is used to style
291 * the plugin button in the visual editor {@see WP_Data_Access_Public}.
292 *
293 * @since 1.0.0
294 *
295 * @see WPDA_Settings
296 * @see \WPDataAccess\Simple_Form\WPDA_Simple_Form
297 * @see \WPDataAccess\User_Menu\WPDA_User_Menu_Form
298 * @see WP_Data_Access_Public
299 */
300 public function enqueue_styles() {
301
302 // WPDataAccess CSS.
303 wp_register_style(
304 'wpdataaccess',
305 plugins_url( '../assets/css/wpda_style.css', __FILE__ ),
306 [],
307 WPDA::get_option( WPDA::OPTION_WPDA_VERSION )
308 );
309 wp_enqueue_style( 'wpdataaccess' );
310
311 // Add style for shortcode button in editor toolbar.
312 wp_register_style(
313 'wpda_shortcode_button_css',
314 plugins_url( '../assets/css/wpda_shortcode_button.css', __FILE__ ),
315 [],
316 WPDA::get_option( WPDA::OPTION_WPDA_VERSION )
317 );
318 wp_enqueue_style( 'wpda_shortcode_button_css' );
319
320 wp_enqueue_style( 'wp-jquery-ui-core' );
321 wp_enqueue_style( 'wp-jquery-ui-dialog' );
322 wp_enqueue_style( 'wp-jquery-ui-tabs' );
323
324 // Add WP Data Projects stylesheet.
325 wp_register_style(
326 'wpdataprojects',
327 plugins_url( '../WPDataProjects/assets/css/wpdp_style.css', __FILE__ ),
328 [],
329 WPDA::get_option( WPDA::OPTION_WPDA_VERSION )
330 );
331 wp_enqueue_style( 'wpdataprojects' );
332
333 }
334
335 /**
336 * Add scripts to back-end
337 *
338 * Adds jquery ui to the back-end which is used to build the shortcode button functionality
339 * {@see WP_Data_Access_Public}.
340 *
341 * @since 1.0.0
342 *
343 * @see WP_Data_Access_Public
344 */
345 public function enqueue_scripts() {
346
347 wp_enqueue_script( 'jquery-ui-core' );
348 wp_enqueue_script( 'jquery-ui-dialog' );
349 wp_enqueue_script( 'jquery-ui-tabs' );
350
351 // Register purl external library.
352 wp_register_script(
353 'purl',
354 plugins_url( '../assets/js/purl.js', __FILE__ ) ,
355 [],
356 WPDA::get_option( WPDA::OPTION_WPDA_VERSION )
357 );
358 wp_enqueue_script( 'purl' );
359
360 // Register clipboard.js external library.
361 wp_register_script(
362 'clipboard',
363 plugins_url( '../assets/js/clipboard.min.js', __FILE__ ) ,
364 [],
365 WPDA::get_option( WPDA::OPTION_WPDA_VERSION )
366 );
367 wp_enqueue_script( 'clipboard' );
368
369 // Register wpda admin functions.
370 wp_register_script(
371 'wpda_admin_scripts',
372 plugins_url('../assets/js/wpda_admin.js', __FILE__ ),
373 [],
374 WPDA::get_option( WPDA::OPTION_WPDA_VERSION )
375 );
376 wp_enqueue_script( 'wpda_admin_scripts' );
377
378 // Add WP Data Projects JS functions.
379 wp_register_script(
380 'wpdataprojects',
381 plugins_url('../WPDataProjects/assets/js/wpdp_admin.js', __FILE__ ),
382 [],
383 WPDA::get_option( WPDA::OPTION_WPDA_VERSION )
384 );
385 wp_enqueue_script( 'wpdataprojects' );
386
387 }
388
389 /**
390 * Available tables for front-end
391 *
392 * Generates javascript code to support dynamic requests for tables that can be viewed on the front-end. The list
393 * of available tables is requested via ajax call 'wpda_tinymce_listbox_tables' in
394 * {@see WP_Data_Access::define_public_hooks()}.
395 *
396 * @since 1.0.0
397 *
398 * @see WP_Data_Access::define_public_hooks()
399 */
400 public function tinymce_listboxes_get_tables() {
401
402 if ( get_user_option( 'rich_editing' ) === 'true' &&
403 current_user_can( 'edit_posts' ) &&
404 current_user_can( 'edit_pages' )
405 ) {
406
407 // TinyMCE add table list to listbox.
408 ?>
409
410 <script type="text/javascript">
411 jQuery(document).ready(function (jQuery) {
412 var wpda_data = {
413 'action': 'wpda_tinymce_listbox_tables'
414 };
415 // Load table listbox.
416 jQuery.post(ajaxurl, wpda_data, function (response) {
417 if (typeof(tinyMCE) != 'undefined') {
418 if (tinyMCE.activeEditor != null) {
419 tinyMCE.activeEditor.settings.wpda_table_list = response;
420 }
421 }
422 });
423 });
424 </script>
425
426 <?php
427
428 }
429
430 }
431
432 /**
433 * Add plugin menu and sub menus
434 *
435 * Adds the following menu and sub menus to the back-end menu:
436 * + WP Data Access
437 * + Data Explorer
438 * + Data Designer
439 * + Data Projects
440 * + Manage Plugin
441 * + Plugin Help
442 *
443 * Menu titles are dynamically set in {@see WP_Data_Access_Admin::set_menu_titles()} to support translations.
444 *
445 * @since 1.0.0
446 *
447 * @see WP_Data_Access_Admin::set_menu_titles()
448 */
449 public function add_menu_items() {
450
451 global $wpdb;
452
453 if ( current_user_can( 'manage_options' ) ) {
454
455 // Dynamically set menu titles.
456 $this->set_menu_titles();
457
458 // Specific list tables (and forms) can be made available for specific capabilities:
459 // managed in method add_menu_my_tables.
460 // Main menu and items are only available to admin users (set capability to 'manage_options').
461 add_menu_page(
462 $this->title_menu_menu,
463 $this->title_menu_menu,
464 'manage_options',
465 self::PAGE_MAIN,
466 null,
467 'dashicons-editor-table',
468 999999999
469 );
470
471 // Add data explorer to WPDA menu.
472 $this->wpda_data_explorer_menu = add_submenu_page(
473 self::PAGE_MAIN,
474 $this->title_menu_menu,
475 $this->title_submenu_explorer,
476 'manage_options',
477 self::PAGE_MAIN,
478 [ $this, 'data_explorer_page' ]
479 );
480 $this->wpda_data_explorer_view = new WPDA_List_View(
481 [
482 'page_hook_suffix' => $this->wpda_data_explorer_menu,
483 ]
484 );
485
486 if ( WPDA_Design_Table_Model::table_table_design_exists() ) {
487 // Add data designer to WPDA menu.
488 $this->wpda_data_designer_menu = add_submenu_page(
489 self::PAGE_MAIN,
490 $this->title_menu_menu,
491 $this->title_submenu_designer,
492 'manage_options',
493 self::PAGE_DESIGNER,
494 [ $this, 'data_designer_page' ]
495 );
496 $this->wpda_data_designer_view = new WPDA_List_View(
497 [
498 'page_hook_suffix' => $this->wpda_data_designer_menu,
499 'table_name' => $wpdb->prefix . WPDA::get_option( WPDA::OPTION_WPDA_PREFIX ) . 'table_design',
500 'list_table_class' => 'WPDataAccess\\Design_Table\\WPDA_Design_Table_List_Table',
501 'edit_form_class' => 'WPDataAccess\\Design_Table\\WPDA_Design_Table_Form',
502 'subtitle' => '',
503 ]
504 );
505 }
506
507 // Add Data Projects menu.
508 $wpdp = new \WPDataProjects\WPDP();
509 $wpdp->add_menu_items();
510
511 // Add plugin export import page to WPDA menu.
512 add_submenu_page(
513 self::PAGE_MAIN,
514 $this->title_menu_menu,
515 $this->title_submenu_backup,
516 'manage_options',
517 self::PAGE_BACKUP,
518 [ $this, 'backup_page' ]
519 );
520
521 // Add plugin settings page to WPDA menu.
522 add_submenu_page(
523 self::PAGE_MAIN,
524 $this->title_menu_menu,
525 $this->title_submenu_settings,
526 'manage_options',
527 self::PAGE_SETTINGS,
528 [ $this, 'settings_page' ]
529 );
530
531 // Add plugin help page to WPDA menu.
532 add_submenu_page(
533 self::PAGE_MAIN,
534 $this->title_menu_menu,
535 $this->title_submenu_help,
536 'manage_options',
537 self::PAGE_HELP,
538 [ $this, 'help_page' ]
539 );
540 }
541
542 // Add Data Projects menu.
543 $wpdp = new \WPDataProjects\WPDP();
544 $wpdp->add_projects();
545
546 }
547
548 /**
549 * Dynamically set menu titles
550 *
551 * Dynamically set menu titles to support translations.
552 *
553 * @since 1.0.0
554 */
555 protected function set_menu_titles() {
556
557 $this->title_menu_menu = __( 'WP Data Access', 'wp-data-access' );
558 $this->title_submenu_explorer = __( 'Data Explorer', 'wp-data-access' );
559 $this->title_submenu_designer = __( 'Data Designer', 'wp-data-access' );
560 $this->title_submenu_backup = __( 'Data Backup', 'wp-data-access' );
561 $this->title_submenu_settings = __( 'Manage Plugin', 'wp-data-access' );
562 $this->title_submenu_help = __( 'Plugin Help', 'wp-data-access' );
563 $this->title_menu_my_tables = __( 'WP Data Tables', 'wp-data-access' );
564
565 }
566
567 /**
568 * Show data explorer
569 *
570 * Initialization of $this->wpda_data_explorer_view is done earlier in
571 * {@see WP_Data_Access_Admin::add_menu_items()} to support screen options. This method just shows the page
572 * containing the list table.
573 *
574 * @since 1.0.0
575 *
576 * @see WP_Data_Access_Admin::add_menu_items()
577 */
578 public function data_explorer_page() {
579
580 $this->wpda_data_explorer_view->show();
581
582 }
583
584 /**
585 * Show data designer
586 *
587 * Initialization of $this->wpda_data_designer_view is done earlier in
588 * {@see WP_Data_Access_Admin::add_menu_items()} to support screen options. This method just shows the page
589 * containing the list table.
590 *
591 * @since 1.0.0
592 *
593 * @see WP_Data_Access_Admin::add_menu_items()
594 */
595 public function data_designer_page() {
596
597 $this->wpda_data_designer_view->show();
598
599 }
600
601 /**
602 * Calls a page to create automatic backups (in fact data exports) and offers possibilities to restore (in fact
603 * data imports).
604 *
605 * @since 2.0.6
606 *
607 * @see WPDA_Data_Export::show_wp_cron()
608 */
609 public function backup_page() {
610
611 $wpda_backup = new WPDA_Data_Export();
612 if ( isset( $_REQUEST['action'] ) ) {
613 $action = sanitize_text_field( wp_unslash( $_REQUEST['action'] ) ); // input var okay.
614 if ( 'new' === $action ) {
615 $wpda_backup->create_export( 'add' );
616 } elseif ( 'add' === $action ) {
617 $wpda_backup->wpda_add_cron_job();
618 } elseif ( 'remove' === $action ) {
619 $wpda_backup->wpda_remove_cron_job();
620 } elseif ( 'edit' === $action ) {
621 $wpda_backup->create_export( 'update' );
622 } elseif ( 'update' === $action ) {
623 $wpda_backup->wpda_update_cron_job();
624 }
625 } else {
626 $wpda_backup->show_wp_cron();
627 }
628
629 }
630
631 /**
632 * Show setting pages
633 *
634 * @since 1.0.0
635 *
636 * @see WPDA_Settings::show()
637 */
638 public function settings_page() {
639
640 $wpda_settings = new WPDA_Settings();
641 $wpda_settings->show();
642
643 }
644
645 /**
646 * Show help page
647 *
648 * @since 2.0.0
649 */
650 public function help_page() {
651
652 $wpda_documentation = new WPDA_Documentation();
653 $wpda_documentation->show();
654
655 }
656
657 /**
658 * Add user defined sub menu
659 *
660 * WPDA allows users to create sub menu for table lists and simple forms. Sub menus can be added to the WPDA
661 * menu or any other (external) menu. A sub menu is added to an external menu via the menu slug. Sub menus are
662 * taken from {@see WPDA_User_Menu_Model}.
663 *
664 * This method is called from the admin_menu action with a lower priority to make sure other menus are available.
665 * User defined menu items are added to avalable menus in this method. These can be WPDA menus or external menus
666 * as mentioned in the according list table and edit form. WPDA menus are added to menu WP Data Tables. External
667 * menus are added to the menu having the menu slug defined by the user.
668 *
669 * This method does not actually show the list tables! It just creates the menu items. When the user clicks on such
670 * a dynamiccally defined menu item, method {@see WP_Data_Access_Admin::my_tables_page()} is called, which takes
671 * care of showing the list table.
672 *
673 * @since 1.0.0
674 *
675 * @see WP_Data_Access_Admin::my_tables_page()
676 * @see WPDA_User_Menu_Model
677 */
678 public function add_menu_my_tables() {
679
680 // Dynamically set menu titles.
681 $this->set_menu_titles();
682
683 $menus_shown_to_current_user = [];
684
685 // Add list tables to external menus.
686 foreach ( WPDA_User_Menu_Model::list_external_menus() as $menu ) {
687 if ( current_user_can( $menu->menu_capability ) ) {
688 if ( ! isset( $menus_shown_to_current_user[ $menu->menu_slug . '/' . $menu->menu_name . '/' . $menu->menu_table_name ] ) ) {
689 $menu_slug = self::PAGE_EXPLORER . '_' . $menu->menu_table_name;
690
691 $this->wpda_my_table_list_menu[ $menu->menu_table_name ] =
692 add_submenu_page(
693 $menu->menu_slug,
694 $this->title_menu_menu . ' : ' . strtoupper( $menu->menu_table_name ),
695 $menu->menu_name,
696 $menu->menu_capability,
697 $menu_slug,
698 [ $this, 'my_tables_page' ]
699 );
700
701 $this->wpda_my_table_list_view[ $menu->menu_table_name ] =
702 new WPDA_List_View(
703 [
704 'page_hook_suffix' => $this->wpda_my_table_list_menu[ $menu->menu_table_name ],
705 'table_name' => $menu->menu_table_name,
706 ]
707 );
708
709 $menus_shown_to_current_user[ $menu->menu_slug . '/' . $menu->menu_name . '/' . $menu->menu_table_name ] = true;
710 }
711 }
712 }
713
714 }
715
716 /**
717 * Show user defined menus
718 *
719 * A user defined menu that are added to the plugin menu in {@see WP_Data_Access_Admin::add_menu_my_tables()} is
720 * shown here. This method is called when the user clicks on the menu item generated in
721 * {@see WP_Data_Access_Admin::add_menu_my_tables()}.
722 *
723 * @since 1.0.0
724 *
725 * @see WP_Data_Access_Admin::add_menu_my_tables()
726 */
727 public function my_tables_page() {
728
729 // Grab table name from menu slug.
730 if ( null !== $this->page ) {
731 if ( strpos( $this->page, self::PAGE_EXPLORER ) !== false ) {
732 $table = substr( $this->page, strlen( self::PAGE_EXPLORER . '_' ) );
733 } else {
734 $table = substr( $this->page, strlen( self::PAGE_MY_TABLES . '_' ) );
735 }
736 // Show list table.
737 $this->wpda_my_table_list_view[ $table ]->show();
738 }
739
740 }
741
742 }
743