mirror of
https://github.com/vrana/adminer.git
synced 2025-08-30 09:39:51 +02:00
Show second link for editing a table under the table view, add table head to indexes
This commit is contained in:
@@ -366,9 +366,12 @@ class Adminer {
|
||||
*/
|
||||
function tableIndexesPrint($indexes) {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<thead><tr><th>" . lang('Type') . "</th><td>" . lang('Column (length)') . "</td></tr></thead>\n";
|
||||
|
||||
foreach ($indexes as $name => $index) {
|
||||
ksort($index["columns"]); // enforce correct columns order
|
||||
$print = array();
|
||||
$print = [];
|
||||
|
||||
foreach ($index["columns"] as $key => $val) {
|
||||
$print[] = "<i>" . h($val) . "</i>"
|
||||
. ($index["lengths"][$key] ? "(" . $index["lengths"][$key] . ")" : "")
|
||||
@@ -377,6 +380,7 @@ class Adminer {
|
||||
}
|
||||
echo "<tr title='" . h($name) . "'><th>$index[type]<td>" . implode(", ", $print) . "\n";
|
||||
}
|
||||
|
||||
echo "</table>\n";
|
||||
}
|
||||
|
||||
|
@@ -28,10 +28,20 @@ if ($comment != "") {
|
||||
if ($fields) {
|
||||
$adminer->tableStructurePrint($fields);
|
||||
|
||||
if (is_view($table_status)) {
|
||||
$editLink = '<p class="links"><a href="' . h(ME) . 'view=' . urlencode($TABLE) . '">' . lang('Alter view') . "</a>\n";
|
||||
} else {
|
||||
$editLink = '<p class="links"><a href="' . h(ME) . 'create=' . urlencode($TABLE) . '">' . lang('Alter table') . "</a>\n";
|
||||
}
|
||||
echo $editLink;
|
||||
|
||||
if (support("partitioning") && preg_match("~partitioned~", $table_status["Create_options"])) {
|
||||
echo "<h3 id='partition-by'>" . lang('Partition by') . "</h3>\n";
|
||||
|
||||
$partitions_info = get_partitions_info($TABLE);
|
||||
$adminer->tablePartitionsPrint($partitions_info);
|
||||
|
||||
echo $editLink;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user