RecommendedAppsController.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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\NoCSRFRequired;
  11. use OCP\AppFramework\Http\Attribute\OpenAPI;
  12. use OCP\AppFramework\Http\Response;
  13. use OCP\AppFramework\Http\StandaloneTemplateResponse;
  14. use OCP\IInitialStateService;
  15. use OCP\IRequest;
  16. use OCP\IURLGenerator;
  17. #[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
  18. class RecommendedAppsController extends Controller {
  19. public function __construct(
  20. IRequest $request,
  21. public IURLGenerator $urlGenerator,
  22. private IInitialStateService $initialStateService,
  23. ) {
  24. parent::__construct('core', $request);
  25. }
  26. /**
  27. * @return Response
  28. */
  29. #[NoCSRFRequired]
  30. #[FrontpageRoute(verb: 'GET', url: '/core/apps/recommended')]
  31. public function index(): Response {
  32. $defaultPageUrl = $this->urlGenerator->linkToDefaultPageUrl();
  33. $this->initialStateService->provideInitialState('core', 'defaultPageUrl', $defaultPageUrl);
  34. return new StandaloneTemplateResponse($this->appName, 'recommendedapps', [], 'guest');
  35. }
  36. }