From c7693c77125ec1195ddb9d6f19dd9e0ef8fe0afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Gro=C3=9Fberndt?= Date: Tue, 10 Mar 2026 10:10:35 +0100 Subject: [PATCH] [TASK] Uniform output of FlashMessages in the backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Instead of displaying all `FlashMessages` in a single `alert-warning` container, use the standard template and render an `alert` for its status with an icon for each message. * Add localization for `BackendConfirmationFlashMessageLogout`, which was previously always displayed in English. * Remove the `messageTitle` of the backend `FlashMessages` – these were not previously displayed and have not been localized. --- Classes/Controller/UserBackendController.php | 29 ++++++++++---------- Resources/Private/Language/locallang.xlf | 3 ++ Resources/Private/Layouts/Backend.html | 8 +----- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/Classes/Controller/UserBackendController.php b/Classes/Controller/UserBackendController.php index 25be0d606..8c22716ff 100644 --- a/Classes/Controller/UserBackendController.php +++ b/Classes/Controller/UserBackendController.php @@ -144,7 +144,13 @@ public function userLogoutAction(User $user): ResponseInterface } UserUtility::removeFrontendSessionToUser($user); - $this->addFlashMessage('User successfully logged out'); + $this->addFlashMessage( + LocalizationUtility::translate( + 'BackendConfirmationFlashMessageLogout', + 'femanager', + [$user->getUsername()] + ) + ); return $this->redirect('list'); } @@ -166,8 +172,7 @@ public function confirmUserAction(int $userIdentifier): ResponseInterface 'BackendConfirmationFlashMessageConfirmed', 'femanager', [$user->getUsername()] - ), - 'User Confirmation' + ) ); } else { $this->addFlashMessage( @@ -176,7 +181,7 @@ public function confirmUserAction(int $userIdentifier): ResponseInterface 'femanager', [$user->getUsername()] ), - 'User Confirmation', + '', ContextualFeedbackSeverity::ERROR ); } @@ -220,7 +225,7 @@ public function refuseUserAction(int $userIdentifier): ResponseInterface 'femanager', [$user->getUsername()] ), - 'User Confirmation', + '', ContextualFeedbackSeverity::ERROR ); } @@ -283,11 +288,8 @@ public function getConfigPID(): int } $this->addFlashMessage( - LocalizationUtility::translate( - 'BackendMissingConfigPID', - 'femanager' - ), - 'Backend Configuration', + LocalizationUtility::translate('BackendMissingConfigPID'), + '', ContextualFeedbackSeverity::ERROR ); @@ -332,11 +334,8 @@ public function getFrontendRequestResult(string $status, int $userIdentifier, Us $content = $response->getReasonPhrase(); $GLOBALS['BE_USER']->writelog(4, 0, 1, 0, 'femanager: Frontend request failed.', $content); $this->addFlashMessage( - LocalizationUtility::translate( - 'BackendConfirmationFlashMessageFailed', - 'femanager' - ), - 'User Confirmation', + LocalizationUtility::translate('BackendConfirmationFlashMessageFailed'), + '', ContextualFeedbackSeverity::ERROR ); } else { diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 723a5cd17..cd92b191e 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -689,6 +689,9 @@ UID + + %s was successfully logged out + %s was successfully approved diff --git a/Resources/Private/Layouts/Backend.html b/Resources/Private/Layouts/Backend.html index ac00b9732..fc48660a3 100644 --- a/Resources/Private/Layouts/Backend.html +++ b/Resources/Private/Layouts/Backend.html @@ -44,13 +44,7 @@
- -
- -
{flashMessage.message}
-
-
-
+