Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions apps/files_sharing/lib/Event/BeforeTemplateRenderedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,43 @@
use OCP\EventDispatcher\Event;
use OCP\Share\IShare;

/**
* Emitted before the rendering step of the public share page happens. The event
* holds a flag that specifies if it is the authentication page of a public share.
*
* @since 20.0.0
*/
class BeforeTemplateRenderedEvent extends Event {
/**
* @since 20.0.0
*/
public const SCOPE_PUBLIC_SHARE_AUTH = 'publicShareAuth';

/** @var IShare */
private $share;
/** @var string|null */
private $scope;

/**
* @since 20.0.0
*/
public function __construct(IShare $share, ?string $scope = null) {
parent::__construct();

$this->share = $share;
$this->scope = $scope;
}

/**
* @since 20.0.0
*/
public function getShare(): IShare {
return $this->share;
}

/**
* @since 20.0.0
*/
public function getScope(): ?string {
return $this->scope;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
use OCP\EventDispatcher\Event;

/**
* The event is triggered before the rendering step of each TemplateResponse.
* Emitted before the rendering step of each TemplateResponse. The event holds a
* flag that specifies if an user is logged in.
*
* @package OCP\AppFramework\Http\Events
* @since 20.0.0
*/
class BeforeTemplateRenderedEvent extends Event {
Expand Down