diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-05-12 11:28:03 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-05-12 11:50:13 +0300 |
commit | ae0e9ff0834e9446d14d58b5dfbc5cc90794f760 (patch) | |
tree | f2e7ec7088a47c5faee9f080b24f4ebf8f0d474f /apps/files_sharing | |
parent | 9a6869943e9a929cd2e0331c1d25d07f03d865e9 (diff) |
Move files_sharing over to new event for projectsenh/projects-event
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/AppInfo/Application.php | 7 | ||||
-rw-r--r-- | apps/files_sharing/list.php | 16 |
2 files changed, 13 insertions, 10 deletions
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php index 2539247b561..6f1d72f9115 100644 --- a/apps/files_sharing/lib/AppInfo/Application.php +++ b/apps/files_sharing/lib/AppInfo/Application.php @@ -56,6 +56,7 @@ use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; +use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent as ResourcesLoadAdditionalScriptsEvent; use OCP\EventDispatcher\IEventDispatcher; use OCP\Federation\ICloudIdManager; use OCP\Files\Config\IMountProviderCollection; @@ -131,11 +132,11 @@ class Application extends App implements IBootstrap { $dispatcher->addServiceListener(BeforeTemplateRenderedEvent::class, LegacyBeforeTemplateRenderedListener::class); $dispatcher->addServiceListener(LoadSidebar::class, LoadSidebarListener::class); $dispatcher->addServiceListener(ShareCreatedEvent::class, ShareInteractionListener::class); - $dispatcher->addListener('\OCP\Collaboration\Resources::loadAdditionalScripts', function () { - \OCP\Util::addScript('files_sharing', 'collaboration'); - }); $dispatcher->addServiceListener(ShareCreatedEvent::class, UserShareAcceptanceListener::class); $dispatcher->addServiceListener(UserAddedEvent::class, UserAddedToGroupListener::class); + $dispatcher->addListener(ResourcesLoadAdditionalScriptsEvent::class, function () { + \OCP\Util::addScript('files_sharing', 'collaboration'); + }); // notifications api to accept incoming user shares $oldDispatcher->addListener('OCP\Share::postShare', function (GenericEvent $event) { diff --git a/apps/files_sharing/list.php b/apps/files_sharing/list.php index edcfdc180a6..a4667ad17ad 100644 --- a/apps/files_sharing/list.php +++ b/apps/files_sharing/list.php @@ -26,13 +26,15 @@ use OCA\Files\Event\LoadAdditionalScriptsEvent; use OCA\Files\Event\LoadSidebar; use OCA\Viewer\Event\LoadViewer; -use OCP\EventDispatcher\GenericEvent; +use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent as ResourcesLoadAdditionalScriptsEvent; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\IConfig; +use OCP\IUserSession; +use OCP\Server; -$config = \OC::$server->getConfig(); -$userSession = \OC::$server->getUserSession(); -$legacyEventDispatcher = \OC::$server->getEventDispatcher(); -/** @var \OCP\EventDispatcher\IEventDispatcher $eventDispatcher */ -$eventDispatcher = \OC::$server->get(OCP\EventDispatcher\IEventDispatcher::class); +$config = Server::get(IConfig::class); +$userSession = Server::get(IUserSession::class); +$eventDispatcher = Server::get(IEventDispatcher::class); $showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', false); @@ -42,7 +44,7 @@ $tmpl = new OCP\Template('files_sharing', 'list', ''); $tmpl->assign('showgridview', $showgridview); // fire script events -$legacyEventDispatcher->dispatch('\OCP\Collaboration\Resources::loadAdditionalScripts', new GenericEvent()); +$eventDispatcher->dispatchTyped(new ResourcesLoadAdditionalScriptsEvent()); $eventDispatcher->dispatchTyped(new LoadAdditionalScriptsEvent()); $eventDispatcher->dispatchTyped(new LoadSidebar()); |