diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-20 12:14:42 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-20 12:14:42 +0200 |
commit | b9f3136f3a7564b983aef6564f9c7488d5b2b25b (patch) | |
tree | a50cc5851cf399df4ba594eacac53f3533c6a2ea /controller/itemcontroller.php | |
parent | e56498784f6691d5ceba84ed070f5b6f0d27aafa (diff) |
get rid of unneeded settings core class and inject it from the core container
Diffstat (limited to 'controller/itemcontroller.php')
-rw-r--r-- | controller/itemcontroller.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/controller/itemcontroller.php b/controller/itemcontroller.php index ec316aabb..99f308be7 100644 --- a/controller/itemcontroller.php +++ b/controller/itemcontroller.php @@ -14,11 +14,11 @@ namespace OCA\News\Controller; use \OCP\IRequest; +use \OCP\IConfig; use \OCP\AppFramework\Controller; use \OCP\AppFramework\Http; use \OCP\AppFramework\Http\JSONResponse; -use \OCA\News\Core\Settings; use \OCA\News\BusinessLayer\BusinessLayerException; use \OCA\News\BusinessLayer\ItemBusinessLayer; use \OCA\News\BusinessLayer\FeedBusinessLayer; @@ -35,8 +35,8 @@ class ItemController extends Controller { IRequest $request, FeedBusinessLayer $feedBusinessLayer, ItemBusinessLayer $itemBusinessLayer, - $userId, - Settings $settings){ + IConfig $settings, + $userId){ parent::__construct($appName, $request); $this->itemBusinessLayer = $itemBusinessLayer; $this->feedBusinessLayer = $feedBusinessLayer; @@ -49,15 +49,18 @@ class ItemController extends Controller { * @NoAdminRequired */ public function index(){ - $showAll = $this->settings->getUserValue('showAll') === '1'; + $showAll = $this->settings->getUserValue($this->userId, $this->appName, + 'showAll') === '1'; $limit = $this->params('limit'); $type = (int) $this->params('type'); $id = (int) $this->params('id'); $offset = (int) $this->params('offset', 0); - $this->settings->setUserValue('lastViewedFeedId', $id); - $this->settings->setUserValue('lastViewedFeedType', $type); + $this->settings->setUserValue($this->userId, $this->appName, + 'lastViewedFeedId', $id); + $this->settings->setUserValue($this->userId, $this->appName, + 'lastViewedFeedType', $type); $params = array(); @@ -87,7 +90,8 @@ class ItemController extends Controller { * @NoAdminRequired */ public function newItems() { - $showAll = $this->settings->getUserValue('showAll') === '1'; + $showAll = $this->settings->getUserValue($this->userId, $this->appName, + 'showAll') === '1'; $type = (int) $this->params('type'); $id = (int) $this->params('id'); |