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/Goals/Controller.php')
-rw-r--r--plugins/Goals/Controller.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/plugins/Goals/Controller.php b/plugins/Goals/Controller.php
index 02f8ee5c9e..fd7ddc109a 100644
--- a/plugins/Goals/Controller.php
+++ b/plugins/Goals/Controller.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\Plugins\Goals;
+use Piwik\API\Proxy;
use Piwik\API\Request;
use Piwik\Common;
use Piwik\DataTable;
@@ -16,10 +17,13 @@ use Piwik\DataTable\Filter\AddColumnsProcessedMetricsGoal;
use Piwik\FrontController;
use Piwik\Piwik;
use Piwik\Plugin\Manager;
+use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\CoreVisualizations\Visualizations\Sparklines;
use Piwik\Plugins\Live\Live;
use Piwik\Plugins\Referrers\API as APIReferrers;
use Piwik\Translation\Translator;
use Piwik\View;
+use Piwik\ViewDataTable\Factory as ViewDataTableFactory;
/**
*
@@ -219,6 +223,29 @@ class Controller extends \Piwik\Plugin\Controller
return $this->renderView($view);
}
+ public function getSparklines()
+ {
+ $content = "";
+ $goals = Request::processRequest('Goals.getGoals', ['idSite' => $this->idSite, 'filter_limit' => '-1'], []);
+
+ foreach ($goals as $goal) {
+ $params = [
+ 'idGoal' => $goal['idgoal'],
+ 'allow_multiple' => (int) $goal['allow_multiple'],
+ 'only_summary' => 1,
+ ];
+
+ \Piwik\Context::executeWithQueryParameters($params, function() use (&$content) {
+ //load Visualisations Sparkline
+ $view = ViewDataTableFactory::build(Sparklines::ID, 'Goals.getMetrics', 'Goals.' . __METHOD__, true);
+ $view->config->show_title = true;
+ $content .= $view->render();
+ });
+ }
+
+ return $content;
+ }
+
private function getColumnTranslation($nameToLabel, $columnName, $idGoal)
{
$columnTranslation = '';