Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/API/DataTableManipulator/Flattener.php')
-rw-r--r--core/API/DataTableManipulator/Flattener.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/core/API/DataTableManipulator/Flattener.php b/core/API/DataTableManipulator/Flattener.php
index 7aaef6bf27..fbcd36d068 100644
--- a/core/API/DataTableManipulator/Flattener.php
+++ b/core/API/DataTableManipulator/Flattener.php
@@ -63,18 +63,26 @@ class Flattener extends DataTableManipulator
{
$newDataTable = $dataTable->getEmptyClone($keepFilters = true);
- foreach ($dataTable->getRows() as $rowId => $row) {
- $this->flattenRow($row, $rowId, $newDataTable);
- }
+ // this recursive filter will be applied to subtables
+ $dataTable->filter('ReplaceSummaryRowLabel');
+
+ $this->flattenDataTableInto($dataTable, $newDataTable);
- $queuedFiltersEnabled = Common::getRequestVar('disable_queued_filters', 0, 'int', $this->request) == 0;
- if ($queuedFiltersEnabled) {
- $newDataTable->applyQueuedFilters();
- }
return $newDataTable;
}
/**
+ * @param $dataTable DataTable
+ * @param $newDataTable
+ */
+ protected function flattenDataTableInto($dataTable, $newDataTable, $prefix = '', $logo = false)
+ {
+ foreach ($dataTable->getRows() as $rowId => $row) {
+ $this->flattenRow($row, $rowId, $newDataTable, $prefix, $logo);
+ }
+ }
+
+ /**
* @param Row $row
* @param DataTable $dataTable
* @param string $labelPrefix
@@ -128,9 +136,7 @@ class Flattener extends DataTableManipulator
$dataTable->addRow($row);
}
$prefix = $label . $this->recursiveLabelSeparator;
- foreach ($subTable->getRows() as $rowId => $row) {
- $this->flattenRow($row, $rowId, $dataTable, $prefix, $logo);
- }
+ $this->flattenDataTableInto($subTable, $dataTable, $prefix, $logo);
}
}
@@ -146,4 +152,5 @@ class Flattener extends DataTableManipulator
return $request;
}
+
}