]> git.joonet.de Git - adminer.git/commitdiff
PostgreSQL: Fix help link to pg_catalog views
authorJakub Vrana <jakub@vrana.cz>
Wed, 26 Feb 2025 18:21:13 +0000 (19:21 +0100)
committerJakub Vrana <jakub@vrana.cz>
Wed, 26 Feb 2025 18:21:13 +0000 (19:21 +0100)
adminer/drivers/mysql.inc.php
adminer/drivers/pgsql.inc.php
adminer/drivers/sqlite.inc.php
adminer/include/adminer.inc.php
adminer/include/driver.inc.php

index 47ba442fc70b114e117e456da91e2d1e37f7159c..bdafbddc99389cc0748e333cdb86f9f2dc55371f 100644 (file)
@@ -335,7 +335,7 @@ if (!defined("DRIVER")) {
                        }
                }
 
-               function tableHelp($name) {
+               function tableHelp($name, $is_view = false) {
                        $maria = preg_match('~MariaDB~', $this->_conn->server_info);
                        if (information_schema(DB)) {
                                return strtolower("information-schema-" . ($maria ? "$name-table/" : str_replace("_", "-", $name) . "-table.html"));
index 069d3f855189893ab3965ad2e3e80d7088eaab33..69be6117e78f13b243cb24fd91243be39bb97db3 100644 (file)
@@ -238,10 +238,10 @@ if (isset($_GET["pgsql"])) {
                        return $this->_conn->warnings();
                }
 
-               function tableHelp($name) {
+               function tableHelp($name, $is_view = false) {
                        $links = array(
                                "information_schema" => "infoschema",
-                               "pg_catalog" => "catalog",
+                               "pg_catalog" => ($is_view ? "view" : "catalog"),
                        );
                        $link = $links[$_GET["ns"]];
                        if ($link) {
index efe267b8bbdc280f1a79ea457198fa76dd83067c..ec7bdd7a11b844d1aba7c31189bca5b5d0803452 100644 (file)
@@ -130,7 +130,7 @@ if (isset($_GET["sqlite"])) {
                        return queries("REPLACE INTO " . table($table) . " (" . implode(", ", array_keys(reset($rows))) . ") VALUES\n" . implode(",\n", $values));
                }
 
-               function tableHelp($name) {
+               function tableHelp($name, $is_view = false) {
                        if ($name == "sqlite_sequence") {
                                return "fileformat2.html#seqtab";
                        }
index a7d8f8d13de8922fc56e8ad222981061582f0e7d..73e45a573a4105285d4b6b3360516e1b350727fa 100644 (file)
@@ -180,8 +180,10 @@ class Adminer {
                if (support("table") || support("indexes")) {
                        $links["table"] = lang('Show structure');
                }
+               $is_view = false;
                if (support("table")) {
-                       if (is_view($tableStatus)) {
+                       $is_view = is_view($tableStatus);
+                       if ($is_view) {
                                $links["view"] = lang('Alter view');
                        } else {
                                $links["create"] = lang('Alter table');
@@ -194,7 +196,7 @@ class Adminer {
                foreach ($links as $key => $val) {
                        echo " <a href='" . h(ME) . "$key=" . urlencode($name) . ($key == "edit" ? $set : "") . "'" . bold(isset($_GET[$key])) . ">$val</a>";
                }
-               echo doc_link(array($jush => $driver->tableHelp($name)), "?");
+               echo doc_link(array($jush => $driver->tableHelp($name, $is_view)), "?");
                echo "\n";
        }
 
index 9bb21e35badee7ac8935dbc3f68f735324108736..830a34928ada1e3fc9357c9df0c3bce4dcec5f16 100644 (file)
@@ -188,9 +188,10 @@ function get_driver($id) {
 
        /** Get help link for table
        * @param string
+       * @param bool
        * @return string relative URL or null
        */
-       function tableHelp($name) {
+       function tableHelp($name, $is_view = false) {
        }
 
        /** Check if C-style escapes are supported