summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-07-15 15:01:14 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-07-18 13:35:35 +0200
commit1c5e082ee145815a13a0dadbc7e9fb0e49ae2f0f (patch)
tree1788a32926333f46d776159e08f1e77a4137d6d2 /apps/files_sharing/lib
parentea3035aa0e2d4b58532a127c7f3dbe0b41470a33 (diff)
downloadnextcloud-server-1c5e082ee145815a13a0dadbc7e9fb0e49ae2f0f.tar.gz
nextcloud-server-1c5e082ee145815a13a0dadbc7e9fb0e49ae2f0f.zip
Add eventdispatcher to public link view
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/AppInfo/Application.php3
-rw-r--r--apps/files_sharing/lib/Controllers/ShareController.php10
2 files changed, 11 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php
index 5ed8d886e2e..b91b0f3ef6e 100644
--- a/apps/files_sharing/lib/AppInfo/Application.php
+++ b/apps/files_sharing/lib/AppInfo/Application.php
@@ -59,7 +59,8 @@ class Application extends App {
$server->getSession(),
$server->getPreviewManager(),
$server->getRootFolder(),
- $federatedSharingApp->getFederatedShareProvider()
+ $federatedSharingApp->getFederatedShareProvider(),
+ $server->getEventDispatcher()
);
});
$container->registerService('ExternalSharesController', function (SimpleContainer $c) {
diff --git a/apps/files_sharing/lib/Controllers/ShareController.php b/apps/files_sharing/lib/Controllers/ShareController.php
index 124d633b99f..fd4ff3f32c0 100644
--- a/apps/files_sharing/lib/Controllers/ShareController.php
+++ b/apps/files_sharing/lib/Controllers/ShareController.php
@@ -54,6 +54,7 @@ use OCA\Files_Sharing\Activity;
use \OCP\Files\NotFoundException;
use OCP\Files\IRootFolder;
use OCP\Share\Exceptions\ShareNotFound;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* Class ShareController
@@ -82,6 +83,8 @@ class ShareController extends Controller {
protected $rootFolder;
/** @var FederatedShareProvider */
protected $federatedShareProvider;
+ /** @var EventDispatcherInterface */
+ protected $eventDispatcher;
/**
* @param string $appName
@@ -96,6 +99,7 @@ class ShareController extends Controller {
* @param IPreview $previewManager
* @param IRootFolder $rootFolder
* @param FederatedShareProvider $federatedShareProvider
+ * @param EventDispatcherInterface $eventDispatcher
*/
public function __construct($appName,
IRequest $request,
@@ -108,7 +112,8 @@ class ShareController extends Controller {
ISession $session,
IPreview $previewManager,
IRootFolder $rootFolder,
- FederatedShareProvider $federatedShareProvider) {
+ FederatedShareProvider $federatedShareProvider,
+ EventDispatcherInterface $eventDispatcher) {
parent::__construct($appName, $request);
$this->config = $config;
@@ -121,6 +126,7 @@ class ShareController extends Controller {
$this->previewManager = $previewManager;
$this->rootFolder = $rootFolder;
$this->federatedShareProvider = $federatedShareProvider;
+ $this->eventDispatcher = $eventDispatcher;
}
/**
@@ -376,6 +382,8 @@ class ShareController extends Controller {
OCP\Util::addscript('files', 'keyboardshortcuts');
}
+ $this->eventDispatcher->dispatch('OCA\Files_Sharing::loadAdditionalScripts');
+
$csp = new OCP\AppFramework\Http\ContentSecurityPolicy();
$csp->addAllowedFrameDomain('\'self\'');
$response = new TemplateResponse($this->appName, 'public', $shareTmpl, 'base');