@@ -7,16 +7,16 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | $value = ''; |
13 | 13 | $class = ''; |
14 | 14 | |
15 | -if ( is_user_logged_in() ) { |
|
15 | +if (is_user_logged_in()) { |
|
16 | 16 | $user = wp_get_current_user(); |
17 | - $value = sanitize_email( $user->user_email ); |
|
17 | + $value = sanitize_email($user->user_email); |
|
18 | 18 | |
19 | - if ( ! empty( $hide_billing_email ) ) { |
|
19 | + if (!empty($hide_billing_email)) { |
|
20 | 20 | $class = 'd-none'; |
21 | 21 | } |
22 | 22 | |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | echo aui()->input( |
28 | 28 | array( |
29 | 29 | 'name' => 'billing_email', |
30 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
31 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
32 | - 'required' => ! empty( $required ), |
|
33 | - 'label' => empty( $label ) ? '' : wp_kses_post( $label ), |
|
30 | + 'id' => esc_attr($id) . uniqid('_'), |
|
31 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
32 | + 'required' => !empty($required), |
|
33 | + 'label' => empty($label) ? '' : wp_kses_post($label), |
|
34 | 34 | 'label_type' => 'vertical', |
35 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
35 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
36 | 36 | 'type' => 'email', |
37 | 37 | 'value' => $value, |
38 | 38 | ) |
@@ -7,36 +7,36 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -if ( empty( $form->get_items() ) ) { |
|
12 | +if (empty($form->get_items())) { |
|
13 | 13 | return; |
14 | 14 | } |
15 | 15 | |
16 | -if ( empty( $items_type ) ) { |
|
16 | +if (empty($items_type)) { |
|
17 | 17 | $items_type = 'total'; |
18 | 18 | } |
19 | 19 | |
20 | -switch( $items_type ) { |
|
20 | +switch ($items_type) { |
|
21 | 21 | case 'radio': |
22 | - wpinv_get_template( 'payment-forms/variations/radio.php', compact( 'form', 'items_type' ) ); |
|
22 | + wpinv_get_template('payment-forms/variations/radio.php', compact('form', 'items_type')); |
|
23 | 23 | break; |
24 | 24 | case 'checkbox': |
25 | - wpinv_get_template( 'payment-forms/variations/checkbox.php', compact( 'form', 'items_type' ) ); |
|
25 | + wpinv_get_template('payment-forms/variations/checkbox.php', compact('form', 'items_type')); |
|
26 | 26 | break; |
27 | 27 | case 'select': |
28 | - wpinv_get_template( 'payment-forms/variations/select.php', compact( 'form', 'items_type' ) ); |
|
28 | + wpinv_get_template('payment-forms/variations/select.php', compact('form', 'items_type')); |
|
29 | 29 | break; |
30 | 30 | } |
31 | 31 | |
32 | 32 | // Display the cart totals. |
33 | -if ( ! empty( $hide_cart ) ) { |
|
33 | +if (!empty($hide_cart)) { |
|
34 | 34 | echo '<div class="d-none">'; |
35 | 35 | } |
36 | 36 | |
37 | 37 | // Display the cart totals. |
38 | -wpinv_get_template( 'payment-forms/cart.php', compact( 'form', 'items_type' ) ); |
|
38 | +wpinv_get_template('payment-forms/cart.php', compact('form', 'items_type')); |
|
39 | 39 | |
40 | -if ( ! empty( $hide_cart ) ) { |
|
40 | +if (!empty($hide_cart)) { |
|
41 | 41 | echo '</div>'; |
42 | 42 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ( ! defined( 'ABSPATH' ) ) { |
|
3 | +if (!defined('ABSPATH')) { |
|
4 | 4 | exit; // Exit if accessed directly |
5 | 5 | } |
6 | 6 | |
@@ -13,15 +13,15 @@ discard block |
||
13 | 13 | |
14 | 14 | public function __construct() { |
15 | 15 | |
16 | - foreach( $this->get_elements() as $element ) { |
|
16 | + foreach ($this->get_elements() as $element) { |
|
17 | 17 | $element = $element['type']; |
18 | 18 | |
19 | - if ( method_exists( $this, "render_{$element}_template" ) ) { |
|
20 | - add_action( 'wpinv_payment_form_render_element_template', array( $this, "render_{$element}_template" ), 10, 2 ); |
|
19 | + if (method_exists($this, "render_{$element}_template")) { |
|
20 | + add_action('wpinv_payment_form_render_element_template', array($this, "render_{$element}_template"), 10, 2); |
|
21 | 21 | } |
22 | 22 | |
23 | - if ( method_exists( $this, "edit_{$element}_template" ) ) { |
|
24 | - add_action( 'wpinv_payment_form_edit_element_template', array( $this, "edit_{$element}_template" ), 10, 2 ); |
|
23 | + if (method_exists($this, "edit_{$element}_template")) { |
|
24 | + add_action('wpinv_payment_form_edit_element_template', array($this, "edit_{$element}_template"), 10, 2); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -34,20 +34,20 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function get_elements() { |
36 | 36 | |
37 | - if ( ! empty( $this->elements ) ) { |
|
37 | + if (!empty($this->elements)) { |
|
38 | 38 | return $this->elements; |
39 | 39 | } |
40 | 40 | |
41 | - $this->elements = wpinv_get_data( 'payment-form-elements' ); |
|
41 | + $this->elements = wpinv_get_data('payment-form-elements'); |
|
42 | 42 | |
43 | - $this->elements = apply_filters( 'wpinv_filter_core_payment_form_elements', $this->elements ); |
|
43 | + $this->elements = apply_filters('wpinv_filter_core_payment_form_elements', $this->elements); |
|
44 | 44 | return $this->elements; |
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
48 | 48 | * Returns the restrict markup. |
49 | 49 | */ |
50 | - public function get_restrict_markup( $field, $field_type ) { |
|
50 | + public function get_restrict_markup($field, $field_type) { |
|
51 | 51 | $restrict = "$field.type=='$field_type'"; |
52 | 52 | return "v-if=\"$restrict\""; |
53 | 53 | } |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * Renders the gateway select element template. |
57 | 57 | */ |
58 | - public function render_gateway_select_template( $field ) { |
|
59 | - $restrict = $this->get_restrict_markup( $field, 'gateway_select' ); |
|
60 | - $text = __( 'The gateway select box will appear here', 'invoicing' ); |
|
58 | + public function render_gateway_select_template($field) { |
|
59 | + $restrict = $this->get_restrict_markup($field, 'gateway_select'); |
|
60 | + $text = __('The gateway select box will appear here', 'invoicing'); |
|
61 | 61 | echo " |
62 | 62 | <div $restrict class='alert alert-info' role='alert'> |
63 | 63 | <span>$text</span> |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | /** |
69 | 69 | * Renders the edit gateway select element template. |
70 | 70 | */ |
71 | - public function edit_gateway_select_template( $field ) { |
|
72 | - $restrict = $this->get_restrict_markup( $field, 'gateway_select' ); |
|
73 | - $label = __( 'The gateway select text', 'invoicing' ); |
|
71 | + public function edit_gateway_select_template($field) { |
|
72 | + $restrict = $this->get_restrict_markup($field, 'gateway_select'); |
|
73 | + $label = __('The gateway select text', 'invoicing'); |
|
74 | 74 | $id = $field . '.id + "_edit"'; |
75 | 75 | echo " |
76 | 76 | <div $restrict> |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | /** |
87 | 87 | * Renders the ip address element template. |
88 | 88 | */ |
89 | - public function render_ip_address_template( $field ) { |
|
90 | - $restrict = $this->get_restrict_markup( $field, 'ip_address' ); |
|
91 | - $ip_address = sanitize_text_field( wpinv_get_ip() ); |
|
92 | - $url = esc_url( getpaid_ip_location_url( $ip_address ) ); |
|
89 | + public function render_ip_address_template($field) { |
|
90 | + $restrict = $this->get_restrict_markup($field, 'ip_address'); |
|
91 | + $ip_address = sanitize_text_field(wpinv_get_ip()); |
|
92 | + $url = esc_url(getpaid_ip_location_url($ip_address)); |
|
93 | 93 | |
94 | 94 | echo " |
95 | 95 | <div $restrict class='getpaid-ip-info'> |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | /** |
103 | 103 | * Renders the edit ip address element template. |
104 | 104 | */ |
105 | - public function edit_ip_address_template( $field ) { |
|
106 | - $restrict = $this->get_restrict_markup( $field, 'ip_address' ); |
|
107 | - $label = __( 'The IP Address text', 'invoicing' ); |
|
105 | + public function edit_ip_address_template($field) { |
|
106 | + $restrict = $this->get_restrict_markup($field, 'ip_address'); |
|
107 | + $label = __('The IP Address text', 'invoicing'); |
|
108 | 108 | $id = $field . '.id + "_edit"'; |
109 | 109 | echo " |
110 | 110 | <div $restrict> |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | /** |
121 | 121 | * Renders the total payable element template. |
122 | 122 | */ |
123 | - public function render_total_payable_template( $field ) { |
|
124 | - $restrict = $this->get_restrict_markup( $field, 'total_payable' ); |
|
125 | - $text = __( 'The total payable amount will appear here', 'invoicing' ); |
|
123 | + public function render_total_payable_template($field) { |
|
124 | + $restrict = $this->get_restrict_markup($field, 'total_payable'); |
|
125 | + $text = __('The total payable amount will appear here', 'invoicing'); |
|
126 | 126 | echo " |
127 | 127 | <div $restrict class='alert alert-info' role='alert'> |
128 | 128 | <span>$text</span> |
@@ -133,9 +133,9 @@ discard block |
||
133 | 133 | /** |
134 | 134 | * Renders the edit total payable element template. |
135 | 135 | */ |
136 | - public function edit_total_payable_template( $field ) { |
|
137 | - $restrict = $this->get_restrict_markup( $field, 'total_payable' ); |
|
138 | - $label = __( 'The total payable text', 'invoicing' ); |
|
136 | + public function edit_total_payable_template($field) { |
|
137 | + $restrict = $this->get_restrict_markup($field, 'total_payable'); |
|
138 | + $label = __('The total payable text', 'invoicing'); |
|
139 | 139 | $id = $field . '.id + "_edit"'; |
140 | 140 | echo " |
141 | 141 | <div $restrict> |
@@ -151,18 +151,18 @@ discard block |
||
151 | 151 | /** |
152 | 152 | * Renders the title element template. |
153 | 153 | */ |
154 | - public function render_heading_template( $field ) { |
|
155 | - $restrict = $this->get_restrict_markup( $field, 'heading' ); |
|
154 | + public function render_heading_template($field) { |
|
155 | + $restrict = $this->get_restrict_markup($field, 'heading'); |
|
156 | 156 | echo "<component :is='$field.level' $restrict v-html='$field.text'></component>"; |
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
160 | 160 | * Renders the edit title element template. |
161 | 161 | */ |
162 | - public function edit_heading_template( $field ) { |
|
163 | - $restrict = $this->get_restrict_markup( $field, 'heading' ); |
|
164 | - $label = __( 'Heading', 'invoicing' ); |
|
165 | - $label2 = __( 'Select Heading Level', 'invoicing' ); |
|
162 | + public function edit_heading_template($field) { |
|
163 | + $restrict = $this->get_restrict_markup($field, 'heading'); |
|
164 | + $label = __('Heading', 'invoicing'); |
|
165 | + $label2 = __('Select Heading Level', 'invoicing'); |
|
166 | 166 | $id = $field . '.id + "_edit"'; |
167 | 167 | $id2 = $field . '.id + "_edit2"'; |
168 | 168 | |
@@ -194,8 +194,8 @@ discard block |
||
194 | 194 | /** |
195 | 195 | * Renders a paragraph element template. |
196 | 196 | */ |
197 | - public function render_paragraph_template( $field ) { |
|
198 | - $restrict = $this->get_restrict_markup( $field, 'paragraph' ); |
|
197 | + public function render_paragraph_template($field) { |
|
198 | + $restrict = $this->get_restrict_markup($field, 'paragraph'); |
|
199 | 199 | $label = "$field.text"; |
200 | 200 | echo "<p $restrict v-html='$label' style='font-size: 16px;'></p>"; |
201 | 201 | } |
@@ -203,9 +203,9 @@ discard block |
||
203 | 203 | /** |
204 | 204 | * Renders the edit paragraph element template. |
205 | 205 | */ |
206 | - public function edit_paragraph_template( $field ) { |
|
207 | - $restrict = $this->get_restrict_markup( $field, 'paragraph' ); |
|
208 | - $label = __( 'Enter your text', 'invoicing' ); |
|
206 | + public function edit_paragraph_template($field) { |
|
207 | + $restrict = $this->get_restrict_markup($field, 'paragraph'); |
|
208 | + $label = __('Enter your text', 'invoicing'); |
|
209 | 209 | $id = $field . '.id + "_edit"'; |
210 | 210 | echo " |
211 | 211 | <div $restrict> |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | /** |
222 | 222 | * Renders the text element template. |
223 | 223 | */ |
224 | - public function render_text_template( $field ) { |
|
225 | - $restrict = $this->get_restrict_markup( $field, 'text' ); |
|
224 | + public function render_text_template($field) { |
|
225 | + $restrict = $this->get_restrict_markup($field, 'text'); |
|
226 | 226 | $label = "$field.label"; |
227 | 227 | echo " |
228 | 228 | <div $restrict class='wpinv-payment-form-field-preview'> |
@@ -237,56 +237,56 @@ discard block |
||
237 | 237 | /** |
238 | 238 | * Renders the edit price select element template. |
239 | 239 | */ |
240 | - public function edit_price_select_template( $field ) { |
|
241 | - $restrict = $this->get_restrict_markup( $field, 'price_select' ); |
|
240 | + public function edit_price_select_template($field) { |
|
241 | + $restrict = $this->get_restrict_markup($field, 'price_select'); |
|
242 | 242 | |
243 | - $label3 = __( 'Help text', 'invoicing' ); |
|
244 | - $label4 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
243 | + $label3 = __('Help text', 'invoicing'); |
|
244 | + $label4 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
245 | 245 | $id3 = $field . '.id + "_edit3"'; |
246 | - $label6 = __( 'Options', 'invoicing' ); |
|
246 | + $label6 = __('Options', 'invoicing'); |
|
247 | 247 | $id6 = $field . '.id + "_edit5"'; |
248 | 248 | ?> |
249 | 249 | <div <?php echo $restrict; ?>> |
250 | - <small class='form-text text-muted mb-2'><?php _e( 'This amount will be added to the total amount for this form', 'invoicing' ); ?></small> |
|
250 | + <small class='form-text text-muted mb-2'><?php _e('This amount will be added to the total amount for this form', 'invoicing'); ?></small> |
|
251 | 251 | <div class='form-group'> |
252 | 252 | <label class="d-block"> |
253 | - <span><?php _e( 'Field Label', 'invoicing' ); ?></span> |
|
253 | + <span><?php _e('Field Label', 'invoicing'); ?></span> |
|
254 | 254 | <input v-model='<?php echo $field; ?>.label' class='form-control' /> |
255 | 255 | </label> |
256 | 256 | </div> |
257 | 257 | |
258 | 258 | <div class='form-group' v-if="<?php echo $field; ?>.select_type=='select'"> |
259 | 259 | <label class="d-block"> |
260 | - <span><?php _e( 'Placeholder text', 'invoicing' ); ?></span> |
|
260 | + <span><?php _e('Placeholder text', 'invoicing'); ?></span> |
|
261 | 261 | <input v-model='<?php echo $field; ?>.placeholder' class='form-control' /> |
262 | 262 | </label> |
263 | 263 | </div> |
264 | 264 | |
265 | 265 | <div class='form-group'> |
266 | 266 | <label class="d-block"> |
267 | - <span><?php _e( 'Select Type', 'invoicing' ); ?></span> |
|
267 | + <span><?php _e('Select Type', 'invoicing'); ?></span> |
|
268 | 268 | <select class='form-control custom-select' v-model='<?php echo $field; ?>.select_type'> |
269 | - <option value='select'><?php _e( 'Dropdown', 'invoicing' ) ?></option> |
|
270 | - <option value='checkboxes'><?php _e( 'Checkboxes', 'invoicing' ) ?></option> |
|
271 | - <option value='radios'><?php _e( 'Radio Buttons', 'invoicing' ) ?></option> |
|
272 | - <option value='buttons'><?php _e( 'Buttons', 'invoicing' ) ?></option> |
|
273 | - <option value='circles'><?php _e( 'Circles', 'invoicing' ) ?></option> |
|
269 | + <option value='select'><?php _e('Dropdown', 'invoicing') ?></option> |
|
270 | + <option value='checkboxes'><?php _e('Checkboxes', 'invoicing') ?></option> |
|
271 | + <option value='radios'><?php _e('Radio Buttons', 'invoicing') ?></option> |
|
272 | + <option value='buttons'><?php _e('Buttons', 'invoicing') ?></option> |
|
273 | + <option value='circles'><?php _e('Circles', 'invoicing') ?></option> |
|
274 | 274 | </select> |
275 | 275 | </label> |
276 | 276 | </div> |
277 | 277 | |
278 | 278 | <div class='form-group'> |
279 | 279 | <label class="d-block"> |
280 | - <span><?php _e( 'Options', 'invoicing' ); ?></span> |
|
280 | + <span><?php _e('Options', 'invoicing'); ?></span> |
|
281 | 281 | <textarea placeholder='Basic|10,Pro|99,Business|199' v-model='<?php echo $field; ?>.options' class='form-control' rows='3'></textarea> |
282 | - <small class='form-text text-muted mb-2'><?php _e( 'Use commas to separate options and pipes to separate a label and its price. Do not include a currency symbol in the price.', 'invoicing' ); ?></small> |
|
282 | + <small class='form-text text-muted mb-2'><?php _e('Use commas to separate options and pipes to separate a label and its price. Do not include a currency symbol in the price.', 'invoicing'); ?></small> |
|
283 | 283 | </label> |
284 | 284 | </div> |
285 | 285 | |
286 | 286 | <div class='form-group'> |
287 | 287 | <label class="d-block"> |
288 | - <span><?php _e( 'Help Text', 'invoicing' ); ?></span> |
|
289 | - <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='<?php echo $field; ?>.description' class='form-control' rows='3'></textarea> |
|
288 | + <span><?php _e('Help Text', 'invoicing'); ?></span> |
|
289 | + <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='<?php echo $field; ?>.description' class='form-control' rows='3'></textarea> |
|
290 | 290 | </label> |
291 | 291 | </div> |
292 | 292 | </div> |
@@ -297,8 +297,8 @@ discard block |
||
297 | 297 | /** |
298 | 298 | * Renders the price select element template. |
299 | 299 | */ |
300 | - public function render_price_select_template( $field ) { |
|
301 | - $restrict = $this->get_restrict_markup( $field, 'price_select' ); |
|
300 | + public function render_price_select_template($field) { |
|
301 | + $restrict = $this->get_restrict_markup($field, 'price_select'); |
|
302 | 302 | ?> |
303 | 303 | <div <?php echo $restrict; ?> class='wpinv-payment-form-field-preview'> |
304 | 304 | <div class='wpinv-payment-form-field-preview-overlay'></div> |
@@ -306,24 +306,24 @@ discard block |
||
306 | 306 | <label>{{<?php echo $field; ?>.label}}</label> |
307 | 307 | |
308 | 308 | <!-- Buttons --> |
309 | - <div v-if='<?php echo esc_attr( $field ); ?>.select_type=="buttons"' class="getpaid-price-buttons"> |
|
310 | - <span v-for="(option, index) in <?php echo esc_attr( $field ); ?>.options.split(',')" :key="index"> |
|
311 | - <input type="radio" :id="<?php echo esc_attr( $field ); ?>.id + index" :checked="index==0" /> |
|
312 | - <label :for="<?php echo esc_attr( $field ); ?>.id + index" class="rounded">{{option | optionize}}</label> |
|
309 | + <div v-if='<?php echo esc_attr($field); ?>.select_type=="buttons"' class="getpaid-price-buttons"> |
|
310 | + <span v-for="(option, index) in <?php echo esc_attr($field); ?>.options.split(',')" :key="index"> |
|
311 | + <input type="radio" :id="<?php echo esc_attr($field); ?>.id + index" :checked="index==0" /> |
|
312 | + <label :for="<?php echo esc_attr($field); ?>.id + index" class="rounded">{{option | optionize}}</label> |
|
313 | 313 | </span> |
314 | 314 | </div> |
315 | 315 | |
316 | 316 | <!-- Circles --> |
317 | - <div v-if='<?php echo esc_attr( $field ); ?>.select_type=="circles"' class="getpaid-price-buttons getpaid-price-circles"> |
|
318 | - <span v-for="(option, index) in <?php echo esc_attr( $field ); ?>.options.split(',')" :key="index"> |
|
319 | - <input type="radio" :id="<?php echo esc_attr( $field ); ?>.id + index" :checked="index==0" /> |
|
320 | - <label :for="<?php echo esc_attr( $field ); ?>.id + index"><span>{{option | optionize}}</span></label> |
|
317 | + <div v-if='<?php echo esc_attr($field); ?>.select_type=="circles"' class="getpaid-price-buttons getpaid-price-circles"> |
|
318 | + <span v-for="(option, index) in <?php echo esc_attr($field); ?>.options.split(',')" :key="index"> |
|
319 | + <input type="radio" :id="<?php echo esc_attr($field); ?>.id + index" :checked="index==0" /> |
|
320 | + <label :for="<?php echo esc_attr($field); ?>.id + index"><span>{{option | optionize}}</span></label> |
|
321 | 321 | </span> |
322 | 322 | </div> |
323 | 323 | |
324 | 324 | <!-- Radios --> |
325 | - <div v-if='<?php echo esc_attr( $field ); ?>.select_type=="radios"'> |
|
326 | - <div v-for="(option, index) in <?php echo esc_attr( $field ); ?>.options.split(',')" :key="index"> |
|
325 | + <div v-if='<?php echo esc_attr($field); ?>.select_type=="radios"'> |
|
326 | + <div v-for="(option, index) in <?php echo esc_attr($field); ?>.options.split(',')" :key="index"> |
|
327 | 327 | <label> |
328 | 328 | <input type="radio" :checked="index==0" /> |
329 | 329 | <span>{{option | optionize}}</span> |
@@ -332,8 +332,8 @@ discard block |
||
332 | 332 | </div> |
333 | 333 | |
334 | 334 | <!-- Checkboxes --> |
335 | - <div v-if='<?php echo esc_attr( $field ); ?>.select_type=="checkboxes"'> |
|
336 | - <div v-for="(option, index) in <?php echo esc_attr( $field ); ?>.options.split(',')" :key="index"> |
|
335 | + <div v-if='<?php echo esc_attr($field); ?>.select_type=="checkboxes"'> |
|
336 | + <div v-for="(option, index) in <?php echo esc_attr($field); ?>.options.split(',')" :key="index"> |
|
337 | 337 | <label> |
338 | 338 | <input type="checkbox" :checked="index==0" /> |
339 | 339 | <span>{{option | optionize}}</span> |
@@ -342,15 +342,15 @@ discard block |
||
342 | 342 | </div> |
343 | 343 | |
344 | 344 | <!-- Select --> |
345 | - <select v-if='<?php echo esc_attr( $field ); ?>.select_type=="select"' class='form-control custom-select'> |
|
346 | - <option v-if="<?php echo esc_attr( $field ); ?>.placeholder" selected="selected"> |
|
347 | - {{<?php echo esc_attr( $field ); ?>.placeholder}} |
|
345 | + <select v-if='<?php echo esc_attr($field); ?>.select_type=="select"' class='form-control custom-select'> |
|
346 | + <option v-if="<?php echo esc_attr($field); ?>.placeholder" selected="selected"> |
|
347 | + {{<?php echo esc_attr($field); ?>.placeholder}} |
|
348 | 348 | </option> |
349 | - <option v-for="(option, index) in <?php echo esc_attr( $field ); ?>.options.split(',')" :key="index"> |
|
349 | + <option v-for="(option, index) in <?php echo esc_attr($field); ?>.options.split(',')" :key="index"> |
|
350 | 350 | {{option | optionize}} |
351 | 351 | </option> |
352 | 352 | </select> |
353 | - <small v-if='<?php echo esc_attr( $field ); ?>.description' class='form-text text-muted' v-html='<?php echo esc_attr( $field ); ?>.description'></small> |
|
353 | + <small v-if='<?php echo esc_attr($field); ?>.description' class='form-text text-muted' v-html='<?php echo esc_attr($field); ?>.description'></small> |
|
354 | 354 | </div> |
355 | 355 | |
356 | 356 | <?php |
@@ -359,17 +359,17 @@ discard block |
||
359 | 359 | /** |
360 | 360 | * Renders the edit price input element template. |
361 | 361 | */ |
362 | - public function edit_price_input_template( $field ) { |
|
363 | - $restrict = $this->get_restrict_markup( $field, 'price_input' ); |
|
364 | - $label = __( 'Field Label', 'invoicing' ); |
|
362 | + public function edit_price_input_template($field) { |
|
363 | + $restrict = $this->get_restrict_markup($field, 'price_input'); |
|
364 | + $label = __('Field Label', 'invoicing'); |
|
365 | 365 | $id = $field . '.id + "_edit"'; |
366 | - $label2 = __( 'Placeholder text', 'invoicing' ); |
|
366 | + $label2 = __('Placeholder text', 'invoicing'); |
|
367 | 367 | $id2 = $field . '.id + "_edit2"'; |
368 | - $label3 = __( 'Help text', 'invoicing' ); |
|
369 | - $label4 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
368 | + $label3 = __('Help text', 'invoicing'); |
|
369 | + $label4 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
370 | 370 | $id3 = $field . '.id + "_edit3"'; |
371 | - $label5 = __( 'The amount that users add to this field will be added to the total amount', 'invoicing' ); |
|
372 | - $label6 = __( 'Default Amount', 'invoicing' ); |
|
371 | + $label5 = __('The amount that users add to this field will be added to the total amount', 'invoicing'); |
|
372 | + $label6 = __('Default Amount', 'invoicing'); |
|
373 | 373 | $id6 = $field . '.id + "_edit5"'; |
374 | 374 | echo " |
375 | 375 | <div $restrict> |
@@ -397,16 +397,16 @@ discard block |
||
397 | 397 | /** |
398 | 398 | * Renders the edit text element template. |
399 | 399 | */ |
400 | - public function edit_text_template( $field ) { |
|
401 | - $restrict = $this->get_restrict_markup( $field, 'text' ); |
|
402 | - $label = __( 'Field Label', 'invoicing' ); |
|
400 | + public function edit_text_template($field) { |
|
401 | + $restrict = $this->get_restrict_markup($field, 'text'); |
|
402 | + $label = __('Field Label', 'invoicing'); |
|
403 | 403 | $id = $field . '.id + "_edit"'; |
404 | - $label2 = __( 'Placeholder text', 'invoicing' ); |
|
404 | + $label2 = __('Placeholder text', 'invoicing'); |
|
405 | 405 | $id2 = $field . '.id + "_edit2"'; |
406 | - $label3 = __( 'Help text', 'invoicing' ); |
|
407 | - $label4 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
406 | + $label3 = __('Help text', 'invoicing'); |
|
407 | + $label4 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
408 | 408 | $id3 = $field . '.id + "_edit3"'; |
409 | - $label5 = __( 'Is this field required?', 'invoicing' ); |
|
409 | + $label5 = __('Is this field required?', 'invoicing'); |
|
410 | 410 | $id4 = $field . '.id + "_edit4"'; |
411 | 411 | echo " |
412 | 412 | <div $restrict> |
@@ -434,8 +434,8 @@ discard block |
||
434 | 434 | /** |
435 | 435 | * Renders the textarea element template. |
436 | 436 | */ |
437 | - public function render_textarea_template( $field ) { |
|
438 | - $restrict = $this->get_restrict_markup( $field, 'textarea' ); |
|
437 | + public function render_textarea_template($field) { |
|
438 | + $restrict = $this->get_restrict_markup($field, 'textarea'); |
|
439 | 439 | $label = "$field.label"; |
440 | 440 | echo " |
441 | 441 | <div $restrict class='wpinv-payment-form-field-preview'> |
@@ -450,16 +450,16 @@ discard block |
||
450 | 450 | /** |
451 | 451 | * Renders the edit textarea element template. |
452 | 452 | */ |
453 | - public function edit_textarea_template( $field ) { |
|
454 | - $restrict = $this->get_restrict_markup( $field, 'textarea' ); |
|
455 | - $label = __( 'Field Label', 'invoicing' ); |
|
453 | + public function edit_textarea_template($field) { |
|
454 | + $restrict = $this->get_restrict_markup($field, 'textarea'); |
|
455 | + $label = __('Field Label', 'invoicing'); |
|
456 | 456 | $id = $field . '.id + "_edit"'; |
457 | - $label2 = __( 'Placeholder text', 'invoicing' ); |
|
457 | + $label2 = __('Placeholder text', 'invoicing'); |
|
458 | 458 | $id2 = $field . '.id + "_edit2"'; |
459 | - $label3 = __( 'Help text', 'invoicing' ); |
|
460 | - $label4 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
459 | + $label3 = __('Help text', 'invoicing'); |
|
460 | + $label4 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
461 | 461 | $id3 = $field . '.id + "_edit3"'; |
462 | - $label5 = __( 'Is this field required?', 'invoicing' ); |
|
462 | + $label5 = __('Is this field required?', 'invoicing'); |
|
463 | 463 | $id4 = $field . '.id + "_edit4"'; |
464 | 464 | echo " |
465 | 465 | <div $restrict> |
@@ -487,8 +487,8 @@ discard block |
||
487 | 487 | /** |
488 | 488 | * Renders the select element template. |
489 | 489 | */ |
490 | - public function render_select_template( $field ) { |
|
491 | - $restrict = $this->get_restrict_markup( $field, 'select' ); |
|
490 | + public function render_select_template($field) { |
|
491 | + $restrict = $this->get_restrict_markup($field, 'select'); |
|
492 | 492 | $label = "$field.label"; |
493 | 493 | $placeholder = "$field.placeholder"; |
494 | 494 | $id = $field . '.id'; |
@@ -508,18 +508,18 @@ discard block |
||
508 | 508 | /** |
509 | 509 | * Renders the edit select element template. |
510 | 510 | */ |
511 | - public function edit_select_template( $field ) { |
|
512 | - $restrict = $this->get_restrict_markup( $field, 'select' ); |
|
513 | - $label = __( 'Field Label', 'invoicing' ); |
|
511 | + public function edit_select_template($field) { |
|
512 | + $restrict = $this->get_restrict_markup($field, 'select'); |
|
513 | + $label = __('Field Label', 'invoicing'); |
|
514 | 514 | $id = $field . '.id + "_edit"'; |
515 | - $label2 = __( 'Placeholder text', 'invoicing' ); |
|
515 | + $label2 = __('Placeholder text', 'invoicing'); |
|
516 | 516 | $id2 = $field . '.id + "_edit2"'; |
517 | - $label3 = __( 'Help text', 'invoicing' ); |
|
518 | - $label4 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
517 | + $label3 = __('Help text', 'invoicing'); |
|
518 | + $label4 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
519 | 519 | $id3 = $field . '.id + "_edit3"'; |
520 | - $label5 = __( 'Is this field required?', 'invoicing' ); |
|
520 | + $label5 = __('Is this field required?', 'invoicing'); |
|
521 | 521 | $id4 = $field . '.id + "_edit4"'; |
522 | - $label6 = __( 'Available Options', 'invoicing' ); |
|
522 | + $label6 = __('Available Options', 'invoicing'); |
|
523 | 523 | echo " |
524 | 524 | <div $restrict> |
525 | 525 | <div class='form-group'> |
@@ -557,8 +557,8 @@ discard block |
||
557 | 557 | /** |
558 | 558 | * Renders the checkbox element template. |
559 | 559 | */ |
560 | - public function render_checkbox_template( $field ) { |
|
561 | - $restrict = $this->get_restrict_markup( $field, 'checkbox' ); |
|
560 | + public function render_checkbox_template($field) { |
|
561 | + $restrict = $this->get_restrict_markup($field, 'checkbox'); |
|
562 | 562 | echo " |
563 | 563 | <div class='form-check' $restrict> |
564 | 564 | <div class='wpinv-payment-form-field-preview-overlay'></div> |
@@ -572,14 +572,14 @@ discard block |
||
572 | 572 | /** |
573 | 573 | * Renders the edit checkbox element template. |
574 | 574 | */ |
575 | - public function edit_checkbox_template( $field ) { |
|
576 | - $restrict = $this->get_restrict_markup( $field, 'checkbox' ); |
|
577 | - $label = __( 'Field Label', 'invoicing' ); |
|
575 | + public function edit_checkbox_template($field) { |
|
576 | + $restrict = $this->get_restrict_markup($field, 'checkbox'); |
|
577 | + $label = __('Field Label', 'invoicing'); |
|
578 | 578 | $id = $field . '.id + "_edit"'; |
579 | - $label2 = __( 'Help text', 'invoicing' ); |
|
580 | - $label3 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
579 | + $label2 = __('Help text', 'invoicing'); |
|
580 | + $label3 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
581 | 581 | $id2 = $field . '.id + "_edit2"'; |
582 | - $label4 = __( 'Is this field required?', 'invoicing' ); |
|
582 | + $label4 = __('Is this field required?', 'invoicing'); |
|
583 | 583 | $id3 = $field . '.id + "_edit3"'; |
584 | 584 | echo " |
585 | 585 | <div $restrict> |
@@ -603,8 +603,8 @@ discard block |
||
603 | 603 | /** |
604 | 604 | * Renders the radio element template. |
605 | 605 | */ |
606 | - public function render_radio_template( $field ) { |
|
607 | - $restrict = $this->get_restrict_markup( $field, 'radio' ); |
|
606 | + public function render_radio_template($field) { |
|
607 | + $restrict = $this->get_restrict_markup($field, 'radio'); |
|
608 | 608 | $label = "$field.label"; |
609 | 609 | $id = $field . '.id'; |
610 | 610 | echo " |
@@ -623,16 +623,16 @@ discard block |
||
623 | 623 | /** |
624 | 624 | * Renders the edit radio element template. |
625 | 625 | */ |
626 | - public function edit_radio_template( $field ) { |
|
627 | - $restrict = $this->get_restrict_markup( $field, 'radio' ); |
|
628 | - $label = __( 'Field Label', 'invoicing' ); |
|
626 | + public function edit_radio_template($field) { |
|
627 | + $restrict = $this->get_restrict_markup($field, 'radio'); |
|
628 | + $label = __('Field Label', 'invoicing'); |
|
629 | 629 | $id = $field . '.id + "_edit"'; |
630 | - $label2 = __( 'Help text', 'invoicing' ); |
|
631 | - $label3 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
630 | + $label2 = __('Help text', 'invoicing'); |
|
631 | + $label3 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
632 | 632 | $id2 = $field . '.id + "_edit3"'; |
633 | - $label4 = __( 'Is this field required?', 'invoicing' ); |
|
633 | + $label4 = __('Is this field required?', 'invoicing'); |
|
634 | 634 | $id3 = $field . '.id + "_edit4"'; |
635 | - $label5 = __( 'Available Options', 'invoicing' ); |
|
635 | + $label5 = __('Available Options', 'invoicing'); |
|
636 | 636 | echo " |
637 | 637 | <div $restrict> |
638 | 638 | <div class='form-group'> |
@@ -666,8 +666,8 @@ discard block |
||
666 | 666 | /** |
667 | 667 | * Renders the address element template. |
668 | 668 | */ |
669 | - public function render_address_template( $field ) { |
|
670 | - $restrict = $this->get_restrict_markup( $field, 'address' ); |
|
669 | + public function render_address_template($field) { |
|
670 | + $restrict = $this->get_restrict_markup($field, 'address'); |
|
671 | 671 | |
672 | 672 | echo " |
673 | 673 | <div class='wpinv-address-wrapper' $restrict> |
@@ -689,13 +689,13 @@ discard block |
||
689 | 689 | /** |
690 | 690 | * Renders the edit address element template. |
691 | 691 | */ |
692 | - public function edit_address_template( $field ) { |
|
693 | - $restrict = $this->get_restrict_markup( $field, 'address' ); |
|
694 | - $label = __( 'Field Label', 'invoicing' ); |
|
695 | - $label2 = __( 'Placeholder', 'invoicing' ); |
|
696 | - $label3 = __( 'Description', 'invoicing' ); |
|
697 | - $label4 = __( 'Is required', 'invoicing' ); |
|
698 | - $label5 = __( 'Is visible', 'invoicing' ); |
|
692 | + public function edit_address_template($field) { |
|
693 | + $restrict = $this->get_restrict_markup($field, 'address'); |
|
694 | + $label = __('Field Label', 'invoicing'); |
|
695 | + $label2 = __('Placeholder', 'invoicing'); |
|
696 | + $label3 = __('Description', 'invoicing'); |
|
697 | + $label4 = __('Is required', 'invoicing'); |
|
698 | + $label5 = __('Is visible', 'invoicing'); |
|
699 | 699 | $id = $field . '.id + "_edit_label"'; |
700 | 700 | $id2 = $field . '.id + "_edit_placeholder"'; |
701 | 701 | $id3 = $field . '.id + "_edit_description"'; |
@@ -763,8 +763,8 @@ discard block |
||
763 | 763 | /** |
764 | 764 | * Renders the email element template. |
765 | 765 | */ |
766 | - public function render_email_template( $field ) { |
|
767 | - $restrict = $this->get_restrict_markup( $field, 'email' ); |
|
766 | + public function render_email_template($field) { |
|
767 | + $restrict = $this->get_restrict_markup($field, 'email'); |
|
768 | 768 | $label = "$field.label"; |
769 | 769 | echo " |
770 | 770 | <div $restrict class='wpinv-payment-form-field-preview'> |
@@ -779,8 +779,8 @@ discard block |
||
779 | 779 | /** |
780 | 780 | * Renders the billing_email element template. |
781 | 781 | */ |
782 | - public function render_billing_email_template( $field ) { |
|
783 | - $restrict = $this->get_restrict_markup( $field, 'billing_email' ); |
|
782 | + public function render_billing_email_template($field) { |
|
783 | + $restrict = $this->get_restrict_markup($field, 'billing_email'); |
|
784 | 784 | $label = "$field.label"; |
785 | 785 | echo " |
786 | 786 | <div $restrict> |
@@ -794,18 +794,18 @@ discard block |
||
794 | 794 | /** |
795 | 795 | * Renders the edit email element template. |
796 | 796 | */ |
797 | - public function edit_email_template( $field ) { |
|
798 | - $restrict = $this->get_restrict_markup( $field, 'email' ); |
|
799 | - $label = __( 'Field Label', 'invoicing' ); |
|
797 | + public function edit_email_template($field) { |
|
798 | + $restrict = $this->get_restrict_markup($field, 'email'); |
|
799 | + $label = __('Field Label', 'invoicing'); |
|
800 | 800 | $id = $field . '.id + "_edit"'; |
801 | - $label2 = __( 'Placeholder text', 'invoicing' ); |
|
801 | + $label2 = __('Placeholder text', 'invoicing'); |
|
802 | 802 | $id2 = $field . '.id + "_edit2"'; |
803 | - $label3 = __( 'Help text', 'invoicing' ); |
|
804 | - $label4 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
803 | + $label3 = __('Help text', 'invoicing'); |
|
804 | + $label4 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
805 | 805 | $id3 = $field . '.id + "_edit3"'; |
806 | - $label5 = __( 'Is this field required?', 'invoicing' ); |
|
806 | + $label5 = __('Is this field required?', 'invoicing'); |
|
807 | 807 | $id4 = $field . '.id + "_edit4"'; |
808 | - $label6 = __( 'Hide if the user is logged in', 'invoicing' ); |
|
808 | + $label6 = __('Hide if the user is logged in', 'invoicing'); |
|
809 | 809 | echo " |
810 | 810 | <div $restrict> |
811 | 811 | <label class='form-group'> |
@@ -836,16 +836,16 @@ discard block |
||
836 | 836 | /** |
837 | 837 | * Renders the edit billing_email element template. |
838 | 838 | */ |
839 | - public function edit_billing_email_template( $field ) { |
|
840 | - $restrict = $this->get_restrict_markup( $field, 'billing_email' ); |
|
841 | - $label = __( 'Field Label', 'invoicing' ); |
|
839 | + public function edit_billing_email_template($field) { |
|
840 | + $restrict = $this->get_restrict_markup($field, 'billing_email'); |
|
841 | + $label = __('Field Label', 'invoicing'); |
|
842 | 842 | $id = $field . '.id + "_edit"'; |
843 | - $label2 = __( 'Placeholder text', 'invoicing' ); |
|
843 | + $label2 = __('Placeholder text', 'invoicing'); |
|
844 | 844 | $id2 = $field . '.id + "_edit2"'; |
845 | - $label3 = __( 'Help text', 'invoicing' ); |
|
846 | - $label4 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
845 | + $label3 = __('Help text', 'invoicing'); |
|
846 | + $label4 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
847 | 847 | $id3 = $field . '.id + "_edit3"'; |
848 | - $label6 = __( 'Hide if the user is logged in', 'invoicing' ); |
|
848 | + $label6 = __('Hide if the user is logged in', 'invoicing'); |
|
849 | 849 | echo " |
850 | 850 | <div $restrict> |
851 | 851 | <label class='form-group'> |
@@ -872,8 +872,8 @@ discard block |
||
872 | 872 | /** |
873 | 873 | * Renders the website element template. |
874 | 874 | */ |
875 | - public function render_website_template( $field ) { |
|
876 | - $restrict = $this->get_restrict_markup( $field, 'website' ); |
|
875 | + public function render_website_template($field) { |
|
876 | + $restrict = $this->get_restrict_markup($field, 'website'); |
|
877 | 877 | $label = "$field.label"; |
878 | 878 | echo " |
879 | 879 | <div $restrict class='wpinv-payment-form-field-preview'> |
@@ -888,16 +888,16 @@ discard block |
||
888 | 888 | /** |
889 | 889 | * Renders the edit website element template. |
890 | 890 | */ |
891 | - public function edit_website_template( $field ) { |
|
892 | - $restrict = $this->get_restrict_markup( $field, 'website' ); |
|
893 | - $label = __( 'Field Label', 'invoicing' ); |
|
891 | + public function edit_website_template($field) { |
|
892 | + $restrict = $this->get_restrict_markup($field, 'website'); |
|
893 | + $label = __('Field Label', 'invoicing'); |
|
894 | 894 | $id = $field . '.id + "_edit"'; |
895 | - $label2 = __( 'Placeholder text', 'invoicing' ); |
|
895 | + $label2 = __('Placeholder text', 'invoicing'); |
|
896 | 896 | $id2 = $field . '.id + "_edit2"'; |
897 | - $label3 = __( 'Help text', 'invoicing' ); |
|
898 | - $label4 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
897 | + $label3 = __('Help text', 'invoicing'); |
|
898 | + $label4 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
899 | 899 | $id3 = $field . '.id + "_edit3"'; |
900 | - $label5 = __( 'Is this field required?', 'invoicing' ); |
|
900 | + $label5 = __('Is this field required?', 'invoicing'); |
|
901 | 901 | $id4 = $field . '.id + "_edit4"'; |
902 | 902 | echo " |
903 | 903 | <div $restrict> |
@@ -925,8 +925,8 @@ discard block |
||
925 | 925 | /** |
926 | 926 | * Renders the date element template. |
927 | 927 | */ |
928 | - public function render_date_template( $field ) { |
|
929 | - $restrict = $this->get_restrict_markup( $field, 'date' ); |
|
928 | + public function render_date_template($field) { |
|
929 | + $restrict = $this->get_restrict_markup($field, 'date'); |
|
930 | 930 | $label = "$field.label"; |
931 | 931 | echo " |
932 | 932 | <div $restrict class='wpinv-payment-form-field-preview'> |
@@ -941,14 +941,14 @@ discard block |
||
941 | 941 | /** |
942 | 942 | * Renders the edit date element template. |
943 | 943 | */ |
944 | - public function edit_date_template( $field ) { |
|
945 | - $restrict = $this->get_restrict_markup( $field, 'date' ); |
|
946 | - $label = __( 'Field Label', 'invoicing' ); |
|
944 | + public function edit_date_template($field) { |
|
945 | + $restrict = $this->get_restrict_markup($field, 'date'); |
|
946 | + $label = __('Field Label', 'invoicing'); |
|
947 | 947 | $id = $field . '.id + "_edit"'; |
948 | - $label3 = __( 'Help text', 'invoicing' ); |
|
949 | - $label4 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
948 | + $label3 = __('Help text', 'invoicing'); |
|
949 | + $label4 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
950 | 950 | $id3 = $field . '.id + "_edit3"'; |
951 | - $label5 = __( 'Is this field required?', 'invoicing' ); |
|
951 | + $label5 = __('Is this field required?', 'invoicing'); |
|
952 | 952 | $id4 = $field . '.id + "_edit4"'; |
953 | 953 | echo " |
954 | 954 | <div $restrict> |
@@ -972,8 +972,8 @@ discard block |
||
972 | 972 | /** |
973 | 973 | * Renders the time element template. |
974 | 974 | */ |
975 | - public function render_time_template( $field ) { |
|
976 | - $restrict = $this->get_restrict_markup( $field, 'time' ); |
|
975 | + public function render_time_template($field) { |
|
976 | + $restrict = $this->get_restrict_markup($field, 'time'); |
|
977 | 977 | $label = "$field.label"; |
978 | 978 | echo " |
979 | 979 | <div $restrict class='wpinv-payment-form-field-preview'> |
@@ -988,14 +988,14 @@ discard block |
||
988 | 988 | /** |
989 | 989 | * Renders the edit time element template. |
990 | 990 | */ |
991 | - public function edit_time_template( $field ) { |
|
992 | - $restrict = $this->get_restrict_markup( $field, 'time' ); |
|
993 | - $label = __( 'Field Label', 'invoicing' ); |
|
991 | + public function edit_time_template($field) { |
|
992 | + $restrict = $this->get_restrict_markup($field, 'time'); |
|
993 | + $label = __('Field Label', 'invoicing'); |
|
994 | 994 | $id = $field . '.id + "_edit"'; |
995 | - $label3 = __( 'Help text', 'invoicing' ); |
|
996 | - $label4 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
995 | + $label3 = __('Help text', 'invoicing'); |
|
996 | + $label4 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
997 | 997 | $id3 = $field . '.id + "_edit3"'; |
998 | - $label5 = __( 'Is this field required?', 'invoicing' ); |
|
998 | + $label5 = __('Is this field required?', 'invoicing'); |
|
999 | 999 | $id4 = $field . '.id + "_edit4"'; |
1000 | 1000 | echo " |
1001 | 1001 | <div $restrict> |
@@ -1019,8 +1019,8 @@ discard block |
||
1019 | 1019 | /** |
1020 | 1020 | * Renders the number element template. |
1021 | 1021 | */ |
1022 | - public function render_number_template( $field ) { |
|
1023 | - $restrict = $this->get_restrict_markup( $field, 'number' ); |
|
1022 | + public function render_number_template($field) { |
|
1023 | + $restrict = $this->get_restrict_markup($field, 'number'); |
|
1024 | 1024 | $label = "$field.label"; |
1025 | 1025 | echo " |
1026 | 1026 | <div $restrict class='wpinv-payment-form-field-preview'> |
@@ -1035,16 +1035,16 @@ discard block |
||
1035 | 1035 | /** |
1036 | 1036 | * Renders the edit number element template. |
1037 | 1037 | */ |
1038 | - public function edit_number_template( $field ) { |
|
1039 | - $restrict = $this->get_restrict_markup( $field, 'number' ); |
|
1040 | - $label = __( 'Field Label', 'invoicing' ); |
|
1038 | + public function edit_number_template($field) { |
|
1039 | + $restrict = $this->get_restrict_markup($field, 'number'); |
|
1040 | + $label = __('Field Label', 'invoicing'); |
|
1041 | 1041 | $id = $field . '.id + "_edit"'; |
1042 | - $label2 = __( 'Placeholder text', 'invoicing' ); |
|
1042 | + $label2 = __('Placeholder text', 'invoicing'); |
|
1043 | 1043 | $id2 = $field . '.id + "_edit2"'; |
1044 | - $label3 = __( 'Help text', 'invoicing' ); |
|
1045 | - $label4 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
1044 | + $label3 = __('Help text', 'invoicing'); |
|
1045 | + $label4 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
1046 | 1046 | $id3 = $field . '.id + "_edit3"'; |
1047 | - $label5 = __( 'Is this field required?', 'invoicing' ); |
|
1047 | + $label5 = __('Is this field required?', 'invoicing'); |
|
1048 | 1048 | $id4 = $field . '.id + "_edit4"'; |
1049 | 1049 | echo " |
1050 | 1050 | <div $restrict> |
@@ -1072,16 +1072,16 @@ discard block |
||
1072 | 1072 | /** |
1073 | 1073 | * Renders the separator element template. |
1074 | 1074 | */ |
1075 | - public function render_separator_template( $field ) { |
|
1076 | - $restrict = $this->get_restrict_markup( $field, 'separator' ); |
|
1075 | + public function render_separator_template($field) { |
|
1076 | + $restrict = $this->get_restrict_markup($field, 'separator'); |
|
1077 | 1077 | echo "<hr class='featurette-divider' $restrict>"; |
1078 | 1078 | } |
1079 | 1079 | |
1080 | 1080 | /** |
1081 | 1081 | * Renders the pay button element template. |
1082 | 1082 | */ |
1083 | - public function render_pay_button_template( $field ) { |
|
1084 | - $restrict = $this->get_restrict_markup( $field, 'pay_button' ); |
|
1083 | + public function render_pay_button_template($field) { |
|
1084 | + $restrict = $this->get_restrict_markup($field, 'pay_button'); |
|
1085 | 1085 | $label = "$field.label"; |
1086 | 1086 | echo " |
1087 | 1087 | <div $restrict> |
@@ -1094,14 +1094,14 @@ discard block |
||
1094 | 1094 | /** |
1095 | 1095 | * Renders the pay button element template. |
1096 | 1096 | */ |
1097 | - public function edit_pay_button_template( $field ) { |
|
1098 | - $restrict = $this->get_restrict_markup( $field, 'pay_button' ); |
|
1099 | - $label = __( 'Button Text', 'invoicing' ); |
|
1097 | + public function edit_pay_button_template($field) { |
|
1098 | + $restrict = $this->get_restrict_markup($field, 'pay_button'); |
|
1099 | + $label = __('Button Text', 'invoicing'); |
|
1100 | 1100 | $id = $field . '.id + "_edit"'; |
1101 | - $label2 = __( 'Help text', 'invoicing' ); |
|
1102 | - $label3 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
1101 | + $label2 = __('Help text', 'invoicing'); |
|
1102 | + $label3 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
1103 | 1103 | $id2 = $field . '.id + "_edit2"'; |
1104 | - $label4 = esc_attr__( 'Button Type', 'invoicing' ); |
|
1104 | + $label4 = esc_attr__('Button Type', 'invoicing'); |
|
1105 | 1105 | $id3 = $field . '.id + "_edit3"'; |
1106 | 1106 | |
1107 | 1107 | echo " |
@@ -1118,15 +1118,15 @@ discard block |
||
1118 | 1118 | <label :for='$id3'>$label4</label> |
1119 | 1119 | |
1120 | 1120 | <select class='form-control custom-select' :id='$id3' v-model='$field.class'> |
1121 | - <option value='btn-primary'>" . __( 'Primary', 'invoicing' ) ."</option> |
|
1122 | - <option value='btn-secondary'>" . __( 'Secondary', 'invoicing' ) ."</option> |
|
1123 | - <option value='btn-success'>" . __( 'Success', 'invoicing' ) ."</option> |
|
1124 | - <option value='btn-danger'>" . __( 'Danger', 'invoicing' ) ."</option> |
|
1125 | - <option value='btn-warning'>" . __( 'Warning', 'invoicing' ) ."</option> |
|
1126 | - <option value='btn-info'>" . __( 'Info', 'invoicing' ) ."</option> |
|
1127 | - <option value='btn-light'>" . __( 'Light', 'invoicing' ) ."</option> |
|
1128 | - <option value='btn-dark'>" . __( 'Dark', 'invoicing' ) ."</option> |
|
1129 | - <option value='btn-link'>" . __( 'Link', 'invoicing' ) ."</option> |
|
1121 | + <option value='btn-primary'>" . __('Primary', 'invoicing') . "</option> |
|
1122 | + <option value='btn-secondary'>" . __('Secondary', 'invoicing') . "</option> |
|
1123 | + <option value='btn-success'>" . __('Success', 'invoicing') . "</option> |
|
1124 | + <option value='btn-danger'>" . __('Danger', 'invoicing') . "</option> |
|
1125 | + <option value='btn-warning'>" . __('Warning', 'invoicing') . "</option> |
|
1126 | + <option value='btn-info'>" . __('Info', 'invoicing') . "</option> |
|
1127 | + <option value='btn-light'>" . __('Light', 'invoicing') . "</option> |
|
1128 | + <option value='btn-dark'>" . __('Dark', 'invoicing') . "</option> |
|
1129 | + <option value='btn-link'>" . __('Link', 'invoicing') . "</option> |
|
1130 | 1130 | </select> |
1131 | 1131 | </div> |
1132 | 1132 | </div> |
@@ -1137,8 +1137,8 @@ discard block |
||
1137 | 1137 | /** |
1138 | 1138 | * Renders the alert element template. |
1139 | 1139 | */ |
1140 | - public function render_alert_template( $field ) { |
|
1141 | - $restrict = $this->get_restrict_markup( $field, 'alert' ); |
|
1140 | + public function render_alert_template($field) { |
|
1141 | + $restrict = $this->get_restrict_markup($field, 'alert'); |
|
1142 | 1142 | $text = "$field.text"; |
1143 | 1143 | echo " |
1144 | 1144 | <div $restrict class='alert' :class='$field.class' role='alert'> |
@@ -1153,14 +1153,14 @@ discard block |
||
1153 | 1153 | /** |
1154 | 1154 | * Renders the alert element template. |
1155 | 1155 | */ |
1156 | - public function edit_alert_template( $field ) { |
|
1157 | - $restrict = $this->get_restrict_markup( $field, 'alert' ); |
|
1158 | - $label = __( 'Alert Text', 'invoicing' ); |
|
1159 | - $label2 = esc_attr__( 'Enter your alert text here', 'invoicing' ); |
|
1156 | + public function edit_alert_template($field) { |
|
1157 | + $restrict = $this->get_restrict_markup($field, 'alert'); |
|
1158 | + $label = __('Alert Text', 'invoicing'); |
|
1159 | + $label2 = esc_attr__('Enter your alert text here', 'invoicing'); |
|
1160 | 1160 | $id = $field . '.id + "_edit"'; |
1161 | - $label3 = __( 'Is Dismissible?', 'invoicing' ); |
|
1161 | + $label3 = __('Is Dismissible?', 'invoicing'); |
|
1162 | 1162 | $id2 = $field . '.id + "_edit2"'; |
1163 | - $label4 = esc_attr__( 'Alert Type', 'invoicing' ); |
|
1163 | + $label4 = esc_attr__('Alert Type', 'invoicing'); |
|
1164 | 1164 | $id3 = $field . '.id + "_edit3"'; |
1165 | 1165 | echo " |
1166 | 1166 | <div $restrict> |
@@ -1176,14 +1176,14 @@ discard block |
||
1176 | 1176 | <label :for='$id3'>$label4</label> |
1177 | 1177 | |
1178 | 1178 | <select class='form-control custom-select' :id='$id3' v-model='$field.class'> |
1179 | - <option value='alert-primary'>" . __( 'Primary', 'invoicing' ) ."</option> |
|
1180 | - <option value='alert-secondary'>" . __( 'Secondary', 'invoicing' ) ."</option> |
|
1181 | - <option value='alert-success'>" . __( 'Success', 'invoicing' ) ."</option> |
|
1182 | - <option value='alert-danger'>" . __( 'Danger', 'invoicing' ) ."</option> |
|
1183 | - <option value='alert-warning'>" . __( 'Warning', 'invoicing' ) ."</option> |
|
1184 | - <option value='alert-info'>" . __( 'Info', 'invoicing' ) ."</option> |
|
1185 | - <option value='alert-light'>" . __( 'Light', 'invoicing' ) ."</option> |
|
1186 | - <option value='alert-dark'>" . __( 'Dark', 'invoicing' ) ."</option> |
|
1179 | + <option value='alert-primary'>" . __('Primary', 'invoicing') . "</option> |
|
1180 | + <option value='alert-secondary'>" . __('Secondary', 'invoicing') . "</option> |
|
1181 | + <option value='alert-success'>" . __('Success', 'invoicing') . "</option> |
|
1182 | + <option value='alert-danger'>" . __('Danger', 'invoicing') . "</option> |
|
1183 | + <option value='alert-warning'>" . __('Warning', 'invoicing') . "</option> |
|
1184 | + <option value='alert-info'>" . __('Info', 'invoicing') . "</option> |
|
1185 | + <option value='alert-light'>" . __('Light', 'invoicing') . "</option> |
|
1186 | + <option value='alert-dark'>" . __('Dark', 'invoicing') . "</option> |
|
1187 | 1187 | </select> |
1188 | 1188 | </div> |
1189 | 1189 | </div> |
@@ -1194,8 +1194,8 @@ discard block |
||
1194 | 1194 | /** |
1195 | 1195 | * Renders the discount element template. |
1196 | 1196 | */ |
1197 | - public function render_discount_template( $field ) { |
|
1198 | - $restrict = $this->get_restrict_markup( $field, 'discount' ); |
|
1197 | + public function render_discount_template($field) { |
|
1198 | + $restrict = $this->get_restrict_markup($field, 'discount'); |
|
1199 | 1199 | ?> |
1200 | 1200 | |
1201 | 1201 | <div <?php echo $restrict; ?> class="discount_field border rounded p-3 wpinv-payment-form-field-preview"> |
@@ -1213,12 +1213,12 @@ discard block |
||
1213 | 1213 | /** |
1214 | 1214 | * Renders the discount element template. |
1215 | 1215 | */ |
1216 | - public function edit_discount_template( $field ) { |
|
1217 | - $restrict = $this->get_restrict_markup( $field, 'discount' ); |
|
1218 | - $label = __( 'Discount Input Placeholder', 'invoicing' ); |
|
1219 | - $label2 = __( 'Help Text', 'invoicing' ); |
|
1220 | - $label3 = esc_attr__( 'Add some help text for this field', 'invoicing' ); |
|
1221 | - $label4 = __( 'Button Text', 'invoicing' ); |
|
1216 | + public function edit_discount_template($field) { |
|
1217 | + $restrict = $this->get_restrict_markup($field, 'discount'); |
|
1218 | + $label = __('Discount Input Placeholder', 'invoicing'); |
|
1219 | + $label2 = __('Help Text', 'invoicing'); |
|
1220 | + $label3 = esc_attr__('Add some help text for this field', 'invoicing'); |
|
1221 | + $label4 = __('Button Text', 'invoicing'); |
|
1222 | 1222 | $id = $field . '.id + "_edit"'; |
1223 | 1223 | $id2 = $field . '.id + "_edit2"'; |
1224 | 1224 | $id3 = $field . '.id + "_edit3"'; |
@@ -1247,17 +1247,17 @@ discard block |
||
1247 | 1247 | /** |
1248 | 1248 | * Renders the items element template. |
1249 | 1249 | */ |
1250 | - public function render_items_template( $field ) { |
|
1251 | - $restrict = $this->get_restrict_markup( $field, 'items' ); |
|
1250 | + public function render_items_template($field) { |
|
1251 | + $restrict = $this->get_restrict_markup($field, 'items'); |
|
1252 | 1252 | ?> |
1253 | 1253 | |
1254 | 1254 | <div <?php echo $restrict; ?> class='item_totals'> |
1255 | 1255 | <div v-if='!is_default'> |
1256 | - <div v-if='! canCheckoutSeveralSubscriptions(<?php echo $field; ?>)' class='alert alert-info' role='alert'><?php _e( 'Item totals will appear here. Click to set items.', 'invoicing' ) ?></div> |
|
1257 | - <div v-if='canCheckoutSeveralSubscriptions(<?php echo $field; ?>)' class='alert alert-danger' role='alert'><?php _e( 'Your form allows customers to buy several recurring items. This is not supported and might lead to unexpected behaviour.', 'invoicing' ); ?></div> |
|
1256 | + <div v-if='! canCheckoutSeveralSubscriptions(<?php echo $field; ?>)' class='alert alert-info' role='alert'><?php _e('Item totals will appear here. Click to set items.', 'invoicing') ?></div> |
|
1257 | + <div v-if='canCheckoutSeveralSubscriptions(<?php echo $field; ?>)' class='alert alert-danger' role='alert'><?php _e('Your form allows customers to buy several recurring items. This is not supported and might lead to unexpected behaviour.', 'invoicing'); ?></div> |
|
1258 | 1258 | </div> |
1259 | 1259 | <div v-if='is_default'> |
1260 | - <div class='alert alert-info' role='alert'><?php _e( 'Item totals will appear here.', 'invoicing' ) ?></div> |
|
1260 | + <div class='alert alert-info' role='alert'><?php _e('Item totals will appear here.', 'invoicing') ?></div> |
|
1261 | 1261 | </div> |
1262 | 1262 | </div> |
1263 | 1263 | |
@@ -1267,25 +1267,25 @@ discard block |
||
1267 | 1267 | /** |
1268 | 1268 | * Renders the items element template. |
1269 | 1269 | */ |
1270 | - public function edit_items_template( $field ) { |
|
1270 | + public function edit_items_template($field) { |
|
1271 | 1271 | global $wpinv_euvat, $post; |
1272 | 1272 | |
1273 | - $restrict = $this->get_restrict_markup( $field, 'items' ); |
|
1273 | + $restrict = $this->get_restrict_markup($field, 'items'); |
|
1274 | 1274 | $id2 = $field . '.id + "_edit2"'; |
1275 | 1275 | $id3 = $field . '.id + "_edit3"'; |
1276 | 1276 | |
1277 | 1277 | // Item types. |
1278 | - $item_types = apply_filters( 'wpinv_item_types_for_quick_add_item', wpinv_get_item_types(), $post ); |
|
1278 | + $item_types = apply_filters('wpinv_item_types_for_quick_add_item', wpinv_get_item_types(), $post); |
|
1279 | 1279 | |
1280 | 1280 | ?> |
1281 | 1281 | <div <?php echo $restrict; ?>> |
1282 | 1282 | <div v-if="!is_default"> |
1283 | 1283 | <label class='form-group'> |
1284 | 1284 | <input v-model='<?php echo $field; ?>.hide_cart' type='checkbox' /> |
1285 | - <span class='form-check-label'><?php _e( 'Hide cart details', 'invoicing' ); ?></span> |
|
1285 | + <span class='form-check-label'><?php _e('Hide cart details', 'invoicing'); ?></span> |
|
1286 | 1286 | </label> |
1287 | 1287 | |
1288 | - <div class="mb-1"><?php _e( 'Form Items', 'invoicing' ); ?></div> |
|
1288 | + <div class="mb-1"><?php _e('Form Items', 'invoicing'); ?></div> |
|
1289 | 1289 | <draggable v-model='form_items' group='selectable_form_items'> |
1290 | 1290 | <div class='wpinv-available-items-editor' v-for='(item, index) in form_items' :class="'item_' + item.id" :key="item.id"> |
1291 | 1291 | |
@@ -1303,35 +1303,35 @@ discard block |
||
1303 | 1303 | |
1304 | 1304 | <div class="form-group" v-if="! item.new"> |
1305 | 1305 | <span class='form-text'> |
1306 | - <a target="_blank" :href="'<?php echo esc_url( admin_url( '/post.php?action=edit&post' ) ) ?>=' + item.id"> |
|
1307 | - <?php _e( 'Edit the item name, price and other details', 'invoicing' ); ?> |
|
1306 | + <a target="_blank" :href="'<?php echo esc_url(admin_url('/post.php?action=edit&post')) ?>=' + item.id"> |
|
1307 | + <?php _e('Edit the item name, price and other details', 'invoicing'); ?> |
|
1308 | 1308 | </a> |
1309 | 1309 | </span> |
1310 | 1310 | </div> |
1311 | 1311 | |
1312 | 1312 | <div class='form-group' v-if="item.new"> |
1313 | 1313 | <label class='mb-0 w-100'> |
1314 | - <span><?php _e( 'Item Name', 'invoicing' ); ?></span> |
|
1314 | + <span><?php _e('Item Name', 'invoicing'); ?></span> |
|
1315 | 1315 | <input v-model='item.title' type='text' class='w-100'/> |
1316 | 1316 | </label> |
1317 | 1317 | </div> |
1318 | 1318 | |
1319 | 1319 | <div class='form-group' v-if="item.new"> |
1320 | 1320 | <label class='mb-0 w-100'> |
1321 | - <span v-if='!item.custom_price'><?php _e( 'Item Price', 'invoicing' ); ?></span> |
|
1322 | - <span v-if='item.custom_price'><?php _e( 'Recommended Price', 'invoicing' ); ?></span> |
|
1321 | + <span v-if='!item.custom_price'><?php _e('Item Price', 'invoicing'); ?></span> |
|
1322 | + <span v-if='item.custom_price'><?php _e('Recommended Price', 'invoicing'); ?></span> |
|
1323 | 1323 | <input v-model='item.price' type='text' class='w-100'/> |
1324 | 1324 | </label> |
1325 | 1325 | </div> |
1326 | 1326 | |
1327 | 1327 | <div class='form-group' v-if='item.new'> |
1328 | 1328 | <label :for="'edit_item_type' + item.id" class='mb-0 w-100'> |
1329 | - <span><?php _e( 'Item Type', 'invoicing' ); ?></span> |
|
1329 | + <span><?php _e('Item Type', 'invoicing'); ?></span> |
|
1330 | 1330 | <select class='w-100' v-model='item.type'> |
1331 | 1331 | <?php |
1332 | - foreach ( $item_types as $type => $_label ) { |
|
1333 | - $type = esc_attr( $type ); |
|
1334 | - $_label = esc_html( $_label ); |
|
1332 | + foreach ($item_types as $type => $_label) { |
|
1333 | + $type = esc_attr($type); |
|
1334 | + $_label = esc_html($_label); |
|
1335 | 1335 | echo "<option value='$type'>$_label</type>"; |
1336 | 1336 | } |
1337 | 1337 | ?> |
@@ -1340,71 +1340,71 @@ discard block |
||
1340 | 1340 | </div> |
1341 | 1341 | |
1342 | 1342 | <div v-if='item.new'> |
1343 | - <?php if ( $wpinv_euvat->allow_vat_rules() ) : ?> |
|
1343 | + <?php if ($wpinv_euvat->allow_vat_rules()) : ?> |
|
1344 | 1344 | <div class='form-group'> |
1345 | - <label class='w-100 mb-0'><?php _e( 'VAT Rule', 'invoicing' ) ; ?> |
|
1345 | + <label class='w-100 mb-0'><?php _e('VAT Rule', 'invoicing'); ?> |
|
1346 | 1346 | <select class='w-100' v-model='item.rule'> |
1347 | 1347 | <?php |
1348 | - foreach ( $wpinv_euvat->get_rules() as $type => $_label ) { |
|
1349 | - $type = esc_attr( $type ); |
|
1350 | - $_label = esc_html( $_label ); |
|
1348 | + foreach ($wpinv_euvat->get_rules() as $type => $_label) { |
|
1349 | + $type = esc_attr($type); |
|
1350 | + $_label = esc_html($_label); |
|
1351 | 1351 | echo "<option value='$type'>$_label</type>"; |
1352 | 1352 | } |
1353 | 1353 | ?> |
1354 | 1354 | </select> |
1355 | 1355 | </label> |
1356 | 1356 | </div> |
1357 | - <?php endif;?> |
|
1357 | + <?php endif; ?> |
|
1358 | 1358 | |
1359 | - <?php if ( $wpinv_euvat->allow_vat_classes() ) : ?> |
|
1359 | + <?php if ($wpinv_euvat->allow_vat_classes()) : ?> |
|
1360 | 1360 | <div class='form-group'> |
1361 | - <label class='w-100 mb-0'><?php _e( 'VAT class', 'invoicing' ) ; ?> |
|
1361 | + <label class='w-100 mb-0'><?php _e('VAT class', 'invoicing'); ?> |
|
1362 | 1362 | <select class='w-100' v-model='item.class'> |
1363 | 1363 | <?php |
1364 | - foreach ( $wpinv_euvat->get_all_classes() as $type => $_label ) { |
|
1365 | - $type = esc_attr( $type ); |
|
1366 | - $_label = esc_html( $_label ); |
|
1364 | + foreach ($wpinv_euvat->get_all_classes() as $type => $_label) { |
|
1365 | + $type = esc_attr($type); |
|
1366 | + $_label = esc_html($_label); |
|
1367 | 1367 | echo "<option value='$type'>$_label</type>"; |
1368 | 1368 | } |
1369 | 1369 | ?> |
1370 | 1370 | </select> |
1371 | 1371 | </label> |
1372 | 1372 | </div> |
1373 | - <?php endif;?> |
|
1373 | + <?php endif; ?> |
|
1374 | 1374 | |
1375 | 1375 | </div> |
1376 | 1376 | |
1377 | 1377 | <label v-if='item.new' class='form-group'> |
1378 | 1378 | <input v-model='item.custom_price' type='checkbox' /> |
1379 | - <span class='form-check-label'><?php _e( 'Allow users to pay what they want', 'invoicing' ); ?></span> |
|
1379 | + <span class='form-check-label'><?php _e('Allow users to pay what they want', 'invoicing'); ?></span> |
|
1380 | 1380 | </label> |
1381 | 1381 | |
1382 | 1382 | <div class='form-group' v-if='item.new && item.custom_price'> |
1383 | 1383 | <label class='mb-0 w-100'> |
1384 | - <span><?php _e( 'Minimum Price', 'invoicing' ); ?></span> |
|
1384 | + <span><?php _e('Minimum Price', 'invoicing'); ?></span> |
|
1385 | 1385 | <input placeholder='0.00' v-model='item.minimum_price' class='w-100' /> |
1386 | - <small class='form-text text-muted'><?php _e( 'Enter the minimum price that a user can pay', 'invoicing' ); ?></small> |
|
1386 | + <small class='form-text text-muted'><?php _e('Enter the minimum price that a user can pay', 'invoicing'); ?></small> |
|
1387 | 1387 | </label> |
1388 | 1388 | </div> |
1389 | 1389 | |
1390 | 1390 | <label class='form-group'> |
1391 | 1391 | <input v-model='item.allow_quantities' type='checkbox' /> |
1392 | - <span><?php _e( 'Allow users to buy several quantities', 'invoicing' ); ?></span> |
|
1392 | + <span><?php _e('Allow users to buy several quantities', 'invoicing'); ?></span> |
|
1393 | 1393 | </label> |
1394 | 1394 | |
1395 | 1395 | <label class='form-group'> |
1396 | 1396 | <input v-model='item.required' type='checkbox' /> |
1397 | - <span><?php _e( 'This item is required', 'invoicing' ); ?></span> |
|
1397 | + <span><?php _e('This item is required', 'invoicing'); ?></span> |
|
1398 | 1398 | </label> |
1399 | 1399 | |
1400 | 1400 | <div class='form-group'> |
1401 | 1401 | <label class="mb-0 w-100"> |
1402 | - <span><?php _e( 'Item Description', 'invoicing' ); ?></span> |
|
1402 | + <span><?php _e('Item Description', 'invoicing'); ?></span> |
|
1403 | 1403 | <textarea v-model='item.description' class='w-100'></textarea> |
1404 | 1404 | </label> |
1405 | 1405 | </div> |
1406 | 1406 | |
1407 | - <button type='button' class='button button-link button-link-delete' @click.prevent='removeItem(item)'><?php _e( 'Delete Item', 'invoicing' ); ?></button> |
|
1407 | + <button type='button' class='button button-link button-link-delete' @click.prevent='removeItem(item)'><?php _e('Delete Item', 'invoicing'); ?></button> |
|
1408 | 1408 | |
1409 | 1409 | </div> |
1410 | 1410 | </div> |
@@ -1412,36 +1412,36 @@ discard block |
||
1412 | 1412 | </div> |
1413 | 1413 | </draggable> |
1414 | 1414 | |
1415 | - <small v-if='! form_items.length' class='form-text text-danger'><?php _e( 'You have not set up any items. Please select an item below or create a new item.', 'invoicing' ); ?></small> |
|
1415 | + <small v-if='! form_items.length' class='form-text text-danger'><?php _e('You have not set up any items. Please select an item below or create a new item.', 'invoicing'); ?></small> |
|
1416 | 1416 | |
1417 | 1417 | <div class='form-group mt-2'> |
1418 | 1418 | |
1419 | 1419 | <select class='w-100' style="padding: 6px 24px 6px 8px; border-color: #e0e0e0;" v-model='selected_item' @change='addSelectedItem'> |
1420 | - <option value=''><?php _e( 'Select an item to add...', 'invoicing' ) ?></option> |
|
1420 | + <option value=''><?php _e('Select an item to add...', 'invoicing') ?></option> |
|
1421 | 1421 | <option v-for='(item, index) in all_items' :value='index'>{{item.title}}</option> |
1422 | 1422 | </select> |
1423 | 1423 | |
1424 | 1424 | </div> |
1425 | 1425 | |
1426 | 1426 | <div class='form-group'> |
1427 | - <button @click.prevent='addNewItem' class="button button-link"><?php _e( 'Or create a new item.', 'invoicing' ) ?></button> |
|
1427 | + <button @click.prevent='addNewItem' class="button button-link"><?php _e('Or create a new item.', 'invoicing') ?></button> |
|
1428 | 1428 | </div> |
1429 | 1429 | |
1430 | 1430 | <div class='form-group mt-5'> |
1431 | - <label :for='<?php echo $id2; ?>'><?php _e( 'Let customers...', 'invoicing' ) ?></label> |
|
1431 | + <label :for='<?php echo $id2; ?>'><?php _e('Let customers...', 'invoicing') ?></label> |
|
1432 | 1432 | |
1433 | 1433 | <select class='w-100' style="padding: 6px 24px 6px 8px; border-color: #e0e0e0;" :id='<?php echo $id2; ?>' v-model='<?php echo $field; ?>.items_type'> |
1434 | - <option value='total' :disabled='canCheckoutSeveralSubscriptions(<?php echo $field; ?>)'><?php _e( 'Buy all items on the list', 'invoicing' ); ?></option> |
|
1435 | - <option value='radio'><?php _e( 'Select a single item from the list', 'invoicing' ); ?></option> |
|
1436 | - <option value='checkbox' :disabled='canCheckoutSeveralSubscriptions(<?php echo $field; ?>)'><?php _e( 'Select one or more items on the list', 'invoicing' ) ;?></option> |
|
1437 | - <option value='select'><?php _e( 'Select a single item from a dropdown', 'invoicing' ); ?></option> |
|
1434 | + <option value='total' :disabled='canCheckoutSeveralSubscriptions(<?php echo $field; ?>)'><?php _e('Buy all items on the list', 'invoicing'); ?></option> |
|
1435 | + <option value='radio'><?php _e('Select a single item from the list', 'invoicing'); ?></option> |
|
1436 | + <option value='checkbox' :disabled='canCheckoutSeveralSubscriptions(<?php echo $field; ?>)'><?php _e('Select one or more items on the list', 'invoicing'); ?></option> |
|
1437 | + <option value='select'><?php _e('Select a single item from a dropdown', 'invoicing'); ?></option> |
|
1438 | 1438 | </select> |
1439 | 1439 | |
1440 | 1440 | </div> |
1441 | 1441 | </div> |
1442 | 1442 | <div class='form-group'> |
1443 | - <label :for='<?php echo $id3; ?>'><?php _e( 'Help Text', 'invoicing' ); ?></label> |
|
1444 | - <textarea placeholder='<?php esc_attr_e( 'Add some help text for this element', 'invoicing' ); ?>' :id='<?php echo $id3; ?>' v-model='<?php echo $field; ?>.description' class='form-control' rows='3'></textarea> |
|
1443 | + <label :for='<?php echo $id3; ?>'><?php _e('Help Text', 'invoicing'); ?></label> |
|
1444 | + <textarea placeholder='<?php esc_attr_e('Add some help text for this element', 'invoicing'); ?>' :id='<?php echo $id3; ?>' v-model='<?php echo $field; ?>.description' class='form-control' rows='3'></textarea> |
|
1445 | 1445 | </div> |
1446 | 1446 | |
1447 | 1447 | </div> |
@@ -1460,7 +1460,7 @@ discard block |
||
1460 | 1460 | 'orderby' => 'title', |
1461 | 1461 | 'order' => 'ASC', |
1462 | 1462 | 'posts_per_page' => -1, |
1463 | - 'post_status' => array( 'publish' ), |
|
1463 | + 'post_status' => array('publish'), |
|
1464 | 1464 | 'meta_query' => array( |
1465 | 1465 | array( |
1466 | 1466 | 'key' => '_wpinv_type', |
@@ -1470,15 +1470,15 @@ discard block |
||
1470 | 1470 | ) |
1471 | 1471 | ); |
1472 | 1472 | |
1473 | - $items = get_posts( apply_filters( 'getpaid_payment_form_item_dropdown_query_args', $item_args ) ); |
|
1473 | + $items = get_posts(apply_filters('getpaid_payment_form_item_dropdown_query_args', $item_args)); |
|
1474 | 1474 | |
1475 | - if ( empty( $items ) ) { |
|
1475 | + if (empty($items)) { |
|
1476 | 1476 | return array(); |
1477 | 1477 | } |
1478 | 1478 | |
1479 | - $options = array(); |
|
1480 | - foreach ( $items as $item ) { |
|
1481 | - $item = new GetPaid_Form_Item( $item ); |
|
1479 | + $options = array(); |
|
1480 | + foreach ($items as $item) { |
|
1481 | + $item = new GetPaid_Form_Item($item); |
|
1482 | 1482 | $options[] = $item->prepare_data_for_use(); |
1483 | 1483 | } |
1484 | 1484 | return $options; |
@@ -1488,39 +1488,39 @@ discard block |
||
1488 | 1488 | /** |
1489 | 1489 | * Returns an array of items for the currently being edited form. |
1490 | 1490 | */ |
1491 | - public function get_form_items( $id = false ) { |
|
1492 | - $form = new GetPaid_Payment_Form( $id ); |
|
1491 | + public function get_form_items($id = false) { |
|
1492 | + $form = new GetPaid_Payment_Form($id); |
|
1493 | 1493 | |
1494 | 1494 | // Is this a default form? |
1495 | - if ( $form->is_default() ) { |
|
1495 | + if ($form->is_default()) { |
|
1496 | 1496 | return array(); |
1497 | 1497 | } |
1498 | 1498 | |
1499 | - return $form->get_items( 'view', 'arrays' ); |
|
1499 | + return $form->get_items('view', 'arrays'); |
|
1500 | 1500 | } |
1501 | 1501 | |
1502 | 1502 | /** |
1503 | 1503 | * Converts form items for use. |
1504 | 1504 | */ |
1505 | - public function convert_checkout_items( $items, $invoice ) { |
|
1505 | + public function convert_checkout_items($items, $invoice) { |
|
1506 | 1506 | |
1507 | 1507 | $converted = array(); |
1508 | - foreach ( $items as $item ) { |
|
1508 | + foreach ($items as $item) { |
|
1509 | 1509 | |
1510 | 1510 | $item_id = $item['id']; |
1511 | - $_item = new WPInv_Item( $item_id ); |
|
1511 | + $_item = new WPInv_Item($item_id); |
|
1512 | 1512 | |
1513 | - if( ! $_item ) { |
|
1513 | + if (!$_item) { |
|
1514 | 1514 | continue; |
1515 | 1515 | } |
1516 | 1516 | |
1517 | 1517 | $converted[] = array( |
1518 | - 'title' => esc_html( wpinv_get_cart_item_name( $item ) ) . wpinv_get_item_suffix( $_item ), |
|
1518 | + 'title' => esc_html(wpinv_get_cart_item_name($item)) . wpinv_get_item_suffix($_item), |
|
1519 | 1519 | 'id' => $item['id'], |
1520 | 1520 | 'price' => $item['subtotal'], |
1521 | 1521 | 'custom_price' => $_item->get_is_dynamic_pricing(), |
1522 | 1522 | 'recurring' => $_item->is_recurring(), |
1523 | - 'description' => apply_filters( 'wpinv_checkout_cart_line_item_summary', '', $item, $_item, $invoice ), |
|
1523 | + 'description' => apply_filters('wpinv_checkout_cart_line_item_summary', '', $item, $_item, $invoice), |
|
1524 | 1524 | 'minimum_price' => $_item->get_minimum_price(), |
1525 | 1525 | 'allow_quantities' => false, |
1526 | 1526 | 'quantity' => $item['quantity'], |
@@ -1534,27 +1534,27 @@ discard block |
||
1534 | 1534 | /** |
1535 | 1535 | * Converts an array of id => quantity for use. |
1536 | 1536 | */ |
1537 | - public function convert_normal_items( $items ) { |
|
1537 | + public function convert_normal_items($items) { |
|
1538 | 1538 | |
1539 | 1539 | $converted = array(); |
1540 | - foreach ( $items as $item_id => $quantity ) { |
|
1540 | + foreach ($items as $item_id => $quantity) { |
|
1541 | 1541 | |
1542 | - $item = new WPInv_Item( $item_id ); |
|
1542 | + $item = new WPInv_Item($item_id); |
|
1543 | 1543 | |
1544 | - if( ! $item ) { |
|
1544 | + if (!$item) { |
|
1545 | 1545 | continue; |
1546 | 1546 | } |
1547 | 1547 | |
1548 | 1548 | $converted[] = array( |
1549 | - 'title' => esc_html( $item->get_name() ) . wpinv_get_item_suffix( $item ), |
|
1549 | + 'title' => esc_html($item->get_name()) . wpinv_get_item_suffix($item), |
|
1550 | 1550 | 'id' => $item_id, |
1551 | 1551 | 'price' => $item->get_price(), |
1552 | 1552 | 'custom_price' => $item->get_is_dynamic_pricing(), |
1553 | 1553 | 'recurring' => $item->is_recurring(), |
1554 | 1554 | 'description' => $item->get_summary(), |
1555 | 1555 | 'minimum_price' => $item->get_minimum_price(), |
1556 | - 'allow_quantities' => ! empty( $quantity ), |
|
1557 | - 'quantity' => empty( $quantity ) ? 1 : $quantity, |
|
1556 | + 'allow_quantities' => !empty($quantity), |
|
1557 | + 'quantity' => empty($quantity) ? 1 : $quantity, |
|
1558 | 1558 | 'required' => true, |
1559 | 1559 | ); |
1560 | 1560 | |
@@ -1567,19 +1567,19 @@ discard block |
||
1567 | 1567 | /** |
1568 | 1568 | * Returns an array of elements for the currently being edited form. |
1569 | 1569 | */ |
1570 | - public function get_form_elements( $id = false ) { |
|
1570 | + public function get_form_elements($id = false) { |
|
1571 | 1571 | |
1572 | - if ( empty( $id ) ) { |
|
1573 | - return wpinv_get_data( 'sample-payment-form' ); |
|
1572 | + if (empty($id)) { |
|
1573 | + return wpinv_get_data('sample-payment-form'); |
|
1574 | 1574 | } |
1575 | 1575 | |
1576 | - $form_elements = get_post_meta( $id, 'wpinv_form_elements', true ); |
|
1576 | + $form_elements = get_post_meta($id, 'wpinv_form_elements', true); |
|
1577 | 1577 | |
1578 | - if ( is_array( $form_elements ) ) { |
|
1578 | + if (is_array($form_elements)) { |
|
1579 | 1579 | return $form_elements; |
1580 | 1580 | } |
1581 | 1581 | |
1582 | - return wpinv_get_data( 'sample-payment-form' ); |
|
1582 | + return wpinv_get_data('sample-payment-form'); |
|
1583 | 1583 | } |
1584 | 1584 | |
1585 | 1585 | } |