Cleanup indexes bar
This commit is contained in:
@@ -438,9 +438,6 @@ class PMA_Index
|
|||||||
$r .= '<table>';
|
$r .= '<table>';
|
||||||
$r .= '<thead>';
|
$r .= '<thead>';
|
||||||
$r .= '<tr>';
|
$r .= '<tr>';
|
||||||
if (! $print_mode) {
|
|
||||||
$r .= '<th colspan="2">' . __('Action') . '</th>';
|
|
||||||
}
|
|
||||||
$r .= '<th>' . __('Keyname') . '</th>';
|
$r .= '<th>' . __('Keyname') . '</th>';
|
||||||
$r .= '<th>' . __('Type') . '</th>';
|
$r .= '<th>' . __('Type') . '</th>';
|
||||||
$r .= '<th>' . __('Unique') . '</th>';
|
$r .= '<th>' . __('Unique') . '</th>';
|
||||||
@@ -450,6 +447,9 @@ class PMA_Index
|
|||||||
$r .= '<th>' . __('Collation') . '</th>';
|
$r .= '<th>' . __('Collation') . '</th>';
|
||||||
$r .= '<th>' . __('Null') . '</th>';
|
$r .= '<th>' . __('Null') . '</th>';
|
||||||
$r .= '<th>' . __('Comment') . '</th>';
|
$r .= '<th>' . __('Comment') . '</th>';
|
||||||
|
if (! $print_mode) {
|
||||||
|
$r .= '<th colspan="2">' . __('Action') . '</th>';
|
||||||
|
}
|
||||||
$r .= '</tr>';
|
$r .= '</tr>';
|
||||||
$r .= '</thead>';
|
$r .= '</thead>';
|
||||||
$r .= '<tbody>';
|
$r .= '<tbody>';
|
||||||
@@ -460,37 +460,6 @@ class PMA_Index
|
|||||||
|
|
||||||
$r .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
|
$r .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
|
||||||
|
|
||||||
if (! $print_mode) {
|
|
||||||
$this_params = $GLOBALS['url_params'];
|
|
||||||
$this_params['index'] = $index->getName();
|
|
||||||
$r .= '<td ' . $row_span . '>'
|
|
||||||
. ' <a href="tbl_indexes.php' . PMA_generate_common_url($this_params)
|
|
||||||
. '">' . PMA_getIcon('b_edit.png', __('Edit')) . '</a>'
|
|
||||||
. '</td>' . "\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 .= '<td ' . $row_span . '>';
|
|
||||||
$r .= '<input type="hidden" class="drop_primary_key_index_msg" value="' . $js_msg . '" />';
|
|
||||||
$r .= ' <a ';
|
|
||||||
if ($GLOBALS['cfg']['AjaxEnable']) {
|
|
||||||
$r .= 'class="drop_primary_key_index_anchor" ';
|
|
||||||
}
|
|
||||||
$r .= ' href="sql.php' . PMA_generate_common_url($this_params)
|
|
||||||
. '" >'
|
|
||||||
. PMA_getIcon('b_drop.png', __('Drop')) . '</a>'
|
|
||||||
. '</td>' . "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$r .= '<th ' . $row_span . '>' . htmlspecialchars($index->getName()) . '</th>';
|
$r .= '<th ' . $row_span . '>' . htmlspecialchars($index->getName()) . '</th>';
|
||||||
$r .= '<td ' . $row_span . '>' . htmlspecialchars($index->getType()) . '</td>';
|
$r .= '<td ' . $row_span . '>' . htmlspecialchars($index->getType()) . '</td>';
|
||||||
$r .= '<td ' . $row_span . '>' . $index->isUnique(true) . '</td>';
|
$r .= '<td ' . $row_span . '>' . $index->isUnique(true) . '</td>';
|
||||||
@@ -513,6 +482,38 @@ class PMA_Index
|
|||||||
$r .= '<td ' . $row_span . '>'
|
$r .= '<td ' . $row_span . '>'
|
||||||
. htmlspecialchars($index->getComments()) . '</td>';
|
. htmlspecialchars($index->getComments()) . '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $print_mode) {
|
||||||
|
$this_params = $GLOBALS['url_params'];
|
||||||
|
$this_params['index'] = $index->getName();
|
||||||
|
$r .= '<td ' . $row_span . '>'
|
||||||
|
. ' <a href="tbl_indexes.php' . PMA_generate_common_url($this_params)
|
||||||
|
. '">' . PMA_getOnlyIcon('b_edit.png', __('Edit')) . '</a>'
|
||||||
|
. '</td>' . "\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 .= '<td ' . $row_span . '>';
|
||||||
|
$r .= '<input type="hidden" class="drop_primary_key_index_msg" value="' . $js_msg . '" />';
|
||||||
|
$r .= ' <a ';
|
||||||
|
if ($GLOBALS['cfg']['AjaxEnable']) {
|
||||||
|
$r .= 'class="drop_primary_key_index_anchor" ';
|
||||||
|
}
|
||||||
|
$r .= ' href="sql.php' . PMA_generate_common_url($this_params)
|
||||||
|
. '" >'
|
||||||
|
. PMA_getOnlyIcon('b_drop.png', __('Drop')) . '</a>'
|
||||||
|
. '</td>' . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
$r .= '</tr>';
|
$r .= '</tr>';
|
||||||
} // end foreach $index['Sequences']
|
} // end foreach $index['Sequences']
|
||||||
|
|
||||||
|
@@ -602,20 +602,6 @@ if (! $tbl_is_view && ! $db_is_information_schema && 'ARCHIVE' != $tbl_type) {
|
|||||||
*/
|
*/
|
||||||
echo PMA_Index::getView($table, $db);
|
echo PMA_Index::getView($table, $db);
|
||||||
?>
|
?>
|
||||||
<br />
|
|
||||||
<form action="./tbl_indexes.php" method="post"
|
|
||||||
onsubmit="return checkFormElementInRange(this, 'added_fields',
|
|
||||||
'<?php echo str_replace('\'', '\\\'', __('Column count has to be larger than zero.')); ?>',
|
|
||||||
1)">
|
|
||||||
<fieldset>
|
|
||||||
<?php
|
|
||||||
echo PMA_generate_common_hidden_inputs($db, $table);
|
|
||||||
echo sprintf(__('Create an index on %s columns'),
|
|
||||||
'<input type="text" size="2" name="added_fields" value="1" />');
|
|
||||||
?>
|
|
||||||
<input type="submit" name="create_index" value="<?php echo __('Go'); ?>" />
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user