diff --git a/adminer/db.inc.php b/adminer/db.inc.php
index 0807fae2..8c6629c5 100644
--- a/adminer/db.inc.php
+++ b/adminer/db.inc.php
@@ -80,14 +80,27 @@ if (adminer()->homepage()) {
echo '';
echo ' \n";
$tables = 0;
@@ -101,26 +114,15 @@ if (adminer()->homepage()) {
echo '' . script("qs('#check-all').onclick = partial(formCheck, /^(tables|views)\[/);", "");
echo ' ' . lang('Table');
- echo ' ' . lang('Engine') . doc_link(array('sql' => 'storage-engines.html'));
- echo ' ' . lang('Collation') . doc_link(array('sql' => 'charset-charsets.html', 'mariadb' => 'supported-character-sets-and-collations/'));
- echo ' ' . lang('Data Length') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT', 'oracle' => 'REFRN20286'));
- echo ' ' . lang('Index Length') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT'));
- echo ' ' . lang('Data Free') . doc_link(array('sql' => 'show-table-status.html'));
- echo ' ' . lang('Auto Increment') . doc_link(array('sql' => 'example-auto-increment.html', 'mariadb' => 'auto_increment/'));
- echo ' ' . lang('Rows') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'catalog-pg-class.html#CATALOG-PG-CLASS', 'oracle' => 'REFRN20286'));
- echo (support("comment") ? ' ' . lang('Comment') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'functions-info.html#FUNCTIONS-INFO-COMMENT-TABLE')) : '');
+ $columns = array("Engine" => array(lang('Engine') . doc_link(array('sql' => 'storage-engines.html'))));
+ if (collations()) {
+ $columns["Collation"] = array(lang('Collation') . doc_link(array('sql' => 'charset-charsets.html', 'mariadb' => 'supported-character-sets-and-collations/')));
+ }
+ if (function_exists('Adminer\alter_table')) {
+ $columns["Data_length"] = array(lang('Data Length') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT', 'oracle' => 'REFRN20286')), "create", lang('Alter table'));
+ }
+ if (support('indexes')) {
+ $columns["Index_length"] = array(lang('Index Length') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT')), "indexes", lang('Alter indexes'));
+ }
+ $columns["Data_free"] = array(lang('Data Free') . doc_link(array('sql' => 'show-table-status.html')), "edit", lang('New item'));
+ if (function_exists('Adminer\alter_table')) {
+ $columns["Auto_increment"] = array(lang('Auto Increment') . doc_link(array('sql' => 'example-auto-increment.html', 'mariadb' => 'auto_increment/')), "auto_increment=1&create", lang('Alter table'));
+ }
+ $columns["Rows"] = array(lang('Rows') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'catalog-pg-class.html#CATALOG-PG-CLASS', 'oracle' => 'REFRN20286')), "select", lang('Select data'));
+ if (support("comment")) {
+ $columns["Comment"] = array(lang('Comment') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'functions-info.html#FUNCTIONS-INFO-COMMENT-TABLE')));
+ }
+ foreach ($columns as $column) {
+ echo " $column[0]";
+ }
echo "
" . lang('Create table') . "\n"; + echo (function_exists('Adminer\alter_table') ? "
" . lang('Create table') . "\n" : ''); echo (support("view") ? "" . lang('Create view') . "\n" : ""); if (support("routine")) { diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 1211f86f..933ec267 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -201,10 +201,12 @@ class Adminer { $is_view = false; if (support("table")) { $is_view = is_view($tableStatus); - if (!$is_view) { + if ($is_view) { + if (support("view")) { + $links["view"] = lang('Alter view'); + } + } elseif (function_exists('Adminer\alter_table')) { $links["create"] = lang('Alter table'); - } elseif (support("view")) { - $links["view"] = lang('Alter view'); } } if ($set !== null) { @@ -423,7 +425,7 @@ class Adminer { echo "
\n" . implode("\n", $actions) . "\n" : "");