MDL-85888 mod_bigbluebuttonbn: Fix setting logic

This commit is contained in:
Shamiso Jaravaza
2025-07-22 16:11:36 -06:00
parent ef6df9e70e
commit f0242eea23
+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);
}
/**