Merge branch 'MDL-78283-master' of https://github.com/ferranrecio/moodle

This commit is contained in:
Jun Pataleta
2023-07-27 14:48:15 +08:00
14 changed files with 372 additions and 40 deletions
+15
View File
@@ -1462,6 +1462,21 @@ abstract class base {
return $PAGE->user_is_editing() && has_all_capabilities($capabilities, $coursecontext);
}
/**
* Check if the group mode can be displayed.
* @param cm_info $cm the activity module
* @return bool
*/
public function show_groupmode(cm_info $cm): bool {
if (!plugin_supports('mod', $cm->modname, FEATURE_GROUPS, false)) {
return false;
}
if (!has_capability('moodle/course:manageactivities', $cm->context)) {
return false;
}
return true;
}
/**
* Allows to specify for modinfo that section is not available even when it is visible and conditionally available.
*