aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/list.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-08-18 16:25:19 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-08-18 20:27:46 +0200
commita5853d7ecc08e048144ad1e9f1ff6f1fbf192a92 (patch)
tree691af0f2776ce517f7aa0e188e3a8675c2948bf8 /apps/files_sharing/list.php
parent92b67409fa3e9ac25da7439731b5df783f50b299 (diff)
downloadnextcloud-server-a5853d7ecc08e048144ad1e9f1ff6f1fbf192a92.tar.gz
nextcloud-server-a5853d7ecc08e048144ad1e9f1ff6f1fbf192a92.zip
Use dispatchTyped instead of dispatch on the new event dispatcher
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_sharing/list.php')
-rw-r--r--apps/files_sharing/list.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/files_sharing/list.php b/apps/files_sharing/list.php
index 370ca53c6b4..58d2b56b253 100644
--- a/apps/files_sharing/list.php
+++ b/apps/files_sharing/list.php
@@ -30,7 +30,9 @@ use OCP\EventDispatcher\GenericEvent;
OCP\User::checkLoggedIn();
$config = \OC::$server->getConfig();
$userSession = \OC::$server->getUserSession();
-$eventDispatcher = \OC::$server->getEventDispatcher();
+$legacyEventDispatcher = \OC::$server->getEventDispatcher();
+/** @var \OCP\EventDispatcher\IEventDispatcher $eventDispatcher */
+$eventDispatcher = \OC::$server->get(OCP\EventDispatcher\IEventDispatcher::class);
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', false);
$isIE = \OCP\Util::isIE();
@@ -41,13 +43,13 @@ $tmpl = new OCP\Template('files_sharing', 'list', '');
$tmpl->assign('showgridview', $showgridview && !$isIE);
// fire script events
-$eventDispatcher->dispatch('\OCP\Collaboration\Resources::loadAdditionalScripts', new GenericEvent());
-$eventDispatcher->dispatch(LoadAdditionalScriptsEvent::class, new LoadAdditionalScriptsEvent());
-$eventDispatcher->dispatch(LoadSidebar::class, new LoadSidebar());
+$legacyEventDispatcher->dispatch('\OCP\Collaboration\Resources::loadAdditionalScripts', new GenericEvent());
+$eventDispatcher->dispatchTyped(new LoadAdditionalScriptsEvent());
+$eventDispatcher->dispatchTyped(new LoadSidebar());
// Load Viewer scripts
if (class_exists(LoadViewer::class)) {
- $eventDispatcher->dispatch(LoadViewer::class, new LoadViewer());
+ $eventDispatcher->dispatchTyped(new LoadViewer());
}
$tmpl->printPage();