From 193bd948d7e628f1b0544f9b7b0304cdd1067a4a Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 20 Nov 2014 10:58:58 +0100 Subject: fix multiple bugs --- controller/itemcontroller.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'controller') 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); -- cgit v1.2.3