diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-20 10:58:58 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-20 10:58:58 +0100 |
commit | 193bd948d7e628f1b0544f9b7b0304cdd1067a4a (patch) | |
tree | 0d7a7442977a4ac4c573a3d496a14fdc4393826b /controller | |
parent | a2054d20b7b9616b7cb4cbf8b66bfb7d4c520246 (diff) |
fix multiple bugs
Diffstat (limited to 'controller')
-rw-r--r-- | controller/itemcontroller.php | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/controller/itemcontroller.php b/controller/itemcontroller.php index 4aee6402a..f2ff5990a 100644 --- a/controller/itemcontroller.php +++ b/controller/itemcontroller.php @@ -54,13 +54,26 @@ class ItemController extends Controller { * @param int $id * @param int $limit * @param int $offset + * @param bool $showAll + * @param bool $oldestFirst * @return array */ - public function index($type, $id, $limit=50, $offset=0) { - $showAll = $this->settings->getUserValue($this->userId, $this->appName, - 'showAll') === '1'; - $oldestFirst = $this->settings->getUserValue($this->userId, - $this->appName, 'oldestFirst') === '1'; + public function index($type, $id, $limit=50, $offset=0, $showAll=null, + $oldestFirst=null) { + + // in case this is called directly and not from the website use the + // internal state + if ($showAll === null) { + $showAll = $this->settings->getUserValue( + $this->userId, $this->appName,'showAll' + ) === '1'; + } + + if ($oldestFirst === null) { + $oldestFirst = $this->settings->getUserValue( + $this->userId, $this->appName, 'oldestFirst' + ) === '1'; + } $this->settings->setUserValue($this->userId, $this->appName, 'lastViewedFeedId', $id); |