From 0c8a5e15bd57a2e28f1a3ac7d24a2cea6824f70c Mon Sep 17 00:00:00 2001 From: Pellaeon Lin Date: Fri, 29 Aug 2014 15:34:25 +0000 Subject: [PATCH] Add L10N and Mail service --- appinfo/application.php | 11 +++++++++-- controller/registrationcontroller.php | 8 +++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/appinfo/application.php b/appinfo/application.php index eba3c94..6f20fa3 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -15,11 +15,11 @@ namespace OCA\Registration\AppInfo; use \OCP\AppFramework\App; use \OCA\Registration\Controller\RegistrationController; +use \OCA\Registration\Wrapper; class Application extends App { - public function __construct (array $urlParams=array()) { parent::__construct('registration', $urlParams); @@ -42,7 +42,14 @@ class Application extends App { $container->registerService('UserId', function($c) { return \OCP\User::getUser(); }); - + + $container->registerService('Mail', function($c) { + return Mail(); + }); + + $container->registerService('L10N', function($c) { + return $c->query('ServerContainer')->getL10N($c->query('AppName')); + }); } diff --git a/controller/registrationcontroller.php b/controller/registrationcontroller.php index f476044..4ee3cab 100644 --- a/controller/registrationcontroller.php +++ b/controller/registrationcontroller.php @@ -15,10 +15,16 @@ namespace OCA\Registration\Controller; use \OCP\IRequest; use \OCP\AppFramework\Http\TemplateResponse; use \OCP\AppFramework\Controller; +use \OCA\Registration\Wrapper; class RegistrationController extends Controller { - public function __construct($appName, IRequest $request){ + private $mail; + private $l10n; + + public function __construct($appName, IRequest $request, Mail $mail, $l10n){ + $this->mail = $mail; + $this->l10n = $l10n; parent::__construct($appName, $request); }