From 912127a1586e2f60d63705b150bea182012daba8 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 3 Nov 2005 05:01:31 +0000 Subject: [PATCH] Standard menus can now be part of tabindex sequences for keyboard accessibility --- lib/weblib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/weblib.php b/lib/weblib.php index fc19003c40b..fba3e9bd68f 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -651,7 +651,8 @@ function close_window($delay=0) { * @param type description * @todo Finish documenting this function */ -function choose_from_menu ($options, $name, $selected='', $nothing='choose', $script='', $nothingvalue='0', $return=false, $disabled=false) { +function choose_from_menu ($options, $name, $selected='', $nothing='choose', $script='', + $nothingvalue='0', $return=false, $disabled=false, $tabindex=0) { if ($nothing == 'choose') { $nothing = get_string('choose') .'...'; @@ -662,6 +663,10 @@ function choose_from_menu ($options, $name, $selected='', $nothing='choose', $sc $attributes .= ' disabled="disabled"'; } + if ($tabindex) { + $attributes .= ' tabindex="'.$tabindex.'"'; + } + $output = '