From 07c9106476ae7dd1f56e338bc09c0a03b8fb0265 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 24 Apr 2020 14:50:30 +0800 Subject: [PATCH] MDL-68463 user: Remove old selectall attribute --- user/classes/table/participants.php | 22 +++------------------- user/index.php | 4 +--- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/user/classes/table/participants.php b/user/classes/table/participants.php index c1058cd15dd..04d47f56fb7 100644 --- a/user/classes/table/participants.php +++ b/user/classes/table/participants.php @@ -54,11 +54,6 @@ class participants extends \table_sql implements dynamic_table { */ protected $courseid; - /** - * @var bool $selectall Has the user selected all users on the page? - */ - protected $selectall; - /** * @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, [ 'id' => 'select-all-participants', 'name' => 'select-all-participants', - 'label' => $this->selectall ? get_string('deselectall') : get_string('selectall'), + 'label' => get_string('selectall'), 'labelclasses' => 'sr-only', 'classes' => 'm-1', - 'checked' => $this->selectall + 'checked' => false, ]); $headers[] = $OUTPUT->render($mastercheckbox); $columns[] = 'select'; @@ -236,7 +231,7 @@ class participants extends \table_sql implements dynamic_table { 'classes' => 'usercheckbox m-1', 'id' => 'user' . $data->id, 'name' => 'user' . $data->id, - 'checked' => $this->selectall, + 'checked' => false, 'label' => get_string('selectitem', 'moodle', fullname($data)), 'labelclasses' => 'accesshide', ]); @@ -453,17 +448,6 @@ class participants extends \table_sql implements dynamic_table { 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. * diff --git a/user/index.php b/user/index.php index b542c1a4227..579a04cd6d9 100644 --- a/user/index.php +++ b/user/index.php @@ -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. $courseid = optional_param('id', 0, PARAM_INT); // This are required. $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); $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->set_selectall($selectall); $participanttable->set_filterset($filterset); $participanttable->define_baseurl($baseurl); @@ -293,7 +291,7 @@ if ($bulkoperations) { 'id' => 'participantsform', 'data-course-id' => $course->id, '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 '
'; echo '';