Merged link to role assign screen from 1.9

This commit is contained in:
moodler 2008-02-29 04:30:27 +00:00
parent c6edfab4d4
commit 15234a92a1

View File

@ -515,10 +515,16 @@
}
print_heading($heading, 'center', 3);
} else {
if ($matchcount < $totalcount) {
print_heading(get_string('allparticipants').': '.$matchcount.'/'.$totalcount, '', 3);
if ($course->id !== SITEID && has_capability('moodle/role:assign', $context)) {
$editlink = ' <a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id.'">';
$editlink .= '<img src="'.$CFG->pixpath.'/i/edit.gif" class="icon" alt="" /></a>';
} else {
print_heading(get_string('allparticipants').': '.$matchcount, '', 3);
$editlink = '';
}
if ($matchcount < $totalcount) {
print_heading(get_string('allparticipants').': '.$matchcount.'/'.$totalcount . $editlink, '', 3);
} else {
print_heading(get_string('allparticipants').': '.$matchcount . $editlink, '', 3);
}
}