1
0
Fork 0
mirror of https://github.com/Findus23/plugin-ClassicCounter.git synced 2024-09-19 15:23:45 +02:00

Matomo 5 compatibility

This commit is contained in:
Lukas Winkler 2023-07-22 22:25:51 +02:00
parent f62af0080d
commit 54ba8cd645
Signed by: lukas
GPG key ID: 54DE4D798D244853
2 changed files with 9 additions and 8 deletions

View file

@ -36,14 +36,15 @@ class Controller extends \Piwik\Plugin\Controller
private $colorRegex = '/^(?:[0-9a-fA-F]{3}){1,2}$/m'; private $colorRegex = '/^(?:[0-9a-fA-F]{3}){1,2}$/m';
public function svg() { public function svg() {
$idSite = Common::getRequestVar('idSite', $this->idSite, 'int'); $request = \Piwik\Request::fromRequest();
$mode = Common::getRequestVar('mode', "nb_visits", 'string'); $idSite = $request->getIntegerParameter('idSite', $this->idSite);
$mode = $request->getStringParameter('mode', "nb_visits");
$colors = [ $colors = [
"backgroundColor" => Common::getRequestVar('backgroundColor', "000", 'string'), "backgroundColor" => $request->getStringParameter('backgroundColor', "000"),
"foregroundColor" => Common::getRequestVar('foregroundColor', "f00", 'string'), "foregroundColor" => $request->getStringParameter('foregroundColor', "f00"),
"lightColor" => Common::getRequestVar('lightColor', "222", 'string'), "lightColor" => $request->getStringParameter('lightColor', "222"),
]; ];
$historicValue = Common::getRequestVar('historicValue', 0, 'int'); $historicValue = $request->getIntegerParameter('historicValue', 0);
try { try {
if (!in_array($mode, $this->modes)) { if (!in_array($mode, $this->modes)) {
$modestring = implode(", ", $this->modes); $modestring = implode(", ", $this->modes);

View file

@ -1,10 +1,10 @@
{ {
"name": "ClassicCounter", "name": "ClassicCounter",
"description": "Embed a view counter in the style of classic CGI scripts into your website", "description": "Embed a view counter in the style of classic CGI scripts into your website",
"version": "0.3.2", "version": "0.4.0",
"theme": false, "theme": false,
"require": { "require": {
"matomo": ">=4.0.0-b1,<5.0.0-b1" "matomo": ">=5.0.0-b1,<6.0.0-b1"
}, },
"authors": [ "authors": [
{ {