diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-13 20:14:00 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-13 20:14:00 +0200 |
commit | f82b818bdb852f63fdb4a431808f37902f4272ff (patch) | |
tree | 60e23d0b4b95a5f862661f3ad4fcc8cfa21f076f /controller/pagecontroller.php | |
parent | c9c7b457a09ed3f1899099bba60dad21ff6ad026 (diff) |
break all the things!
Diffstat (limited to 'controller/pagecontroller.php')
-rw-r--r-- | controller/pagecontroller.php | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/controller/pagecontroller.php b/controller/pagecontroller.php index fe6fe967a..5a9c592f5 100644 --- a/controller/pagecontroller.php +++ b/controller/pagecontroller.php @@ -15,6 +15,7 @@ namespace OCA\News\Controller; use \OCP\IRequest; use \OCP\IConfig; +use \OCP\IL10N; use \OCP\AppFramework\Http\JSONResponse; use \OCP\AppFramework\Controller; @@ -24,8 +25,11 @@ class PageController extends Controller { private $l10n; private $userId; - public function __construct($appName, IRequest $request, IConfig $settings, - $l10n, $userId){ + public function __construct($appName, + IRequest $request, + IConfig $settings, + IL10N $l10n, + $userId){ parent::__construct($appName, $request); $this->settings = $settings; $this->l10n = $l10n; @@ -58,28 +62,25 @@ class PageController extends Controller { 'language' => $language ); - return new JSONResponse($settings); + return $settings; } /** * @NoAdminRequired + * + * */ - public function updateSettings() { - $isShowAll = $this->params('showAll', null); - $isCompact = $this->params('compact', null); - - if($isShowAll !== null) { + public function updateSettings($showAll, $compact) { + if($showAll !== null) { $this->settings->setUserValue($this->userId, $this->appName, - 'showAll', $isShowAll); + 'showAll', $showAll); } - if($isCompact !== null) { + if($compact !== null) { $this->settings->setUserValue($this->userId, $this->appName, - 'compact', $isCompact); + 'compact', $compact); } - - return new JSONResponse(); } }
\ No newline at end of file |