1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-18 20:31:19 +02:00

Display help for functions and MySQL engines

This commit is contained in:
Jakub Vrana
2013-07-19 11:55:49 -07:00
parent f8453fe65c
commit 3b3d169c72
8 changed files with 33 additions and 20 deletions

View File

@@ -236,7 +236,8 @@ username.form['auth[driver]'].onchange();
$select[""] = array();
foreach ($select as $key => $val) {
$val = $_GET["columns"][$key];
echo "<div>" . html_select("columns[$i][fun]", array(-1 => "") + $fun_group, $val["fun"], ($key !== "" ? "" : " this.nextSibling.nextSibling.onchange();"));
echo "<div><select name='columns[$i][fun]' onchange='helpClose();" . ($key !== "" ? "" : " this.nextSibling.nextSibling.onchange();") . "'"
. on_help("getTarget(event).value && getTarget(event).value.replace(/ |\$/, '(') + ')'", 1) . ">" . optionlist(array(-1 => "") + $fun_group, $val["fun"]) . "</select>";
echo "(" . select_input(" name='columns[$i][col]' onchange='" . ($key !== "" ? "selectFieldChange(this.form)" : "selectAddRow(this)") . ";'", $columns, $val["col"]) . ")</div>\n";
$i++;
}

View File

@@ -469,10 +469,10 @@ function doc_link($path) {
}
/** Return events to display help on mouse over
* @param string
* @param bool
* @param string JS expression
* @param bool JS expression
* @return string
*/
function on_help($command, $right = 0) {
return " onmouseover=\"helpMouseover(this, '" . js_escape($command) . "', $right);\" onmouseout='helpMouseout();'";
function on_help($command, $side = 0) {
return " onmouseover='helpMouseover(getTarget(event), " . h($command) . ", $side);' onmouseout='helpMouseout();'";
}

View File

@@ -800,7 +800,7 @@ function input($field, $value, $function) {
$onchange = ($first ? " onchange=\"var f = this.form['function[" . h(js_escape(bracket_escape($field["field"]))) . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\"" : "");
$attrs .= $onchange;
echo (count($functions) > 1
? html_select("function[$name]", $functions, $function === null || in_array($function, $functions) || isset($functions[$function]) ? $function : "", "functionChange(this);")
? "<select name='function[$name]' onchange='functionChange(this);'" . on_help("getTarget(event).value.replace(/^SQL\$/, '')", 1) . ">" . optionlist($functions, $function === null || in_array($function, $functions) || isset($functions[$function]) ? $function : "") . "</select>"
: nbsp(reset($functions))
) . '<td>';
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table