diff --git a/admin/settings/courses.php b/admin/settings/courses.php index aff5e0f8a63..0326282ec23 100644 --- a/admin/settings/courses.php +++ b/admin/settings/courses.php @@ -88,6 +88,15 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { $downloadcontentsitedefault->add_dependent_on('downloadcoursecontentallowed'); $temp->add($downloadcontentsitedefault); + $temp->add( + new admin_setting_configtext( + 'moodlecourse/participantsperpage', + new lang_string('participants:perpage', 'course'), + new lang_string('participants:perpage_help', 'course'), + 20 + ) + ); + // Course format. $temp->add(new admin_setting_heading('courseformathdr', new lang_string('type_format', 'plugin'), '')); diff --git a/lang/en/course.php b/lang/en/course.php index 9af2dd07fa4..ee2906f7dd0 100644 --- a/lang/en/course.php +++ b/lang/en/course.php @@ -101,6 +101,8 @@ $string['norecentaccessesinfomessage'] = 'Hi {$a->userfirstname},

A number of students in {$a->coursename} have not accessed the course recently.

'; $string['noteachinginfomessage'] = 'Hi {$a->userfirstname},

Courses with start dates in the next week have been identified as having no teacher or student enrolments.

'; +$string['participants:perpage'] = 'Number of participants per page'; +$string['participants:perpage_help'] = 'Specify the number of participants that are shown per page'; $string['participantsnavigation'] = 'Participants tertiary navigation.'; $string['privacy:perpage'] = 'The number of courses to show per page.'; $string['privacy:completionpath'] = 'Course completion'; diff --git a/report/participation/index.php b/report/participation/index.php index e9e53c36455..e718bc20233 100644 --- a/report/participation/index.php +++ b/report/participation/index.php @@ -30,7 +30,8 @@ require_once($CFG->dirroot.'/lib/tablelib.php'); require_once($CFG->dirroot.'/notes/lib.php'); require_once($CFG->dirroot.'/report/participation/locallib.php'); -define('DEFAULT_PAGE_SIZE', 20); +$participantsperpage = intval(get_config('moodlecourse', 'participantsperpage')); +define('DEFAULT_PAGE_SIZE', (!empty($participantsperpage) ? $participantsperpage : 20)); define('SHOW_ALL_PAGE_SIZE', 5000); $id = required_param('id', PARAM_INT); // course id. diff --git a/user/index.php b/user/index.php index 56b2fcfe76f..bdc1829f165 100644 --- a/user/index.php +++ b/user/index.php @@ -34,7 +34,8 @@ use core_table\local\filter\filter; use core_table\local\filter\integer_filter; use core_table\local\filter\string_filter; -define('DEFAULT_PAGE_SIZE', 20); +$participantsperpage = intval(get_config('moodlecourse', 'participantsperpage')); +define('DEFAULT_PAGE_SIZE', (!empty($participantsperpage) ? $participantsperpage : 20)); $page = optional_param('page', 0, PARAM_INT); // Which page to show. $perpage = optional_param('perpage', DEFAULT_PAGE_SIZE, PARAM_INT); // How many per page.