Skip to content

Commit

Permalink
FEATURE: upgrade to most recent klaro.js version
Browse files Browse the repository at this point in the history
* now using most recent klaro version
* removed code for inline hints as klaro now supports contextual consents
* removed code for creating Js in PHP
    * PHP now only creates a json config
    * everything concerning Js is kept in the browser
* changed api/config to be closer to the klaro config
    * klaro now feels more mature ;)
* added a lot of documentation
  • Loading branch information
Florian Heinze committed Jul 12, 2021
1 parent 5971644 commit f90acb1
Show file tree
Hide file tree
Showing 95 changed files with 7,107 additions and 4,360 deletions.
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"phpVersion": "7.2"
"phpVersion": "7.2",
"tabWidth": 2
}
20 changes: 12 additions & 8 deletions Classes/DataSource/GroupsDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,27 @@ class GroupsDataSource extends AbstractDataSource
/**
* @var string
*/
protected static $identifier = 'sandstorm-cookiepunch-groups';
protected static $identifier = 'sandstorm-cookiepunch-services';

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

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

if(isset($this->services) && sizeof(array_keys($this->services)) > 0) {
foreach ($this->services as $name => $service) {
$label = isset($service["title"])
? $CookiePunchConfig->translate($service["title"])
: $name;
$options[$name] = ['label' => $label];
}
}

return $options;
}
}
Loading

0 comments on commit f90acb1

Please sign in to comment.