]> git.joonet.de Git - adminer.git/commitdiff
Unify displaying of 'New item' action based on privileges
authorPeter Knut <peter@pematon.com>
Thu, 3 Oct 2024 22:26:04 +0000 (00:26 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 19 Feb 2025 10:16:40 +0000 (11:16 +0100)
adminer/table.inc.php

index 6c63f97094396351ffff877b9c464deefbcf1ab0..7817287cebafb052a3a82aafa31ef54125e34989 100644 (file)
@@ -9,7 +9,12 @@ $name = $adminer->tableName($table_status);
 
 page_header(($fields && is_view($table_status) ? $table_status['Engine'] == 'materialized view' ? lang('Materialized view') : lang('View') : lang('Table')) . ": " . ($name != "" ? $name : h($TABLE)), $error);
 
-$adminer->selectLinks($table_status);
+$rights = array();
+foreach ($fields as $key => $field) {
+       $rights += $field["privileges"];
+}
+$adminer->selectLinks($table_status, (isset($rights["insert"]) || !support("table") ? "" : null));
+
 $comment = $table_status["Comment"];
 if ($comment != "") {
        echo "<p class='nowrap'>" . lang('Comment') . ": " . h($comment) . "\n";
@@ -28,7 +33,7 @@ if (!is_view($table_status)) {
                }
                echo '<p class="links"><a href="' . h(ME) . 'indexes=' . urlencode($TABLE) . '">' . lang('Alter indexes') . "</a>\n";
        }
-       
+
        if (fk_support($table_status)) {
                echo "<h3 id='foreign-keys'>" . lang('Foreign keys') . "</h3>\n";
                $foreign_keys = foreign_keys($TABLE);