Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions collector/database/chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,16 @@
$displayedmetrics[] = $m->get_name();
$displayed = true;
}

$checkboxes[] = ['checkbox' => html_writer::checkbox($m->get_name(), 1, $displayed, $m->get_label(),
['onchange' => 'this.form.submit()'])];
$checkbox = html_writer::checkbox($m->get_name(), 1, $displayed, '',
['id' => $m->get_name(), 'onchange' => 'this.form.submit()']);
$label = html_writer::tag('label', $m->get_label(), ['for' => $m->get_name(), 'style' => 'display:inline-block; margin: 0;']);
$color = html_writer::tag('span', '',
['style' => 'display: inline-block; width: 2.5em; height: 1em; background-color: ' . $m->get_colour() . '; margin: 0 6px; vertical-align: middle;']);
$checkboxes[] = [
'checkbox' => html_writer::tag('div', $checkbox . $color . $label, [
'style' => 'display: inline-flex; align-items: center; margin-right: 16px;',
]),
];

if (!in_array($m->group, $groups) && !empty($m->group)) {
$groups += [$m->group => get_string($m->group, 'tool_cloudmetrics')];
Expand Down Expand Up @@ -304,7 +311,7 @@
$context['checkboxes'] = $checkboxes;
$context['metriclabel'] = $context['metriclabel'] ?? get_string('multiplemetrics', 'cltr_database');
$context['frequency'] = html_writer::empty_tag('input',
array('type' => 'hidden', 'name' => 'graphfrequency', 'value' => $displayfrequency));
['type' => 'hidden', 'name' => 'graphfrequency', 'value' => $displayfrequency]);
$renderer = $PAGE->get_renderer('tool_cloudmetrics');

echo $OUTPUT->header();
Expand Down
5 changes: 0 additions & 5 deletions tests/tool_cloudmetrics_collect_metrics_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ class helper_collect_metrics_task extends collect_metrics_task {
/** @var mock_receiver Mock receiver */
private $mock;

/**
* @var object mock variable
*/
public $mock;

/**
* Constructer for helper_collect_metrics_task
*
Expand Down
Loading