diff options
author | diosmosis <benaka@piwik.pro> | 2014-12-18 12:34:42 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-12-18 12:35:03 +0300 |
commit | c48290dfa02d74724a4c34f5c3af3c2d73e0ee89 (patch) | |
tree | 25cfe315d60e56243ab251ea3cd524dd531ccb23 /plugins/CoreHome/DataTableRowAction/RowEvolution.php | |
parent | f6da9b34b5a32c99182435983491d865db2bb0ca (diff) |
Refs #6751, do not remove nb_users from array of row evolution metric togglers, instead hide it; this way the toggler indexes are mapped correctly with series indexes.
Diffstat (limited to 'plugins/CoreHome/DataTableRowAction/RowEvolution.php')
-rw-r--r-- | plugins/CoreHome/DataTableRowAction/RowEvolution.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/plugins/CoreHome/DataTableRowAction/RowEvolution.php b/plugins/CoreHome/DataTableRowAction/RowEvolution.php index c86b83b2d0..978b6755ca 100644 --- a/plugins/CoreHome/DataTableRowAction/RowEvolution.php +++ b/plugins/CoreHome/DataTableRowAction/RowEvolution.php @@ -230,14 +230,6 @@ class RowEvolution list($first, $last) = $this->getFirstAndLastDataPointsForMetric($metric); $details = Piwik::translate('RowEvolution_MetricBetweenText', array($first, $last)); - // TODO: this check should be determined by metric metadata, not hardcoded here - if ($metric == 'nb_users' - && $first == 0 - && $last == 0 - ) { - continue; - } - if ($change !== false) { $lowerIsBetter = Metrics::isLowerValueBetter($metric); if (substr($change, 0, 1) == '+') { @@ -275,6 +267,15 @@ class RowEvolution if (!empty($metricData['logo'])) { $newMetric['logo'] = $metricData['logo']; } + + // TODO: this check should be determined by metric metadata, not hardcoded here + if ($metric == 'nb_users' + && $first == 0 + && $last == 0 + ) { + $newMetric['hide'] = true; + } + $metrics[] = $newMetric; $i++; } |