Use the router for table structure page

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2019-07-19 20:17:16 -03:00
parent 5edf1b8710
commit aec0402679
37 changed files with 156 additions and 119 deletions

View File

@ -291,7 +291,7 @@ if ($import_type == 'table') {
$goto = 'server_import.php';
} elseif (empty($goto) || ! preg_match('@^(server|db|tbl)(_[a-z]*)*\.php$@i', $goto)) {
if (strlen($table) > 0 && strlen($db) > 0) {
$goto = 'tbl_structure.php';
$goto = Url::getFromRoute('/table/structure');
} elseif (strlen($db) > 0) {
$goto = Url::getFromRoute('/database/structure');
} else {

View File

@ -55,6 +55,9 @@ if (isset($_GET['route']) || isset($_POST['route'])) {
});
});
$routes->addGroup('/table', function (RouteCollector $routes) {
$routes->addRoute(['GET', 'POST'], '/structure', function () {
require_once ROOT_PATH . 'libraries/entry_points/table/structure.php';
});
$routes->addRoute(['GET', 'POST'], '/tracking', function () {
require_once ROOT_PATH . 'libraries/entry_points/table/tracking.php';
});

View File

@ -1280,7 +1280,7 @@ DesignerMove.startTableNew = function () {
DesignerMove.startTabUpd = function (table) {
CommonParams.set('table', table);
CommonActions.refreshMain('tbl_structure.php');
CommonActions.refreshMain('index.php?route=/table/structure');
};
// --------------------------- hide tables --------------------------------------

View File

@ -2408,8 +2408,8 @@ Functions.checkReservedWordColumns = function ($form) {
var isConfirmed = true;
$.ajax({
type: 'POST',
url: 'tbl_structure.php',
data: $form.serialize() + CommonParams.get('arg_separator') + 'reserved_word_check=1',
url: 'index.php',
data: $form.serialize() + CommonParams.get('arg_separator') + 'reserved_word_check=1' + CommonParams.get('arg_separator') + 'route=/table/structure',
success: function (data) {
if (typeof data.success !== 'undefined' && data.success === true) {
isConfirmed = confirm(data.message);
@ -2939,7 +2939,7 @@ AJAX.registerOnload('functions.js', function () {
if (! (history && history.pushState)) {
params12 += MicroHistory.menus.getRequestParam();
}
var tableStructureUrl = 'tbl_structure.php?server=' + data.params.server +
var tableStructureUrl = 'index.php?route=/table/structure' + argsep + 'server=' + data.params.server +
argsep + 'db=' + data.params.db + argsep + 'token=' + data.params.token +
argsep + 'goto=' + encodeURIComponent('index.php?route=/database/structure') + argsep + 'table=' + data.params.table + '';
$.get(tableStructureUrl, params12, AJAX.responseHandler);

View File

@ -13,7 +13,7 @@
/* global sprintf */ // js/vendor/sprintf.js
/**
* AJAX scripts for tbl_structure.php
* AJAX scripts for /table/structure
*
* Actions ajaxified here:
* Drop Column

View File

@ -9,6 +9,7 @@ declare(strict_types=1);
namespace PhpMyAdmin\Config;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
/**
@ -96,7 +97,7 @@ class SpecialSchemaLinks
'column_name' => 'Table_name',
],
],
'default_page' => './tbl_structure.php?change_column=1',
'default_page' => './' . Url::getFromRoute('/table/structure', ['change_column' => 1]),
],
],
'db' => [
@ -147,7 +148,7 @@ class SpecialSchemaLinks
'column_name' => 'table_name',
],
],
'default_page' => './tbl_structure.php',
'default_page' => './' . Url::getFromRoute('/table/structure'),
],
],
'innodb_table_stats' => [
@ -289,7 +290,7 @@ class SpecialSchemaLinks
'column_name' => 'table_name',
],
],
'default_page' => './tbl_structure.php?change_column=1',
'default_page' => './' . Url::getFromRoute('/table/structure', ['change_column' => 1]),
],
],
'key_column_usage' => [
@ -315,7 +316,7 @@ class SpecialSchemaLinks
'column_name' => 'table_name',
],
],
'default_page' => './tbl_structure.php?change_column=1',
'default_page' => './' . Url::getFromRoute('/table/structure', ['change_column' => 1]),
],
'referenced_table_name' => [
'link_param' => 'table',
@ -339,7 +340,7 @@ class SpecialSchemaLinks
'column_name' => 'referenced_table_name',
],
],
'default_page' => './tbl_structure.php?change_column=1',
'default_page' => './' . Url::getFromRoute('/table/structure', ['change_column' => 1]),
],
],
'partitions' => [
@ -433,7 +434,7 @@ class SpecialSchemaLinks
'column_name' => 'table_name',
],
],
'default_page' => './tbl_structure.php?change_column=1',
'default_page' => './' . Url::getFromRoute('/table/structure', ['change_column' => 1]),
],
],
'tables' => [

View File

@ -366,12 +366,10 @@ class StructureController extends AbstractController
$table_is_view = false;
// Sets parameters for links
$tbl_url_query = Url::getCommon(
[
'db' => $this->db,
'table' => $current_table['TABLE_NAME'],
]
);
$tableUrlParams = [
'db' => $this->db,
'table' => $current_table['TABLE_NAME'],
];
// do not list the previous table's size info for a view
list($current_table, $formatted_size, $unit, $formatted_overhead,
@ -405,8 +403,8 @@ class StructureController extends AbstractController
if ($this->isShowStats) {
$overhead = '-';
if ($formatted_overhead != '') {
$overhead = '<a href="tbl_structure.php'
. $tbl_url_query . '#showusage">'
$overhead = '<a href="' . Url::getFromRoute('/table/structure', $tableUrlParams)
. '#showusage">'
. '<span>' . $formatted_overhead . '</span>&nbsp;'
. '<span class="unit">' . $overhead_unit . '</span>'
. '</a>' . "\n";
@ -557,7 +555,7 @@ class StructureController extends AbstractController
'empty_table_title' => $may_have_rows ? $titles['Empty'] : $titles['NoEmpty'],
'tracking_icon' => $this->getTrackingIcon($truename),
'server_slave_status' => $GLOBALS['replication_info']['slave']['status'],
'tbl_url_query' => $tbl_url_query,
'table_url_params' => $tableUrlParams,
'db_is_system_schema' => $this->dbIsSystemSchema,
'titles' => $titles,
'drop_query' => $drop_query,

View File

@ -169,7 +169,7 @@ class IndexesController extends AbstractController
)
);
} else {
include ROOT_PATH . 'tbl_structure.php';
include ROOT_PATH . 'libraries/entry_points/table/structure.php';
}
} else {
$this->response->setRequestStatus(false);

View File

@ -215,7 +215,11 @@ class StructureController extends AbstractController
* A click on Change has been made for one column
*/
if (isset($_GET['change_column'])) {
$this->displayHtmlForColumnChange(null, 'tbl_structure.php', $containerBuilder);
$this->displayHtmlForColumnChange(
null,
Url::getFromRoute('/table/structure'),
$containerBuilder
);
return;
}
@ -247,7 +251,7 @@ class StructureController extends AbstractController
} else {
// handle multiple field commands
// handle confirmation of deleting multiple columns
$action = 'tbl_structure.php';
$action = Url::getFromRoute('/table/structure');
$GLOBALS['selected'] = $_POST['selected_fld'];
list(
$what_ret, $query_type_ret, $is_unset_submit_mult,
@ -348,12 +352,12 @@ class StructureController extends AbstractController
$this->_url_query = Url::getCommonRaw([
'db' => $db,
'table' => $table,
'goto' => 'tbl_structure.php',
'back' => 'tbl_structure.php',
'goto' => Url::getFromRoute('/table/structure'),
'back' => Url::getFromRoute('/table/structure'),
]);
/* The url_params array is initialized in above include */
$url_params['goto'] = 'tbl_structure.php';
$url_params['back'] = 'tbl_structure.php';
$url_params['goto'] = Url::getFromRoute('/table/structure');
$url_params['back'] = Url::getFromRoute('/table/structure');
// 2. Gets table keys and retains them
// @todo should be: $server->db($db)->table($table)->primary()
@ -885,12 +889,10 @@ class StructureController extends AbstractController
*/
protected function updateColumns()
{
$err_url = 'tbl_structure.php' . Url::getCommon(
[
'db' => $this->db,
'table' => $this->table,
]
);
$err_url = Url::getFromRoute('/table/structure', [
'db' => $this->db,
'table' => $this->table,
]);
$regenerate = false;
$field_cnt = count($_POST['field_name']);
$changes = [];
@ -1624,7 +1626,7 @@ class StructureController extends AbstractController
// the rendering
exit;
case 'browse':
// this should already be handled by tbl_structure.php
// this should already be handled by /table/structure
}
return [

View File

@ -60,7 +60,6 @@ class Core
'tbl_sql.php',
'tbl_export.php',
'tbl_operations.php',
'tbl_structure.php',
'tbl_relation.php',
'tbl_replace.php',
'tbl_row_action.php',

View File

@ -1270,7 +1270,7 @@ class Import
'table' => (string) $table[self::TBL_NAME],
];
$tbl_url = 'sql.php' . Url::getCommon($params);
$tbl_struct_url = 'tbl_structure.php' . Url::getCommon($params);
$tbl_struct_url = Url::getFromRoute('/table/structure', $params);
$tbl_ops_url = 'tbl_operations.php' . Url::getCommon($params);
unset($params);

View File

@ -344,15 +344,10 @@ class Menu
$tabs['browse']['args']['pos'] = 0;
$tabs['structure']['icon'] = 'b_props';
$tabs['structure']['link'] = 'tbl_structure.php';
$tabs['structure']['link'] = Url::getFromRoute('/table/structure');
$tabs['structure']['text'] = __('Structure');
$tabs['structure']['active'] = in_array(
basename($GLOBALS['PMA_PHP_SELF']),
[
'tbl_structure.php',
'tbl_relation.php',
]
);
$tabs['structure']['active'] = basename($GLOBALS['PMA_PHP_SELF']) === 'tbl_relation.php' ||
(isset($_REQUEST['route']) && in_array($_REQUEST['route'], ['/table/structure']));
$tabs['sql']['icon'] = 'b_sql';
$tabs['sql']['link'] = 'tbl_sql.php';

View File

@ -9,6 +9,7 @@ declare(strict_types=1);
namespace PhpMyAdmin\Navigation\Nodes;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
/**
@ -33,12 +34,20 @@ class NodeColumn extends Node
parent::__construct($item['name'], $type, $isGroup);
$this->icon = Util::getImage($this->getColumnIcon($item['key']), __('Column'));
$this->links = [
'text' => 'tbl_structure.php?server=' . $GLOBALS['server']
. '&amp;db=%3$s&amp;table=%2$s&amp;field=%1$s'
. '&amp;change_column=1',
'icon' => 'tbl_structure.php?server=' . $GLOBALS['server']
. '&amp;db=%3$s&amp;table=%2$s&amp;field=%1$s'
. '&amp;change_column=1',
'text' => Url::getFromRoute('/table/structure', [
'server' => $GLOBALS['server'],
'db' => '%3\$s',
'table' => '%2\$s',
'field' => '%1\$s',
'change_column' => 1,
]),
'icon' => Url::getFromRoute('/table/structure', [
'server' => $GLOBALS['server'],
'db' => '%3\$s',
'table' => '%2\$s',
'field' => '%1\$s',
'change_column' => 1,
]),
'title' => __('Structure'),
];
}

View File

@ -10,6 +10,7 @@ declare(strict_types=1);
namespace PhpMyAdmin\Navigation\Nodes;
use PhpMyAdmin\Navigation\NodeFactory;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
/**
@ -27,10 +28,16 @@ class NodeColumnContainer extends Node
parent::__construct(__('Columns'), Node::CONTAINER);
$this->icon = Util::getImage('pause', __('Columns'));
$this->links = [
'text' => 'tbl_structure.php?server=' . $GLOBALS['server']
. '&amp;db=%2$s&amp;table=%1$s',
'icon' => 'tbl_structure.php?server=' . $GLOBALS['server']
. '&amp;db=%2$s&amp;table=%1$s',
'text' => Url::getFromRoute('/table/structure', [
'server' => $GLOBALS['server'],
'db' => '%2\$s',
'table' => '%1\$s',
]),
'icon' => Url::getFromRoute('/table/structure', [
'server' => $GLOBALS['server'],
'db' => '%2\$s',
'table' => '%1\$s',
]),
];
$this->realName = 'columns';

View File

@ -10,6 +10,7 @@ declare(strict_types=1);
namespace PhpMyAdmin\Navigation\Nodes;
use PhpMyAdmin\Navigation\NodeFactory;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
/**
@ -27,10 +28,16 @@ class NodeIndexContainer extends Node
parent::__construct(__('Indexes'), Node::CONTAINER);
$this->icon = Util::getImage('b_index', __('Indexes'));
$this->links = [
'text' => 'tbl_structure.php?server=' . $GLOBALS['server']
. '&amp;db=%2$s&amp;table=%1$s',
'icon' => 'tbl_structure.php?server=' . $GLOBALS['server']
. '&amp;db=%2$s&amp;table=%1$s',
'text' => Url::getFromRoute('/table/structure', [
'server' => $GLOBALS['server'],
'db' => '%2\$s',
'table' => '%1\$s',
]),
'icon' => Url::getFromRoute('/table/structure', [
'server' => $GLOBALS['server'],
'db' => '%2\$s',
'table' => '%1\$s',
]),
];
$this->realName = 'indexes';

View File

@ -9,6 +9,7 @@ declare(strict_types=1);
namespace PhpMyAdmin\Navigation\Nodes;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
/**
@ -51,23 +52,25 @@ class NodeTable extends NodeDatabaseChild
$GLOBALS['cfg']['DefaultTabTable'],
'table'
);
$firstIconLink = Util::getScriptNameForOption(
$GLOBALS['cfg']['NavigationTreeDefaultTabTable'],
'table'
);
$secondIconLink = Util::getScriptNameForOption(
$GLOBALS['cfg']['NavigationTreeDefaultTabTable2'],
'table'
);
$this->links = [
'text' => $scriptName
. '?server=' . $GLOBALS['server']
'text' => $scriptName . (strpos($scriptName, '?') === false ? '?' : '&')
. 'server=' . $GLOBALS['server']
. '&amp;db=%2$s&amp;table=%1$s'
. '&amp;pos=0',
'icon' => [
Util::getScriptNameForOption(
$GLOBALS['cfg']['NavigationTreeDefaultTabTable'],
'table'
)
. '?server=' . $GLOBALS['server']
$firstIconLink . (strpos($firstIconLink, '?') === false ? '?' : '&')
. 'server=' . $GLOBALS['server']
. '&amp;db=%2$s&amp;table=%1$s',
Util::getScriptNameForOption(
$GLOBALS['cfg']['NavigationTreeDefaultTabTable2'],
'table'
)
. '?server=' . $GLOBALS['server']
$secondIconLink . (strpos($secondIconLink, '?') === false ? '?' : '&')
. 'server=' . $GLOBALS['server']
. '&amp;db=%2$s&amp;table=%1$s',
],
'title' => $this->title,
@ -290,7 +293,7 @@ class NodeTable extends NodeDatabaseChild
}
switch ($page) {
case 'tbl_structure.php':
case Url::getFromRoute('/table/structure'):
$this->icon[] = Util::getImage('b_props', __('Structure'));
break;
case 'tbl_select.php':

View File

@ -9,6 +9,7 @@ declare(strict_types=1);
namespace PhpMyAdmin\Navigation\Nodes;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
/**
@ -30,10 +31,12 @@ class NodeView extends NodeDatabaseChild
{
parent::__construct($name, $type, $isGroup);
$this->icon = Util::getImage('b_props', __('View'));
$iconLink = Url::getFromRoute('/table/structure');
$this->links = [
'text' => 'sql.php?server=' . $GLOBALS['server']
. '&amp;db=%2$s&amp;table=%1$s&amp;pos=0',
'icon' => 'tbl_structure.php?server=' . $GLOBALS['server']
'icon' => $iconLink . (strpos($iconLink, '?') === false ? '?' : '&')
. 'server=' . $GLOBALS['server']
. '&amp;db=%2$s&amp;table=%1$s',
];
$this->classes = 'view';

View File

@ -42,7 +42,6 @@ class Sanitize
'./db_sql.php?',
'./db_search.php?',
'./db_operations.php?',
'./tbl_structure.php?',
'./tbl_sql.php?',
'./tbl_select.php?',
'./tbl_change.php?',
@ -51,7 +50,6 @@ class Sanitize
'./db_events.php?',
'./db_routines.php?',
'./server_privileges.php?',
'./tbl_structure.php?',
];
$is_setup = $GLOBALS['PMA_Config'] !== null && $GLOBALS['PMA_Config']->get('is_setup');
// Adjust path to setup script location

View File

@ -6,7 +6,7 @@
* @usedby server_sql.php
* @usedby db_sql.php
* @usedby tbl_sql.php
* @usedby tbl_structure.php
* @usedby /table/structure
* @usedby /table/tracking
* @package PhpMyAdmin
*/
@ -41,7 +41,7 @@ class SqlQueryForm
* @usedby server_sql.php
* @usedby db_sql.php
* @usedby tbl_sql.php
* @usedby tbl_structure.php
* @usedby /table/structure
* @usedby /table/tracking
*/
public function getHtml(

View File

@ -3201,7 +3201,7 @@ class Util
// $cfg['NavigationTreeDefaultTabTable2']
switch ($target) {
case 'structure':
return 'tbl_structure.php';
return Url::getFromRoute('/table/structure');
case 'sql':
return 'tbl_sql.php';
case 'search':

View File

@ -16,7 +16,7 @@ if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
global $db_is_system_schema, $tbl_is_view, $tbl_storage_engine;
global $containerBuilder, $db_is_system_schema, $tbl_is_view, $tbl_storage_engine;
global $table_info_num_rows, $tbl_collation, $showtable;
require_once ROOT_PATH . 'libraries/common.inc.php';

View File

@ -83,8 +83,8 @@ if (isset($_POST['submit_num_fields'])) {
}
if (isset($_POST['do_save_data'])) {
//avoid an incorrect calling of PMA_updateColumns() via
//tbl_structure.php below
// avoid an incorrect calling of PMA_updateColumns() via
// /table/structure below
unset($_POST['do_save_data']);
$createAddField = new CreateAddField($dbi);
@ -148,7 +148,7 @@ if ($abort === false) {
*/
include_once ROOT_PATH . 'libraries/tbl_common.inc.php';
$active_page = 'tbl_structure.php';
$active_page = Url::getFromRoute('/table/structure');
/**
* Display the form
*/

View File

@ -16,6 +16,7 @@ use PhpMyAdmin\Partition;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\Table;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
@ -452,7 +453,7 @@ if (! (isset($db_is_system_schema) && $db_is_system_schema)) {
$url_params,
[
'sql_query' => $this_sql_query,
'goto' => 'tbl_structure.php',
'goto' => Url::getFromRoute('/table/structure'),
'reload' => '1',
'message_to_show' => sprintf(
__('Table %s has been emptied.'),

View File

@ -7,7 +7,7 @@
id="checkbox_tbl_{{ curr }}">
</td>
<th>
<a href="sql.php{{ tbl_url_query|raw }}&amp;pos=0" title="{{ browse_table_label_title }}">
<a href="sql.php{{ get_common(table_url_params|merge({'pos': 0})) }}" title="{{ browse_table_label_title }}">
{{ browse_table_label_truename }}
</a>
{{ tracking_icon|raw }}
@ -40,25 +40,25 @@
{% endif %}
<td class="center print_ignore">
<a href="sql.php{{ tbl_url_query|raw }}&amp;pos=0">
<a href="sql.php{{ get_common(table_url_params|merge({'pos': 0})) }}">
{{ browse_table_title|raw }}
</a>
</td>
<td class="center print_ignore">
<a href="tbl_structure.php{{ tbl_url_query|raw }}">
<a href="{{ url('/table/structure', table_url_params) }}">
{{ titles['Structure']|raw }}
</a>
</td>
<td class="center print_ignore">
<a href="tbl_select.php{{ tbl_url_query|raw }}">
<a href="tbl_select.php{{ get_common(table_url_params) }}">
{{ search_table_title|raw }}
</a>
</td>
{% if not db_is_system_schema %}
<td class="insert_table center print_ignore">
<a href="tbl_change.php{{ tbl_url_query|raw }}">{{ titles['Insert']|raw }}</a>
<a href="tbl_change.php{{ get_common(table_url_params) }}">{{ titles['Insert']|raw }}</a>
</td>
{% if table_is_view %}
<td class="center print_ignore">
@ -69,17 +69,23 @@
</td>
{% else %}
<td class="center print_ignore">
<a class="truncate_table_anchor ajax" href="sql.php" data-post="{{ tbl_url_query|raw }}&amp;sql_query=
{{- empty_table_sql_query }}&amp;message_to_show={{ empty_table_message_to_show }}">
<a class="truncate_table_anchor ajax" href="sql.php" data-post="{{ get_common(table_url_params|merge({
'sql_query': empty_table_sql_query,
'message_to_show': empty_table_message_to_show
}), '') }}">
{{ empty_table_title|raw }}
</a>
</td>
{% endif %}
<td class="center print_ignore">
<a class="ajax drop_table_anchor
{{- table_is_view or current_table['ENGINE'] == null ? ' view' }}"
href="sql.php" data-post="{{ tbl_url_query|raw }}&amp;reload=1&amp;purge=1&amp;sql_query=
{{- drop_query|url_encode }}&amp;message_to_show={{ drop_message|url_encode }}">
{{- table_is_view or current_table['ENGINE'] == null ? ' view' }}" href="sql.php" data-post="
{{- get_common(table_url_params|merge({
'reload': 1,
'purge': 1,
'sql_query': drop_query|url_encode,
'message_to_show': drop_message|url_encode
}), '') }}">
{{ titles['Drop']|raw }}
</a>
</td>
@ -128,7 +134,7 @@
{% if is_show_stats %}
<td class="value tbl_size">
<a href="tbl_structure.php{{ tbl_url_query|raw }}#showusage">
<a href="{{ url('/table/structure', table_url_params) }}#showusage">
<span>{{ formatted_size }}</span>
<span class="unit">{{ unit }}</span>
</a>

View File

@ -2,7 +2,7 @@
<ul id="topmenu2">
{{ get_html_tab({
'icon': 'b_props',
'link': 'tbl_structure.php',
'link': url('/table/structure'),
'text': 'Table structure'|trans,
'id': 'table_strucuture_id'
}, url_params) }}

View File

@ -14,7 +14,7 @@
add_unique_anchor
{%- elseif action == 'Spatial' %}
add_spatial_anchor
{%- endif %}" href="tbl_structure.php" data-post="{{ url_query|raw -}}
{%- endif %}" href="{{ url('/table/structure') }}" data-post="{{ url_query|raw -}}
&amp;add_key=1&amp;sql_query=
{{- ('ALTER TABLE ' ~
backquote(table) ~

View File

@ -76,7 +76,7 @@
<td>{{ partition.getComment() }}</td>
{% for action, icon in action_icons %}
<td>
<a href="tbl_structure.php" data-post="{{ url_query -}}
<a href="{{ url('/table/structure') }}" data-post="{{ url_query -}}
&amp;partition_maintenance=1&amp;sql_query=
{{- ("ALTER TABLE " ~ backquote(table) ~ " " ~ action
~ " PARTITION " ~ partition.getName())|url_encode }}"
@ -128,7 +128,7 @@
{% endif %}
</fieldset>
<fieldset class="tblFooters print_ignore">
<form action="tbl_structure.php" method="post">
<form action="{{ url('/table/structure') }}" method="post">
{{ get_hidden_inputs(db, table) }}
<input type="hidden" name="edit_partitioning" value="true">
{% if partitions is empty %}

View File

@ -1,6 +1,6 @@
{% extends 'table/page_with_secondary_tabs.twig' %}
{% block content %}
<form method="post" action="tbl_structure.php" name="fieldsForm" id="fieldsForm"
<form method="post" action="{{ url('/table/structure') }}" name="fieldsForm" id="fieldsForm"
class="ajax{{ hide_structure_actions ? ' HideStructureActions' }}">
{{ get_hidden_inputs(db, table) }}
<input type="hidden" name="table_type" value=
@ -99,8 +99,10 @@
<td class="nowrap">{{ row['Extra']|upper }}</td>
{% if not tbl_is_view and not db_is_system_schema %}
<td class="edit center print_ignore">
<a class="change_column_anchor ajax" href="tbl_structure.php
{{- url_query }}&amp;field={{ row['Field']|url_encode }}&amp;change_column=1">
<a class="change_column_anchor ajax" href="{{ url('/table/structure', url_params|merge({
'field': row['Field']|url_encode,
'change_column': 1
})) }}">
{{ titles['Change']|raw }}
</a>
</td>
@ -215,7 +217,7 @@
or tbl_storage_engine == 'MARIA'
or (tbl_storage_engine == 'INNODB' and mysql_int_version >= 50604)
) and ('text' in type or 'char' in type) %}
<a rel="samepage" class="ajax add_key add_fulltext_anchor" href="tbl_structure.php"
<a rel="samepage" class="ajax add_key add_fulltext_anchor" href="{{ url('/table/structure') }}"
data-post="{{- url_query|raw }}&amp;add_key=1&amp;sql_query=
{{- ('ALTER TABLE ' ~ backquote(table)
~ ' ADD FULLTEXT(' ~ backquote(row['Field'])
@ -362,7 +364,7 @@
<hr class="print_ignore">
<div id="move_columns_dialog" class="hide" title="{% trans 'Move columns' %}">
<p>{% trans 'Move the columns by dragging them up and down.' %}</p>
<form action="tbl_structure.php" name="move_column_form" id="move_column_form">
<form action="{{ url('/table/structure') }}" name="move_column_form" id="move_column_form">
<div>
{{ get_hidden_inputs(db, table) }}
<ul></ul>

View File

@ -1,4 +1,4 @@
<form action="tbl_structure.php" method="post">
<form action="{{ url('/table/structure') }}" method="post">
{{ get_hidden_inputs(db, table) }}
<input type="hidden" name="edit_partitioning" value="true">

View File

@ -48,6 +48,7 @@ class ResultsTest extends PmaTestCase
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();
$GLOBALS['text_dir'] = 'ltr';
$GLOBALS['cfg']['Server']['DisableIS'] = false;
$dbi = $this->getMockBuilder('PhpMyAdmin\DatabaseInterface')
->disableOriginalConstructor()
@ -575,7 +576,7 @@ class ResultsTest extends PmaTestCase
. 'message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3Fdb'
. '%3DData%26table%3Dcustomer%26sql_query%3DSELECT%2B%252A%2BFROM'
. '%2B%2560customer%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen'
. '%2Bdeleted%26goto%3Dtbl_structure.php',
. '%2Bdeleted%26goto%3Dindex.php%253Froute%253D%252Ftable%252Fstructure',
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" '
. 'alt="Delete" class="icon ic_b_drop"> Delete</span>',
'DELETE FROM `Data`.`customer` WHERE `customer`.`id` = 1',
@ -586,7 +587,7 @@ class ResultsTest extends PmaTestCase
. '+1&amp;message_to_show=The+row+has+been+deleted&amp;goto=sql.php'
. '%3Fdb%3DData%26table%3Dcustomer%26sql_query%3DSELECT%2B%252A%2B'
. 'FROM%2B%2560customer%2560%26message_to_show%3DThe%2Brow%2Bhas%2B'
. 'been%2Bdeleted%26goto%3Dtbl_structure.php" '
. 'been%2Bdeleted%26goto%3Dindex.php%253Froute%253D%252Ftable%252Fstructure" '
. 'class="delete_row requireConfirm"><span class="nowrap"><img src="themes/dot.'
. 'gif" title="Delete" alt="Delete" class="icon ic_b_drop"> '
. 'Delete</span></a>'
@ -648,7 +649,7 @@ class ResultsTest extends PmaTestCase
. 'The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3D'
. 'new%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26'
. 'message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3D'
. 'tbl_structure.php',
. 'index.php%253Froute%253D%252Ftable%252Fstructure',
[
'edit_lnk' => 'ur',
'del_lnk' => 'dr',
@ -706,7 +707,7 @@ class ResultsTest extends PmaTestCase
. 'message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3F'
. 'db%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B'
. '%2560new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2B'
. 'deleted%26goto%3Dtbl_structure.php" '
. 'deleted%26goto%3Dindex.php%253Froute%253D%252Ftable%252Fstructure" '
. 'class="delete_row requireConfirm"><span class="nowrap"><img src="themes/dot.'
. 'gif" title="Delete" alt="Delete" class="icon ic_b_drop"> '
. 'Delete</span></a>'
@ -719,8 +720,8 @@ class ResultsTest extends PmaTestCase
. '.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show='
. 'The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3D'
. 'new%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message'
. '_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_'
. 'structure.php',
. '_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3D'
. 'index.php%253Froute%253D%252Ftable%252Fstructure',
[
'edit_lnk' => 'ur',
'del_lnk' => 'dr',
@ -756,7 +757,7 @@ class ResultsTest extends PmaTestCase
. 'message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3Fdb'
. '%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B%25'
. '60new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted'
. '%26goto%3Dtbl_structure.php" class="delete'
. '%26goto%3Dindex.php%253Froute%253D%252Ftable%252Fstructure" class="delete'
. '_row requireConfirm"><span class="nowrap"><img src="themes/dot.gif" title='
. '"Delete" alt="Delete" class="icon ic_b_drop"> Delete</span></a>'
. '<div class="hide">DELETE FROM `data`.`new` WHERE `new`.'

View File

@ -43,7 +43,7 @@ class NodeColumnContainerTest extends PmaTestCase
$parent->links
);
$this->assertStringContainsString(
'tbl_structure.php',
'index.php?route=/table/structure',
$parent->links['text']
);
$this->assertEquals('columns', $parent->realName);

View File

@ -49,7 +49,7 @@ class NodeColumnTest extends PmaTestCase
$parent->links
);
$this->assertStringContainsString(
'tbl_structure.php',
'index.php?route=/table/structure',
$parent->links['text']
);
}

View File

@ -43,7 +43,7 @@ class NodeIndexContainerTest extends PmaTestCase
$parent->links
);
$this->assertStringContainsString(
'tbl_structure.php',
'index.php?route=/table/structure',
$parent->links['text']
);
$this->assertEquals('indexes', $parent->realName);

View File

@ -146,7 +146,7 @@ table {
}
// For hiding 'Open a New phpMyAdmin Window' button
// Hide extra menu on tbl_structure.php
// Hide extra menu on /table/structure
.ic_window-new,
.ic_s_cog,
.sticky_columns tr,

View File

@ -126,7 +126,7 @@ div.success {
}
// For hiding 'Open a New phpMyAdmin Window' button
// Hide extra menu on tbl_structure.php
// Hide extra menu on /table/structure
.ic_window-new,
.ic_s_cog,
.sticky_columns tr,

View File

@ -14,6 +14,7 @@ use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Message;
use PhpMyAdmin\Response;
use PhpMyAdmin\Template;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
@ -31,7 +32,7 @@ $response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
$url_params['goto'] = 'tbl_structure.php';
$url_params['goto'] = Url::getFromRoute('/table/structure');
$url_params['back'] = 'view_create.php';
/** @var Template $template */
@ -168,7 +169,7 @@ if (isset($_POST['createview']) || isset($_POST['alterview'])) {
if (! isset($_POST['ajax_dialog'])) {
$message = Message::success();
include ROOT_PATH . 'tbl_structure.php';
include ROOT_PATH . 'libraries/entry_points/table/structure.php';
} else {
$response->addJSON(
'message',

View File

@ -14,6 +14,7 @@ use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\Table;
use PhpMyAdmin\Template;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
@ -107,7 +108,7 @@ $drop_view_url_params = array_merge(
$url_params,
[
'sql_query' => 'DROP VIEW ' . Util::backquote($GLOBALS['table']),
'goto' => 'tbl_structure.php',
'goto' => Url::getFromRoute('/table/structure'),
'reload' => '1',
'purge' => '1',
'message_to_show' => sprintf(