-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
Classes/ExpressionLanguage/AxeAccessibilityTypoScriptConditionProvider.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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Xima\XimaTypo3Toolbox\ExpressionLanguage; | ||
|
||
use TYPO3\CMS\Core\ExpressionLanguage\AbstractProvider; | ||
use Xima\XimaTypo3Toolbox\TypoScript\AxeAccessibilityConditionFunctionsProvider; | ||
|
||
class AxeAccessibilityTypoScriptConditionProvider extends AbstractProvider | ||
{ | ||
public function __construct() | ||
{ | ||
$this->expressionLanguageProviders = [ | ||
AxeAccessibilityConditionFunctionsProvider::class, | ||
]; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
Classes/TypoScript/AxeAccessibilityConditionFunctionsProvider.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); | ||
|
||
namespace Xima\XimaTypo3Toolbox\TypoScript; | ||
|
||
use Symfony\Component\ExpressionLanguage\ExpressionFunction; | ||
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; | ||
use TYPO3\CMS\Core\Core\Environment; | ||
use Xima\XimaTypo3Toolbox\Configuration; | ||
|
||
class AxeAccessibilityConditionFunctionsProvider implements ExpressionFunctionProviderInterface | ||
{ | ||
public function getFunctions(): array | ||
{ | ||
return [ | ||
$this->getWebserviceFunction(), | ||
]; | ||
} | ||
|
||
protected function getWebserviceFunction(): ExpressionFunction | ||
{ | ||
return new ExpressionFunction( | ||
'enableAxeAccessibility', | ||
static fn () => null, | ||
static function () { | ||
return $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][Configuration::EXT_KEY]['axeAccessibility']['enable'] && in_array(Environment::getContext()->__toString(), $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][Configuration::EXT_KEY]['axeAccessibility']['enableForContexts']); | ||
} | ||
); | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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