| @@ -1,44 +1,44 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -/** | |
| 4 | - * Contact form template | |
| 5 | - */ | |
| 6 | -class WeForms_Template_Contact extends WeForms_Form_Template { | |
| 7 | - | |
| 8 | - public function __construct() { | |
| 9 | - parent::__construct(); | |
| 10 | - | |
| 11 | - $this->enabled = true; | |
| 12 | - $this->title = __( 'Contact Form', 'weforms' ); | |
| 13 | - $this->description = __( 'Create a simple contact form for your site.', 'weforms' ); | |
| 14 | - $this->image = WEFORMS_ASSET_URI . '/images/form-template/contact.png'; | |
| 15 | - $this->category = 'default'; | |
| 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 | - ] ), | |
| 35 | - array_merge( $all_fields['textarea_field']->get_field_props(), [ | |
| 36 | - 'required' => 'yes', | |
| 37 | - 'label' => __( 'Message', 'weforms' ), | |
| 38 | - 'name' => 'message', | |
| 39 | - ] ), | |
| 40 | - ]; | |
| 41 | - | |
| 42 | - return $form_fields; | |
| 43 | - } | |
| 44 | -} | |
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Contact form template | |
| 5 | + */ | |
| 6 | +class WeForms_Template_Contact extends WeForms_Form_Template { | |
| 7 | + | |
| 8 | + public function __construct() { | |
| 9 | + parent::__construct(); | |
| 10 | + | |
| 11 | + $this->enabled = true; | |
| 12 | + $this->title = __( 'Contact Form', 'weforms' ); | |
| 13 | + $this->description = __( 'Create a simple contact form for your site.', 'weforms' ); | |
| 14 | + $this->image = WEFORMS_ASSET_URI . '/images/form-template/contact.png'; | |
| 15 | + } | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * Get the form fields | |
| 19 | + * | |
| 20 | + * @return array | |
| 21 | + */ | |
| 22 | + public function get_form_fields() { | |
| 23 | + $all_fields = $this->get_available_fields(); | |
| 24 | + | |
| 25 | + $form_fields = array( | |
| 26 | + array_merge( $all_fields['name_field']->get_field_props(), array( | |
| 27 | + 'required' => 'yes', | |
| 28 | + 'name' => 'name' | |
| 29 | + ) ), | |
| 30 | + array_merge( $all_fields['email_address']->get_field_props(), array( | |
| 31 | + 'required' => 'yes', | |
| 32 | + 'name' => 'email' | |
| 33 | + ) ), | |
| 34 | + array_merge( $all_fields['textarea_field']->get_field_props(), array( | |
| 35 | + 'required' => 'yes', | |
| 36 | + 'label' => __( 'Message', 'weforms' ), | |
| 37 | + 'name' => 'message', | |
| 38 | + ) ), | |
| 39 | + ); | |
| 40 | + | |
| 41 | + return $form_fields; | |
| 42 | + } | |
| 43 | + | |
| 44 | +} | |