diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2012-11-02 22:17:06 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2012-11-02 22:17:06 +0100 |
commit | ded22aaf4b1de1cdd813dcebae8ee52bbf351ae3 (patch) | |
tree | bc2836eca25b6b3c041caf61a7572fa9c3d26f77 /controllers/news.controller.php | |
parent | 9112586eeca8ca5216d66b1820d175c12ef3cf0d (diff) |
removed unforseen overwrite of controller classes
Diffstat (limited to 'controllers/news.controller.php')
-rw-r--r-- | controllers/news.controller.php | 23 |
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)); } |