Skip to content

Commit 55e1f54

Browse files
committed
move inspector configs within groupDefinitions array
1 parent ec86098 commit 55e1f54

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

formwidgets/Blocks.php

+4-10
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ class Blocks extends Repeater
2727
*/
2828
public string|array|null $tags = null;
2929

30-
/**
31-
* List of inspector configs for the blocks.
32-
*/
33-
public array $inspectorConfigs = [];
34-
3530
/**
3631
* Configuration stored with each index.
3732
*/
@@ -212,10 +207,9 @@ protected function processGroupMode(): void
212207
'name' => array_get($config, 'name'),
213208
'icon' => array_get($config, 'icon', 'icon-square-o'),
214209
'description' => array_get($config, 'description'),
215-
'fields' => array_get($config, 'fields')
210+
'fields' => array_get($config, 'fields'),
211+
'config' => array_get($config, 'config', null),
216212
];
217-
218-
$this->inspectorConfigs[$code] = array_get($config, 'config', null);
219213
}
220214

221215
// Sort the builder blocks by translated name label
@@ -299,15 +293,15 @@ public function getGroupIcon(string $groupCode): ?string
299293
*/
300294
public function hasInspectorConfig(string $groupCode): bool
301295
{
302-
return isset($this->inspectorConfigs[$groupCode]);
296+
return isset($this->groupDefinitions[$groupCode]['config']);
303297
}
304298

305299
/**
306300
* Returns the Inspector config, as a JSON string, for the given group code.
307301
*/
308302
public function getInspectorConfig(string $groupCode): string
309303
{
310-
return json_encode($this->processInspectorConfig(array_get($this->inspectorConfigs, $groupCode, [])));
304+
return json_encode($this->processInspectorConfig(array_get($this->groupDefinitions, $groupCode . '.config', [])));
311305
}
312306

313307
/**

0 commit comments

Comments
 (0)