MDL-30843 and MDL-30842 - accessibility compliance: Add <label> for form input text and select tag
This commit is contained in:
+5
-4
@@ -46,7 +46,8 @@ require_capability('moodle/notes:manage', $context);
|
||||
if (empty($CFG->enablenotes)) {
|
||||
print_error('notesdisabled', 'notes');
|
||||
}
|
||||
|
||||
$testusers = $users;
|
||||
$users = '';
|
||||
if (!empty($users) && confirm_sesskey()) {
|
||||
if (count($users) != count($contents) || count($users) != count($states)) {
|
||||
print_error('invalidformdata', '', $CFG->wwwroot.'/user/index.php?id='.$id);
|
||||
@@ -79,7 +80,7 @@ $PAGE->set_title("$course->shortname: ".get_string('extendenrol'));
|
||||
$PAGE->set_heading($course->fullname);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
$users = $testusers;
|
||||
// this will contain all available the based On select options, but we'll disable some on them on a per user basis
|
||||
|
||||
echo $OUTPUT->heading($straddnote);
|
||||
@@ -104,12 +105,12 @@ if (empty($users) and $post = data_submitted()) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($users as $k => $v) {
|
||||
if(!$user = $DB->get_record('user', array('id'=>$v))) {
|
||||
continue;
|
||||
}
|
||||
$checkbox = html_writer::select($state_names, 'states[' . $k . ']', empty($states[$k]) ? NOTES_STATE_PUBLIC : $states[$k], false);
|
||||
$checkbox = html_writer::label('menustates[' . $k . ']', 'menustates', false, array('class' => 'accesshide'));
|
||||
$checkbox .= html_writer::select($state_names, 'states[' . $k . ']', empty($states[$k]) ? NOTES_STATE_PUBLIC : $states[$k], false);
|
||||
$table->data[] = array(
|
||||
'<input type="hidden" name="userid['.$k.']" value="'.$v.'" />'. fullname($user, true),
|
||||
'<textarea name="contents['. $k . ']" rows="2" cols="40">' . strip_tags(@$contents[$k]) . '</textarea>',
|
||||
|
||||
Reference in New Issue
Block a user