Skip to content

Commit 9585e35

Browse files
Do not reverse the icons for "change all groups"
1 parent 15801a5 commit 9585e35

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

renderer.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ public function get_grouping($name, $counter) {
105105
*/
106106
public function change_all_groups() {
107107
// Creates two urls for showing all groups hiding all groups.
108-
$urlshow = $this->create_all_groups_link('show');
109-
$urlhide = $this->create_all_groups_link('hide');
108+
$urlshow = $this->create_all_groups_link('show', false);
109+
$urlhide = $this->create_all_groups_link('hide', false);
110110

111111
$line = html_writer::span(get_string('changeallgroups', 'block_groups'), 'wrapperblockgroupsallgroups') .
112112
$urlshow . $urlhide;
@@ -140,9 +140,10 @@ public function get_tag_group($group, $visibility) {
140140
/**
141141
* Internal Function to create two links for showing all groups hiding all groups.
142142
* @param string $action show/hide
143+
* @param bool $reverseimage whether to reverse the icon (show crossed out eye for 'show' action).
143144
* @return string html_link
144145
*/
145-
private function create_all_groups_link($action) {
146+
private function create_all_groups_link($action, $reverseimage = true) {
146147
global $OUTPUT, $CFG, $COURSE;
147148
if ($action === 'hide') {
148149
$actionnumber = 0;
@@ -154,7 +155,7 @@ private function create_all_groups_link($action) {
154155
$urlhide = new moodle_url($CFG->wwwroot . '/blocks/groups/changeallgroups.php',
155156
array('courseid' => $COURSE->id, 'hide' => $actionnumber));
156157

157-
$icon = $OUTPUT->pix_icon('t/' . $reverse, get_string($reverse . 'group', 'block_groups'),
158+
$icon = $OUTPUT->pix_icon('t/' . ($reverseimage ? $reverse : $action), get_string($reverse . 'group', 'block_groups'),
158159
'moodle', array('class' => "imggroup-all imggroup"));
159160
$rightaligndiv = html_writer::div($icon, 'rightalign');
160161
return html_writer::link($urlhide, $rightaligndiv, array('data-action' => $reverse, 'class' => 'block_groups_all_toggle'));

0 commit comments

Comments
 (0)