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 b2d0712748
commit 4f7dd1a54b
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 {
// Print the list of instances.
$table = new html_table();
if (course_format_uses_sections($this->course->format)) {
$sectionheading = get_string('sectionname', "format_{$this->course->format}");
} else {
$sectionheading = '';
}
$table->head = [
get_string('week'),
$sectionheading,
get_string('index_heading_name', plugin::COMPONENT),
get_string('index_heading_group', plugin::COMPONENT),
get_string('index_heading_users', plugin::COMPONENT),
@ -118,6 +125,12 @@ class index implements renderable {
}
$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();
if ($groupid = $instance->get_group_id()) {
$viewurl->param('group', $groupid);
@ -128,7 +141,7 @@ class index implements renderable {
// The meeting info was returned.
if ($meeting->is_running()) {
return [
$instance->get_cm()->sectionnum,
$sectionname,
$joinurl,
$instance->get_group_name(),
$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(), '', '', '', '', ''];
}
/**