]> git.joonet.de Git - adminer.git/commitdiff
Hide view links without view support
authorJakub Vrana <jakub@vrana.cz>
Wed, 11 Jun 2025 07:27:51 +0000 (09:27 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 11 Jun 2025 13:16:17 +0000 (15:16 +0200)
adminer/db.inc.php
adminer/include/adminer.inc.php

index ecc02dd431b985a398ada203a4e250c8aa598103..b9c53df17e1b6afd1ca7c81838fd1110e6219961 100644 (file)
@@ -97,7 +97,8 @@ if (adminer()->homepage()) {
                                echo '<tr><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array("$name", $tables_views, true), "", "", "", $id); // "$name" to check numeric table names
                                echo '<th>' . (support("table") || support("indexes") ? "<a href='" . h(ME) . "table=" . urlencode($name) . "' title='" . lang('Show structure') . "' id='$id'>" . h($name) . '</a>' : h($name));
                                if ($view) {
-                                       echo '<td colspan="6"><a href="' . h(ME) . "view=" . urlencode($name) . '" title="' . lang('Alter view') . '">' . (preg_match('~materialized~i', $type) ? lang('Materialized view') : lang('View')) . '</a>';
+                                       $title = (preg_match('~materialized~i', $type) ? lang('Materialized view') : lang('View'));
+                                       echo '<td colspan="6">' . (support("view") ? "<a href='" . h(ME) . "view=" . urlencode($name) . "' title='" . lang('Alter view') . "'>$title</a>" : $title);
                                        echo '<td align="right"><a href="' . h(ME) . "select=" . urlencode($name) . '" title="' . lang('Select data') . '">?</a>';
                                } else {
                                        foreach (
index 69fd67f2cf9891cae01982c18336117bfe117890..52115ebda4bad636730ec7c68354d4f9b4968e10 100644 (file)
@@ -197,10 +197,10 @@ class Adminer {
                $is_view = false;
                if (support("table")) {
                        $is_view = is_view($tableStatus);
-                       if ($is_view) {
-                               $links["view"] = lang('Alter view');
-                       } else {
+                       if (!$is_view) {
                                $links["create"] = lang('Alter table');
+                       } elseif (support("view")) {
+                               $links["view"] = lang('Alter view');
                        }
                }
                if ($set !== null) {