MDL-58180 lib: Role name pass format_text.

In function stats_get_report_options, the role names are returned after
having been processed through format_text which lets the filters work on them.

Signed-off-by: Luca Bösch <[email protected]>
This commit is contained in:
Luca Bösch
2017-04-07 16:09:25 +08:00
committed by Marina Glancy
parent bd99cb9021
commit 9955d65e5c
+2 -1
View File
@@ -1399,7 +1399,8 @@ function stats_get_report_options($courseid,$mode) {
$sql = 'SELECT r.id, r.name FROM {role} r JOIN {stats_daily} s ON s.roleid = r.id WHERE s.courseid = :courseid GROUP BY r.id, r.name';
if ($roles = $DB->get_records_sql($sql, array('courseid' => $courseid))) {
foreach ($roles as $role) {
$reportoptions[STATS_REPORT_ACTIVITYBYROLE.$role->id] = get_string('statsreport'.STATS_REPORT_ACTIVITYBYROLE). ' '.$role->name;
$reportoptions[STATS_REPORT_ACTIVITYBYROLE.$role->id] = get_string('statsreport'.STATS_REPORT_ACTIVITYBYROLE).
' ' . format_string($role->name, true, ['context' => $context]);
}
}
}