mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-21933 course: Allow users to search participants course permission
Capability checks are performed at the top of the page and do not need to be completed again. Search is an expected feature for users and it was confusion to only appear after 3 pages. This has been changed to enable search when there are more records than are visible on the screen. If users are unable to use browser search, they will be able to use Moodle's search.
This commit is contained in:
parent
969e5b51a0
commit
e456edf9b7
1 changed files with 2 additions and 1 deletions
|
@ -811,7 +811,8 @@
|
|||
$PAGE->requires->js_init_call('M.core_user.init_participation', null, false, $module);
|
||||
}
|
||||
|
||||
if (has_capability('moodle/site:viewparticipants', $context) && $totalcount > ($perpage*3)) {
|
||||
// Show a search box if all participants don't fit on a single screen
|
||||
if ($totalcount > $perpage) {
|
||||
echo '<form action="index.php" class="searchform"><div><input type="hidden" name="id" value="'.$course->id.'" />';
|
||||
echo '<label for="search">' . get_string('search', 'search') . ' </label>';
|
||||
echo '<input type="text" id="search" name="search" value="'.s($search).'" /> <input type="submit" value="'.get_string('search').'" /></div></form>'."\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue