From 47db4f25c7b2d257c176bf5616bb60d8745a4a07 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 7 Feb 2017 14:57:03 +0100 Subject: [statistics_reporting] Fix location highlighting (do it server side) --- modules-available/statistics_reporting/page.inc.php | 11 ++++++++++- .../statistics_reporting/templates/table-client.html | 2 +- .../statistics_reporting/templates/table-location.html | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'modules-available/statistics_reporting') diff --git a/modules-available/statistics_reporting/page.inc.php b/modules-available/statistics_reporting/page.inc.php index 06f9cfb6..90188121 100644 --- a/modules-available/statistics_reporting/page.inc.php +++ b/modules-available/statistics_reporting/page.inc.php @@ -209,7 +209,16 @@ class Page_Statistics_Reporting extends Page case 'total': return GetData::total($flags); case 'location': - return GetData::perLocation($flags); + $data = GetData::perLocation($flags); + $highlight = Request::get('location', false, 'int'); + if ($highlight !== false) { + foreach ($data as &$row) { + if ($row['locationId'] == $highlight) { + $row['highlight'] = true; + } + } + } + return $data; case 'client': return GetData::perClient($flags); case 'user': diff --git a/modules-available/statistics_reporting/templates/table-client.html b/modules-available/statistics_reporting/templates/table-client.html index 2bb79447..2fb2f574 100644 --- a/modules-available/statistics_reporting/templates/table-client.html +++ b/modules-available/statistics_reporting/templates/table-client.html @@ -16,7 +16,7 @@ {{#data}} {{hostname}} - {{location}} + {{location}} {{time_s}} {{medianTime_s}} {{sessions}} diff --git a/modules-available/statistics_reporting/templates/table-location.html b/modules-available/statistics_reporting/templates/table-location.html index 02292e5b..9479b7af 100644 --- a/modules-available/statistics_reporting/templates/table-location.html +++ b/modules-available/statistics_reporting/templates/table-location.html @@ -11,7 +11,7 @@ {{#data}} - + {{location}} {{time_s}} {{medianTime_s}} -- cgit v1.2.3-55-g7522