|
67 | 67 | $displayedmetrics[] = $m->get_name(); |
68 | 68 | $displayed = true; |
69 | 69 | } |
70 | | - |
71 | | - $checkboxes[] = ['checkbox' => html_writer::checkbox($m->get_name(), 1, $displayed, $m->get_label(), |
72 | | - ['onchange' => 'this.form.submit()'])]; |
| 70 | + $checkbox = html_writer::checkbox($m->get_name(), 1, $displayed, '', |
| 71 | + ['id' => $m->get_name(), 'onchange' => 'this.form.submit()']); |
| 72 | + $label = html_writer::tag('label', $m->get_label(), ['for' => $m->get_name(), 'style' => 'display:inline-block; margin: 0;']); |
| 73 | + $color = html_writer::tag('span', '', |
| 74 | + ['style' => 'display:inline-block; width:12px; height:12px; background-color:' . $m->get_colour() . '; margin: 0 6px; vertical-align: middle;']); |
| 75 | + $checkboxes[] = [ |
| 76 | + 'checkbox' => html_writer::tag('div', $checkbox . $color . $label, [ |
| 77 | + 'style' => 'display: inline-flex; align-items: center; margin-right: 16px;', |
| 78 | + ]), |
| 79 | + ]; |
73 | 80 |
|
74 | 81 | if (!in_array($m->group, $groups) && !empty($m->group)) { |
75 | 82 | $groups += [$m->group => get_string($m->group, 'tool_cloudmetrics')]; |
|
304 | 311 | $context['checkboxes'] = $checkboxes; |
305 | 312 | $context['metriclabel'] = $context['metriclabel'] ?? get_string('multiplemetrics', 'cltr_database'); |
306 | 313 | $context['frequency'] = html_writer::empty_tag('input', |
307 | | - array('type' => 'hidden', 'name' => 'graphfrequency', 'value' => $displayfrequency)); |
| 314 | + ['type' => 'hidden', 'name' => 'graphfrequency', 'value' => $displayfrequency]); |
308 | 315 | $renderer = $PAGE->get_renderer('tool_cloudmetrics'); |
309 | 316 |
|
310 | 317 | echo $OUTPUT->header(); |
|
0 commit comments