From e2dbb9c7bdf7f2282fb6b75f779589f5b405054b Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 29 Jul 2012 11:16:41 -0700 Subject: [PATCH] Links for column search in select --- adminer/select.inc.php | 4 +++- adminer/static/functions.js | 22 ++++++++++++++++++++++ changes.txt | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 768e5fa3..3218799b 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -273,10 +273,12 @@ if (!$columns) { if ($name != "") { $rank++; $names[$key] = $name; - $column = idf_escape($key); $href = remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key); echo '' . (!$select || $val ? apply_sql_function($val["fun"], $name) : h(current($select))) . ""; //! columns looking like functions echo ""; + if (!$val["fun"]) { + echo ' ='; + } } $functions[$key] = $val["fun"]; next($select); diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 8dbf4c18..4f5df703 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -262,6 +262,28 @@ function selectFieldChange(form) { +/** Fill column in search field + * @param string + */ +function selectSearch(name) { + var el = document.getElementById('fieldset-search'); + el.className = ''; + var divs = el.getElementsByTagName('div'); + for (var i=0; i < divs.length; i++) { + var div = divs[i]; + if (selectValue(div.firstChild) == name) { + break; + } + } + if (i == divs.length) { + div.firstChild.value = name; + div.firstChild.onchange(); + } + div.lastChild.focus(); +} + + + /** Send form by Ctrl+Enter on