Skip to content

Commit

Permalink
Merge branch 'MDL-65949-master' of git://github.com/junpataleta/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Aug 13, 2019
2 parents 2217ca9 + e773533 commit 9abc0ed
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 7 deletions.
1 change: 1 addition & 0 deletions lang/en/moodle.php
Expand Up @@ -505,6 +505,7 @@
$string['description'] = 'Description';
$string['descriptiona'] = 'Description: {$a}';
$string['deselectall'] = 'Deselect all';
$string['deselectnos'] = 'Deselect all \'No\'';
$string['detailedless'] = 'Less detailed';
$string['detailedmore'] = 'More detailed';
$string['digitalminor'] = 'Digital minor';
Expand Down
42 changes: 35 additions & 7 deletions report/participation/index.php
Expand Up @@ -152,7 +152,15 @@
$table->define_headers(array(get_string('user'), $actionheader));
} else {
$table->define_columns(array('fullname', 'count', 'select'));
$table->define_headers(array(get_string('user'), $actionheader, get_string('select')));
$mastercheckbox = new \core\output\checkbox_toggleall('participants-table', true, [
'id' => 'select-all-participants',
'name' => 'select-all-participants',
'label' => get_string('select'),
// Consistent labels to prevent select column from resizing.
'selectall' => get_string('select'),
'deselectall' => get_string('select'),
]);
$table->define_headers(array(get_string('user'), $actionheader, $OUTPUT->render($mastercheckbox)));
}
$table->define_baseurl($baseurl);

Expand Down Expand Up @@ -317,7 +325,16 @@
$data[] = !empty($u->count) ? get_string('yes').' ('.$u->count.') ' : get_string('no');

if (!empty($CFG->messaging)) {
$data[] = '<input type="checkbox" class="usercheckbox" name="user'.$u->userid.'" value="'.$u->count.'" />';
$togglegroup = 'participants-table';
if (empty($u->count)) {
$togglegroup .= ' no';
}
$checkbox = new \core\output\checkbox_toggleall($togglegroup, false, [
'classes' => 'usercheckbox',
'name' => 'user' . $u->userid,
'value' => $u->count,
]);
$data[] = $OUTPUT->render($checkbox);
}
$table->add_data($data);
}
Expand All @@ -337,18 +354,29 @@
}

if (!empty($CFG->messaging)) {
$buttonclasses = 'btn btn-secondary';
echo '<div class="selectbuttons btn-group">';
echo '<input type="button" id="checkallonpage" value="'.get_string('selectall').'" class="'. $buttonclasses .'"> '."\n";
echo '<input type="button" id="checknone" value="'.get_string('deselectall').'" class="'. $buttonclasses .'"> '."\n";
if ($perpage >= $matchcount) {
echo '<input type="button" id="checkallnos" value="'.get_string('selectnos').'" class="'. $buttonclasses .'">'."\n";
$checknos = new \core\output\checkbox_toggleall('participants-table no', true, [
'id' => 'select-nos',
'name' => 'select-nos',
'label' => get_string('selectnos'),
'selectall' => get_string('selectnos'),
'deselectall' => get_string('deselectnos'),
], true);
echo $OUTPUT->render($checknos);
}
echo '</div>';
echo '<div class="p-y-1">';
echo html_writer::label(get_string('withselectedusers'), 'formactionselect');
$displaylist['#messageselect'] = get_string('messageselectadd');
echo html_writer::select($displaylist, 'formaction', '', array('' => 'choosedots'), array('id' => 'formactionid'));
$withselectedparams = array(
'id' => 'formactionid',
'data-action' => 'toggle',
'data-togglegroup' => 'participants-table',
'data-toggle' => 'action',
'disabled' => true
);
echo html_writer::select($displaylist, 'formaction', '', array('' => 'choosedots'), $withselectedparams);
echo '</div>';
echo '</div>'."\n";
echo '</form>'."\n";
Expand Down

0 comments on commit 9abc0ed

Please sign in to comment.