summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2012-09-02 14:34:24 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2012-09-02 14:34:24 +0200
commita5495046a484fd699717463185de3a9018f96c81 (patch)
tree5386994187849c70374f06efa188931fe435b4a5 /index.php
parent3385de22ef4f5bacad569d6fd0b80c8ab407d397 (diff)
dont use mock folders, use html delivered from server; deleted unecessary templates and ajax files
Diffstat (limited to 'index.php')
-rw-r--r--index.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/index.php b/index.php
index 3f7839c76..b7e688ba2 100644
--- a/index.php
+++ b/index.php
@@ -40,25 +40,29 @@ if ($allfeeds) {
$feedid = isset( $_GET['feedid'] ) ? $_GET['feedid'] : null;
if ($feedid == null) {
$feedmapper = new OCA\News\FeedMapper(OCP\USER::getUser($userid));
- if(OCP\Config::getUserValue(OCP\USER::getUser(), 'news', 'lastViewedFeed') == null){
+ $lastViewedId = OCP\Config::getUserValue($userid, 'news', 'lastViewedFeed');
+ $lastViewedType = OCP\Config::getUserValue($userid, 'news', 'lastViewedFeedType');
+ if( $lastViewedId == null || $lastViewedType == null){
$feedid = $feedmapper->mostRecent();
} else {
- $feedid = OCP\Config::getUserValue(OCP\USER::getUser(), 'news', 'lastViewedFeed');
+ $feedid = $lastViewedId;
+ $feedtype = $lastViewedType;
// check if feed exists in table
if($feedmapper->findById($feedid) === null){
- $feedid = $feedmapper->mostRecent();
+ $feedid = $feedmapper->mostRecent();
}
}
}
-}
-else {
+} else {
$feedid = 0;
+ $feedtype = 0;
}
$tmpl = new OCP\Template( 'news', 'main', 'user' );
$tmpl->assign('allfeeds', $allfeeds);
$tmpl->assign('folderforest', $folderforest);
$tmpl->assign('feedid', $feedid);
+$tmpl->assign('feedtype', $feedtype);
$tmpl->printPage();
?>