diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-19 14:14:01 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-19 14:14:01 +0100 |
commit | 62b6bd485009b5dbb85b50e634ea94aa177d8d42 (patch) | |
tree | 089454ad9588ef97fa96b9199ed26aaedb19d12f /controller/pagecontroller.php | |
parent | 322726c37f0cabad1a2021126d4d420bce914574 (diff) |
controller action for recommended sites
Diffstat (limited to 'controller/pagecontroller.php')
-rw-r--r-- | controller/pagecontroller.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/controller/pagecontroller.php b/controller/pagecontroller.php index 94cdeb51a..e7aea6bb1 100644 --- a/controller/pagecontroller.php +++ b/controller/pagecontroller.php @@ -23,6 +23,7 @@ use \OCP\AppFramework\Controller; use \OCA\News\Config\AppConfig; use \OCA\News\Config\Config; +use \OCA\News\RecommendedSites\RecommendedSites; class PageController extends Controller { @@ -32,6 +33,7 @@ class PageController extends Controller { private $appConfig; private $urlGenerator; private $config; + private $recommendedSites; public function __construct($appName, IRequest $request, @@ -40,6 +42,7 @@ class PageController extends Controller { AppConfig $appConfig, Config $config, IL10N $l10n, + RecommendedSites $recommendedSites, $userId){ parent::__construct($appName, $request); $this->settings = $settings; @@ -48,6 +51,7 @@ class PageController extends Controller { $this->l10n = $l10n; $this->userId = $userId; $this->config = $config; + $this->recommendedSites = $recommendedSites; } @@ -166,4 +170,16 @@ class PageController extends Controller { return $response; } + /** + * @NoAdminRequired + * @NoCSRFRequired + */ + public function recommended() { + $languageCode = $this->l10n->getLanguageCode(); + $default = 'en'; + + return $this->recommendedSites->forLanguage($languageCode, $default); + } + + }
\ No newline at end of file |