MDL-50484 core_grade: courseheader id should be unique

grader report show category with courseheader id
which gets replicated for all categories on page.
This will now be courseheader_categoryname.
This commit is contained in:
Rajesh Taneja 2016-02-08 14:25:00 +08:00
parent 7e341eb48f
commit 7b287e09e2
2 changed files with 5 additions and 4 deletions

View File

@ -1603,8 +1603,9 @@ class grade_report_grader extends grade_report {
}
$name = shorten_text($element['object']->get_name());
$courseheader = html_writer::tag('span', $name, array('id' => 'courseheader'));
$courseheader .= html_writer::label($showing, 'courseheader', false, array('class' => 'accesshide'));
$courseheaderid = 'courseheader_' . clean_param($name, PARAM_ALPHANUMEXT);
$courseheader = html_writer::tag('span', $name, array('id' => $courseheaderid));
$courseheader .= html_writer::label($showing, $courseheaderid, false, array('class' => 'accesshide'));
$courseheader .= $icon;
return $courseheader;

View File

@ -103,9 +103,9 @@ foreach ($users as $k => $v) {
if (!$user = $DB->get_record('user', array('id' => $v))) {
continue;
}
$checkbox = html_writer::label(get_string('selectnotestate', 'notes'), 'menustates', false, array('class' => 'accesshide'));
$checkbox = html_writer::label(get_string('selectnotestate', 'notes'), 'menustates_'.$v, false, array('class' => 'accesshide'));
$checkbox .= html_writer::select($statenames, 'states[' . $k . ']',
empty($states[$k]) ? NOTES_STATE_PUBLIC : $states[$k], false, array('id' => 'menustates'));
empty($states[$k]) ? NOTES_STATE_PUBLIC : $states[$k], false, array('id' => 'menustates_'.$v));
$table->data[] = array(
'<input type="hidden" name="userid['.$k.']" value="'.$v.'" />'. fullname($user, true),
'<textarea name="contents['. $k . ']" rows="2" cols="40" spellcheck="true">' . strip_tags(@$contents[$k]) . '</textarea>',