| @@ -1,61 +1,61 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -/** | |
| 4 | - * Support form template | |
| 5 | - */ | |
| 6 | -class WeForms_Template_Support extends WeForms_Form_Template { | |
| 7 | - | |
| 8 | - public function __construct() { | |
| 9 | - parent::__construct(); | |
| 10 | - | |
| 11 | - $this->enabled = true; | |
| 12 | - $this->title = __( 'Support Form', 'weforms' ); | |
| 13 | - $this->description = __( 'Enable your users for asking support questions.', 'weforms' ); | |
| 14 | - $this->category = 'default'; | |
| 15 | - $this->image = WEFORMS_ASSET_URI . '/images/form-template/support.png'; | |
| 16 | - } | |
| 17 | - | |
| 18 | - /** | |
| 19 | - * Get the form fields | |
| 20 | - * | |
| 21 | - * @return array | |
| 22 | - */ | |
| 23 | - public function get_form_fields() { | |
| 24 | - $all_fields = $this->get_available_fields(); | |
| 25 | - | |
| 26 | - $form_fields = [ | |
| 27 | - array_merge( $all_fields['name_field']->get_field_props(), [ | |
| 28 | - 'required' => 'yes', | |
| 29 | - 'name' => 'name', | |
| 30 | - ] ), | |
| 31 | - array_merge( $all_fields['email_address']->get_field_props(), [ | |
| 32 | - 'required' => 'yes', | |
| 33 | - 'name' => 'email', | |
| 34 | - 'help' => __( 'Please provide a valid email address so we can get back to you', 'weforms' ), | |
| 35 | - ] ), | |
| 36 | - array_merge( $all_fields['radio_field']->get_field_props(), [ | |
| 37 | - 'required' => 'yes', | |
| 38 | - 'label' => __( 'Department', 'weforms' ), | |
| 39 | - 'name' => 'department', | |
| 40 | - 'options' => [ | |
| 41 | - 'sales' => __( 'Sales', 'weforms' ), | |
| 42 | - 'support' => __( 'Customer Support', 'weforms' ), | |
| 43 | - 'product_development' => __( 'Product Development', 'weforms' ), | |
| 44 | - 'other' => __( 'Other', 'weforms' ), | |
| 45 | - ], | |
| 46 | - ] ), | |
| 47 | - array_merge( $all_fields['text_field']->get_field_props(), [ | |
| 48 | - 'required' => 'yes', | |
| 49 | - 'label' => __( 'Subject', 'weforms' ), | |
| 50 | - 'name' => 'subject', | |
| 51 | - ] ), | |
| 52 | - array_merge( $all_fields['textarea_field']->get_field_props(), [ | |
| 53 | - 'label' => __( 'Message', 'weforms' ), | |
| 54 | - 'name' => 'message', | |
| 55 | - 'help' => __( 'How may we help you? Please be brief as much as possible.', 'weforms' ), | |
| 56 | - ] ), | |
| 57 | - ]; | |
| 58 | - | |
| 59 | - return $form_fields; | |
| 60 | - } | |
| 61 | -} | |
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Support form template | |
| 5 | + */ | |
| 6 | +class WeForms_Template_Support extends WeForms_Form_Template { | |
| 7 | + | |
| 8 | + public function __construct() { | |
| 9 | + parent::__construct(); | |
| 10 | + | |
| 11 | + $this->enabled = true; | |
| 12 | + $this->title = __( 'Support Form', 'weforms' ); | |
| 13 | + $this->description = __( 'Enable your users for asking support questions.', 'weforms' ); | |
| 14 | + $this->category = 'default'; | |
| 15 | + $this->image = WEFORMS_ASSET_URI . '/images/form-template/support.png'; | |
| 16 | + } | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * Get the form fields | |
| 20 | + * | |
| 21 | + * @return array | |
| 22 | + */ | |
| 23 | + public function get_form_fields() { | |
| 24 | + $all_fields = $this->get_available_fields(); | |
| 25 | + | |
| 26 | + $form_fields = array( | |
| 27 | + array_merge( $all_fields['name_field']->get_field_props(), array( | |
| 28 | + 'required' => 'yes', | |
| 29 | + 'name' => 'name' | |
| 30 | + ) ), | |
| 31 | + array_merge( $all_fields['email_address']->get_field_props(), array( | |
| 32 | + 'required' => 'yes', | |
| 33 | + 'name' => 'email', | |
| 34 | + 'help' => __( 'Please provide a valid email address so we can get back to you', 'weforms' ), | |
| 35 | + ) ), | |
| 36 | + array_merge( $all_fields['radio_field']->get_field_props(), array( | |
| 37 | + 'required' => 'yes', | |
| 38 | + 'label' => __( 'Department', 'weforms' ), | |
| 39 | + 'name' => 'department', | |
| 40 | + 'options' => array( | |
| 41 | + 'sales' => __( 'Sales', 'weforms' ), | |
| 42 | + 'support' => __( 'Customer Support', 'weforms' ), | |
| 43 | + 'product_development' => __( 'Product Development', 'weforms' ), | |
| 44 | + 'other' => __( 'Other', 'weforms' ), | |
| 45 | + ), | |
| 46 | + ) ), | |
| 47 | + array_merge( $all_fields['text_field']->get_field_props(), array( | |
| 48 | + 'required' => 'yes', | |
| 49 | + 'label' => __( 'Subject', 'weforms' ), | |
| 50 | + 'name' => 'subject', | |
| 51 | + ) ), | |
| 52 | + array_merge( $all_fields['textarea_field']->get_field_props(), array( | |
| 53 | + 'label' => __( 'Message', 'weforms' ), | |
| 54 | + 'name' => 'message', | |
| 55 | + 'help' => __( 'How may we help you? Please be brief as much as possible.', 'weforms' ), | |
| 56 | + ) ), | |
| 57 | + ); | |
| 58 | + | |
| 59 | + return $form_fields; | |
| 60 | + } | |
| 61 | +} | |