Merge branch 'MDL-78283-master' of https://github.com/ferranrecio/moodle
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user