MDL-80469 forms: add a hidden label to the button action group
This is a temporary solution to the accessibility problem "Fieldsets without legend". We will no longer use a fieldset tag if there is no legend after MDL-80431
This commit is contained in:
@@ -410,7 +410,8 @@ class course_edit_form extends moodleform {
|
||||
}
|
||||
$buttonarray[] = &$mform->createElement('submit', 'saveanddisplay', get_string('savechangesanddisplay'), $classarray);
|
||||
$buttonarray[] = &$mform->createElement('cancel');
|
||||
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
|
||||
$grp = $mform->addGroup($buttonarray, 'buttonar', get_string('formactions', 'core_form'), array(' '), false);
|
||||
$grp->setHiddenLabel(true);
|
||||
$mform->closeHeaderBefore('buttonar');
|
||||
|
||||
$mform->addElement('hidden', 'id', null);
|
||||
|
||||
@@ -1054,7 +1054,8 @@ abstract class moodleform_mod extends moodleform {
|
||||
$buttonarray[] = &$mform->createElement('cancel');
|
||||
}
|
||||
|
||||
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
|
||||
$grp = $mform->addGroup($buttonarray, 'buttonar', get_string('formactions', 'form'), array(' '), false);
|
||||
$grp->setHiddenLabel(true);
|
||||
$mform->setType('buttonar', PARAM_RAW);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -1380,7 +1380,8 @@ abstract class moodleform {
|
||||
$mform->createElement('cancel'),
|
||||
];
|
||||
$buttonarname = $forceuniqueid && $this::$uniqueid > 0 ? 'buttonar_' . $this::$uniqueid : 'buttonar';
|
||||
$mform->addGroup($buttonarray, $buttonarname, '', [' '], false);
|
||||
$grp = $mform->addGroup($buttonarray, $buttonarname, get_string('formactions', 'core_form'), [' '], false);
|
||||
$grp->setHiddenLabel(true);
|
||||
$mform->closeHeaderBefore('buttonar');
|
||||
} else {
|
||||
// No group needed.
|
||||
|
||||
Reference in New Issue
Block a user