diff --git a/adminer/dump.inc.php b/adminer/dump.inc.php index 28e1f34f..d3e2d425 100644 --- a/adminer/dump.inc.php +++ b/adminer/dump.inc.php @@ -167,9 +167,9 @@ if (!isset($row["events"])) { // backwards compatibility $row["triggers"] = $row["table_style"]; } -echo "" . lang('Output') . "" . html_select("output", $adminer->dumpOutput(), $row["output"], 0) . "\n"; // 0 - radio +echo "" . lang('Output') . "" . html_radios("output", $adminer->dumpOutput(), $row["output"]) . "\n"; -echo "" . lang('Format') . "" . html_select("format", $adminer->dumpFormat(), $row["format"], 0) . "\n"; // 0 - radio +echo "" . lang('Format') . "" . html_radios("format", $adminer->dumpFormat(), $row["format"]) . "\n"; echo (JUSH == "sqlite" ? "" : "" . lang('Database') . "" . html_select('db_style', $db_style, $row["db_style"]) . (support("type") ? checkbox("types", 1, $row["types"], lang('User types')) : "") diff --git a/adminer/foreign.inc.php b/adminer/foreign.inc.php index 72ef1f1a..e371b762 100644 --- a/adminer/foreign.inc.php +++ b/adminer/foreign.inc.php @@ -94,8 +94,8 @@ if (support("scheme")) { $j = 0; foreach ($row["source"] as $key => $val) { echo ""; - echo "" . html_select("source[" . (+$key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow.call(this);" : 1), "label-source"); - echo "" . html_select("target[" . (+$key) . "]", $target, $row["target"][$key], 1, "label-target"); + echo "" . html_select("source[" . (+$key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow.call(this);" : ""), "label-source"); + echo "" . html_select("target[" . (+$key) . "]", $target, $row["target"][$key], "", "label-target"); $j++; } ?> diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 0ef1f71c..3daa9905 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -217,22 +217,29 @@ function optionlist($options, $selected = null, $use_keys = false) { return $return; } +/** Generate HTML " . optionlist($options, $value) . "" + . ($onchange ? script("qsl('select').onchange = function () { $onchange };", "") : "") + ; +} + /** Generate HTML radio list * @param string * @param array * @param string -* @param string true for no onchange, false for radio -* @param string * @return string */ -function html_select($name, $options, $value = "", $onchange = true, $labelled_by = "") { - if ($onchange) { - return "" - . (is_string($onchange) ? script("qsl('select').onchange = function () { $onchange };", "") : "") - ; - } +function html_radios($name, $options, $value = "") { $return = ""; foreach ($options as $key => $val) { $return .= ""; diff --git a/adminer/indexes.inc.php b/adminer/indexes.inc.php index 84f02257..43712d3a 100644 --- a/adminer/indexes.inc.php +++ b/adminer/indexes.inc.php @@ -126,7 +126,7 @@ if ($primary) { $j = 1; foreach ($row["indexes"] as $index) { if (!$_POST["drop_col"] || $j != key($_POST["drop_col"])) { - echo "" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow.call(this);" : 1), "label-type"); + echo "" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow.call(this);" : ""), "label-type"); echo ""; ksort($index["columns"]); diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 834a4b41..95950d72 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -587,7 +587,7 @@ if (!$columns && support("table")) { echo script("qsl('a').onclick = partial(toggle, 'import');", ""); echo ""; echo "";