use correct array-structure for output of preconfig

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-05-01 16:57:52 +02:00
parent c59c5efc11
commit 54b467887b
3 changed files with 6 additions and 8 deletions

View File

@@ -123,7 +123,6 @@ if ($page == 'overview') {
];
$preconfig = Preconfig::getPreConfig();
if (!empty($preconfig)) {
$upd_formfield['updates']['sections'] = $preconfig;
}

View File

@@ -34,7 +34,7 @@ $preconfig = [
];
$return = [];
if (Update::versionInUpdate($current_version, '0.10.99')) {
if (Update::versionInUpdate($current_version, '0.11.0-dev1')) {
$description = 'We have rearranged the settings and split them into basic and advanced categories. This makes it easier for users who do not need all the detailed or very specific settings and options and gives a better overview of the basic/mostly used settings.';
$return['panel_settings_mode_note'] = ['type' => 'infotext', 'value' => $description];
$question = '<strong>Chose settings mode (you can change that at any time)</strong>';

View File

@@ -61,7 +61,9 @@ class Preconfig
*/
public function addToPreConfig(array $array)
{
$this->preconfig_data = $this->preconfig_data + $array;
if (isset($array['title']) && isset($array['fields']) && count($array['fields']) > 0) {
$this->preconfig_data[] = $array;
}
}
/**
@@ -103,11 +105,8 @@ class Preconfig
'update_preconfig' => ['type' => 'hidden', 'value' => 1]
]
];
$result = [
$preconfig->getData(),
$agree
];
return $result;
$preconfig->addToPreConfig($agree);
return $preconfig->getData();
}
return [];
}