diff --git a/lang/en/moodle.php b/lang/en/moodle.php index d3ae030b80445..fc8f43dad595f 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -505,6 +505,7 @@ $string['description'] = 'Description'; $string['descriptiona'] = 'Description: {$a}'; $string['deselectall'] = 'Deselect all'; +$string['deselectnos'] = 'Deselect all \'No\''; $string['detailedless'] = 'Less detailed'; $string['detailedmore'] = 'More detailed'; $string['digitalminor'] = 'Digital minor'; diff --git a/report/participation/index.php b/report/participation/index.php index 9708951c6cf21..2688e3ba6cf45 100644 --- a/report/participation/index.php +++ b/report/participation/index.php @@ -152,7 +152,15 @@ $table->define_headers(array(get_string('user'), $actionheader)); } else { $table->define_columns(array('fullname', 'count', 'select')); - $table->define_headers(array(get_string('user'), $actionheader, get_string('select'))); + $mastercheckbox = new \core\output\checkbox_toggleall('participants-table', true, [ + 'id' => 'select-all-participants', + 'name' => 'select-all-participants', + 'label' => get_string('select'), + // Consistent labels to prevent select column from resizing. + 'selectall' => get_string('select'), + 'deselectall' => get_string('select'), + ]); + $table->define_headers(array(get_string('user'), $actionheader, $OUTPUT->render($mastercheckbox))); } $table->define_baseurl($baseurl); @@ -317,7 +325,16 @@ $data[] = !empty($u->count) ? get_string('yes').' ('.$u->count.') ' : get_string('no'); if (!empty($CFG->messaging)) { - $data[] = ''; + $togglegroup = 'participants-table'; + if (empty($u->count)) { + $togglegroup .= ' no'; + } + $checkbox = new \core\output\checkbox_toggleall($togglegroup, false, [ + 'classes' => 'usercheckbox', + 'name' => 'user' . $u->userid, + 'value' => $u->count, + ]); + $data[] = $OUTPUT->render($checkbox); } $table->add_data($data); } @@ -337,18 +354,29 @@ } if (!empty($CFG->messaging)) { - $buttonclasses = 'btn btn-secondary'; echo '
'; echo '