1
0

RecommendedAppsController.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\Core\Controller;
  8. use OCP\AppFramework\Controller;
  9. use OCP\AppFramework\Http\Attribute\FrontpageRoute;
  10. use OCP\AppFramework\Http\Attribute\OpenAPI;
  11. use OCP\AppFramework\Http\Response;
  12. use OCP\AppFramework\Http\StandaloneTemplateResponse;
  13. use OCP\IInitialStateService;
  14. use OCP\IRequest;
  15. use OCP\IURLGenerator;
  16. #[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
  17. class RecommendedAppsController extends Controller {
  18. public function __construct(
  19. IRequest $request,
  20. public IURLGenerator $urlGenerator,
  21. private IInitialStateService $initialStateService,
  22. ) {
  23. parent::__construct('core', $request);
  24. }
  25. /**
  26. * @NoCSRFRequired
  27. * @return Response
  28. */
  29. #[FrontpageRoute(verb: 'GET', url: '/core/apps/recommended')]
  30. public function index(): Response {
  31. $defaultPageUrl = $this->urlGenerator->linkToDefaultPageUrl();
  32. $this->initialStateService->provideInitialState('core', 'defaultPageUrl', $defaultPageUrl);
  33. return new StandaloneTemplateResponse($this->appName, 'recommendedapps', [], 'guest');
  34. }
  35. }