summaryrefslogtreecommitdiffstats
path: root/controllers
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2012-10-13 03:07:34 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2012-10-13 03:07:34 +0200
commit8904f6d3f5132529d654c5b5a8b94cec7304b482 (patch)
tree08ba67467efb0283ee18cde101ec19110bf58734 /controllers
parentf3d86d21def0f635a2a8583debcdde5de9ea87e1 (diff)
preperations for always selecting last feed/folder
Diffstat (limited to 'controllers')
-rw-r--r--controllers/news.controller.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/controllers/news.controller.php b/controllers/news.controller.php
index 30b409f54..9695e85d1 100644
--- a/controllers/news.controller.php
+++ b/controllers/news.controller.php
@@ -58,40 +58,40 @@ class NewsController extends Controller {
$folderMapper = new FolderMapper($this->userId);
$feedMapper = new FeedMapper($this->userId);
+ $itemMapper = new ItemMapper($this->userId);
// always show the last viewed feed on reload
- $lastViewedId = $this->getUserValue('lastViewedFeed');
- $lastViewedType = $this->getUserValue('lastViewedFeedType');
+ $lastViewedFeedId = $this->getUserValue('lastViewedFeed');
+ $lastViewedFeedType = $this->getUserValue('lastViewedFeedType');
$showAll = $this->getUserValue('showAll');
- if( $lastViewedId === null || $lastViewedType === null) {
- $lastViewedId = $feedMapper->mostRecent();
+ if( $lastViewedFeedId === null || $lastViewedFeedType === null) {
+ $lastViewedFeedId = $feedMapper->mostRecent();
} else {
// check if the last selected feed or folder exists
if( (
- $lastViewedType === FeedType::FEED &&
- $feedMapper->findById($lastViewedId) === null
+ $lastViewedFeedType === FeedType::FEED &&
+ $feedMapper->findById($lastViewedFeedId) === null
) ||
(
- $lastViewedType === FeedType::FOLDER &&
- $folderMapper->findById($lastViewedId) === null
+ $lastViewedFeedType === FeedType::FOLDER &&
+ $folderMapper->findById($lastViewedFeedId) === null
) ){
- $lastViewedId = $feedMapper->mostRecent();
+ $lastViewedFeedId = $feedMapper->mostRecent();
}
}
$feeds = $folderMapper->childrenOfWithFeeds(0);
$folderForest = $folderMapper->childrenOf(0); //retrieve all the folders
+ $starredCount = $itemMapper->countEveryItemByStatus(StatusFlag::IMPORTANT);
$params = array(
'allfeeds' => $feeds,
'folderforest' => $folderForest,
'showAll' => $showAll,
- 'lastViewedId' => $lastViewedType,
- 'lastViewedType' => $lastViewedType,
- // FIXME: for compability, remove this after refactoring
- 'feedid' => $lastViewedId,
- 'feedtype' => $lastViewedType,
+ 'lastViewedFeedId' => $lastViewedFeedId,
+ 'lastViewedFeedType' => $lastViewedFeedType,
+ 'starredCount' => $starredCount,
);
$this->render('main', $params);