diff options
author | nfebe <fenn25.fn@gmail.com> | 2025-05-03 10:34:21 +0100 |
---|---|---|
committer | nfebe <fenn25.fn@gmail.com> | 2025-05-06 14:28:01 +0100 |
commit | f471bd292fa70937050f971cba3b07e8ca3ae9d2 (patch) | |
tree | 8a1cbb8cdad0d19e68e495677fcba6cf0867bf9c /apps/files_sharing/lib | |
parent | 4c241d4f4b8f329528b381ab4717316fe7fbbf1f (diff) | |
download | nextcloud-server-f471bd292fa70937050f971cba3b07e8ca3ae9d2.tar.gz nextcloud-server-f471bd292fa70937050f971cba3b07e8ca3ae9d2.zip |
fix(files_sharing): Move `ConfigLexicon` to Config dir, update sharing input
- Fix autoloading for new `ConfigLexicon`
- Ensure that sharing input in sharing tab respect `show-federated-shares-as-internal`:
This is important, because when federated shares are shown as internal the users should add them from the internal shares section
Signed-off-by: nfebe <fenn25.fn@gmail.com>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/AppInfo/Application.php | 6 | ||||
-rw-r--r-- | apps/files_sharing/lib/Config/ConfigLexicon.php (renamed from apps/files_sharing/lib/AppInfo/ConfigLexicon.php) | 2 | ||||
-rw-r--r-- | apps/files_sharing/lib/Listener/LoadSidebarListener.php | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php index 1fdd042869f..8ddb3afaf33 100644 --- a/apps/files_sharing/lib/AppInfo/Application.php +++ b/apps/files_sharing/lib/AppInfo/Application.php @@ -13,6 +13,7 @@ use OC\User\DisplayNameCache; use OCA\Files\Event\LoadAdditionalScriptsEvent; use OCA\Files\Event\LoadSidebar; use OCA\Files_Sharing\Capabilities; +use OCA\Files_Sharing\Config\ConfigLexicon; use OCA\Files_Sharing\External\Manager; use OCA\Files_Sharing\External\MountProvider as ExternalMountProvider; use OCA\Files_Sharing\Helper; @@ -38,7 +39,6 @@ use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent; -use OCP\AppFramework\Services\IInitialState; use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent as ResourcesLoadAdditionalScriptsEvent; use OCP\EventDispatcher\IEventDispatcher; use OCP\Federation\ICloudIdManager; @@ -49,7 +49,6 @@ use OCP\Files\Events\Node\BeforeNodeReadEvent; use OCP\Group\Events\GroupChangedEvent; use OCP\Group\Events\GroupDeletedEvent; use OCP\Group\Events\UserAddedEvent; -use OCP\IAppConfig; use OCP\IDBConnection; use OCP\IGroup; use OCP\Share\Events\ShareCreatedEvent; @@ -116,9 +115,6 @@ class Application extends App implements IBootstrap { public function boot(IBootContext $context): void { $context->injectFn([$this, 'registerMountProviders']); $context->injectFn([$this, 'registerEventsScripts']); - $context->injectFn(function (IInitialState $initialState, IAppConfig $appConfig) { - $initialState->provideInitialState('showFederatedSharesAsInternal', $appConfig->getValueBool(self::APP_ID, ConfigLexicon::SHOW_FEDERATED_AS_INTERNAL)); - }); Helper::registerHooks(); diff --git a/apps/files_sharing/lib/AppInfo/ConfigLexicon.php b/apps/files_sharing/lib/Config/ConfigLexicon.php index 90739fac633..a463b4e7ef2 100644 --- a/apps/files_sharing/lib/AppInfo/ConfigLexicon.php +++ b/apps/files_sharing/lib/Config/ConfigLexicon.php @@ -6,7 +6,7 @@ declare(strict_types=1); * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\Files_Sharing\AppInfo; +namespace OCA\Files_Sharing\Config; use NCU\Config\Lexicon\ConfigLexiconEntry; use NCU\Config\Lexicon\ConfigLexiconStrictness; diff --git a/apps/files_sharing/lib/Listener/LoadSidebarListener.php b/apps/files_sharing/lib/Listener/LoadSidebarListener.php index b00e937d675..9f0eee9159a 100644 --- a/apps/files_sharing/lib/Listener/LoadSidebarListener.php +++ b/apps/files_sharing/lib/Listener/LoadSidebarListener.php @@ -11,9 +11,12 @@ namespace OCA\Files_Sharing\Listener; use OCA\Files\Event\LoadSidebar; use OCA\Files_Sharing\AppInfo\Application; +use OCA\Files_Sharing\Config\ConfigLexicon; use OCP\AppFramework\Services\IInitialState; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; +use OCP\IAppConfig; +use OCP\Server; use OCP\Share\IManager; use OCP\Util; @@ -33,6 +36,8 @@ class LoadSidebarListener implements IEventListener { return; } + $appConfig = Server::get(IAppConfig::class); + $this->initialState->provideInitialState('showFederatedSharesAsInternal', $appConfig->getValueBool('files_sharing', ConfigLexicon::SHOW_FEDERATED_AS_INTERNAL)); Util::addScript(Application::APP_ID, 'files_sharing_tab', 'files'); } } |