Compare commits
2 Commits
retro
...
6180c4ec60
Author | SHA1 | Date | |
---|---|---|---|
6180c4ec60 | |||
ce16b8c77c |
@@ -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']
|
||||||
|
|
||||||
|
@@ -392,13 +392,15 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
|
|||||||
</td>
|
</td>
|
||||||
<td align="center" class="primary">
|
<td align="center" class="primary">
|
||||||
<?php
|
<?php
|
||||||
if ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_type || ($primary && $primary->hasColumn($field_name))) {
|
if ($primary && $primary->hasColumn($field_name)) {
|
||||||
$primary_enabled = false;
|
$primary_extra_class = ' highlight';
|
||||||
|
} elseif ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_type) {
|
||||||
|
$primary_extra_class = ' disabled';
|
||||||
} else {
|
} else {
|
||||||
$primary_enabled = true;
|
$primary_extra_class = '';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<a class="add_primary_key_anchor<?php echo $primary_enabled ? '' : ' disabled' ?>" href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ($primary ? ' DROP PRIMARY KEY,' : '') . ' ADD PRIMARY KEY(' . PMA_backquote($row['Field']) . ')'); ?>&message_to_show=<?php echo urlencode(sprintf(__('A primary key has been added on %s'), htmlspecialchars($row['Field']))); ?>" >
|
<a class="add_primary_key_anchor<?php echo $primary_extra_class ?>" href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ($primary ? ' DROP PRIMARY KEY,' : '') . ' ADD PRIMARY KEY(' . PMA_backquote($row['Field']) . ')'); ?>&message_to_show=<?php echo urlencode(sprintf(__('A primary key has been added on %s'), htmlspecialchars($row['Field']))); ?>" >
|
||||||
<?php echo $titles['Primary']; ?></a>
|
<?php echo $titles['Primary']; ?></a>
|
||||||
</td>
|
</td>
|
||||||
<td align="center" class="unique">
|
<td align="center" class="unique">
|
||||||
@@ -602,20 +604,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
|
||||||
}
|
}
|
||||||
|
@@ -78,6 +78,11 @@ a.disabled {
|
|||||||
filter: grayscale(1);
|
filter: grayscale(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.highlight {
|
||||||
|
cursor: default;
|
||||||
|
filter: grayscale(10%) sepia(40%) hue-rotate(50deg) saturate(150%);
|
||||||
|
}
|
||||||
|
|
||||||
dfn {
|
dfn {
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user