blob: e6a6fdc022ab30ef1233d0cf53f4843e01544f03 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
<?php
/**
* ownCloud - News app
*
* @author Alessandro Cosentino
* Copyright (c) 2012 - Alessandro Cosentino <cosenal@gmail.com>
*
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file
*
*/
// Check if we are a user
OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled('news');
OCP\App::setActiveNavigationEntry('news');
OCP\Util::addScript('news','news');
OCP\Util::addStyle('news','news');
OCP\Util::addStyle('news','settings');
$l = OC_L10N::get('news');
$userid = OCP\USER::getUser();
$foldermapper = new OCA\News\FolderMapper($userid);
$allfeeds = $foldermapper->childrenOfWithFeeds(0); //$foldermapper->populate($folder);
$folderforest = $foldermapper->getFoldersOfUser(0); //retrieve all the folders
if ($allfeeds) {
$feedid = isset( $_GET['feedid'] ) ? $_GET['feedid'] : null;
if ($feedid == null) {
$feedmapper = new OCA\News\FeedMapper(OCP\USER::getUser($userid));
$feedid = $feedmapper->mostRecent();
}
}
else {
$feedid = 0;
}
$tmpl = new OCP\Template( 'news', 'main', 'user' );
$tmpl->assign('allfeeds', $allfeeds);
$tmpl->assign('folderforest', $folderforest);
$tmpl->assign('feedid', $feedid);
$tmpl->printPage();
?>
|