← All changes
|
backend/src/Services/Template/TrainerFeedbackFormTemplate.php
+17
-3
1.0
→
1.5
View file →
| @@ -6,13 +6,13 @@ | ||
| 6 | 6 | |
| 7 | 7 | class TrainerFeedbackFormTemplate |
| 8 | 8 | { |
| 9 | 9 | /** |
| 10 | - * Get the Trainer Feedback Form template | |
| 10 | + * Get template metadata (without form_data) | |
| 11 | 11 | * |
| 12 | 12 | * @return array<string, mixed> |
| 13 | 13 | */ |
| 14 | - public static function getTemplate(): array | |
| 14 | + public static function getTemplateMeta(): array | |
| 15 | 15 | { |
| 16 | 16 | return [ |
| 17 | 17 | 'id' => 'trainer_feedback_form', |
| 18 | 18 | 'name' => BackendStrings::getTemplateStrings()['trainer_feedback_form'], |
| @@ -21,8 +21,21 @@ | ||
| 21 | 21 | 'subcategory' => 'training-feedback-forms', |
| 22 | 22 | 'is_pro' => false, |
| 23 | 23 | 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'trainer-feedback-form.svg', |
| 24 | 24 | 'showRatingText' => true, |
| 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 | + [ | |
| 25 | 38 | 'form_data' => [ |
| 26 | 39 | 'name' => BackendStrings::getTemplateStrings()['trainer_feedback_form'], |
| 27 | 40 | 'published' => 1, |
| 28 | 41 | 'showTitle' => 1, |
| @@ -37,9 +50,10 @@ | ||
| 37 | 50 | self::getNameField() |
| 38 | 51 | ), |
| 39 | 52 | 'settings' => [] |
| 40 | 53 | ] |
| 41 | - ]; | |
| 54 | + ] | |
| 55 | + ); | |
| 42 | 56 | } |
| 43 | 57 | |
| 44 | 58 | /** |
| 45 | 59 | * Trainer clarity rating with custom options |