summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics_reporting/page.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/statistics_reporting/page.inc.php')
-rw-r--r--modules-available/statistics_reporting/page.inc.php25
1 files changed, 10 insertions, 15 deletions
diff --git a/modules-available/statistics_reporting/page.inc.php b/modules-available/statistics_reporting/page.inc.php
index c3e469fe..ec4bbf1a 100644
--- a/modules-available/statistics_reporting/page.inc.php
+++ b/modules-available/statistics_reporting/page.inc.php
@@ -125,14 +125,14 @@ class Page_Statistics_Reporting extends Page
foreach ($this->COLUMNS as $column) {
$data['columns'][] = array(
'id' => 'col_' . $column,
- 'name' => Dictionary::translateFile('template-tags', 'lang_' . $column, true),
+ 'name' => Dictionary::translateFile('template-tags', 'lang_' . $column),
'checked' => ($forceOn || Request::get('col_' . $column, 'off', 'string') !== 'off') ? 'checked' : '',
);
}
foreach ($this->TABLES as $table) {
$data['tables'][] = array(
- 'name' => Dictionary::translate('table_' . $table, true),
+ 'name' => Dictionary::translate('table_' . $table),
'value' => $table,
'allowed' => User::hasPermission("table.view.$table"),
'selected' => ($this->type === $table) ? 'selected' : '',
@@ -185,12 +185,10 @@ class Page_Statistics_Reporting extends Page
}
Header('Content-Type: application/json; charset=utf-8');
die(json_encode($data));
- } else {
- die('No permission.');
}
- } else {
- echo 'Invalid action.';
+ die('No permission.');
}
+ echo 'Invalid action.';
}
private function doExport()
@@ -257,7 +255,6 @@ class Page_Statistics_Reporting extends Page
}
fclose($fh);
exit();
- break;
case 'xml':
$xml_data = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8" ?><data></data>');
$this->array_to_xml($res, $xml_data, 'row');
@@ -273,9 +270,9 @@ class Page_Statistics_Reporting extends Page
/**
* @param $data array Data to encode
- * @param $xml_data \SimpleXMLElement XML Object to append to
+ * @param $xml_data SimpleXMLElement XML Object to append to
*/
- private function array_to_xml($data, $xml_data, $parentName = 'row')
+ private function array_to_xml(array $data, SimpleXMLElement $xml_data, string $parentName = 'row'): void
{
foreach ($data as $key => $value) {
if (is_numeric($key)) {
@@ -290,7 +287,7 @@ class Page_Statistics_Reporting extends Page
}
}
- private function fetchData($flags)
+ private function fetchData(int $flags)
{
// TODO: Make all modes location-aware, filter while querying, not after
switch ($this->type) {
@@ -314,10 +311,9 @@ class Page_Statistics_Reporting extends Page
}
}
// correct indexing of array after deletions
- $data = array_values($data);
- return $data;
+ return array_values($data);
case 'client':
- $data = GetData::perClient($flags, Request::any('new', false, 'string'));
+ $data = GetData::perClient($flags);
// only show clients from locations which you have permission for
$filterLocs = User::getAllowedLocations("table.view.client");
foreach ($data as $key => $row) {
@@ -326,8 +322,7 @@ class Page_Statistics_Reporting extends Page
}
}
// correct indexing of array after deletions
- $data = array_values($data);
- return $data;
+ return array_values($data);
case 'user':
return GetData::perUser($flags);
case 'vm':