Add accessibility labels to Indexes
This commit is contained in:
parent
647cab7c69
commit
2cee788ad3
|
@ -112,7 +112,7 @@ function nl_br($string) {
|
||||||
* @param string
|
* @param string
|
||||||
* @param string
|
* @param string
|
||||||
* @param string
|
* @param string
|
||||||
* @return string
|
* @param string
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function checkbox($name, $value, $checked, $label = "", $onclick = "", $class = "", $labelled_by = "") {
|
function checkbox($name, $value, $checked, $label = "", $onclick = "", $class = "", $labelled_by = "") {
|
||||||
|
@ -154,11 +154,15 @@ function optionlist($options, $selected = null, $use_keys = false) {
|
||||||
* @param array
|
* @param array
|
||||||
* @param string
|
* @param string
|
||||||
* @param string true for no onchange, false for radio
|
* @param string true for no onchange, false for radio
|
||||||
|
* @param string
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function html_select($name, $options, $value = "", $onchange = true) {
|
function html_select($name, $options, $value = "", $onchange = true, $labelled_by = "") {
|
||||||
if ($onchange) {
|
if ($onchange) {
|
||||||
return "<select name='" . h($name) . "'" . (is_string($onchange) ? ' onchange="' . h($onchange) . '"' : "") . ">" . optionlist($options, $value) . "</select>";
|
return "<select name='" . h($name) . "'"
|
||||||
|
. (is_string($onchange) ? ' onchange="' . h($onchange) . '"' : "")
|
||||||
|
. ($labelled_by ? " aria-labelledby='$labelled_by'" : "")
|
||||||
|
. ">" . optionlist($options, $value) . "</select>";
|
||||||
}
|
}
|
||||||
$return = "";
|
$return = "";
|
||||||
foreach ($options as $key => $val) {
|
foreach ($options as $key => $val) {
|
||||||
|
|
|
@ -93,9 +93,9 @@ if (!$row) {
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
<table cellspacing="0" class="nowrap">
|
<table cellspacing="0" class="nowrap">
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
<th><?php echo lang('Index Type'); ?>
|
<th id="label-type"><?php echo lang('Index Type'); ?>
|
||||||
<th><input type="submit" class="wayoff"><?php echo lang('Column (length)'); ?>
|
<th><input type="submit" class="wayoff"><?php echo lang('Column (length)'); ?>
|
||||||
<th><?php echo lang('Name'); ?>
|
<th id="label-name"><?php echo lang('Name'); ?>
|
||||||
<th><noscript><input type='image' class='icon' name='add[0]' src='../adminer/static/plus.gif' alt='+' title='<?php echo lang('Add next'); ?>'></noscript>
|
<th><noscript><input type='image' class='icon' name='add[0]' src='../adminer/static/plus.gif' alt='+' title='<?php echo lang('Add next'); ?>'></noscript>
|
||||||
</thead>
|
</thead>
|
||||||
<?php
|
<?php
|
||||||
|
@ -110,24 +110,24 @@ if ($primary) {
|
||||||
$j = 1;
|
$j = 1;
|
||||||
foreach ($row["indexes"] as $index) {
|
foreach ($row["indexes"] as $index) {
|
||||||
if (!$_POST["drop_col"] || $j != key($_POST["drop_col"])) {
|
if (!$_POST["drop_col"] || $j != key($_POST["drop_col"])) {
|
||||||
echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow(this);" : 1));
|
echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow(this);" : 1), "label-type");
|
||||||
|
|
||||||
echo "<td>";
|
echo "<td>";
|
||||||
ksort($index["columns"]);
|
ksort($index["columns"]);
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach ($index["columns"] as $key => $column) {
|
foreach ($index["columns"] as $key => $column) {
|
||||||
echo "<span>" . select_input(
|
echo "<span>" . select_input(
|
||||||
" name='indexes[$j][columns][$i]' onchange=\"" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . "(this, '" . h(js_escape($jush == "sql" ? "" : $_GET["indexes"] . "_")) . "');\"",
|
" name='indexes[$j][columns][$i]' onchange=\"" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . "(this, '" . h(js_escape($jush == "sql" ? "" : $_GET["indexes"] . "_")) . "');\" title='" . lang('Column') . "'",
|
||||||
($fields ? array_combine($fields, $fields) : $fields),
|
($fields ? array_combine($fields, $fields) : $fields),
|
||||||
$column
|
$column
|
||||||
);
|
);
|
||||||
echo ($jush == "sql" || $jush == "mssql" ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h($index["lengths"][$key]) . "'>" : "");
|
echo ($jush == "sql" || $jush == "mssql" ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h($index["lengths"][$key]) . "' title='" . lang('Length') . "'>" : "");
|
||||||
echo ($jush != "sql" ? checkbox("indexes[$j][descs][$i]", 1, $index["descs"][$key], lang('descending')) : "");
|
echo ($jush != "sql" ? checkbox("indexes[$j][descs][$i]", 1, $index["descs"][$key], lang('descending')) : "");
|
||||||
echo " </span>";
|
echo " </span>";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "' autocapitalize='off'>\n";
|
echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "' autocapitalize='off' aria-labelledby='label-name'>\n";
|
||||||
echo "<td><input type='image' class='icon' name='drop_col[$j]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick=\"return !editingRemoveRow(this, 'indexes\$1[type]');\">\n";
|
echo "<td><input type='image' class='icon' name='drop_col[$j]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick=\"return !editingRemoveRow(this, 'indexes\$1[type]');\">\n";
|
||||||
}
|
}
|
||||||
$j++;
|
$j++;
|
||||||
|
|
Loading…
Reference in a new issue