aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/Bootstrap/RegistrationContext.php
diff options
context:
space:
mode:
authorjld3103 <jld3103yt@gmail.com>2023-12-07 16:39:16 +0100
committerAndrey Borysenko <andrey18106x@gmail.com>2024-03-12 13:56:54 +0200
commit4ac2375ca2082750432ccc9cff46bf5888b4db30 (patch)
treebca24a21f4dfa0184f8e400e9508fc5600ade8d4 /lib/private/AppFramework/Bootstrap/RegistrationContext.php
parentc42397358f05aa60ae91ed11e7754fddba182cce (diff)
downloadnextcloud-server-4ac2375ca2082750432ccc9cff46bf5888b4db30.tar.gz
nextcloud-server-4ac2375ca2082750432ccc9cff46bf5888b4db30.zip
feat: Add declarative settings
Signed-off-by: jld3103 <jld3103yt@gmail.com> Signed-off-by: Julien Veyssier <julien-nc@posteo.net> Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Diffstat (limited to 'lib/private/AppFramework/Bootstrap/RegistrationContext.php')
-rw-r--r--lib/private/AppFramework/Bootstrap/RegistrationContext.php29
1 files changed, 21 insertions, 8 deletions
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
index 6c51aafff9b..95f59d243c6 100644
--- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php
+++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
@@ -49,6 +49,7 @@ use OCP\Http\WellKnown\IHandler;
use OCP\Notification\INotifier;
use OCP\Profile\ILinkAction;
use OCP\Search\IProvider;
+use OCP\Settings\IDeclarativeSettingsForm;
use OCP\SetupCheck\ISetupCheck;
use OCP\Share\IPublicShareTemplateProvider;
use OCP\SpeechToText\ISpeechToTextProvider;
@@ -142,9 +143,6 @@ class RegistrationContext {
/** @var ServiceRegistration<\OCP\TextToImage\IProvider>[] */
private $textToImageProviders = [];
-
-
-
/** @var ParameterRegistration[] */
private $sensitiveMethods = [];
@@ -159,6 +157,9 @@ class RegistrationContext {
/** @var PreviewProviderRegistration[] */
private array $previewProviders = [];
+ /** @var ServiceRegistration<IDeclarativeSettingsForm>[] */
+ private array $declarativeSettings = [];
+
/** @var ServiceRegistration<ITeamResourceProvider>[] */
private array $teamResourceProviders = [];
@@ -403,6 +404,13 @@ class RegistrationContext {
$setupCheckClass
);
}
+
+ public function registerDeclarativeSettings(string $declarativeSettingsClass): void {
+ $this->context->registerDeclarativeSettings(
+ $this->appId,
+ $declarativeSettingsClass
+ );
+ }
};
}
@@ -542,7 +550,6 @@ class RegistrationContext {
);
}
-
/**
* @psalm-param class-string<ITeamResourceProvider> $class
*/
@@ -577,6 +584,13 @@ class RegistrationContext {
}
/**
+ * @psalm-param class-string<IDeclarativeSettingsForm> $declarativeSettingsClass
+ */
+ public function registerDeclarativeSettings(string $appId, string $declarativeSettingsClass): void {
+ $this->declarativeSettings[] = new ServiceRegistration($appId, $declarativeSettingsClass);
+ }
+
+ /**
* @param App[] $apps
*/
public function delegateCapabilityRegistrations(array $apps): void {
@@ -893,11 +907,10 @@ class RegistrationContext {
return $this->setupChecks;
}
-
/**
- * @return ServiceRegistration<ITeamResourceProvider>[]
+ * @return ServiceRegistration<IDeclarativeSettingsForm>[]
*/
- public function getTeamResourceProviders(): array {
- return $this->teamResourceProviders;
+ public function getDeclarativeSettings(): array {
+ return $this->declarativeSettings;
}
}