Use the router for server export page
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
ef81c86830
commit
86d78c547f
@ -292,7 +292,7 @@ if (isset($_POST['output_format']) && $_POST['output_format'] == 'sendit' && ! $
|
||||
$tables = [];
|
||||
// Generate error url and check for needed variables
|
||||
if ($export_type == 'server') {
|
||||
$err_url = 'server_export.php' . Url::getCommon();
|
||||
$err_url = Url::getFromRoute('/server/export');
|
||||
} elseif ($export_type == 'database' && strlen($db) > 0) {
|
||||
$err_url = Url::getFromRoute('/database/export', ['db' => $db]);
|
||||
// Check if we have something to export
|
||||
|
||||
@ -99,6 +99,9 @@ if (isset($_GET['route']) || isset($_POST['route'])) {
|
||||
$routes->addRoute('GET', '/engines', function () {
|
||||
require_once ROOT_PATH . 'libraries/entry_points/server/engines.php';
|
||||
});
|
||||
$routes->addRoute(['GET', 'POST'], '/export', function () {
|
||||
require_once ROOT_PATH . 'libraries/entry_points/server/export.php';
|
||||
});
|
||||
$routes->addRoute('GET', '/plugins', function () {
|
||||
require_once ROOT_PATH . 'libraries/entry_points/server/plugins.php';
|
||||
});
|
||||
|
||||
@ -33,7 +33,6 @@ class Core
|
||||
'index.php',
|
||||
'pdf_pages.php',
|
||||
'pdf_schema.php',
|
||||
'server_export.php',
|
||||
'server_import.php',
|
||||
'tbl_import.php',
|
||||
'tbl_export.php',
|
||||
|
||||
@ -499,7 +499,7 @@ class Export
|
||||
*/
|
||||
$back_button = '<p id="export_back_button">[ <a href="';
|
||||
if ($export_type == 'server') {
|
||||
$back_button .= 'server_export.php" data-post="' . Url::getCommon([], '');
|
||||
$back_button .= Url::getFromRoute('/server/export') . '" data-post="' . Url::getCommon([], '');
|
||||
} elseif ($export_type == 'database') {
|
||||
$back_button .= Url::getFromRoute('/database/export') . '" data-post="' . Url::getCommon(['db' => $db], '');
|
||||
} else {
|
||||
@ -1051,8 +1051,8 @@ class Export
|
||||
{
|
||||
global $cfg;
|
||||
if ($export_type == 'server') {
|
||||
$active_page = 'server_export.php';
|
||||
include_once ROOT_PATH . 'server_export.php';
|
||||
$active_page = Url::getFromRoute('/server/export');
|
||||
include_once ROOT_PATH . 'libraries/entry_points/server/export.php';
|
||||
} elseif ($export_type == 'database') {
|
||||
$active_page = Url::getFromRoute('/database/export');
|
||||
include_once ROOT_PATH . 'libraries/entry_points/database/export.php';
|
||||
|
||||
@ -616,8 +616,9 @@ class Menu
|
||||
}
|
||||
|
||||
$tabs['export']['icon'] = 'b_export';
|
||||
$tabs['export']['link'] = 'server_export.php';
|
||||
$tabs['export']['link'] = Url::getFromRoute('/server/export');
|
||||
$tabs['export']['text'] = __('Export');
|
||||
$tabs['export']['active'] = isset($_REQUEST['route']) && $_REQUEST['route'] === '/server/export';
|
||||
|
||||
$tabs['import']['icon'] = 'b_import';
|
||||
$tabs['import']['link'] = 'server_import.php';
|
||||
|
||||
@ -11,13 +11,12 @@ use PhpMyAdmin\Config\PageSettings;
|
||||
use PhpMyAdmin\Display\Export;
|
||||
use PhpMyAdmin\Response;
|
||||
|
||||
if (! defined('ROOT_PATH')) {
|
||||
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
global $db, $table;
|
||||
global $db, $table, $sql_query, $num_tables, $unlim_num_rows;
|
||||
|
||||
require_once ROOT_PATH . 'libraries/common.inc.php';
|
||||
require_once ROOT_PATH . 'libraries/server_common.inc.php';
|
||||
|
||||
PageSettings::showGroup('Export');
|
||||
Loading…
Reference in New Issue
Block a user