-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] add eelcondition for loaded extensions
Signed-off-by: Kay Strobach <[email protected]>
- Loading branch information
1 parent
1cd475f
commit cd79400
Showing
3 changed files
with
44 additions
and
0 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,20 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
namespace KayStrobach\Themes\ExpressionLanguage; | ||
|
||
use TYPO3\CMS\Core\ExpressionLanguage\AbstractProvider; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
/** | ||
* ConditionProvider | ||
*/ | ||
class ConditionProvider extends AbstractProvider | ||
{ | ||
public function __construct() | ||
{ | ||
$this->expressionLanguageVariables = [ | ||
'extension' => GeneralUtility::makeInstance(ExtensionCondition::class) | ||
]; | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
namespace KayStrobach\Themes\ExpressionLanguage; | ||
|
||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; | ||
|
||
class ExtensionCondition | ||
{ | ||
/** | ||
* @param string $extensionKey | ||
* @return bool | ||
*/ | ||
public function isLoaded($extensionKey): bool | ||
{ | ||
return ExtensionManagementUtility::isLoaded($extensionKey); | ||
} | ||
} |
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,6 @@ | ||
<?php | ||
return [ | ||
'typoscript' => [ | ||
KayStrobach\Themes\ExpressionLanguage\ConditionProvider::class | ||
] | ||
]; |