1
0

BeforeTemplateRenderedEvent.php 919 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\Files_Sharing\Event;
  8. use OCP\EventDispatcher\Event;
  9. use OCP\Share\IShare;
  10. /**
  11. * Emitted before the rendering step of the public share page happens. The event
  12. * holds a flag that specifies if it is the authentication page of a public share.
  13. *
  14. * @since 20.0.0
  15. */
  16. class BeforeTemplateRenderedEvent extends Event {
  17. /**
  18. * @since 20.0.0
  19. */
  20. public const SCOPE_PUBLIC_SHARE_AUTH = 'publicShareAuth';
  21. /**
  22. * @since 20.0.0
  23. */
  24. public function __construct(
  25. private IShare $share,
  26. private ?string $scope = null,
  27. ) {
  28. parent::__construct();
  29. }
  30. /**
  31. * @since 20.0.0
  32. */
  33. public function getShare(): IShare {
  34. return $this->share;
  35. }
  36. /**
  37. * @since 20.0.0
  38. */
  39. public function getScope(): ?string {
  40. return $this->scope;
  41. }
  42. }