Skip to content

Commit

Permalink
FEATURE: cookie-cutter moved to own repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Heinze committed Aug 11, 2020
1 parent 546cbcb commit 869c3aa
Show file tree
Hide file tree
Showing 76 changed files with 7,896 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
/node_modules/
.idea
yarn-error.log
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v14
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.hbs
Resources/Public
Resources/Private/Fusion
Resources/Private/JavaScript/*Compiled.js
Resources/Private/KlaroTranslations/*.yml
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"phpVersion": "7.2"
}
33 changes: 33 additions & 0 deletions Classes/DataSource/ConsentGroupsDataSource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
namespace Sandstorm\CookieCutter\DataSource;

use Neos\Flow\Annotations as Flow;
use Neos\ContentRepository\Domain\Model\NodeInterface;
use Neos\Neos\Service\DataSource\AbstractDataSource;
use Sandstorm\CookieCutter\Eel\Helper\CookieCutterConfig;

class ConsentGroupsDataSource extends AbstractDataSource
{
/**
* @var string
*/
protected static $identifier = 'sandstorm-consent-groups';

/**
* @Flow\InjectConfiguration(package="Sandstorm.CookieCutter", path="groups")
*/
protected $groups;

public function getData(NodeInterface $node = null, array $arguments = [])
{
$CookieCutterConfig = new CookieCutterConfig();
$options = [];
foreach ($this->groups as $name => $group) {
$label = isset($group["title"])
? $CookieCutterConfig->translate($group["title"])
: $name;
$options[$name] = ['label' => $label];
}
return $options;
}
}
Loading

0 comments on commit 869c3aa

Please sign in to comment.