-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Avoid deprecated EMU::addPageTSConfig() (#1518)
Register own condition matcher to access ExtensionConfiguration toggles. Switch from INCLUDE_TYPOSCRIPT to @import.
- Loading branch information
Showing
5 changed files
with
62 additions
and
33 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
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
31 changes: 31 additions & 0 deletions
31
Classes/ExpressionLanguage/ExtensionConfigurationWrapper.php
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,31 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
/* | ||
* This file is part of the package bk2k/bootstrap-package. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace BK2K\BootstrapPackage\ExpressionLanguage; | ||
|
||
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; | ||
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; | ||
|
||
#[Autoconfigure(public: true)] | ||
final class ExtensionConfigurationWrapper | ||
{ | ||
public function __construct( | ||
private readonly ExtensionConfiguration $extensionConfiguration, | ||
) { | ||
} | ||
|
||
/** | ||
* True if a bool toggle in ext_conf_template is true'ish. | ||
*/ | ||
public function isToggleEnabled(string $extensionKey, string $extConfTemplateToggle): bool | ||
{ | ||
return (bool)$this->extensionConfiguration->get($extensionKey, $extConfTemplateToggle); | ||
} | ||
} |
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,29 @@ | ||
[!extensionConfiguration.isToggleEnabled('bootstrap_package', 'disablePageTsContentElements')] | ||
# Add Content Elements | ||
@import 'EXT:bootstrap_package/Configuration/TsConfig/Page/ContentElement/All.tsconfig' | ||
[end] | ||
|
||
[!extensionConfiguration.isToggleEnabled('bootstrap_package', 'disablePageTsBackendLayouts')] | ||
# Add BackendLayouts for the BackendLayout DataProvider | ||
@import 'EXT:bootstrap_package/Configuration/TsConfig/Page/Mod/WebLayout/BackendLayouts.tsconfig' | ||
[end] | ||
|
||
[!extensionConfiguration.isToggleEnabled('bootstrap_package', 'disablePageTsRTE')] | ||
# RTE | ||
@import 'EXT:bootstrap_package/Configuration/TsConfig/Page/RTE.tsconfig' | ||
[end] | ||
|
||
[!extensionConfiguration.isToggleEnabled('bootstrap_package', 'disablePageTsTCADefaults')] | ||
# TCADefaults | ||
@import 'EXT:bootstrap_package/Configuration/TsConfig/Page/TCADefaults.tsconfig' | ||
[end] | ||
|
||
[!extensionConfiguration.isToggleEnabled('bootstrap_package', 'disablePageTsTCEMAIN')] | ||
# TCEMAIN | ||
@import 'EXT:bootstrap_package/Configuration/TsConfig/Page/TCEMAIN.tsconfig' | ||
[end] | ||
|
||
[!extensionConfiguration.isToggleEnabled('bootstrap_package', 'disablePageTsTCEFORM')] | ||
# TCEFORM | ||
@import 'EXT:bootstrap_package/Configuration/TsConfig/Page/TCEFORM.tsconfig' | ||
[end] |
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