Merge branch 'MDL-73313_master' of https://github.com/tasosb/moodle

This commit is contained in:
Sara Arjona 2022-02-17 08:38:08 +01:00
commit af7a0ed1a1
6 changed files with 28 additions and 5 deletions

View file

@ -797,6 +797,9 @@ EOF;
*/ */
public function get_welcome_message(): string { public function get_welcome_message(): string {
$welcomestring = $this->get_instance_var('welcome'); $welcomestring = $this->get_instance_var('welcome');
if (!config::get('welcome_editable') || empty($welcomestring)) {
$welcomestring = config::get('welcome_default');
}
if (empty($welcomestring)) { if (empty($welcomestring)) {
$welcomestring = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); $welcomestring = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn');
} }

View file

@ -224,6 +224,7 @@ class config {
'lockonjoinconfigurable_editable' => self::get('lockonjoinconfigurable_editable'), 'lockonjoinconfigurable_editable' => self::get('lockonjoinconfigurable_editable'),
'lockonjoinconfigurable_default' => self::get('lockonjoinconfigurable_default'), 'lockonjoinconfigurable_default' => self::get('lockonjoinconfigurable_default'),
'welcome_default' => self::get('welcome_default'), 'welcome_default' => self::get('welcome_default'),
'welcome_editable' => self::get('welcome_editable'),
]; ];
} }

View file

@ -193,6 +193,18 @@ class settings {
$item, $item,
$settingsgeneral $settingsgeneral
); );
$settingsgeneral->add($item);
$item = new admin_setting_configcheckbox(
'bigbluebuttonbn_welcome_editable',
get_string('config_welcome_editable', 'bigbluebuttonbn'),
get_string('config_welcome_editable_description', 'bigbluebuttonbn'),
1,
);
$this->add_conditional_element(
'welcome_editable',
$item,
$settingsgeneral
);
} }
return $settingsgeneral; return $settingsgeneral;
} }

View file

@ -239,6 +239,8 @@ $string['config_muteonstart_editable'] = 'Mute on start can be edited';
$string['config_muteonstart_editable_description'] = 'Mute on start by default can be edited when the instance is added or updated.'; $string['config_muteonstart_editable_description'] = 'Mute on start by default can be edited when the instance is added or updated.';
$string['config_welcome_default'] = 'Default welcome message'; $string['config_welcome_default'] = 'Default welcome message';
$string['config_welcome_default_description'] = 'Replaces the default message setted up for the BigBlueButton server. The message can includes keywords (%%CONFNAME%%, %%DIALNUM%%, %%CONFNUM%%) which will be substituted automatically, and also html tags like <b>...</b> or <i></i> '; $string['config_welcome_default_description'] = 'Replaces the default message setted up for the BigBlueButton server. The message can includes keywords (%%CONFNAME%%, %%DIALNUM%%, %%CONFNUM%%) which will be substituted automatically, and also html tags like <b>...</b> or <i></i> ';
$string['config_welcome_editable'] = 'Default welcome message is editable by teachers';
$string['config_welcome_editable_description'] = 'Welcome message can be edited when the instance is added or updated';
$string['config_default_messages'] = 'Default messages'; $string['config_default_messages'] = 'Default messages';
$string['config_default_messages_description'] = 'Set message defaults for activities'; $string['config_default_messages_description'] = 'Set message defaults for activities';

View file

@ -317,10 +317,15 @@ class mod_bigbluebuttonbn_mod_form extends moodleform_mod {
* @return void * @return void
*/ */
private function bigbluebuttonbn_mform_add_block_room_room(MoodleQuickForm &$mform, array $cfg): void { private function bigbluebuttonbn_mform_add_block_room_room(MoodleQuickForm &$mform, array $cfg): void {
$field = ['type' => 'textarea', 'name' => 'welcome', 'data_type' => PARAM_CLEANHTML, $field = ['type' => 'hidden', 'name' => 'welcome', 'data_type' => PARAM_INT,
'description_key' => 'mod_form_field_welcome']; 'description_key' => null];
$this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], if ($cfg['welcome_editable']) {
$field['description_key'], $cfg['welcome_default'], ['wrap' => 'virtual', 'rows' => 5, 'cols' => '60']); $field['type'] = 'textarea';
$field['data_type'] = PARAM_CLEANHTML;
$field['description_key'] = 'mod_form_field_welcome';
$this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
$field['description_key'], $cfg['welcome_default'], ['wrap' => 'virtual', 'rows' => 5, 'cols' => '60']);
}
$field = ['type' => 'hidden', 'name' => 'voicebridge', 'data_type' => PARAM_INT, $field = ['type' => 'hidden', 'name' => 'voicebridge', 'data_type' => PARAM_INT,
'description_key' => null]; 'description_key' => null];
if ($cfg['voicebridge_editable']) { if ($cfg['voicebridge_editable']) {

View file

@ -27,6 +27,6 @@
defined('MOODLE_INTERNAL') || die; defined('MOODLE_INTERNAL') || die;
$plugin->version = 2021091408; $plugin->version = 2022021600;
$plugin->requires = 2020061500; $plugin->requires = 2020061500;
$plugin->component = 'mod_bigbluebuttonbn'; $plugin->component = 'mod_bigbluebuttonbn';