From 604abd7b522cf5e7be0e63a00f1b9da4b3d9ae8c Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Mon, 24 Jun 2024 14:02:06 +0200 Subject: [PATCH] =?UTF-8?q?FEATURE:=20Add=20=E2=80=9Eback=20home=E2=80=9C?= =?UTF-8?q?=20command=20to=20go=20to=20preferred=20start=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Classes/Service/DataSource/CommandsDataSource.php | 11 ++++++++++- Resources/Private/Translations/en/Main.xlf | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Classes/Service/DataSource/CommandsDataSource.php b/Classes/Service/DataSource/CommandsDataSource.php index 4b0411b..66f5aa6 100644 --- a/Classes/Service/DataSource/CommandsDataSource.php +++ b/Classes/Service/DataSource/CommandsDataSource.php @@ -16,6 +16,7 @@ use Neos\Flow\I18n\Translator; use Neos\Flow\Mvc\Routing\UriBuilder; use Neos\Neos\Controller\Backend\MenuHelper; +use Neos\Neos\Service\BackendRedirectionService; use Neos\Neos\Service\DataSource\AbstractDataSource; use Shel\Neos\CommandBar\Domain\Dto\CommandDto; use Shel\Neos\CommandBar\Helper\TranslationHelper; @@ -28,7 +29,8 @@ class CommandsDataSource extends AbstractDataSource public function __construct( private readonly MenuHelper $menuHelper, private readonly UriBuilder $uriBuilder, - private readonly Translator $translator + private readonly Translator $translator, + private readonly BackendRedirectionService $backendRedirectionService, ) { } @@ -85,6 +87,13 @@ function (array $carry, array $submodule) { }, []); $commands = [ + 'preferred-start-module' => new CommandDto( + 'preferred-start-module', + $this->translate('CommandDataSource.command.preferredStartModule'), + $this->translate('CommandDataSource.command.preferredStartModule.description'), + $this->backendRedirectionService->getAfterLoginRedirectionUri($this->controllerContext), + 'home' + ), 'modules' => [ 'name' => $this->translate('CommandDataSource.category.modules'), 'description' => $this->translate('CommandDataSource.category.modules.description'), diff --git a/Resources/Private/Translations/en/Main.xlf b/Resources/Private/Translations/en/Main.xlf index e204127..c8d729b 100644 --- a/Resources/Private/Translations/en/Main.xlf +++ b/Resources/Private/Translations/en/Main.xlf @@ -66,6 +66,12 @@ Open a backend module + + Back home + + + Back to the start module + Switch edit/preview mode