PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.2.4
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.2.4
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / includes / templates / class-abstract-template.php

class-abstract-template.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.2.4, at includes/templates/class-abstract-template.php

171 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Form template abstract class
5 *
6 * @since 1.1.0
7 */
8 abstract class WeForms_Form_Template {
9
10 /**
11 * If the form is enabled
12 *
13 * @var boolean
14 */
15 public $enabled = true;
16
17 /**
18 * Template title
19 *
20 * @var string
21 */
22 public $title;
23
24 /**
25 * Template description
26 *
27 * @var string
28 */
29 public $description;
30
31 /**
32 * Conditional logic
33 *
34 * @var array
35 */
36 protected $conditionals;
37
38 /**
39 * Form fields
40 *
41 * @var array
42 */
43 protected $form_fields;
44
45 /**
46 * Form settings
47 *
48 * @var array
49 */
50 protected $form_settings;
51
52 /**
53 * Form Template Category
54 *
55 * @var array
56 */
57 public $category = 'default';
58
59
60 /**
61 * Form Template Image
62 *
63 * @var array
64 */
65 public $image;
66
67 /**
68 * Form notifications
69 *
70 * @since 2.5.2
71 *
72 * @var array
73 */
74 protected $form_notifications;
75
76 public function __construct() {
77 $this->conditionals = array(
78 'condition_status' => 'no',
79 'cond_field' => array(),
80 'cond_operator' => array( '=' ),
81 'cond_option' => array( '- select -' ),
82 'cond_logic' => 'all'
83 );
84 }
85
86 /**
87 * Get the template title
88 *
89 * @return string
90 */
91 public function get_title() {
92 return $this->title;
93 }
94
95 /**
96 * Get the description
97 *
98 * @return string
99 */
100 public function get_description() {
101 return $this->description;
102 }
103
104 /**
105 * Get the form fields
106 *
107 * @return array
108 */
109 public function get_form_fields() {
110 return $this->form_fields;
111 }
112
113 /**
114 * Get all available fields
115 *
116 * @return array
117 */
118 public function get_available_fields() {
119 return weforms()->fields->get_fields();
120 }
121
122 /**
123 * Get the form settings
124 *
125 * @return array
126 */
127 public function get_form_settings() {
128 return $this->get_default_settings();
129 }
130
131 /**
132 * Get form notifications
133 *
134 * @since 2.5.2
135 *
136 * @return array
137 */
138 public function get_form_notifications() {
139 return $this->get_default_notification();
140 }
141
142 /**
143 * Check if the template is enabled
144 *
145 * @return boolean
146 */
147 public function is_enabled() {
148 return $this->enabled;
149 }
150
151 /**
152 * Get default settings
153 *
154 * @return array
155 */
156 public function get_default_settings() {
157 return weforms_get_default_form_settings();
158 }
159
160 /**
161 * Get notifications of contact form template
162 *
163 * @return array
164 */
165 function get_default_notification() {
166 return array( weforms_get_default_form_notification() );
167 }
168
169 }
170
171