]> git.joonet.de Git - adminer.git/commitdiff
Elastic: Hide select functions
authorJakub Vrana <jakub@vrana.cz>
Fri, 19 Jul 2013 21:10:02 +0000 (14:10 -0700)
committerJakub Vrana <jakub@vrana.cz>
Fri, 19 Jul 2013 21:11:54 +0000 (14:11 -0700)
adminer/include/adminer.inc.php

index e9bf0c1433f756500511948c1af0a7a9ec334e14..7e509650fa86f5f494a99d951dc8fe9e58cc1efd 100644 (file)
@@ -232,13 +232,13 @@ username.form['auth[driver]'].onchange();
                global $functions, $grouping;
                print_fieldset("select", lang('Select'), $select);
                $i = 0;
-               $fun_group = array_filter(array(lang('Functions') => $functions, lang('Aggregation') => $grouping));
                $select[""] = array();
                foreach ($select as $key => $val) {
                        $val = $_GET["columns"][$key];
-                       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";
+                       $column = select_input(" name='columns[$i][col]' onchange='" . ($key !== ""  ? "selectFieldChange(this.form)" : "selectAddRow(this)") . ";'", $columns, $val["col"]);
+                       echo "<div>" . ($functions || $grouping ? "<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 => "") + array_filter(array(lang('Functions') => $functions, lang('Aggregation') => $grouping)), $val["fun"]) . "</select>"
+                               . "($column)" : $column) . "</div>\n";
                        $i++;
                }
                echo "</div></fieldset>\n";