';
echo '
';
echo '
';
}
echo $participanttablehtml;
$perpageurl = clone($baseurl);
$perpageurl->remove_params('perpage');
if ($perpage == SHOW_ALL_PAGE_SIZE && $participanttable->totalrows > DEFAULT_PAGE_SIZE) {
$perpageurl->param('perpage', DEFAULT_PAGE_SIZE);
echo $OUTPUT->container(html_writer::link($perpageurl, get_string('showperpage', '', DEFAULT_PAGE_SIZE)), array(), 'showall');
} else if ($participanttable->get_page_size() < $participanttable->totalrows) {
$perpageurl->param('perpage', SHOW_ALL_PAGE_SIZE);
echo $OUTPUT->container(html_writer::link($perpageurl, get_string('showall', '', $participanttable->totalrows)),
array(), 'showall');
}
if ($bulkoperations) {
echo '
';
if ($participanttable->get_page_size() < $participanttable->totalrows) {
$perpageurl = clone($baseurl);
$perpageurl->remove_params('perpage');
$perpageurl->param('perpage', SHOW_ALL_PAGE_SIZE);
$perpageurl->param('selectall', true);
$showalllink = $perpageurl;
} else {
$showalllink = false;
}
echo html_writer::start_tag('div', array('class' => 'btn-group'));
if ($participanttable->get_page_size() < $participanttable->totalrows) {
// Select all users, refresh page showing all users and mark them all selected.
$label = get_string('selectalluserswithcount', 'moodle', $participanttable->totalrows);
echo html_writer::empty_tag('input', array('type' => 'button', 'id' => 'checkall', 'class' => 'btn btn-secondary',
'value' => $label, 'data-showallink' => $showalllink));
// Select all users, mark all users on page as selected.
echo html_writer::tag('input', "", array('type' => 'button', 'id' => 'checkallonpage', 'class' => 'btn btn-secondary',
'value' => get_string('selectallusersonpage')));
} else {
echo html_writer::tag('input', "", array('type' => 'button', 'id' => 'checkallonpage', 'class' => 'btn btn-secondary',
'value' => get_string('selectall')));
}
echo html_writer::tag('input', "", array('type' => 'button', 'id' => 'checknone', 'class' => 'btn btn-secondary',
'value' => get_string('deselectall')));
echo html_writer::end_tag('div');
$displaylist = array();
if (!empty($CFG->messaging)) {
$displaylist['#messageselect'] = get_string('messageselectadd');
}
if (!empty($CFG->enablenotes) && has_capability('moodle/notes:manage', $context) && $context->id != $frontpagectx->id) {
$displaylist['#addgroupnote'] = get_string('addnewnote', 'notes');
}
$params = ['operation' => 'download_participants'];
$downloadoptions = [];
$formats = core_plugin_manager::instance()->get_plugins_of_type('dataformat');
foreach ($formats as $format) {
if ($format->is_enabled()) {
$params = ['operation' => 'download_participants', 'dataformat' => $format->name];
$url = new moodle_url('bulkchange.php', $params);
$downloadoptions[$url->out(false)] = get_string('dataformat', $format->component);
}
}
if (!empty($downloadoptions)) {
$displaylist[] = [get_string('downloadas', 'table') => $downloadoptions];
}
if ($context->id != $frontpagectx->id) {
$instances = $manager->get_enrolment_instances();
$plugins = $manager->get_enrolment_plugins(false);
foreach ($instances as $key => $instance) {
if (!isset($plugins[$instance->enrol])) {
// Weird, some broken stuff in plugin.
continue;
}
$plugin = $plugins[$instance->enrol];
$bulkoperations = $plugin->get_bulk_operations($manager);
$pluginoptions = [];
foreach ($bulkoperations as $key => $bulkoperation) {
$params = ['plugin' => $plugin->get_name(), 'operation' => $key];
$url = new moodle_url('bulkchange.php', $params);
$pluginoptions[$url->out(false)] = $bulkoperation->get_title();
}
if (!empty($pluginoptions)) {
$name = get_string('pluginname', 'enrol_' . $plugin->get_name());
$displaylist[] = [$name => $pluginoptions];
}
}
}
$label = html_writer::tag('label', get_string("withselectedusers"),
['for' => 'formactionid', 'class' => 'col-form-label d-inline']);
$select = html_writer::select($displaylist, 'formaction', '', ['' => 'choosedots'], ['id' => 'formactionid']);
echo html_writer::tag('div', $label . $select, ['class' => 'ml-2']);
echo '';
echo '
';
echo '