diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index c0d1eb44..8be06c23 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -185,6 +185,14 @@ username.form['auth[driver]'].onchange(); return $rows; } + /** Get a link to use in select table + * @param string raw value of the field + * @param array single field returned from fields() + * @return string or null to create the default link + */ + function selectLink($val, $field) { + } + /** Value printed in select table * @param string HTML-escaped value to print * @param string link to foreign key diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 839e4bd9..29a3f6ad 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -384,9 +384,9 @@ if (!$columns) { } } } - if (!$link) { - if (is_mail($val)) { - $link = "mailto:$val"; + if (!$link && ($link = $adminer->selectLink($row[$key], $field)) === null) { + if (is_mail($row[$key])) { + $link = "mailto:$row[$key]"; } if ($protocol = is_url($row[$key])) { $link = ($protocol == "http" && $HTTPS diff --git a/changes.txt b/changes.txt index 2420cd76..bd43363a 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,6 @@ Adminer 3.6.3-dev: Display error code in SQL query +Allow specifying external links Treat Meta key same as Ctrl Don't use type="number" for decimal numbers diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 8fad7143..05b3178a 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -162,6 +162,9 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5 return $return; } + function selectLink($val, $field) { + } + function selectVal($val, $link, $field) { $return = ($val === null ? " " : $val); $link = h($link); diff --git a/plugins/links-direct.php b/plugins/links-direct.php new file mode 100644 index 00000000..857782b5 --- /dev/null +++ b/plugins/links-direct.php @@ -0,0 +1,17 @@ +_applyPlugin(__FUNCTION__, $args); } + function selectLink() { + $args = func_get_args(); + return $this->_applyPlugin(__FUNCTION__, $args); + } + function selectVal() { $args = func_get_args(); return $this->_applyPlugin(__FUNCTION__, $args);