← All changes
|
backend/src/Services/Template/PhotoVideoConsentFormTemplate.php
+19
-10
0.6
→
1.5
View file →
| @@ -1,23 +1,18 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace IvyForms\Services\Template; |
| 4 | 4 | |
| 5 | -// phpcs:disable PSR1.Files.SideEffects | |
| 6 | -if (!defined('ABSPATH')) { | |
| 7 | - exit; // Exit if accessed directly | |
| 8 | -} | |
| 9 | - | |
| 10 | 5 | use IvyForms\Services\Translations\BackendStrings; |
| 11 | 6 | |
| 12 | 7 | class PhotoVideoConsentFormTemplate |
| 13 | 8 | { |
| 14 | 9 | /** |
| 15 | - * Get the photo & video consent form template | |
| 10 | + * Get template metadata (without form_data) | |
| 16 | 11 | * |
| 17 | 12 | * @return array<string, mixed> |
| 18 | 13 | */ |
| 19 | - public static function getTemplate(): array | |
| 14 | + public static function getTemplateMeta(): array | |
| 20 | 15 | { |
| 21 | 16 | return [ |
| 22 | 17 | 'id' => 'photo_video_consent_form', |
| 23 | 18 | 'name' => BackendStrings::getTemplateStrings()['photo_video_consent_form'], |
| @@ -22,12 +17,25 @@ | ||
| 22 | 17 | 'id' => 'photo_video_consent_form', |
| 23 | 18 | 'name' => BackendStrings::getTemplateStrings()['photo_video_consent_form'], |
| 24 | 19 | 'description' => BackendStrings::getTemplateStrings()['photo_video_consent_form_desc'], |
| 25 | 20 | 'category' => 'consent-forms', |
| 21 | + 'subcategory' => 'photo-consent-forms', | |
| 26 | 22 | 'is_pro' => true, |
| 27 | - 'demo_url' => IVYFORMS_TEMPLATES_URL . '/photo-video-consent/', | |
| 28 | 23 | 'required_plan' => 'essentials', |
| 29 | - 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'photo-video-consent-form.svg', | |
| 24 | + 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'photo-video-consent-form.svg' | |
| 25 | + ]; | |
| 26 | + } | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * Get the full template including form data | |
| 30 | + * | |
| 31 | + * @return array<string, mixed> | |
| 32 | + */ | |
| 33 | + public static function getTemplate(): array | |
| 34 | + { | |
| 35 | + return array_merge( | |
| 36 | + self::getTemplateMeta(), | |
| 37 | + [ | |
| 30 | 38 | 'form_data' => [ |
| 31 | 39 | 'name' => BackendStrings::getTemplateStrings()['photo_video_consent_form'], |
| 32 | 40 | 'published' => 1, |
| 33 | 41 | 'showTitle' => 1, |
| @@ -35,7 +43,8 @@ | ||
| 35 | 43 | 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(), |
| 36 | 44 | 'fields' => [], |
| 37 | 45 | 'settings' => [] |
| 38 | 46 | ] |
| 39 | - ]; | |
| 47 | + ] | |
| 48 | + ); | |
| 40 | 49 | } |
| 41 | 50 | } |