Merge branch 'MDL-84745-500' of https://github.com/paulholden/moodle into MOODLE_500_STABLE
This commit is contained in:
+6
-2
@@ -117,9 +117,13 @@ if (!empty($searchquery)) {
|
||||
// Show the report.
|
||||
echo $report->output();
|
||||
|
||||
// Show the delete selected button if there are records.
|
||||
if ($DB->record_exists('cohort', [])) {
|
||||
// Show the delete selected button if there are records and user can manage cohorts in current context.
|
||||
$canmanagecohorts = has_capability('moodle/cohort:manage', $context);
|
||||
if ($showall) {
|
||||
$canmanagecohorts = $canmanagecohorts || core_course_category::has_capability_on_any('moodle/cohort:manage');
|
||||
}
|
||||
|
||||
if ($canmanagecohorts && $DB->record_exists('cohort', [])) {
|
||||
echo $OUTPUT->render(new single_button(
|
||||
new moodle_url('#'),
|
||||
get_string('deleteselected'),
|
||||
|
||||
Reference in New Issue
Block a user