Skip to content

Commit

Permalink
Standard menus can now be part of tabindex sequences for keyboard acc…
Browse files Browse the repository at this point in the history
…essibility
  • Loading branch information
moodler committed Nov 3, 2005
1 parent 42521db commit 912127a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/weblib.php
Expand Up @@ -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') .'...';
Expand All @@ -662,6 +663,10 @@ function choose_from_menu ($options, $name, $selected='', $nothing='choose', $sc
$attributes .= ' disabled="disabled"';
}

if ($tabindex) {
$attributes .= ' tabindex="'.$tabindex.'"';
}

$output = '<select id="menu'.$name.'" name="'. $name .'" '. $attributes .'>' . "\n";
if ($nothing) {
$output .= ' <option value="'. $nothingvalue .'"'. "\n";
Expand Down

0 comments on commit 912127a

Please sign in to comment.