| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Blank form template |
| 5 |
*/ |
| 6 |
class WeForms_Template_Todo_List extends WeForms_Form_Template { |
| 7 |
|
| 8 |
public function __construct() { |
| 9 |
parent::__construct(); |
| 10 |
|
| 11 |
$this->enabled = class_exists( 'WeForms_Pro' ); |
| 12 |
$this->title = __( 'Todo List Form', 'weforms' ); |
| 13 |
$this->description = __( 'Get to do reminders with this online form to remember and track your to do list with the help of your form users.', 'weforms' ); |
| 14 |
$this->image = WEFORMS_ASSET_URI . '/images/form-template/to-do-list.png'; |
| 15 |
$this->category = 'others'; |
| 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['text_field']->get_field_props(), [ |
| 28 |
'required' => 'yes', |
| 29 |
'label' => __( 'Item Name', 'weforms' ), |
| 30 |
'name' => 'item_name', |
| 31 |
] ), |
| 32 |
|
| 33 |
array_merge( $all_fields['textarea_field']->get_field_props(), [ |
| 34 |
'label' => __( 'Additional Notes', 'weforms' ), |
| 35 |
'name' => 'additional_notes', |
| 36 |
] ), |
| 37 |
|
| 38 |
array_merge( $all_fields['date_field']->get_field_props(), [ |
| 39 |
'required' => 'yes', |
| 40 |
'label' => __( 'Due Date', 'weforms' ), |
| 41 |
'name' => 'due_date', |
| 42 |
] ), |
| 43 |
|
| 44 |
array_merge( $all_fields['dropdown_field']->get_field_props(), [ |
| 45 |
'required' => 'yes', |
| 46 |
'label' => __( 'Priority', 'weforms' ), |
| 47 |
'name' => 'priority', |
| 48 |
'options' => [ |
| 49 |
'normal' => 'Normal', |
| 50 |
'urgent' => 'Urgent', |
| 51 |
], |
| 52 |
'selected' => 'normal', |
| 53 |
] ), |
| 54 |
]; |
| 55 |
|
| 56 |
return $form_fields; |
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* Get default settings |
| 61 |
* |
| 62 |
* @return array |
| 63 |
*/ |
| 64 |
public function get_default_settings() { |
| 65 |
return [ |
| 66 |
'redirect_to' => 'same', |
| 67 |
'message' => __( 'Thanks for contacting us! We will get in touch with you shortly.', 'weforms' ), |
| 68 |
'page_id' => '', |
| 69 |
'url' => '', |
| 70 |
'submit_text' => __( 'Submit', 'weforms' ), |
| 71 |
]; |
| 72 |
} |
| 73 |
} |
| 74 |
|