Merge branch 'MDL-85888-main' of https://github.com/ssj365/moodle

This commit is contained in:
Amaia Anabitarte
2025-08-05 17:04:20 +02:00
+11 -10
View File
@@ -576,18 +576,19 @@ function mod_bigbluebuttonbn_core_calendar_is_event_visible(calendar_event $even
*/
function bigbluebuttonbn_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $nodenav) {
global $USER;
// Don't add validate completion if the callback for meetingevents is NOT enabled.
if (!(boolean) \mod_bigbluebuttonbn\local\config::get('meetingevents_enabled')) {
return;
}
// Don't add validate completion if user is not allowed to edit the activity.
$context = context_module::instance($settingsnav->get_page()->cm->id);
if (!has_capability('moodle/course:manageactivities', $context, $USER->id)) {
return;
// Add validate completion if the callback for meetingevents is enabled and user is allowed to edit the activity.
if (
(bool) \mod_bigbluebuttonbn\local\config::get('meetingevents_enabled') &&
has_capability('moodle/course:manageactivities', $context, $USER->id)
) {
$completionvalidate = '#action=completion_validate&bigbluebuttonbn=' . $settingsnav->get_page()->cm->instance;
$nodenav->add(
get_string('completionvalidatestate', 'bigbluebuttonbn'),
$completionvalidate,
navigation_node::TYPE_CONTAINER
);
}
$completionvalidate = '#action=completion_validate&bigbluebuttonbn=' . $settingsnav->get_page()->cm->instance;
$nodenav->add(get_string('completionvalidatestate', 'bigbluebuttonbn'),
$completionvalidate, navigation_node::TYPE_CONTAINER);
}
/**