diff --git a/src/Controller/SettingsController.php b/src/Controller/SettingsController.php index cd317876..3479cf84 100644 --- a/src/Controller/SettingsController.php +++ b/src/Controller/SettingsController.php @@ -33,6 +33,8 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; use Symfony\Contracts\Cache\TagAwareCacheInterface; +use function Symfony\Component\Translation\t; + class SettingsController extends AbstractController { public function __construct(private readonly SettingsManagerInterface $settingsManager, private readonly SettingsFormFactoryInterface $settingsFormFactory) @@ -63,6 +65,12 @@ class SettingsController extends AbstractController //It might be possible, that the tree settings have changed, so clear the cache $cache->invalidateTags(['tree_treeview', 'sidebar_tree_update']); + + $this->addFlash('success', t('settings.flash.saved')); + } + + if ($form->isSubmitted() && !$form->isValid()) { + $this->addFlash('error', t('settings.flash.invalid')); } //Render the form @@ -70,4 +78,4 @@ class SettingsController extends AbstractController 'form' => $form ]); } -} \ No newline at end of file +} diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf index 69b205f4..8a4f809b 100644 --- a/translations/messages.en.xlf +++ b/translations/messages.en.xlf @@ -13033,5 +13033,17 @@ Please note, that you can not impersonate a disabled user. If you try you will g The value of this parameter can be overridden by setting the environment variable "%env%". + + + settings.flash.saved + Settings saved successfully. + + + + + settings.flash.invalid + Settings are invalid. Please check your input! + +