diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index b6b5cdcd..5ec64452 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -252,7 +252,6 @@ public function register(IRegistrationContext $context): void { }); $context->registerEventListener(FileCreatedFromTemplateEvent::class, CreateFromTemplateListener::class); - $context->registerEventListener(LoadAdditionalScriptsEvent::class, FilesListener::class); $context->registerEventListener(RegisterDirectEditorEvent::class, DirectEditorListener::class); $context->registerEventListener(LoadViewer::class, ViewerListener::class); $context->registerEventListener(BeforeTemplateRenderedEvent::class, FileSharingListener::class); diff --git a/lib/Listeners/FilesListener.php b/lib/Listeners/FilesListener.php deleted file mode 100644 index ed73a54c..00000000 --- a/lib/Listeners/FilesListener.php +++ /dev/null @@ -1,114 +0,0 @@ -appConfig = $appConfig; - $this->initialState = $initialState; - $this->serverContainer = $serverContainer; - } - - public function handle(Event $event): void { - if (!$event instanceof LoadAdditionalScriptsEvent) { - return; - } - - if (!empty($this->appConfig->getDocumentServerUrl()) - && $this->appConfig->settingsAreSuccessful() - && $this->appConfig->isUserAllowedToUse()) { - Util::addScript("onlyoffice", "onlyoffice-desktop"); - Util::addScript("onlyoffice", "onlyoffice-main"); - Util::addScript("onlyoffice", "onlyoffice-template"); - - if ($this->appConfig->getSameTab()) { - Util::addScript("onlyoffice", "onlyoffice-listener"); - } - - if ($this->appConfig->getAdvanced() - && \OC::$server->getAppManager()->isInstalled("files_sharing")) { - Util::addScript("onlyoffice", "onlyoffice-share"); - Util::addStyle("onlyoffice", "share"); - } - - $container = $this->serverContainer; - $this->initialState->provideLazyInitialState("settings", function () use ($container) { - return $container->query(SettingsData::class); - }); - - Util::addStyle("onlyoffice", "main"); - Util::addStyle("onlyoffice", "template"); - Util::addStyle("onlyoffice", "format"); - } - } -}