Class WP_Data_Access_Admin

Defines admin specific functionality for plugin WP Data Access.

author Peter Schulz
since 1.0.0
package plugin\admin

 Methods

WP_Data_Access_Admin constructor

__construct() 
since 1.0.0

Add plugin menu and sub menus

add_menu_items() 

Adds the following menu and sub menus to the back-end menu:

  • WP Data Access
    • Data Explorer
    • Data Designer
    • Data Projects
    • Manage Plugin

Menu titles are dynamically set in \WP_Data_Access_Admin::set_menu_titles() to support translations.

since 1.0.0
see \WP_Data_Access_Admin::set_menu_titles()

Add user defined sub menu

add_menu_my_tables() 

WPDA allows users to create sub menu for table lists and simple forms. Sub menus can be added to the WPDA menu or any other (external) menu. A sub menu is added to an external menu via the menu slug. Sub menus are taken from \WPDataAccess\Plugin_Table_Models\WPDA_User_Menus_Model.

This method is called from the admin_menu action with a lower priority to make sure other menus are available. User defined menu items are added to avalable menus in this method. These can be WPDA menus or external menus as mentioned in the according list table and edit form. WPDA menus are added to menu WP Data Tables. External menus are added to the menu having the menu slug defined by the user.

This method does not actually show the list tables! It just creates the menu items. When the user clicks on such a dynamiccally defined menu item, method \WP_Data_Access_Admin::my_tables_page() is called, which takes care of showing the list table.

since 1.0.0
see \WP_Data_Access_Admin::my_tables_page()
see \WPDataAccess\Plugin_Table_Models\WPDA_User_Menus_Model

Show data backup main page

backup_page() 

Calls a page to create automatic backups (in fact data exports) and offers possibilities to restore (in fact data imports).

since 2.0.6
see \WPDataAccess\Backup\WPDA_Data_Export::show_wp_cron()

Show data designer main page

data_designer_page() 

Initialization of $this->wpda_data_designer_view is done earlier in \WP_Data_Access_Admin::add_menu_items() to support screen options. This method just shows the page containing the list table.

since 1.0.0
see \WP_Data_Access_Admin::add_menu_items()

Data Designer repository table not found

data_designer_page_not_found() 

Show data explorer main page

data_explorer_page() 

Initialization of $this->wpda_data_explorer_view is done earlier in \WP_Data_Access_Admin::add_menu_items() to support screen options. This method just shows the page containing the list table.

since 1.0.0
see \WP_Data_Access_Admin::add_menu_items()

Show data publisher main page

data_publisher_page() 

Data Publisher repository table not found

data_publisher_page_not_found() 

Add scripts to back-end

enqueue_scripts() 
since 1.0.0
see \WP_Data_Access_Public

Add stylesheets to back-end

enqueue_styles() 

The following stylesheets are added:

  • Plugin stylesheet
  • Visual editor stylesheet

The plugin stylesheet is used to style the setting forms \WPDataAccess\Settings\WPDA_Settings, simple forms \WPDataAccess\Simple_Form\WPDA_Simple_Form.

since 1.0.0
see \WPDataAccess\Settings\WPDA_Settings
see \WPDataAccess\Simple_Form\WPDA_Simple_Form
see \WP_Data_Access_Public

import_csv()

import_csv() 

Show user defined menus

my_tables_page() 

A user defined menu that are added to the plugin menu in \WP_Data_Access_Admin::add_menu_my_tables() is shown here. This method is called when the user clicks on the menu item generated in \WP_Data_Access_Admin::add_menu_my_tables().

since 1.0.0
see \WP_Data_Access_Admin::add_menu_my_tables()

add_data_projects()

add_data_projects() 

grant_access_to_data_publications()

grant_access_to_data_publications() 

Dynamically set menu titles

set_menu_titles() 

Dynamically set menu titles to support translations.

since 1.0.0

 Properties

 

Menu slug or null

$page : null

Default

null
 

Main menu title (dynamically set to support translations)

$title_menu_menu : string

Default

 

Addons sub menu title (dynamically set to support translations)

$title_submenu_addons : string

Default

 

Data designer sub menu title (dynamically set to support translations)

$title_submenu_designer : string

Default

 

Data explorer sub menu title (dynamically set to support translations)

$title_submenu_explorer : string

Default

 

Data Publisher sub menu title (dynamically set to support translations)

$title_submenu_publisher : string

Default

 

Page hook suffix to Data Designer page or false

$wpda_data_designer_menu : string | false

Default

 

Reference to list view for Data Designer page

$wpda_data_designer_view : \WPDataAccess\List_Table\WPDA_List_View

Default

 

Page hook suffix to Data Explorer page or false

$wpda_data_explorer_menu : string | false

Default

 

Reference to list view for Data Explorer page

$wpda_data_explorer_view : \WPDataAccess\List_Table\WPDA_List_View

Default

 

Page hook suffix to Data Publisher page or false

$wpda_data_publisher_menu : string | false

Default

 

Reference to list view for Data Publisher page

$wpda_data_publisher_view : \WPDataAccess\List_Table\WPDA_List_View

Default

 

Page hook suffix help page or false

$wpda_help : string | false

Default

 

Array of page hook suffixes to user defined sub menus

$wpda_my_table_list_menu : array

Default

array()
 

Array of list view for user defined sub menus

$wpda_my_table_list_view : array

Default

array()

 Constants

 

Menu slug for designer page

PAGE_ADDONS = 'wpda_addons' 
 

Menu slug for designer page

PAGE_DESIGNER = 'wpda_designer' 
 

Menu slug for explorer page

PAGE_EXPLORER = 'wpda_explorer' 
 

Menu slug for main page

PAGE_MAIN = 'wpda' 
 

Menu slug for my tables page

PAGE_MY_TABLES = 'wpda_my_tables' 
 

Menu slug for main page

PAGE_PUBLISHER = 'wpda_publisher' 
 

Menu slug for setting page

PAGE_SETTINGS = 'wpda_settings'