Compare commits
1 commit
feature/fl
...
master
Author | SHA1 | Date | |
---|---|---|---|
c03377c974 |
3 changed files with 23 additions and 53 deletions
|
@ -12,8 +12,6 @@ namespace DigiComp\Menu\MenuService;
|
||||||
* source code.
|
* source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Neos\Eel\EelEvaluatorInterface;
|
|
||||||
use Neos\Eel\Utility;
|
|
||||||
use Neos\Flow\Annotations as Flow;
|
use Neos\Flow\Annotations as Flow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,15 +30,6 @@ class SettingsService implements ServiceInterface
|
||||||
*/
|
*/
|
||||||
protected array $items = [];
|
protected array $items = [];
|
||||||
|
|
||||||
#[Flow\InjectConfiguration(path: 'defaultEelContext', package: 'DigiComp.Menu')]
|
|
||||||
protected array $defaultContext = [];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Flow\Inject
|
|
||||||
* @var EelEvaluatorInterface
|
|
||||||
*/
|
|
||||||
protected $eelEvaluator;
|
|
||||||
|
|
||||||
public function getItems(string $forPath = null): \Iterator
|
public function getItems(string $forPath = null): \Iterator
|
||||||
{
|
{
|
||||||
if ($forPath) {
|
if ($forPath) {
|
||||||
|
@ -56,21 +45,6 @@ class SettingsService implements ServiceInterface
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
foreach ($items as $itemName => &$item) {
|
|
||||||
\array_walk_recursive(
|
|
||||||
$item,
|
|
||||||
fn (&$item) => $item =
|
|
||||||
\is_string($item) && \str_starts_with($item, '${') && \str_ends_with($item, '}')
|
|
||||||
? Utility::evaluateEelExpression(
|
|
||||||
$item,
|
|
||||||
$this->eelEvaluator,
|
|
||||||
[...$items, 'this' => $item, 'item' => $itemName],
|
|
||||||
$this->defaultContext
|
|
||||||
)
|
|
||||||
: $item
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new \ArrayIterator($items);
|
return new \ArrayIterator($items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
DigiComp:
|
|
||||||
Menu:
|
|
||||||
defaultEelContext:
|
|
||||||
String: 'Neos\Eel\Helper\StringHelper'
|
|
||||||
Array: 'Neos\Eel\Helper\ArrayHelper'
|
|
||||||
Date: 'Neos\Eel\Helper\DateHelper'
|
|
||||||
Configuration: 'Neos\Eel\Helper\ConfigurationHelper'
|
|
||||||
Math: 'Neos\Eel\Helper\MathHelper'
|
|
||||||
Json: 'Neos\Eel\Helper\JsonHelper'
|
|
||||||
Security: 'Neos\Eel\Helper\SecurityHelper'
|
|
||||||
Translation: 'Neos\Flow\I18n\EelHelper\TranslationHelper'
|
|
||||||
StaticResource: 'Neos\Flow\ResourceManagement\EelHelper\StaticResourceHelper'
|
|
||||||
Type: 'Neos\Eel\Helper\TypeHelper'
|
|
||||||
I18n: 'Neos\Flow\I18n\EelHelper\TranslationHelper'
|
|
||||||
File: 'Neos\Eel\Helper\FileHelper'
|
|
||||||
q: 'Neos\Eel\FlowQuery\FlowQuery::q'
|
|
||||||
BaseUri: 'Neos\Fusion\Eel\BaseUriHelper'
|
|
|
@ -1,36 +1,49 @@
|
||||||
{
|
{
|
||||||
"name": "digicomp/menu",
|
"name": "digicomp/menu",
|
||||||
"type": "neos-package",
|
|
||||||
"description": "Helps with the creation of simple fluid based menus",
|
"description": "Helps with the creation of simple fluid based menus",
|
||||||
|
"type": "neos-package",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"flow",
|
"Neos",
|
||||||
"neos",
|
"Flow",
|
||||||
"menu"
|
"menu"
|
||||||
],
|
],
|
||||||
|
"homepage": "https://git.digital-competence.de/Packages/DigiComp.Menu",
|
||||||
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Ferdinand Kuhl",
|
"name": "Ferdinand Kuhl",
|
||||||
"email": "f.kuhl@digital-competence.de",
|
"email": "f.kuhl@digital-competence.de",
|
||||||
"homepage": "http://www.digital-competence.de",
|
"homepage": "https://www.digital-competence.de",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
|
||||||
"homepage": "https://github.com/digicomp/DigiComp.Menu",
|
|
||||||
"require": {
|
"require": {
|
||||||
"neos/flow": "^7.3 | ^8.2",
|
"php": ">=7.4.0",
|
||||||
"php": "^8.1"
|
"neos/flow": "^6.3.21"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"mikey179/vfsstream": "^1.6.1",
|
||||||
|
"neos/buildessentials": "^7.0.0",
|
||||||
|
"phpunit/phpunit": "~8.5",
|
||||||
|
"vimeo/psalm": "~4.22.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"DigiComp\\Menu\\": "Classes"
|
"DigiComp\\Menu\\": "Classes/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"config": {
|
||||||
|
"sort-packages": true,
|
||||||
|
"platform-check": true
|
||||||
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-develop": "4.0.x-dev",
|
"dev-develop": "3.0.x-dev",
|
||||||
"dev-version/2.x-dev": "2.0.x-dev"
|
"dev-version/2.x-dev": "2.0.x-dev"
|
||||||
},
|
},
|
||||||
|
"neos": {
|
||||||
|
"package-key": "DigiComp.Menu"
|
||||||
|
},
|
||||||
"applied-flow-migrations": [
|
"applied-flow-migrations": [
|
||||||
"TYPO3.Fluid-20150214130800",
|
"TYPO3.Fluid-20150214130800",
|
||||||
"TYPO3.Fluid-20141121091700",
|
"TYPO3.Fluid-20141121091700",
|
||||||
|
|
Loading…
Add table
Reference in a new issue