MDL-78038 mod_bigbluebuttonbn: observe course format section config.

This commit is contained in:
Paul Holden 2023-01-03 17:34:01 +00:00
parent 4e632b7251
commit cabf27f9e1
No known key found for this signature in database
GPG key ID: A81A96D6045F6164

View file

@ -59,8 +59,15 @@ class index implements renderable {
public function get_table(renderer_base $output): html_table { public function get_table(renderer_base $output): html_table {
// Print the list of instances. // Print the list of instances.
$table = new html_table(); $table = new html_table();
if (course_format_uses_sections($this->course->format)) {
$sectionheading = get_string('sectionname', "format_{$this->course->format}");
} else {
$sectionheading = '';
}
$table->head = [ $table->head = [
get_string('week'), $sectionheading,
get_string('index_heading_name', plugin::COMPONENT), get_string('index_heading_name', plugin::COMPONENT),
get_string('index_heading_group', plugin::COMPONENT), get_string('index_heading_group', plugin::COMPONENT),
get_string('index_heading_users', plugin::COMPONENT), get_string('index_heading_users', plugin::COMPONENT),
@ -118,6 +125,12 @@ class index implements renderable {
} }
$meeting = new meeting($instance); $meeting = new meeting($instance);
if (course_format_uses_sections($this->course->format)) {
$sectionname = get_section_name($this->course, $instance->get_cm()->sectionnum);
} else {
$sectionname = '';
}
$viewurl = $instance->get_view_url(); $viewurl = $instance->get_view_url();
if ($groupid = $instance->get_group_id()) { if ($groupid = $instance->get_group_id()) {
$viewurl->param('group', $groupid); $viewurl->param('group', $groupid);
@ -128,7 +141,7 @@ class index implements renderable {
// The meeting info was returned. // The meeting info was returned.
if ($meeting->is_running()) { if ($meeting->is_running()) {
return [ return [
$instance->get_cm()->sectionnum, $sectionname,
$joinurl, $joinurl,
$instance->get_group_name(), $instance->get_group_name(),
$this->get_room_usercount($meeting), $this->get_room_usercount($meeting),
@ -139,7 +152,7 @@ class index implements renderable {
]; ];
} }
return [$instance->get_cm()->sectionnum, $joinurl, $instance->get_group_name(), '', '', '', '', '']; return [$sectionname, $joinurl, $instance->get_group_name(), '', '', '', '', ''];
} }
/** /**