- Issue created by @rkoller
- 🇩🇪Germany rkoller Nürnberg, Germany
wont be necessary if the drupalSettings approach in 📌 [PP-1] change from the global configuration object to the data-skipto approach Postponed is used
currently the skipto module is using this custom php method for transforming an array into a json string
private function skipto_generate_config_json(array $config_export): string {
$properties = [
'colorTheme','containerElement', 'displayOption', 'highlightTarget', 'positionLeft', 'fontSize', 'fontFamily', 'headings', 'landmarks', 'aboutVersion', 'dialogBackgroundTitleDarkColor', 'dialogBackgroundTitleColor',
];
$config_array = [];
foreach ($properties as $property) {
$config_array[$property] = is_array($config_export[$property]) ? implode(' ', $config_export[$property]) : $config_export[$property];
}
return json_encode($config_array);
}
it works but it would probably the better choice to use a method already available in symfony and or drupal
use drupal serialization api. i'll postpone the issue on ✨ Make the skipTo module configurable on a per user basis Active for now.
Active
2.0
Code
wont be necessary if the drupalSettings approach in 📌 [PP-1] change from the global configuration object to the data-skipto approach Postponed is used