diff --git a/mod/bigbluebuttonbn/classes/instance.php b/mod/bigbluebuttonbn/classes/instance.php index 9bad841c22c..da1dad53af7 100644 --- a/mod/bigbluebuttonbn/classes/instance.php +++ b/mod/bigbluebuttonbn/classes/instance.php @@ -731,9 +731,10 @@ EOF; */ public function should_show_recording_button(): bool { global $CFG; - if (!empty($CFG->bigbluebuttonbn_recording_hide_button_editable)) { - return (bool) $this->get_instance_var('recordhidebutton'); + $recordhidebutton = (bool) $this->get_instance_var('recordhidebutton'); + $recordallfromstart = (bool) $this->get_instance_var('recordallfromstart'); + return !($recordhidebutton || $recordallfromstart); } return !$CFG->bigbluebuttonbn_recording_hide_button_default; diff --git a/mod/bigbluebuttonbn/classes/meeting.php b/mod/bigbluebuttonbn/classes/meeting.php index 4b81b8c7061..be6c17b1621 100644 --- a/mod/bigbluebuttonbn/classes/meeting.php +++ b/mod/bigbluebuttonbn/classes/meeting.php @@ -336,10 +336,10 @@ class meeting { // Check if auto_start_record is enable. if ($data['record'] == 'true' && $this->instance->should_record_from_start()) { $data['autoStartRecording'] = 'true'; - // Check if hide_record_button is enable. - if (!$this->instance->should_show_recording_button()) { - $data['allowStartStopRecording'] = 'false'; - } + } + // Check if hide_record_button is enable. + if (!$this->instance->should_show_recording_button()) { + $data['allowStartStopRecording'] = 'false'; } $data['welcome'] = trim($this->instance->get_welcome_message()); $voicebridge = intval($this->instance->get_voice_bridge()); diff --git a/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php b/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php index 1e7f70d6936..7d7811a01b3 100644 --- a/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php +++ b/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php @@ -146,7 +146,7 @@ $string['config_recording_all_from_start_default_description'] = 'If checked the $string['config_recording_all_from_start_editable'] = 'Record all from start can be edited'; $string['config_recording_all_from_start_editable_description'] = 'If checked the interface includes an option for enable and disable the record all from start feature.'; $string['config_recording_hide_button_default'] = 'Hide recording button'; -$string['config_recording_hide_button_default_description'] = 'If checked the button for record will be hide'; +$string['config_recording_hide_button_default_description'] = 'If checked the button for record will be hidden'; $string['config_recording_hide_button_editable'] = 'Hide recording button can be edited'; $string['config_recording_hide_button_editable_description'] = 'If checked the interface includes an option for enable and disable the hide recording button feature.'; $string['config_recording_refresh_period'] = 'Recording refresh period (in seconds)'; diff --git a/mod/bigbluebuttonbn/mod_form.php b/mod/bigbluebuttonbn/mod_form.php index 932d7638b4b..9be734e3a6a 100644 --- a/mod/bigbluebuttonbn/mod_form.php +++ b/mod/bigbluebuttonbn/mod_form.php @@ -382,9 +382,9 @@ class mod_bigbluebuttonbn_mod_form extends moodleform_mod { $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], $field['description_key'], $cfg['recording_hide_button_default']); - $mform->disabledIf('recordallfromstart', 'record', $condition = 'notchecked', $value = '0'); - $mform->disabledIf('recordhidebutton', 'record', $condition = 'notchecked', $value = '0'); - $mform->disabledIf('recordhidebutton', 'recordallfromstart', $condition = 'notchecked', $value = '0'); + $mform->disabledIf('recordallfromstart', 'record'); + $mform->disabledIf('recordhidebutton', 'record'); + $mform->hideIf('recordhidebutton', 'recordallfromstart', 'checked'); // End Record all from start and hide button. $field = ['type' => 'hidden', 'name' => 'muteonstart', 'data_type' => PARAM_INT, 'description_key' => null];