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:
authormattab <matthieu.aubry@gmail.com>2014-12-18 03:26:48 +0300
committermattab <matthieu.aubry@gmail.com>2014-12-18 03:26:48 +0300
commit04b462f31fa2a9b9552ea9b1d6bdc55b6ed2adf8 (patch)
tree93240aef9b5f4985bc30c132db563cf71ccded98 /plugins/ImageGraph
parentd31e90e3b7f61dc64f449f4d9925c14897f611e6 (diff)
Fixes #6865 Introducing new event to let plugin define deprecated module and action
Diffstat (limited to 'plugins/ImageGraph')
-rw-r--r--plugins/ImageGraph/API.php74
1 files changed, 43 insertions, 31 deletions
diff --git a/plugins/ImageGraph/API.php b/plugins/ImageGraph/API.php
index 779d412031..41838e959b 100644
--- a/plugins/ImageGraph/API.php
+++ b/plugins/ImageGraph/API.php
@@ -14,7 +14,6 @@ use Piwik\Common;
use Piwik\Filesystem;
use Piwik\Period;
use Piwik\Piwik;
-use Piwik\Plugins\API\API as APIMetadata;
use Piwik\Plugins\ImageGraph\StaticGraph;
use Piwik\SettingsServer;
use Piwik\Translate;
@@ -156,9 +155,19 @@ class API extends \Piwik\Plugin\API
$apiParameters = array('idGoal' => $idGoal);
}
// Fetch the metadata for given api-action
- $metadata = APIMetadata::getInstance()->getMetadata(
- $idSite, $apiModule, $apiAction, $apiParameters, $languageLoaded, $period, $date,
- $hideMetricsDoc = false, $showSubtableReports = true);
+ $parameters = array(
+ 'idSite' => $idSite,
+ 'apiModule' => $apiModule,
+ 'apiAction' => $apiAction,
+ 'apiParameters' => $apiParameters,
+ 'language' => $languageLoaded,
+ 'period' => $period,
+ 'date' => $date,
+ 'hideMetricsDoc' => false,
+ 'showSubtableReports' => true
+ );
+
+ $metadata = Request::processRequest('API.getMetadata', $parameters);
if (!$metadata) {
throw new Exception('Invalid API Module and/or API Action');
}
@@ -288,20 +297,21 @@ class API extends \Piwik\Plugin\API
}
}
- $processedReport = APIMetadata::getInstance()->getRowEvolution(
- $idSite,
- $period,
- $date,
- $apiModule,
- $apiAction,
- $labels,
- $segment,
- $plottedMetric,
- $languageLoaded,
- $idGoal,
- $legendAppendMetric,
- $labelUseAbsoluteUrl = false
+ $parameters = array(
+ 'idSite' => $idSite,
+ 'period' => $period,
+ 'date' => $date,
+ 'apiModule' => $apiModule,
+ 'apiAction' => $apiAction,
+ 'label' => $labels,
+ 'segment' => $segment,
+ 'column' => $plottedMetric,
+ 'language' => $languageLoaded,
+ 'idGoal' => $idGoal,
+ 'legendAppendMetric' => $legendAppendMetric,
+ 'labelUseAbsoluteUrl' => false
);
+ $processedReport = Request::processRequest('API.getRowEvolution', $parameters);
//@review this test will need to be updated after evaluating the @review comment in API/API.php
if (!$processedReport) {
@@ -345,22 +355,24 @@ class API extends \Piwik\Plugin\API
$ordinateLabels[$plottedMetric] = $processedReport['label'] . ' (' . $metrics[$plottedMetric]['name'] . ')';
}
} else {
- $processedReport = APIMetadata::getInstance()->getProcessedReport(
- $idSite,
- $period,
- $date,
- $apiModule,
- $apiAction,
- $segment,
- $apiParameters = false,
- $idGoal,
- $languageLoaded,
- $showTimer = true,
- $hideMetricsDoc = false,
- $idSubtable,
- $showRawMetrics = false
+ $parameters = array(
+ 'idSite' => $idSite,
+ 'period' => $period,
+ 'date' => $date,
+ 'apiModule' => $apiModule,
+ 'apiAction' => $apiAction,
+ 'segment' => $segment,
+ 'apiParameters' => false,
+ 'idGoal' => $idGoal,
+ 'language' => $languageLoaded,
+ 'showTimer' => true,
+ 'hideMetricsDoc' => false,
+ 'idSubtable' => $idSubtable,
+ 'showRawMetrics' => false
);
+ $processedReport = Request::processRequest('API.getProcessedReport', $parameters);
}
+
// prepare abscissa and ordinate series
$abscissaSeries = array();
$abscissaLogos = array();