-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REFACTOR] Changes backend module registration for m1, m3, m5
The backend modules overview, file & redirects are now registered via Configuration/Backend/Modules.php For TYPO3 v11 they are registered via the old way (ext_tables.php) The Icons are provided via Icons.php and can be retrieved from the IconFactory now. Resolves: https://projekte.in2code.de/issues/60077
- Loading branch information
1 parent
fa91714
commit d568010
Showing
3 changed files
with
197 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* Copyright notice | ||
* | ||
* (c) 2023 in2code.de and the following authors: | ||
* Daniel Hoffmann <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
* This script is part of the TYPO3 project. The TYPO3 project is | ||
* free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* The GNU General Public License can be found at | ||
* http://www.gnu.org/copyleft/gpl.html. | ||
* | ||
* This script is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* This copyright notice MUST APPEAR in all copies of the script! | ||
*/ | ||
|
||
use In2code\In2publishCore\Component\ConfigContainer\ConfigContainer; | ||
use In2code\In2publishCore\Controller\FileController; | ||
use In2code\In2publishCore\Controller\RecordController; | ||
use In2code\In2publishCore\Features\RedirectsSupport\Controller\RedirectController; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
$backendModulesToRegister = []; | ||
|
||
/** @var ConfigContainer $configContainer */ | ||
$configContainer = GeneralUtility::makeInstance(ConfigContainer::class); | ||
|
||
if ($configContainer->get('module.m1')) { | ||
$backendModulesToRegister['in2publish_core_m1'] = [ | ||
'parent' => 'web', | ||
'position' => [], | ||
'access' => 'user,group', | ||
'workspaces' => 'live', | ||
'path' => '/module/in2publish_core/m1', | ||
'labels' => 'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod1.xlf', | ||
'extensionName' => 'in2publish_core', | ||
'iconIdentifier' => 'in2publish-core-overview-module', | ||
'controllerActions' => [ | ||
RecordController::class => ['index', 'detail', 'publishRecord', 'toggleFilterStatus'], | ||
], | ||
]; | ||
} | ||
|
||
if ($configContainer->get('module.m3')) { | ||
$backendModulesToRegister['in2publish_core_m3'] = [ | ||
'parent' => 'file', | ||
'position' => [], | ||
'access' => 'user,group', | ||
'workspaces' => 'live', | ||
'path' => '/module/in2publish_core/m3', | ||
'labels' => 'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod3.xlf', | ||
'extensionName' => 'in2publish_core', | ||
'iconIdentifier' => 'in2publish-core-file-module', | ||
'controllerActions' => [ | ||
FileController::class => ['index', 'publishFolder', 'publishFile', 'toggleFilterStatus'], | ||
], | ||
]; | ||
} | ||
|
||
if ($configContainer->get('features.redirectsSupport.enable')) { | ||
$backendModulesToRegister['in2publish_core_m5'] = [ | ||
'parent' => 'site', | ||
'position' => ['after' => 'redirects/'], | ||
'access' => 'user,group', | ||
'workspaces' => 'live', | ||
'path' => '/module/in2publish_core/m5', | ||
'labels' => 'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod5.xlf', | ||
'extensionName' => 'in2publish_core', | ||
'iconIdentifier' => 'in2publish-core-redirect-module', | ||
'controllerActions' => [ | ||
RedirectController::class => ['list','publish','selectSite'], | ||
], | ||
]; | ||
} | ||
|
||
return $backendModulesToRegister; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* Copyright notice | ||
* | ||
* (c) 2023 in2code.de and the following authors: | ||
* Daniel Hoffmann <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
* This script is part of the TYPO3 project. The TYPO3 project is | ||
* free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* The GNU General Public License can be found at | ||
* http://www.gnu.org/copyleft/gpl.html. | ||
* | ||
* This script is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* This copyright notice MUST APPEAR in all copies of the script! | ||
*/ | ||
|
||
use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider; | ||
|
||
return [ | ||
'in2publish-core-overview-module' => [ | ||
'provider' => SvgIconProvider::class, | ||
'source' => 'EXT:in2publish_core/Resources/Public/Icons/Overview.svg', | ||
], | ||
'in2publish-core-file-module' => [ | ||
'provider' => SvgIconProvider::class, | ||
'source' => 'EXT:in2publish_core/Resources/Public/Icons/File.svg', | ||
], | ||
'in2publish-core-redirect-module' => [ | ||
'provider' => SvgIconProvider::class, | ||
'source' => 'EXT:in2publish_core/Resources/Public/Icons/Redirect.svg', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters