1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

Add accessibility labels to Indexes

This commit is contained in:
Jakub Vrana
2017-01-23 14:29:00 -08:00
parent 647cab7c69
commit 2cee788ad3
2 changed files with 13 additions and 9 deletions

View File

@@ -112,7 +112,7 @@ function nl_br($string) {
* @param string
* @param string
* @param string
* @return string
* @param string
* @return string
*/
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 string
* @param string true for no onchange, false for radio
* @param string
* @return string
*/
function html_select($name, $options, $value = "", $onchange = true) {
function html_select($name, $options, $value = "", $onchange = true, $labelled_by = "") {
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 = "";
foreach ($options as $key => $val) {