MDL-68463 user: Remove old selectall attribute

This commit is contained in:
Andrew Nicols 2020-04-24 14:50:30 +08:00
parent ed23725bc6
commit 07c9106476
2 changed files with 4 additions and 22 deletions

View file

@ -54,11 +54,6 @@ class participants extends \table_sql implements dynamic_table {
*/ */
protected $courseid; protected $courseid;
/**
* @var bool $selectall Has the user selected all users on the page?
*/
protected $selectall;
/** /**
* @var string[] The list of countries. * @var string[] The list of countries.
*/ */
@ -134,10 +129,10 @@ class participants extends \table_sql implements dynamic_table {
$mastercheckbox = new \core\output\checkbox_toggleall('participants-table', true, [ $mastercheckbox = new \core\output\checkbox_toggleall('participants-table', true, [
'id' => 'select-all-participants', 'id' => 'select-all-participants',
'name' => 'select-all-participants', 'name' => 'select-all-participants',
'label' => $this->selectall ? get_string('deselectall') : get_string('selectall'), 'label' => get_string('selectall'),
'labelclasses' => 'sr-only', 'labelclasses' => 'sr-only',
'classes' => 'm-1', 'classes' => 'm-1',
'checked' => $this->selectall 'checked' => false,
]); ]);
$headers[] = $OUTPUT->render($mastercheckbox); $headers[] = $OUTPUT->render($mastercheckbox);
$columns[] = 'select'; $columns[] = 'select';
@ -236,7 +231,7 @@ class participants extends \table_sql implements dynamic_table {
'classes' => 'usercheckbox m-1', 'classes' => 'usercheckbox m-1',
'id' => 'user' . $data->id, 'id' => 'user' . $data->id,
'name' => 'user' . $data->id, 'name' => 'user' . $data->id,
'checked' => $this->selectall, 'checked' => false,
'label' => get_string('selectitem', 'moodle', fullname($data)), 'label' => get_string('selectitem', 'moodle', fullname($data)),
'labelclasses' => 'accesshide', 'labelclasses' => 'accesshide',
]); ]);
@ -453,17 +448,6 @@ class participants extends \table_sql implements dynamic_table {
return ''; return '';
} }
/**
* Set the value for selectall.
*
* Note: This will be removed later in the 3.9 development cycle.
*
* @param bool $selectall
*/
public function set_selectall(bool $selectall): void {
$this->selectall = $selectall;
}
/** /**
* Set filters and build table structure. * Set filters and build table structure.
* *

View file

@ -42,7 +42,6 @@ $perpage = optional_param('perpage', DEFAULT_PAGE_SIZE, PARAM_INT); // How
$contextid = optional_param('contextid', 0, PARAM_INT); // One of this or. $contextid = optional_param('contextid', 0, PARAM_INT); // One of this or.
$courseid = optional_param('id', 0, PARAM_INT); // This are required. $courseid = optional_param('id', 0, PARAM_INT); // This are required.
$newcourse = optional_param('newcourse', false, PARAM_BOOL); $newcourse = optional_param('newcourse', false, PARAM_BOOL);
$selectall = optional_param('selectall', false, PARAM_BOOL); // When rendering checkboxes against users mark them all checked.
$roleid = optional_param('roleid', 0, PARAM_INT); $roleid = optional_param('roleid', 0, PARAM_INT);
$groupparam = optional_param('group', 0, PARAM_INT); $groupparam = optional_param('group', 0, PARAM_INT);
@ -276,7 +275,6 @@ if (count($keywordfilter)) {
} }
$participanttable = new \core_user\table\participants("user-index-participants-{$course->id}"); $participanttable = new \core_user\table\participants("user-index-participants-{$course->id}");
$participanttable->set_selectall($selectall);
$participanttable->set_filterset($filterset); $participanttable->set_filterset($filterset);
$participanttable->define_baseurl($baseurl); $participanttable->define_baseurl($baseurl);
@ -293,7 +291,7 @@ if ($bulkoperations) {
'id' => 'participantsform', 'id' => 'participantsform',
'data-course-id' => $course->id, 'data-course-id' => $course->id,
'data-table-unique-id' => $participanttable->uniqueid, 'data-table-unique-id' => $participanttable->uniqueid,
'data-table-default-per-page' => DEFAULT_PAGE_SIZE, 'data-table-default-per-page' => ($perpage < DEFAULT_PAGE_SIZE) ? $perpage : DEFAULT_PAGE_SIZE,
]); ]);
echo '<div>'; echo '<div>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />'; echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';