Skip to content

Commit 1dea7e5

Browse files
authored
various funnel template fixes (#368)
* various funnel template fixes * add translation keys to layer actions
1 parent 684dc89 commit 1dea7e5

File tree

6 files changed

+19
-11
lines changed

6 files changed

+19
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
1414
|---------|-----------------------------------|----------------------------|--------------|----------------|----------------------------------------------------------------------------------|
15-
| **4.x** | `10.1` - `10.5` | `^5.4` | 13.10.2021 | Feature Branch | master |
15+
| **4.x** | `10.5` | `^5.4` | 13.10.2021 | Feature Branch | master |
1616
| **3.x** | `6.0` - `6.9` | `3.4`, `^4.4` | 17.07.2019 | Bugfix only | [3.x](https://github.com/dachcom-digital/pimcore-formbuilder/tree/3.x) |
1717
| **2.7** | `5.4`, `5.5`, `5.6`, `5.7`, `5.8` | `3.4` | 27.06.2019 | Unsupported | [2.7](https://github.com/dachcom-digital/pimcore-formbuilder/tree/2.7) |
1818
| **1.5** | `4.0` | -- | 18.03.2017 | Unsupported | [pimcore4](https://github.com/dachcom-digital/pimcore-formbuilder/tree/pimcore4) |

src/FormBuilderBundle/Assembler/FormAssembler.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ public function assembleViewVars(FormOptionsResolver $optionsResolver): array
7474
}
7575

7676
$systemRuntimeData = [
77-
'form_preset' => $optionsResolver->getFormPreset(),
78-
'form_output_workflow' => $optionsResolver->getOutputWorkflow(),
79-
'form_template' => $optionsResolver->getFormTemplateName(),
80-
'custom_options' => $optionsResolver->getCustomOptions()
77+
'form_preset' => $optionsResolver->getFormPreset(),
78+
'form_output_workflow' => $optionsResolver->getOutputWorkflow(),
79+
'form_template' => $optionsResolver->getFormTemplateName(),
80+
'form_template_full_path' => $optionsResolver->getFormTemplate(),
81+
'custom_options' => $optionsResolver->getCustomOptions()
8182
];
8283

8384
$viewVars['form_block_template'] = $optionsResolver->getFormBlockTemplate();

src/FormBuilderBundle/Form/Type/LayerType.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
2323
continue;
2424
}
2525

26-
$builder->add($element->getFunnelActionDefinition()->getName(), SubmitType::class);
26+
$builder->add(
27+
$element->getFunnelActionDefinition()->getName(),
28+
SubmitType::class,
29+
[
30+
'label' => $element->getFunnelActionDefinition()->getLabel()
31+
]
32+
);
2733
}
2834
}
2935

src/FormBuilderBundle/OutputWorkflow/Channel/Funnel/FunnelOutputChannel.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,11 @@ public function dispatchFunnelProcessing(FunnelWorkerData $funnelWorkerData): Re
137137
$renderType = $funnelLayer->dynamicFunnelActionAware() ? self::RENDER_TYPE_PRERENDER : self::RENDER_TYPE_INCLUDE;
138138

139139
$viewArguments = array_merge($funnelLayerData->getFunnelLayerViewArguments(), [
140-
'form' => $form->createView(),
141-
'formTheme' => $funnelWorkerData->getSubmissionEvent()->getFormRuntimeData()['form_template'] ?? null,
140+
'form' => $form->createView(),
141+
'formTheme' => $funnelWorkerData->getSubmissionEvent()->getFormRuntimeData()['form_template'] ?? null,
142+
'formThemePath' => $funnelWorkerData->getSubmissionEvent()->getFormRuntimeData()['form_template_full_path'] ?? null,
142143
'formRenderRest' => $renderType === self::RENDER_TYPE_INCLUDE,
143-
'funnelActions' => $funnelWorkerData->getFunnelActionElementStack(),
144+
'funnelActions' => $funnelWorkerData->getFunnelActionElementStack(),
144145
]);
145146

146147
$templateArguments = [

src/FormBuilderBundle/Resources/views/funnel/base.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends '@FormBuilder/layout_funnel.html.twig' %}
22

3-
{% if formTheme is not null %}
4-
{% form_theme form with [formTheme ~ '.html.twig'] only %}
3+
{% if formThemePath is not null %}
4+
{% form_theme form formThemePath %}
55
{% endif %}
66

77
{% block funnel_content %}

0 commit comments

Comments
 (0)