mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-76551 mod_bigbluebuttonbn: Add user picture
* Add user picture with token * Add a new global setting to enable or disable avatar for users in meeting.
This commit is contained in:
parent
ba81f720db
commit
aa9c5cf455
@ -1227,4 +1227,15 @@ EOF;
|
||||
\mod_bigbluebuttonbn\plugin::generate_guest_meeting_credentials();
|
||||
$DB->update_record('bigbluebuttonbn', $this->instancedata);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this meeting configured to display avatars of the users ?
|
||||
*
|
||||
* Note: this is for now a global setting.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_profile_picture_enabled(): bool {
|
||||
return (bool) config::get('profile_picture_enabled');
|
||||
}
|
||||
}
|
||||
|
@ -83,6 +83,7 @@ class config {
|
||||
'recordingstatus_enabled' => false,
|
||||
'meetingevents_enabled' => false,
|
||||
'participant_moderator_default' => '0',
|
||||
'profile_picture_enabled' => false,
|
||||
'scheduled_pre_opening' => '10',
|
||||
'recordings_enabled' => true,
|
||||
'recordings_deleted_default' => false,
|
||||
|
@ -26,6 +26,7 @@ use mod_bigbluebuttonbn\local\exceptions\bigbluebutton_exception;
|
||||
use mod_bigbluebuttonbn\local\exceptions\server_not_available_exception;
|
||||
use moodle_url;
|
||||
use stdClass;
|
||||
use user_picture;
|
||||
|
||||
/**
|
||||
* The bigbluebutton proxy class.
|
||||
@ -120,9 +121,29 @@ class bigbluebutton_proxy extends proxy_base {
|
||||
if (!empty(trim($currentlang))) {
|
||||
$data['userdata-bbb_override_default_locale'] = $currentlang;
|
||||
}
|
||||
if ($instance->is_profile_picture_enabled()) {
|
||||
$user = $instance->get_user();
|
||||
if (!empty($user->picture)) {
|
||||
$data['avatarURL'] = self::get_avatar_url($user)->out(false);
|
||||
}
|
||||
}
|
||||
return self::action_url('join', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user avatar URL
|
||||
*
|
||||
* @param object $user
|
||||
* @return moodle_url
|
||||
*/
|
||||
private static function get_avatar_url(object $user): moodle_url {
|
||||
global $PAGE;
|
||||
$userpicture = new user_picture($user);
|
||||
$userpicture->includetoken = true;
|
||||
$userpicture->size = 3; // Size f3.
|
||||
return $userpicture->get_url($PAGE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform api request on BBB.
|
||||
*
|
||||
|
@ -914,6 +914,17 @@ class settings {
|
||||
$item,
|
||||
$extendedcapabilitiessetting
|
||||
);
|
||||
$item = new admin_setting_configcheckbox(
|
||||
'bigbluebuttonbn_profile_picture_enabled',
|
||||
get_string('config_profile_picture_enabled', 'bigbluebuttonbn'),
|
||||
get_string('config_profile_picture_enabled_description', 'bigbluebuttonbn'),
|
||||
false
|
||||
);
|
||||
$this->add_conditional_element(
|
||||
'profile_picture_enabled',
|
||||
$item,
|
||||
$extendedcapabilitiessetting
|
||||
);
|
||||
}
|
||||
$this->admin->add($this->parent, $extendedcapabilitiessetting);
|
||||
// Configuration for extended BN capabilities should go here.
|
||||
|
@ -137,6 +137,8 @@ $string['config_guestaccess_enabled_description'] = 'Allow users without an acco
|
||||
|
||||
$string['config_general'] = 'General settings';
|
||||
$string['config_general_description'] = 'These settings are always used.';
|
||||
$string['config_profile_picture_enabled'] = 'Show profile pictures';
|
||||
$string['config_profile_picture_enabled_description'] = 'Should profile pictures of participants be shown in BigBlueButton sessions?';
|
||||
$string['config_server_url'] = 'BigBlueButton server URL';
|
||||
$string['config_server_url_description'] = 'The default credentials are for a <a href="https://bigbluebutton.org/free-bigbluebutton-service-for-moodle/" target="_blank">free BigBlueButton service for Moodle (opens in new window)</a> provided by Blindside Networks with restrictions as follows:
|
||||
<ol>
|
||||
|
Loading…
x
Reference in New Issue
Block a user