summaryrefslogtreecommitdiffstats
path: root/controllers/news.controller.php
diff options
context:
space:
mode:
Diffstat (limited to 'controllers/news.controller.php')
-rw-r--r--controllers/news.controller.php23
1 files changed, 10 insertions, 13 deletions
diff --git a/controllers/news.controller.php b/controllers/news.controller.php
index bf31d08f2..0338c23e9 100644
--- a/controllers/news.controller.php
+++ b/controllers/news.controller.php
@@ -12,34 +12,31 @@
namespace OCA\News;
-require_once \OC_App::getAppPath('news') . '/controllers/controller.php';
-
-
class NewsController extends Controller {
/**
* Decides wether to show the feedpage or the firstrun page
*/
- public function index($request){
+ public function index(){
$feedMapper = new FeedMapper($this->userId);
if($feedMapper->feedCount() > 0){
- $this->feedPage($request);
+ $this->feedPage();
} else {
- $this->firstRun($request);
+ $this->firstRun();
}
}
- public function firstRun($request){
+ public function firstRun(){
$this->addScript('news');
$this->addScript('firstrun');
$this->addStyle('firstrun');
- $this->renderTemplate('firstrun');
+ $this->render('firstrun');
}
- public function feedPage($request){
+ public function feedPage(){
$this->addScript('main');
$this->addScript('news');
$this->addScript('menu');
@@ -54,10 +51,10 @@ class NewsController extends Controller {
$itemMapper = new ItemMapper($this->userId);
// if no feed id is passed as parameter, then show the last viewed feed on reload
- $lastViewedFeedId = isset( $request->get['feedid'] ) ? $request->get['feedid'] : (int)$this->getUserValue('lastViewedFeed');
- $lastViewedFeedType = isset( $request->get['feedid'] ) ? FeedType::FEED : (int)$this->getUserValue('lastViewedFeedType');
+ $lastViewedFeedId = isset( $_GET['feedid'] ) ? $_GET['feedid'] : (int)$this->getUserValue('lastViewedFeed');
+ $lastViewedFeedType = isset( $_GET['feedid'] ) ? FeedType::FEED : (int)$this->getUserValue('lastViewedFeedType');
- $showAll = $this->getUserValue('showAll');
+ $showAll = $this->getUserValue('showAll');
if( $lastViewedFeedId === null || $lastViewedFeedType === null) {
$lastViewedFeedId = $feedMapper->mostRecent();
@@ -90,7 +87,7 @@ class NewsController extends Controller {
'items' => $items
);
- $this->renderTemplate('main', $params, array('items' => true));
+ $this->render('main', $params, array('items' => true));
}