So, basically what the title says.
Here is what I would like to have in my settings.php page:
And here is what I have as a workaround:
$warning = 'Please make sure you have no unsaved changes.';
$link = "</form><a href=".new moodle_url('/mod/game/clear.php')." class='btn btn-danger';>Empty all results</a> <strong style='color: red;'>".$warning."</strong>";
$clear_url = new moodle_url('/mod/game/clear_user_results.php');
$link .= "</br>
<form action='".$clear_url."' class='mt-3' method='POST'>
<div class='input-group rounded'>
<input type='text' class='form-control rounded' placeholder='Search a user' name='userSearch' aria-label='Search' aria-describedby='search-addon'/>
<button class='input-group-text border-0' type='submit'>
<i class='fa fa-search'></i>
</button>
</div>
</form>
";
$settings->add(new admin_setting_heading('modemptydb', get_string('modemptydb', 'game'), $link));
It works but I'm having to enter the exact name for the user whereas in the first picture it also shows me other results containing the query.
Is there a way to achieve this?
I've tried both of these but they didn't work:
$settings->add(new core_role_admins_existing_selector());
$settings->add(new core_role_check_users_selector());