Compare commits
2 Commits
6180c4ec60
...
83bdc9bbd7
Author | SHA1 | Date | |
---|---|---|---|
83bdc9bbd7 | |||
ff375abc90 |
@@ -465,7 +465,7 @@ class PMA_Index
|
|||||||
$this_params['index'] = $index->getName();
|
$this_params['index'] = $index->getName();
|
||||||
$r .= '<td ' . $row_span . '>'
|
$r .= '<td ' . $row_span . '>'
|
||||||
. ' <a href="tbl_indexes.php' . PMA_generate_common_url($this_params)
|
. ' <a href="tbl_indexes.php' . PMA_generate_common_url($this_params)
|
||||||
. '">' . PMA_getIcon('b_edit.png', __('Edit')) . '</a>'
|
. '">' . PMA_getOnlyIcon('b_edit.png', __('Edit')) . '</a>'
|
||||||
. '</td>' . "\n";
|
. '</td>' . "\n";
|
||||||
|
|
||||||
$this_params = $GLOBALS['url_params'];
|
$this_params = $GLOBALS['url_params'];
|
||||||
@@ -487,7 +487,7 @@ class PMA_Index
|
|||||||
}
|
}
|
||||||
$r .= ' href="sql.php' . PMA_generate_common_url($this_params)
|
$r .= ' href="sql.php' . PMA_generate_common_url($this_params)
|
||||||
. '" >'
|
. '" >'
|
||||||
. PMA_getIcon('b_drop.png', __('Drop')) . '</a>'
|
. PMA_getOnlyIcon('b_drop.png', __('Drop')) . '</a>'
|
||||||
. '</td>' . "\n";
|
. '</td>' . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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