From da49e3f3e07158e3aec22efec26ff758c0f04598 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 17 May 2022 18:33:38 +0200 Subject: Port share by mail settings to vue Signed-off-by: Carl Schwan --- apps/sharebymail/lib/Settings/Admin.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'apps/sharebymail/lib') diff --git a/apps/sharebymail/lib/Settings/Admin.php b/apps/sharebymail/lib/Settings/Admin.php index f1733b73bc0..5f690f16f2b 100644 --- a/apps/sharebymail/lib/Settings/Admin.php +++ b/apps/sharebymail/lib/Settings/Admin.php @@ -24,32 +24,29 @@ namespace OCA\ShareByMail\Settings; use OCP\AppFramework\Http\TemplateResponse; +use OCP\AppFramework\Services\IInitialState; use OCP\IL10N; use OCP\Settings\IDelegatedSettings; class Admin implements IDelegatedSettings { + private SettingsManager $settingsManager; + private IL10N $l; + private IInitialState $initialState; - /** @var SettingsManager */ - private $settingsManager; - - /** @var IL10N */ - private $l; - - public function __construct(SettingsManager $settingsManager, IL10N $l) { + public function __construct(SettingsManager $settingsManager, IL10N $l, IInitialState $initialState) { $this->settingsManager = $settingsManager; $this->l = $l; + $this->initialState = $initialState; } /** * @return TemplateResponse */ public function getForm() { - $parameters = [ - 'sendPasswordMail' => $this->settingsManager->sendPasswordByMail(), - 'replyToInitiator' => $this->settingsManager->replyToInitiator() - ]; + $this->initialState->provideInitialState('sendPasswordMail', $this->settingsManager->sendPasswordByMail()); + $this->initialState->provideInitialState('replyToInitiator', $this->settingsManager->replyToInitiator()); - return new TemplateResponse('sharebymail', 'settings-admin', $parameters, ''); + return new TemplateResponse('sharebymail', 'settings-admin', [], ''); } /** -- cgit v1.2.3