From ce16b8c77cbd8b0a01e3a009fccf0f0c741221f5 Mon Sep 17 00:00:00 2001 From: Nettika Date: Mon, 21 Apr 2025 17:24:06 -0700 Subject: [PATCH] Cleanup indexes bar --- libraries/Index.class.php | 69 ++++++++++++++++++++------------------- tbl_structure.php | 14 -------- 2 files changed, 35 insertions(+), 48 deletions(-) diff --git a/libraries/Index.class.php b/libraries/Index.class.php index bab0018ab..27bd73da1 100644 --- a/libraries/Index.class.php +++ b/libraries/Index.class.php @@ -438,9 +438,6 @@ class PMA_Index $r .= ''; $r .= ''; $r .= ''; - if (! $print_mode) { - $r .= ''; - } $r .= ''; $r .= ''; $r .= ''; @@ -450,6 +447,9 @@ class PMA_Index $r .= ''; $r .= ''; $r .= ''; + if (! $print_mode) { + $r .= ''; + } $r .= ''; $r .= ''; $r .= ''; @@ -460,37 +460,6 @@ class PMA_Index $r .= ''; - if (! $print_mode) { - $this_params = $GLOBALS['url_params']; - $this_params['index'] = $index->getName(); - $r .= '' . "\n"; - - $this_params = $GLOBALS['url_params']; - if ($index->getName() == 'PRIMARY') { - $this_params['sql_query'] = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP PRIMARY KEY'; - $this_params['message_to_show'] = __('The primary key has been dropped'); - $js_msg = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP PRIMARY KEY'); - } else { - $this_params['sql_query'] = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP INDEX ' . PMA_backquote($index->getName()); - $this_params['message_to_show'] = sprintf(__('Index %s has been dropped'), $index->getName()); - $js_msg = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP INDEX ' . $index->getName()); - } - - $r .= '' . "\n"; - } - $r .= ''; $r .= ''; $r .= ''; @@ -513,6 +482,38 @@ class PMA_Index $r .= ''; } + + if (! $print_mode) { + $this_params = $GLOBALS['url_params']; + $this_params['index'] = $index->getName(); + $r .= '' . "\n"; + + $this_params = $GLOBALS['url_params']; + if ($index->getName() == 'PRIMARY') { + $this_params['sql_query'] = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP PRIMARY KEY'; + $this_params['message_to_show'] = __('The primary key has been dropped'); + $js_msg = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP PRIMARY KEY'); + } else { + $this_params['sql_query'] = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP INDEX ' . PMA_backquote($index->getName()); + $this_params['message_to_show'] = sprintf(__('Index %s has been dropped'), $index->getName()); + $js_msg = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP INDEX ' . $index->getName()); + } + + $r .= '' . "\n"; + } + $r .= ''; } // end foreach $index['Sequences'] diff --git a/tbl_structure.php b/tbl_structure.php index 637a24bbb..646b04fd4 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -602,20 +602,6 @@ if (! $tbl_is_view && ! $db_is_information_schema && 'ARCHIVE' != $tbl_type) { */ echo PMA_Index::getView($table, $db); ?> -
- -
- '); - ?> - -
-
' . __('Action') . '' . __('Keyname') . '' . __('Type') . '' . __('Unique') . '' . __('Collation') . '' . __('Null') . '' . __('Comment') . '' . __('Action') . '
' - . ' ' . PMA_getIcon('b_edit.png', __('Edit')) . '' - . ''; - $r .= ''; - $r .= ' ' - . PMA_getIcon('b_drop.png', __('Drop')) . '' - . '' . htmlspecialchars($index->getName()) . '' . htmlspecialchars($index->getType()) . '' . $index->isUnique(true) . '' . htmlspecialchars($index->getComments()) . '' + . ' ' . PMA_getOnlyIcon('b_edit.png', __('Edit')) . '' + . ''; + $r .= ''; + $r .= ' ' + . PMA_getOnlyIcon('b_drop.png', __('Drop')) . '' + . '