Highlight primary key
This commit is contained in:
@@ -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">
|
||||||
|
@@ -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