if ($roles = get_records('role', '', '', 'sortorder ASC')) {
foreach ($roles as $role) {
if (user_can_assign($context, $role->id)) {
- $options[$role->id] = $role->name;
+ $options[$role->id] = strip_tags(format_string($role->name, true));
}
}
}
if ($roles = get_records('role', '', '', 'sortorder ASC')) {
foreach ($roles as $role) {
if (user_can_override($context, $role->id)) {
- $options[$role->id] = $role->name;
+ $options[$role->id] = strip_tags(format_string($role->name, true));
}
}
}
AND roleid = $role->id");
}
-?>
\ No newline at end of file
+?>
*/
function format_string ($string, $striplinks = false, $courseid=NULL ) {
- global $CFG, $course;
+ global $CFG, $COURSE;
//We'll use a in-memory cache here to speed up repeated strings
static $strcache;
}
if (empty($courseid)) {
- if (!empty($course->id)) { // An ugly hack for better compatibility
- $courseid = $course->id; // (copied from format_text)
+ if (!empty($COURSE->id)) { // An ugly hack for better compatibility
+ $courseid = $COURSE->id; // (copied from format_text)
}
}