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 'plugins/CoreVisualizations/Visualizations/HtmlTable.php')
-rw-r--r--plugins/CoreVisualizations/Visualizations/HtmlTable.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/CoreVisualizations/Visualizations/HtmlTable.php b/plugins/CoreVisualizations/Visualizations/HtmlTable.php
index 4bf717fd1b..a07cc6af2b 100644
--- a/plugins/CoreVisualizations/Visualizations/HtmlTable.php
+++ b/plugins/CoreVisualizations/Visualizations/HtmlTable.php
@@ -42,6 +42,15 @@ class HtmlTable extends Visualization
public function beforeLoadDataTable()
{
$this->checkRequestIsNotForMultiplePeriods();
+
+ if ($this->isComparing()) {
+ // forward the comparisonIdSubtables var if present so it will be used when next/prev links are clicked
+ $comparisonIdSubtables = Common::getRequestVar('comparisonIdSubtables', false, 'string');
+ if (!empty($comparisonIdSubtables)) {
+ $comparisonIdSubtables = Common::unsanitizeInputValue($comparisonIdSubtables);
+ $this->config->custom_parameters['comparisonIdSubtables'] = $comparisonIdSubtables;
+ }
+ }
}
public function beforeRender()
@@ -96,6 +105,12 @@ class HtmlTable extends Visualization
$this->config->columns_to_display = $this->dataTable->getColumns();
}
+ if ($this->isComparing()
+ && !empty($this->dataTable)
+ ) {
+ $this->assignTemplateVar('comparisonTotals', $this->dataTable->getMetadata('comparisonTotals'));
+ }
+
// Note: This needs to be done right before rendering, as otherwise some plugins might change the columns to display again
if ($this->isFlattened()) {
$dimensions = $this->dataTable->getMetadata('dimensions');
@@ -144,6 +159,11 @@ class HtmlTable extends Visualization
});
}
}
+
+ $this->assignTemplateVar('segmentTitlePretty', $this->dataTable->getMetadata('segmentPretty'));
+
+ $period = $this->dataTable->getMetadata('period');
+ $this->assignTemplateVar('periodTitlePretty', $period ? $period->getLocalizedShortString() : '');
}
public function beforeGenericFiltersAreAppliedToLoadedDataTable()
@@ -212,6 +232,11 @@ class HtmlTable extends Visualization
return null;
}
+ public function supportsComparison()
+ {
+ return true;
+ }
+
protected function isFlattened()
{
return $this->requestConfig->flat || Common::getRequestVar('flat', '');