new: [generic form] added checkbox option for boolean fields in metatemplates

cli-modification-summary
iglocska 2022-11-09 14:00:18 +01:00
parent 16a3826cef
commit d43e7c6c22
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 9 additions and 0 deletions

View File

@ -112,6 +112,7 @@
echo $this->Bootstrap->modal([
'title' => empty($data['title']) ? sprintf('%s %s', $actionName, $modelName) : h($data['title']),
'bodyHtml' => $this->element('genericElements/Form/formLayouts/formRaw', [
'data' => $data,
'formCreate' => $formCreate,
'ajaxFlashMessage' => $ajaxFlashMessage,
'fieldsString' => $fieldsString,
@ -124,6 +125,7 @@
]);
} else if (!empty($raw)) {
echo $this->element('genericElements/Form/formLayouts/formDefault', [
'data' => $data,
'actionName' => $actionName,
'modelName' => $modelName,
'submitButtonData' => $submitButtonData,
@ -135,6 +137,7 @@
]);
} else {
echo $this->element('genericElements/Form/formLayouts/formDefault', [
'data' => $data,
'actionName' => $actionName,
'modelName' => $modelName,
'submitButtonData' => $submitButtonData,

View File

@ -37,6 +37,9 @@ foreach ($metaTemplate->meta_template_fields as $metaTemplateField) {
} else {
$fieldData['field'] = sprintf('MetaTemplates.%s.meta_template_fields.%s.metaFields.%s.value', $metaField->meta_template_id, $metaField->meta_template_field_id, array_key_first($metaTemplateField->metaFields));
}
if ($metaTemplateField->type === 'boolean') {
$fieldData['type'] = 'checkbox';
}
$this->Form->setTemplates($backupTemplates);
$fieldsHtml .= $this->element(
'genericElements/Form/fieldScaffold',
@ -64,6 +67,9 @@ foreach ($metaTemplate->meta_template_fields as $metaTemplateField) {
'field' => sprintf('MetaTemplates.%s.meta_template_fields.%s.metaFields.new.0', $metaTemplateField->meta_template_id, $metaTemplateField->id),
'label' => $metaTemplateField->label,
];
if ($metaTemplateField->type === 'boolean') {
$fieldData['type'] = 'checkbox';
}
$fieldsHtml .= $this->element(
'genericElements/Form/fieldScaffold',
[