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:
authorMatthieu Napoli <matthieu@mnapoli.fr>2015-02-02 06:16:08 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2015-02-02 06:16:08 +0300
commit344b0fce2ca0e6d5634546b071526c2322bd878f (patch)
tree40a8a224e2c7ab97d4537cf817fe6f8a817165e4 /plugins/Ecommerce
parent03ea8fb3ec54285bdd63cdada015aa67aec1c6ee (diff)
Replaced calls of static methods with dependency injection
Diffstat (limited to 'plugins/Ecommerce')
-rw-r--r--plugins/Ecommerce/Controller.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/plugins/Ecommerce/Controller.php b/plugins/Ecommerce/Controller.php
index 99b427b01a..b1ce7cdd4a 100644
--- a/plugins/Ecommerce/Controller.php
+++ b/plugins/Ecommerce/Controller.php
@@ -9,14 +9,26 @@
namespace Piwik\Plugins\Ecommerce;
use Exception;
-use Piwik\Common;
use Piwik\DataTable;
use Piwik\FrontController;
use Piwik\Piwik;
+use Piwik\Translation\Translator;
use Piwik\View;
class Controller extends \Piwik\Plugins\Goals\Controller
{
+ /**
+ * @var Translator
+ */
+ private $translator;
+
+ public function __construct(Translator $translator)
+ {
+ $this->translator = $translator;
+
+ parent::__construct($translator);
+ }
+
public function ecommerceReport()
{
if (!\Piwik\Plugin\Manager::getInstance()->isPluginActivated('CustomVariables')) {
@@ -25,7 +37,8 @@ class Controller extends \Piwik\Plugins\Goals\Controller
$view = $this->getGoalReportView($idGoal = Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER);
$view->displayFullReport = false;
- $view->headline = Piwik::translate('General_EvolutionOverPeriod');
+ $view->headline = $this->translator->translate('General_EvolutionOverPeriod');
+
return $view->render();
}