| @@ -1,8 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); | |
| 4 | - | |
| 5 | 3 | namespace IvyForms\Services\Template; |
| 6 | 4 | |
| 7 | 5 | use IvyForms\Services\Translations\BackendStrings; |
| 8 | 6 | |
| @@ -8,13 +6,13 @@ | ||
| 8 | 6 | |
| 9 | 7 | class BlankFormTemplate |
| 10 | 8 | { |
| 11 | 9 | /** |
| 12 | - * Get the blank form template | |
| 10 | + * Get template metadata (without form_data) | |
| 13 | 11 | * |
| 14 | 12 | * @return array<string, mixed> |
| 15 | 13 | */ |
| 16 | - public static function getTemplate(): array | |
| 14 | + public static function getTemplateMeta(): array | |
| 17 | 15 | { |
| 18 | 16 | return [ |
| 19 | 17 | 'id' => 'blank_form', |
| 20 | 18 | 'name' => BackendStrings::getSettingsFormBuilderStrings()['blank_form'], |
| @@ -20,9 +18,22 @@ | ||
| 20 | 18 | 'name' => BackendStrings::getSettingsFormBuilderStrings()['blank_form'], |
| 21 | 19 | 'description' => '', |
| 22 | 20 | 'category' => 'basic', |
| 23 | 21 | 'is_pro' => false, |
| 24 | - 'screenshot' => '', | |
| 22 | + 'screenshot' => '' | |
| 23 | + ]; | |
| 24 | + } | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * Get the full template including form data | |
| 28 | + * | |
| 29 | + * @return array<string, mixed> | |
| 30 | + */ | |
| 31 | + public static function getTemplate(): array | |
| 32 | + { | |
| 33 | + return array_merge( | |
| 34 | + self::getTemplateMeta(), | |
| 35 | + [ | |
| 25 | 36 | 'form_data' => [ |
| 26 | 37 | 'name' => BackendStrings::getSettingsFormBuilderStrings()['blank_form'], |
| 27 | 38 | 'description' => '', |
| 28 | 39 | 'published' => 1, |
| @@ -27,10 +38,12 @@ | ||
| 27 | 38 | 'description' => '', |
| 28 | 39 | 'published' => 1, |
| 29 | 40 | 'showTitle' => 1, |
| 30 | 41 | 'storeEntries' => 1, |
| 42 | + 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(), | |
| 31 | 43 | 'fields' => [], |
| 32 | 44 | 'settings' => [] |
| 33 | 45 | ] |
| 34 | - ]; | |
| 46 | + ] | |
| 47 | + ); | |
| 35 | 48 | } |
| 36 | 49 | } |