summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2019-10-17 10:27:13 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2019-10-17 18:22:54 +0200
commit5c7c30822067ce99ecfa7cff803b28a86b8554c1 (patch)
tree62b884b30f86a38f9e47056a6a7b54ffcf62ab12 /apps/files_sharing/lib
parentbd5189f29fc5b4340298f98f2f7a49aa3a157131 (diff)
downloadnextcloud-server-5c7c30822067ce99ecfa7cff803b28a86b8554c1.tar.gz
nextcloud-server-5c7c30822067ce99ecfa7cff803b28a86b8554c1.zip
Include the share in the Files_Sharing::loadAdditionalScripts event
This provides a better context for apps using the event, for example to load one script or another depending on whether the share is a file or a folder. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index 0725e520b2d..f5cbb63e083 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -445,7 +445,8 @@ class ShareController extends AuthPublicShareController {
\OCP\Util::addHeader('meta', ['property' => "og:type", 'content' => "object"]);
\OCP\Util::addHeader('meta', ['property' => "og:image", 'content' => $ogPreview]);
- $this->eventDispatcher->dispatch('OCA\Files_Sharing::loadAdditionalScripts');
+ $event = new GenericEvent(null, ['share' => $share]);
+ $this->eventDispatcher->dispatch('OCA\Files_Sharing::loadAdditionalScripts', $event);
$csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
$csp->addAllowedFrameDomain('\'self\'');