From e44b58ed8b26ecc9bb7da7f6292f0a3977a882bc Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Sun, 15 Mar 2020 17:32:50 +0100 Subject: Hide card for apps store if disabled Signed-off-by: Daniel Kesselberg Signed-off-by: npmbuildbot[bot] --- apps/workflowengine/lib/Settings/ASettings.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'apps/workflowengine/lib') diff --git a/apps/workflowengine/lib/Settings/ASettings.php b/apps/workflowengine/lib/Settings/ASettings.php index ac2ebdb8cac..a535d21ecdf 100644 --- a/apps/workflowengine/lib/Settings/ASettings.php +++ b/apps/workflowengine/lib/Settings/ASettings.php @@ -27,6 +27,7 @@ namespace OCA\WorkflowEngine\Settings; use OCA\WorkflowEngine\AppInfo\Application; use OCA\WorkflowEngine\Manager; use OCP\AppFramework\Http\TemplateResponse; +use OCP\IConfig; use OCP\IInitialStateService; use OCP\IL10N; use OCP\Settings\ISettings; @@ -54,23 +55,31 @@ abstract class ASettings implements ISettings { /** @var IInitialStateService */ private $initialStateService; + /** @var IConfig */ + private $config; + /** * @param string $appName * @param IL10N $l * @param EventDispatcherInterface $eventDispatcher + * @param Manager $manager + * @param IInitialStateService $initialStateService + * @param IConfig $config */ public function __construct( $appName, IL10N $l, EventDispatcherInterface $eventDispatcher, Manager $manager, - IInitialStateService $initialStateService + IInitialStateService $initialStateService, + IConfig $config ) { $this->appName = $appName; $this->l10n = $l; $this->eventDispatcher = $eventDispatcher; $this->manager = $manager; $this->initialStateService = $initialStateService; + $this->config = $config; } abstract function getScope(): int; @@ -108,6 +117,12 @@ abstract class ASettings implements ISettings { $this->getScope() ); + $this->initialStateService->provideInitialState( + Application::APP_ID, + 'appstoreenabled', + $this->config->getSystemValueBool('appstoreenabled', true) + ); + return new TemplateResponse(Application::APP_ID, 'settings', [], 'blank'); } -- cgit v1.2.3