| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Suppress "error - 0 - No summary was found for this file" on phpdoc generation |
| 5 |
* |
| 6 |
* @package plugin\includes |
| 7 |
*/ |
| 8 |
use WPDataAccess\Connection\WPDADB ; |
| 9 |
use WPDataAccess\Cookies\WPDA_Cookies ; |
| 10 |
use WPDataAccess\Data_Dictionary\WPDA_Dictionary_Lists ; |
| 11 |
use WPDataAccess\Data_Tables\WPDA_Data_Tables ; |
| 12 |
use WPDataAccess\Utilities\WPDA_Table_Actions ; |
| 13 |
use WPDataAccess\Utilities\WPDA_Export ; |
| 14 |
use WPDataAccess\Utilities\WPDA_Favourites ; |
| 15 |
use WPDataAccess\WPDA ; |
| 16 |
use WPDataProjects\Utilities\WPDP_Export_Project ; |
| 17 |
use WPDataAccess\Backup\WPDA_Data_Export ; |
| 18 |
use WPDataAccess\Plugin_Table_Models\WPDA_CSV_Uploads_Model ; |
| 19 |
use WPDataRoles\WPDA_Roles ; |
| 20 |
use WPDataAccess\Utilities\WPDA_Autocomplete ; |
| 21 |
use WPDataAccess\Premium\WPDAPRO_Geo_Location\WPDAPRO_Geo_Location_WS ; |
| 22 |
use WPDataAccess\Premium\WPDAPRO_Geo_Location\WPDAPRO_Geo_Location ; |
| 23 |
use WPDataAccess\Query_Builder\WPDA_Query_Builder ; |
| 24 |
use WPDataAccess\Dashboard\WPDA_Dashboard ; |
| 25 |
use WPDataAccess\Dashboard\WPDA_Widget_Code ; |
| 26 |
use WPDataAccess\Dashboard\WPDA_Widget_Publication ; |
| 27 |
use WPDataAccess\Dashboard\WPDA_Widget_Dbms ; |
| 28 |
use WPDataAccess\Dashboard\WPDA_Widget_Google_Chart ; |
| 29 |
use WPDataAccess\Premium\WPDAPRO_Dashboard\WPDAPRO_Widget_Project ; |
| 30 |
/** |
| 31 |
* Class WP_Data_Access |
| 32 |
* |
| 33 |
* Core plugin class used to define: |
| 34 |
* + admin specific functionality {@see WP_Data_Access_Admin} |
| 35 |
* + public specific functionality {@see WP_Data_Access_Public} |
| 36 |
* + internationalization {@see WP_Data_Access_I18n} |
| 37 |
* + plugin activation and deactivation {@see WP_Data_Access_Loader} |
| 38 |
* |
| 39 |
* @author Peter Schulz |
| 40 |
* @since 1.0.0 |
| 41 |
* |
| 42 |
* @see WP_Data_Access_Admin |
| 43 |
* @see WP_Data_Access_Public |
| 44 |
* @see WP_Data_Access_I18n |
| 45 |
* @see WP_Data_Access_Loader |
| 46 |
*/ |
| 47 |
class WP_Data_Access |
| 48 |
{ |
| 49 |
/** |
| 50 |
* Reference to plugin loader |
| 51 |
* |
| 52 |
* @var WP_Data_Access_Loader |
| 53 |
* |
| 54 |
* @since 1.0.0 |
| 55 |
* |
| 56 |
* @see WP_Data_Access_Loader |
| 57 |
*/ |
| 58 |
protected $loader ; |
| 59 |
/** |
| 60 |
* Menu slug or null |
| 61 |
* |
| 62 |
* @var null |
| 63 |
*/ |
| 64 |
protected $page = null ; |
| 65 |
/** |
| 66 |
* WP_Data_Access constructor |
| 67 |
* |
| 68 |
* Calls method the following methods to setup plugin: |
| 69 |
* + {@see WP_Data_Access::load_dependencies()} |
| 70 |
* + {@see WP_Data_Access::set_locale()} |
| 71 |
* + {@see WP_Data_Access::define_admin_hooks()} |
| 72 |
* + {@see WP_Data_Access::define_public_hooks()} |
| 73 |
* |
| 74 |
* @since 1.0.0 |
| 75 |
* |
| 76 |
* @see WP_Data_Access::load_dependencies() |
| 77 |
* @see WP_Data_Access::set_locale() |
| 78 |
* @see WP_Data_Access::define_admin_hooks() |
| 79 |
* @see WP_Data_Access::define_public_hooks() |
| 80 |
*/ |
| 81 |
public function __construct() |
| 82 |
{ |
| 83 |
|
| 84 |
if ( isset( $_REQUEST['page'] ) ) { |
| 85 |
// phpcs:ignore WordPress.Security.NonceVerification |
| 86 |
$this->page = sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ); |
| 87 |
// phpcs:ignore WordPress.Security.NonceVerification |
| 88 |
} |
| 89 |
|
| 90 |
$this->load_dependencies(); |
| 91 |
$this->set_locale(); |
| 92 |
$this->define_admin_hooks(); |
| 93 |
$this->define_public_hooks(); |
| 94 |
// WP Data Access REST API. |
| 95 |
$this->api(); |
| 96 |
} |
| 97 |
|
| 98 |
/** |
| 99 |
* Add WP Data Access JSON REST API |
| 100 |
* |
| 101 |
* @return void |
| 102 |
*/ |
| 103 |
private function api() |
| 104 |
{ |
| 105 |
$api = new \WPDataAccess\API\WPDA_API(); |
| 106 |
$this->loader->add_action( 'rest_api_init', $api, 'init' ); |
| 107 |
} |
| 108 |
|
| 109 |
/** |
| 110 |
* Load required dependencies |
| 111 |
* |
| 112 |
* Loads required plugin files and initiates the plugin loader. |
| 113 |
* |
| 114 |
* @since 1.0.0 |
| 115 |
* |
| 116 |
* @see WP_Data_Access_Loader |
| 117 |
*/ |
| 118 |
private function load_dependencies() |
| 119 |
{ |
| 120 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wp-data-access-loader.php'; |
| 121 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wp-data-access-i18n.php'; |
| 122 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wp-data-access-admin.php'; |
| 123 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wp-data-access-public.php'; |
| 124 |
$this->loader = new WP_Data_Access_Loader(); |
| 125 |
} |
| 126 |
|
| 127 |
/** |
| 128 |
* Set locale for internationalization |
| 129 |
* |
| 130 |
* @since 1.0.0 |
| 131 |
* |
| 132 |
* @see WP_Data_Access_I18n |
| 133 |
*/ |
| 134 |
private function set_locale() |
| 135 |
{ |
| 136 |
$wpda_i18n = new WP_Data_Access_I18n(); |
| 137 |
$this->loader->add_action( 'init', $wpda_i18n, 'load_plugin_textdomain' ); |
| 138 |
} |
| 139 |
|
| 140 |
/** |
| 141 |
* Add admin hooks |
| 142 |
* |
| 143 |
* Initiates {@see WP_Data_Access_Admin} (admin functionality) and {@see WPDA_Export} (export functionality). |
| 144 |
* Adds the appropriate actions to the loader. |
| 145 |
* |
| 146 |
* @since 1.0.0 |
| 147 |
* |
| 148 |
* @see WP_Data_Access_Admin |
| 149 |
* @see WPDA_Export |
| 150 |
*/ |
| 151 |
private function define_admin_hooks() |
| 152 |
{ |
| 153 |
$plugin_admin = new WP_Data_Access_Admin(); |
| 154 |
|
| 155 |
if ( WPDA::is_plugin_page( $this->page ) ) { |
| 156 |
// Handle plugin cookies. |
| 157 |
$wpda_cookies = new WPDA_Cookies(); |
| 158 |
$this->loader->add_action( 'admin_init', $wpda_cookies, 'handle_plugin_cookies' ); |
| 159 |
} |
| 160 |
|
| 161 |
// Admin menu. |
| 162 |
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_menu_items' ); |
| 163 |
$this->loader->add_action( |
| 164 |
'admin_menu', |
| 165 |
$plugin_admin, |
| 166 |
'add_menu_my_tables', |
| 167 |
11 |
| 168 |
); |
| 169 |
$this->loader->add_filter( 'submenu_file', $plugin_admin, 'wpda_submenu_filter' ); |
| 170 |
// Admin scripts. |
| 171 |
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
| 172 |
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
| 173 |
$this->loader->add_action( 'in_admin_header', $plugin_admin, 'user_admin_notices' ); |
| 174 |
$this->loader->add_action( 'admin_head', $plugin_admin, 'remove_icons' ); |
| 175 |
// Add settings page. |
| 176 |
$this->loader->add_action( 'admin_menu', $this, 'wpdataaccess_register_settings_page' ); |
| 177 |
// Query Builder. |
| 178 |
$query_builder = new WPDA_Query_Builder(); |
| 179 |
$this->loader->add_action( 'admin_action_wpda_query_builder_execute_sql', $query_builder, 'execute' ); |
| 180 |
$this->loader->add_action( 'admin_action_wpda_query_builder_save_sql', $query_builder, 'save' ); |
| 181 |
$this->loader->add_action( 'admin_action_wpda_query_builder_open_sql', $query_builder, 'open' ); |
| 182 |
$this->loader->add_action( 'admin_action_wpda_query_builder_delete_sql', $query_builder, 'delete' ); |
| 183 |
$this->loader->add_action( 'admin_action_wpda_query_builder_get_db_hints', $query_builder, 'get_db_hints' ); |
| 184 |
$this->loader->add_action( 'admin_action_wpda_query_builder_set_db_hints', $query_builder, 'set_db_hints' ); |
| 185 |
$this->loader->add_action( 'admin_action_wpda_query_builder_get_vqb', $query_builder, 'get_visual_query' ); |
| 186 |
// Export action. |
| 187 |
$this->loader->add_action( 'admin_action_wpda_export', WPDA_Export::class, 'export' ); |
| 188 |
// Dashboard and widgets. |
| 189 |
$this->loader->add_action( 'wp_ajax_wpda_save_dashboard', WPDA_Dashboard::class, 'save' ); |
| 190 |
$this->loader->add_action( 'wp_ajax_wpda_dashboard_list', WPDA_Dashboard::class, 'get_list' ); |
| 191 |
$this->loader->add_action( 'wp_ajax_wpda_widget_load_panel', WPDA_Dashboard::class, 'load_widget' ); |
| 192 |
$this->loader->add_action( 'wp_ajax_wpda_widget_delete', WPDA_Dashboard::class, 'delete_widget' ); |
| 193 |
$this->loader->add_action( 'wp_ajax_wpda_widget_code_add', WPDA_Widget_Code::class, 'ajax_widget' ); |
| 194 |
$this->loader->add_action( 'wp_ajax_wpda_widget_dbms_add', WPDA_Widget_Dbms::class, 'ajax_widget' ); |
| 195 |
$this->loader->add_action( 'wp_ajax_wpda_widget_dbms_refresh', WPDA_Widget_Dbms::class, 'ajax_refresh' ); |
| 196 |
$this->loader->add_action( 'wp_ajax_wpda_remove_new_dashboard_message', WPDA_Dashboard::class, 'remove_new_dashboard_message' ); |
| 197 |
$this->loader->add_action( 'wp_ajax_wpda_widget_pub_add', WPDA_Widget_Publication::class, 'ajax_widget' ); |
| 198 |
$this->loader->add_action( 'wp_ajax_wpda_widget_chart_add', WPDA_Widget_Google_Chart::class, 'ajax_widget' ); |
| 199 |
$this->loader->add_action( 'wp_ajax_wpda_widget_chart_refresh', WPDA_Widget_Google_Chart::class, 'ajax_refresh' ); |
| 200 |
// Add/remove favourites. |
| 201 |
$plugin_favourites = new WPDA_Favourites(); |
| 202 |
$this->loader->add_action( 'admin_action_wpda_add_favourite', $plugin_favourites, 'add' ); |
| 203 |
$this->loader->add_action( 'admin_action_wpda_rem_favourite', $plugin_favourites, 'rem' ); |
| 204 |
// Show tables actions. |
| 205 |
$plugin_table_actions = new WPDA_Table_Actions(); |
| 206 |
$this->loader->add_action( 'admin_action_wpda_show_table_actions', $plugin_table_actions, 'show' ); |
| 207 |
$plugin_dictionary_list = new WPDA_Dictionary_Lists(); |
| 208 |
// Get tables for a specific database. |
| 209 |
$this->loader->add_action( 'admin_action_wpda_get_tables', $plugin_dictionary_list, 'get_tables_ajax' ); |
| 210 |
// Get columns for a specific table. |
| 211 |
$this->loader->add_action( 'admin_action_wpda_get_columns', $plugin_dictionary_list, 'get_columns' ); |
| 212 |
// Get row count for a specific table. |
| 213 |
$this->loader->add_action( 'admin_action_wpda_get_table_row_count', $plugin_dictionary_list, 'get_table_row_count_ajax' ); |
| 214 |
// Get table widget info. |
| 215 |
$this->loader->add_action( 'admin_action_wpda_get_table_widget_info', $plugin_dictionary_list, 'get_table_widget_info' ); |
| 216 |
// Export project. |
| 217 |
$plugin_export_project = new WPDP_Export_Project(); |
| 218 |
$this->loader->add_action( 'admin_action_wpda_export_project', $plugin_export_project, 'export' ); |
| 219 |
// Data backup. |
| 220 |
$wpda_data_backup = new WPDA_Data_Export(); |
| 221 |
$this->loader->add_action( 'wpda_data_backup', $wpda_data_backup, 'wpda_data_backup' ); |
| 222 |
// Allow to add multiple user roles. |
| 223 |
$wpda_roles = new WPDA_Roles(); |
| 224 |
$this->loader->add_action( 'user_new_form', $wpda_roles, 'multiple_roles_selection' ); |
| 225 |
$this->loader->add_action( 'edit_user_profile', $wpda_roles, 'multiple_roles_selection' ); |
| 226 |
$this->loader->add_action( 'profile_update', $wpda_roles, 'multiple_roles_update' ); |
| 227 |
$this->loader->add_filter( 'manage_users_columns', $wpda_roles, 'multiple_roles_label' ); |
| 228 |
// Check if a remote db connection can be established via ajax. |
| 229 |
$wpdadb = new WPDADB(); |
| 230 |
$this->loader->add_action( 'admin_action_wpda_check_remote_database_connection', $wpdadb, 'check_remote_database_connection' ); |
| 231 |
// Add id to wpda_datatables.js (for IE). |
| 232 |
$this->loader->add_filter( |
| 233 |
'script_loader_tag', |
| 234 |
$this, |
| 235 |
'add_id_to_script', |
| 236 |
10, |
| 237 |
3 |
| 238 |
); |
| 239 |
// Add CSV mapping calls. |
| 240 |
$wpda_csv_uploads_model = new WPDA_CSV_Uploads_Model(); |
| 241 |
$this->loader->add_action( 'admin_action_wpda_save_csv_mapping', $wpda_csv_uploads_model, 'save_mapping' ); |
| 242 |
$this->loader->add_action( 'admin_action_wpda_csv_preview_mapping', $wpda_csv_uploads_model, 'preview_mapping' ); |
| 243 |
// Show what's new page and update option. |
| 244 |
add_action( |
| 245 |
'admin_action_wpda_show_whats_new', |
| 246 |
function () { |
| 247 |
if ( isset( $_REQUEST['whats_new'] ) && 'off' === $_REQUEST['whats_new'] ) { |
| 248 |
// phpcs:ignore WordPress.Security.NonceVerification |
| 249 |
WPDA::set_option( WPDA::OPTION_WPDA_SHOW_WHATS_NEW, 'off' ); |
| 250 |
} |
| 251 |
header( 'Location: https://wpdataaccess.com/docs/documentation/updates/whats-new/' ); |
| 252 |
}, |
| 253 |
10, |
| 254 |
1 |
| 255 |
); |
| 256 |
// Data Publisher services. |
| 257 |
$this->loader->add_action( 'wp_ajax_wpda_test_publication', \WPDataAccess\Data_Publisher\WPDA_Publisher_Form::class, 'test_publication' ); |
| 258 |
// Add custom CSS to freemius pages. |
| 259 |
add_action( |
| 260 |
'admin_footer', |
| 261 |
function () { |
| 262 |
if ( 'wpda-account' === $this->page || 'wpda-pricing' === $this->page ) { |
| 263 |
?> |
| 264 |
<script type="application/javascript"> |
| 265 |
jQuery(function() { |
| 266 |
jQuery.each(document.styleSheets, function (index, cssFile) { |
| 267 |
if (cssFile.href!==null && cssFile.href.toString().includes("load-styles.php")) { |
| 268 |
var classes = cssFile.rules || cssFile.cssRules; |
| 269 |
for (var x=0; x<classes.length; x++) { |
| 270 |
if ( |
| 271 |
classes[x].selectorText!==undefined && |
| 272 |
classes[x].selectorText!==null && |
| 273 |
classes[x].selectorText.includes("#adminmenu li.current a.menu-top") |
| 274 |
) { |
| 275 |
jQuery("#adminmenu #toplevel_page_wpda a.menu-top").attr("style", classes[x].style.cssText); |
| 276 |
} |
| 277 |
} |
| 278 |
} |
| 279 |
}); |
| 280 |
}); |
| 281 |
</script> |
| 282 |
<?php |
| 283 |
} |
| 284 |
}, |
| 285 |
10, |
| 286 |
1 |
| 287 |
); |
| 288 |
} |
| 289 |
|
| 290 |
/** |
| 291 |
* Needed for JDT to support IE |
| 292 |
* |
| 293 |
* @param string $tag Tag. |
| 294 |
* @param string $handle Handle. |
| 295 |
* @param string $src Source. |
| 296 |
* @return mixed|string |
| 297 |
*/ |
| 298 |
public function add_id_to_script( $tag, $handle, $src ) |
| 299 |
{ |
| 300 |
|
| 301 |
if ( 'wpda_datatables' === $handle ) { |
| 302 |
$tag = '<script id="wpda_datatables" src="' . $src . '"></script>'; |
| 303 |
// phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript |
| 304 |
} |
| 305 |
|
| 306 |
return $tag; |
| 307 |
} |
| 308 |
|
| 309 |
/** |
| 310 |
* Add public hooks |
| 311 |
* |
| 312 |
* Initiates {@see WP_Data_Access_Public} (public functionality), {@see WPDA_Data_Tables} (ajax call to support |
| 313 |
* server side jQuery DataTables functionality). Adds the appropriate actions to |
| 314 |
* the loader. |
| 315 |
* |
| 316 |
* @since 1.0.0 |
| 317 |
* |
| 318 |
* @see WP_Data_Access_Public |
| 319 |
* @see WPDA_Data_Tables |
| 320 |
* @see WPDA_Dictionary_Lists |
| 321 |
*/ |
| 322 |
private function define_public_hooks() |
| 323 |
{ |
| 324 |
$plugin_public = new WP_Data_Access_Public(); |
| 325 |
// Shortcodes. |
| 326 |
$this->loader->add_action( 'init', $plugin_public, 'register_shortcodes' ); |
| 327 |
// Public scripts. |
| 328 |
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
| 329 |
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
| 330 |
$this->loader->add_action( |
| 331 |
'admin_bar_menu', |
| 332 |
$plugin_public, |
| 333 |
'add_data_projects_to_admin_toolbar', |
| 334 |
9999 |
| 335 |
); |
| 336 |
// Ajax calls. |
| 337 |
$plugin_datatables = new WPDA_Data_Tables(); |
| 338 |
$this->loader->add_action( 'wp_ajax_wpda_datatables', $plugin_datatables, 'get_data' ); |
| 339 |
$this->loader->add_action( 'wp_ajax_nopriv_wpda_datatables', $plugin_datatables, 'get_data' ); |
| 340 |
// Export action. |
| 341 |
$this->loader->add_action( 'wp_ajax_wpda_export', WPDA_Export::class, 'export_ajax' ); |
| 342 |
$this->loader->add_action( 'wp_ajax_nopriv_wpda_export', WPDA_Export::class, 'export_ajax' ); |
| 343 |
// Add id to wpda_datatables.js (for IE). |
| 344 |
$this->loader->add_filter( |
| 345 |
'script_loader_tag', |
| 346 |
$this, |
| 347 |
'add_id_to_script', |
| 348 |
10, |
| 349 |
3 |
| 350 |
); |
| 351 |
// Autocomplete. |
| 352 |
$autocomplete_service = new WPDA_Autocomplete(); |
| 353 |
$this->loader->add_action( 'wp_ajax_wpda_autocomplete', $autocomplete_service, 'autocomplete' ); |
| 354 |
$this->loader->add_action( 'wp_ajax_nopriv_wpda_autocomplete', $autocomplete_service, 'autocomplete_anonymous' ); |
| 355 |
} |
| 356 |
|
| 357 |
/** |
| 358 |
* Start plugin loader |
| 359 |
* |
| 360 |
* @since 1.0.0 |
| 361 |
*/ |
| 362 |
public function run() |
| 363 |
{ |
| 364 |
$this->loader->run(); |
| 365 |
} |
| 366 |
|
| 367 |
/** |
| 368 |
* Add plugin settings page |
| 369 |
*/ |
| 370 |
public function wpdataaccess_register_settings_page() |
| 371 |
{ |
| 372 |
add_options_page( |
| 373 |
'WP Data Access', |
| 374 |
'WP Data Access', |
| 375 |
'manage_options', |
| 376 |
WP_Data_Access_Admin::PAGE_SETTINGS, |
| 377 |
array( $this, 'wpdataaccess_settings_page' ) |
| 378 |
); |
| 379 |
} |
| 380 |
|
| 381 |
/** |
| 382 |
* Show settings page |
| 383 |
*/ |
| 384 |
public function wpdataaccess_settings_page() |
| 385 |
{ |
| 386 |
WPDA_Dashboard::add_dashboard(); |
| 387 |
$current_tab = ( isset( $_REQUEST['tab'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['tab'] ) ) : 'plugin' ); |
| 388 |
// phpcs:ignore WordPress.Security.NonceVerification |
| 389 |
switch ( $current_tab ) { |
| 390 |
case 'backend': |
| 391 |
$wpda_settings_class_name = 'WPDA_Settings_BackEnd'; |
| 392 |
$help_url = 'https://wpdataaccess.com/docs/documentation/plugin-settings/back-end/'; |
| 393 |
break; |
| 394 |
case 'frontend': |
| 395 |
$wpda_settings_class_name = 'WPDA_Settings_FrontEnd'; |
| 396 |
$help_url = 'https://wpdataaccess.com/docs/documentation/plugin-settings/front-end/'; |
| 397 |
break; |
| 398 |
case 'pds': |
| 399 |
$wpda_settings_class_name = 'WPDA_Settings_PDS'; |
| 400 |
$help_url = 'https://wpdataaccess.com/docs/documentation/plugin-settings/premium-data-services/'; |
| 401 |
break; |
| 402 |
case 'dashboard': |
| 403 |
$wpda_settings_class_name = 'WPDA_Settings_Dashboard'; |
| 404 |
$help_url = 'https://wpdataaccess.com/docs/documentation/plugin-settings/dashboard/'; |
| 405 |
break; |
| 406 |
case 'datatables': |
| 407 |
$wpda_settings_class_name = 'WPDA_Settings_DataTables'; |
| 408 |
$help_url = 'https://wpdataaccess.com/docs/documentation/plugin-settings/datatables/'; |
| 409 |
break; |
| 410 |
case 'datapublisher': |
| 411 |
$wpda_settings_class_name = 'WPDA_Settings_DataPublisher'; |
| 412 |
$help_url = 'https://wpdataaccess.com/docs/documentation/plugin-settings/data-publisher/'; |
| 413 |
break; |
| 414 |
case 'dataforms': |
| 415 |
$wpda_settings_class_name = 'WPDA_Settings_DataForms'; |
| 416 |
$help_url = 'https://wpdataaccess.com/docs/documentation/plugin-settings/data-forms/'; |
| 417 |
break; |
| 418 |
case 'databackup': |
| 419 |
$wpda_settings_class_name = 'WPDA_Settings_DataBackup'; |
| 420 |
$help_url = 'https://wpdataaccess.com/docs/documentation/plugin-settings/data-backup/'; |
| 421 |
break; |
| 422 |
case 'uninstall': |
| 423 |
$wpda_settings_class_name = 'WPDA_Settings_Uninstall'; |
| 424 |
$help_url = 'https://wpdataaccess.com/docs/documentation/plugin-settings/uninstall/'; |
| 425 |
break; |
| 426 |
case 'repository': |
| 427 |
$wpda_settings_class_name = 'WPDA_Settings_ManageRepository'; |
| 428 |
$help_url = 'https://wpdataaccess.com/docs/documentation/plugin-settings/manage-repository/'; |
| 429 |
break; |
| 430 |
case 'roles': |
| 431 |
$wpda_settings_class_name = 'WPDA_Settings_ManageRoles'; |
| 432 |
$help_url = 'https://wpdataaccess.com/docs/documentation/plugin-settings/manage-roles/'; |
| 433 |
break; |
| 434 |
case 'system': |
| 435 |
$wpda_settings_class_name = 'WPDA_Settings_SystemInfo'; |
| 436 |
$help_url = 'https://wpdataaccess.com/docs/documentation/plugin-settings/system-info/'; |
| 437 |
break; |
| 438 |
default: |
| 439 |
$wpda_settings_class_name = 'WPDA_Settings_Plugin'; |
| 440 |
$help_url = 'https://wpdataaccess.com/docs/documentation/plugin-settings/plugin/'; |
| 441 |
} |
| 442 |
$wpda_settings_class_name = '\\WPDataAccess\\Settings\\' . $wpda_settings_class_name; |
| 443 |
$wpda_settings = new $wpda_settings_class_name( $current_tab, $help_url ); |
| 444 |
$wpda_settings->show(); |
| 445 |
} |
| 446 |
|
| 447 |
} |