diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 01ca386d..6eadf94e 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -314,6 +314,15 @@ if (!defined("DRIVER")) { } } + function tableHelp($name) { + if (information_schema(DB)) { + return strtolower(str_replace("_", "-", $name)) . "-table.html"; + } + if (DB == "mysql") { + return "system-database.html"; //! more precise link + } + } + } diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index b27a7aee..8b32fbf3 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -216,6 +216,17 @@ if (isset($_GET["pgsql"])) { return $this->_conn->warnings(); } + function tableHelp($name) { + $links = array( + "information_schema" => "infoschema", + "pg_catalog" => "catalog", + ); + $link = $links[$_GET["ns"]]; + if ($link) { + return "$link-" . str_replace("_", "-", $name) . ".html"; + } + } + } diff --git a/adminer/drivers/sqlite.inc.php b/adminer/drivers/sqlite.inc.php index af4f2beb..b34511e5 100644 --- a/adminer/drivers/sqlite.inc.php +++ b/adminer/drivers/sqlite.inc.php @@ -218,6 +218,15 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) { return queries("REPLACE INTO " . table($table) . " (" . implode(", ", array_keys(reset($rows))) . ") VALUES\n" . implode(",\n", $values)); } + function tableHelp($name) { + if ($name == "sqlite_sequence") { + return "fileformat2.html#seqtab"; + } + if ($name == "sqlite_master") { + return "fileformat2.html#$name"; + } + } + } diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index f05b3cbb..325b3484 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -160,6 +160,7 @@ class Adminer { * @return null */ function selectLinks($tableStatus, $set = "") { + global $jush, $driver; echo '
'; $links = array("select" => lang('Select data')); if (support("table") || support("indexes")) { @@ -175,9 +176,11 @@ class Adminer { if ($set !== null) { $links["edit"] = lang('New item'); } + $name = $tableStatus["Name"]; foreach ($links as $key => $val) { - echo " $val"; + echo " $val"; } + echo doc_link(array($jush => $driver->tableHelp($name)), "?"); echo "\n"; } diff --git a/adminer/include/driver.inc.php b/adminer/include/driver.inc.php index 1a4e86ea..da332b26 100644 --- a/adminer/include/driver.inc.php +++ b/adminer/include/driver.inc.php @@ -147,4 +147,11 @@ return ''; } + /** Get help link for table + * @param string + * @return string relative URL or null + */ + function tableHelp($name) { + } + } diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index a16bb41d..4a4e0bcb 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -483,9 +483,10 @@ function ini_bytes($ini) { /** Create link to database documentation * @param array $jush => $path +* @param string HTML code * @return string HTML code */ -function doc_link($paths) { +function doc_link($paths, $text = "?") { global $jush, $connection; $version = preg_replace('~^(\\d\\.?\\d).*~s', '\\1', $connection->server_info); $urls = array( @@ -495,7 +496,7 @@ function doc_link($paths) { 'mssql' => "https://msdn.microsoft.com/library/", 'oracle' => "https://download.oracle.com/docs/cd/B19306_01/server.102/b14200/", ); - return ($paths[$jush] ? "?" : ""); + return ($paths[$jush] ? "$text" : ""); } /** Wrap gzencode() for usage in ob_start() diff --git a/changes.txt b/changes.txt index 85ab585d..48849cea 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,7 @@ Adminer 4.6.1-dev: Speed up rendering of long tables (regression from 4.4.0) Sticky position of table actions +Add system tables help links MySQL: Support non-utf8 charset in search in column MySQL: Support geometry in MySQL 8 (bug #574) SQLite: Allow deleting PRIMARY KEY from tables with auto increment