MDL-76313 forum: improve accessibility on subscribers page

- add header on table of subscribers
- remove one redundant header
This commit is contained in:
Julien Boulen 2023-01-10 11:16:31 +01:00
parent b8b905cd90
commit 5f493679c3
3 changed files with 12 additions and 7 deletions

View file

@ -134,6 +134,13 @@ class mod_forum_renderer extends plugin_renderer_base {
$strparams->count = count($users); $strparams->count = count($users);
$output .= $this->output->heading(get_string("subscriberstowithcount", "forum", $strparams)); $output .= $this->output->heading(get_string("subscriberstowithcount", "forum", $strparams));
$table = new html_table(); $table = new html_table();
$table->id = 'subscribers-table';
$table->head = array();
$table->head[] = get_string('pictureofuser');
$table->head[] = get_string('fullname');
if ($canviewemail) {
$table->head[] = get_string('email');
}
$table->cellpadding = 5; $table->cellpadding = 5;
$table->cellspacing = 5; $table->cellspacing = 5;
$table->tablealign = 'center'; $table->tablealign = 'center';

View file

@ -121,7 +121,6 @@ if ($edit === 1 && !\mod_forum\subscriptions::is_forcesubscribed($forum)) {
echo $OUTPUT->heading(get_string('managesubscriptionson', 'forum'), 2); echo $OUTPUT->heading(get_string('managesubscriptionson', 'forum'), 2);
echo $forumoutput->subscriber_selection_form($existingselector, $subscriberselector); echo $forumoutput->subscriber_selection_form($existingselector, $subscriberselector);
} else { } else {
echo $OUTPUT->heading(get_string('subscribers', 'forum'), 2);
$subscribers = \mod_forum\subscriptions::fetch_subscribed_users($forum, $currentgroup, $context); $subscribers = \mod_forum\subscriptions::fetch_subscribed_users($forum, $currentgroup, $context);
if (\mod_forum\subscriptions::is_forcesubscribed($forum)) { if (\mod_forum\subscriptions::is_forcesubscribed($forum)) {
$subscribers = mod_forum_filter_hidden_users($cm, $context, $subscribers); $subscribers = mod_forum_filter_hidden_users($cm, $context, $subscribers);

View file

@ -32,9 +32,8 @@ Feature: Changes to the subscription mode of a forum can change subcribers of a
When I select "Auto subscription" from the "Subscription mode" singleselect When I select "Auto subscription" from the "Subscription mode" singleselect
Then I should not see "There are no subscribers yet for this forum" Then I should not see "There are no subscribers yet for this forum"
And I navigate to "Subscriptions" in current page administration And I navigate to "Subscriptions" in current page administration
And I should see "Student 1" And the following should exist in the "subscribers-table" table:
And I should see "student.1@example.com" | Full name | Email address |
And I should see "Student 2" | Student 1 | student.1@example.com |
And I should see "student.2@example.com" | Student 2 | student.2@example.com |
And I should see "Teacher Tom" | Teacher Tom | teacher@example.com |
And I should see "teacher@example.com"