diff options
| author | Jan-Hendrik Willms <tleilax+github@gmail.com> | 2024-07-01 10:24:31 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+github@gmail.com> | 2024-07-04 15:50:59 +0200 |
| commit | deab35971dd3cec8c96d097275fd84eda37e5b8d (patch) | |
| tree | 514bafd3a4ffbe16eb1f6a41c7d2787330f0afe0 /templates/forms/form.php | |
| parent | a9c40e363b3e13223bb771105c190be9475021a5 (diff) | |
refactor forms to sfc, fixes #4300tic-4300
Diffstat (limited to 'templates/forms/form.php')
| -rw-r--r-- | templates/forms/form.php | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/templates/forms/form.php b/templates/forms/form.php index fe19404..b6406d0 100644 --- a/templates/forms/form.php +++ b/templates/forms/form.php @@ -19,7 +19,29 @@ foreach ($allinputs as $input) { } } $form_id = md5(uniqid()); -?><form v-cloak + +$vueApp = Studip\VueApp::create('StudipForm'); +foreach ($form->getParts() as $index => $part) { + $vueApp->withSlot('part' . $index, $part->renderWithCondition()); +} +echo $vueApp->withProps([ + 'form'=> [ + 'autosave' => $form->isAutoStoring(), + 'values' => $inputs, + 'required' => $required_inputs, + 'serverValidation' => $server_validation, + 'url' => $form->getURL() ?? false, + ], + + 'debug-mode' => $form->getDebugMode(), + 'is-collapsable' => $form->isCollapsable(), + 'is-secure' => $form->getDataSecure(), + 'request-url' => $_SERVER['REQUEST_URI'], + 'slots' => array_keys($vueApp->getSlots()), +]); +?> + +<form v-cloak method="post" <? if (!$form->isAutoStoring()) : ?> action="<?= htmlReady($form->getURL()) ?>" |
