@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * |
5 | 5 | */ |
6 | 6 | |
7 | -defined( 'ABSPATH' ) || exit; |
|
7 | +defined('ABSPATH') || exit; |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * Represents a single email type. |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * @param string $id Email Type. |
33 | 33 | * @param mixed $object Optional. Associated object. |
34 | 34 | */ |
35 | - public function __construct( $id, $object = false ) { |
|
35 | + public function __construct($id, $object = false) { |
|
36 | 36 | $this->id = $id; |
37 | 37 | $this->object = $object; |
38 | 38 | } |
@@ -42,18 +42,18 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @return mixed |
44 | 44 | */ |
45 | - public function get_option( $key ) { |
|
45 | + public function get_option($key) { |
|
46 | 46 | |
47 | 47 | $key = "email_{$this->id}_$key"; |
48 | - $value = wpinv_get_option( $key, null ); |
|
49 | - if ( is_null( $value ) ) { |
|
48 | + $value = wpinv_get_option($key, null); |
|
49 | + if (is_null($value)) { |
|
50 | 50 | $options = wpinv_get_emails(); |
51 | 51 | |
52 | - if ( ! isset( $options[ $this->id ] ) || ! isset( $options[ $this->id ][ $key ] ) ) { |
|
52 | + if (!isset($options[$this->id]) || !isset($options[$this->id][$key])) { |
|
53 | 53 | return ''; |
54 | 54 | } |
55 | 55 | |
56 | - $value = isset( $options[ $this->id ][ $key ]['std'] ) ? $options[ $this->id ][ $key ]['std'] : ''; |
|
56 | + $value = isset($options[$this->id][$key]['std']) ? $options[$this->id][$key]['std'] : ''; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | return $value; |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | * @return string |
66 | 66 | */ |
67 | 67 | public function get_body() { |
68 | - $body = $this->get_option( 'body' ); |
|
69 | - return apply_filters( 'getpaid_get_email_body', $body, $this->id, $this->object ); |
|
68 | + $body = $this->get_option('body'); |
|
69 | + return apply_filters('getpaid_get_email_body', $body, $this->id, $this->object); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | * @return string |
76 | 76 | */ |
77 | 77 | public function get_subject() { |
78 | - $subject = $this->get_option( 'subject' ); |
|
79 | - return apply_filters( 'getpaid_get_email_subject', $subject, $this->id, $this->object ); |
|
78 | + $subject = $this->get_option('subject'); |
|
79 | + return apply_filters('getpaid_get_email_subject', $subject, $this->id, $this->object); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | * @return string |
86 | 86 | */ |
87 | 87 | public function get_heading() { |
88 | - $heading = $this->get_option( 'heading' ); |
|
89 | - return apply_filters( 'getpaid_get_email_heading', $heading, $this->id, $this->object ); |
|
88 | + $heading = $this->get_option('heading'); |
|
89 | + return apply_filters('getpaid_get_email_heading', $heading, $this->id, $this->object); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | * @return bool |
96 | 96 | */ |
97 | 97 | public function is_active() { |
98 | - $is_active = ! empty( $this->get_option( 'active' ) ); |
|
99 | - return apply_filters( 'getpaid_email_type_is_active', $is_active, $this->id, $this->object ); |
|
98 | + $is_active = !empty($this->get_option('active')); |
|
99 | + return apply_filters('getpaid_email_type_is_active', $is_active, $this->id, $this->object); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | * @return bool |
106 | 106 | */ |
107 | 107 | public function include_admin_bcc() { |
108 | - $include_admin_bcc = ! empty( $this->get_option( 'admin_bcc' ) ); |
|
109 | - return apply_filters( 'getpaid_email_type_include_admin_bcc', $include_admin_bcc, $this->id, $this->object ); |
|
108 | + $include_admin_bcc = !empty($this->get_option('admin_bcc')); |
|
109 | + return apply_filters('getpaid_email_type_include_admin_bcc', $include_admin_bcc, $this->id, $this->object); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | * @return bool |
116 | 116 | */ |
117 | 117 | public function is_admin_email() { |
118 | - $is_admin_email = in_array( $this->id, array( 'new_invoice', 'cancelled_invoice', 'failed_invoice' ) ); |
|
119 | - return apply_filters( 'getpaid_email_type_is_admin_email', $is_admin_email, $this->id, $this->object ); |
|
118 | + $is_admin_email = in_array($this->id, array('new_invoice', 'cancelled_invoice', 'failed_invoice')); |
|
119 | + return apply_filters('getpaid_email_type_is_admin_email', $is_admin_email, $this->id, $this->object); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @return array |
126 | 126 | */ |
127 | 127 | public function get_attachments() { |
128 | - return apply_filters( 'getpaid_get_email_attachments', array(), $this->id, $this->object ); |
|
128 | + return apply_filters('getpaid_get_email_attachments', array(), $this->id, $this->object); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | |
138 | 138 | $merge_tags = array( |
139 | 139 | '{site_title}' => wpinv_get_blogname(), |
140 | - '{date}' => getpaid_format_date_value( current_time( 'mysql' ) ), |
|
140 | + '{date}' => getpaid_format_date_value(current_time('mysql')), |
|
141 | 141 | ); |
142 | 142 | |
143 | - return apply_filters( 'getpaid_get_email_merge_tags', $merge_tags, $this->object, $this->id ); |
|
143 | + return apply_filters('getpaid_get_email_merge_tags', $merge_tags, $this->object, $this->id); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
@@ -150,13 +150,13 @@ discard block |
||
150 | 150 | * @param array $merge_tags |
151 | 151 | * @return string |
152 | 152 | */ |
153 | - public function add_merge_tags( $text, $merge_tags = array() ) { |
|
153 | + public function add_merge_tags($text, $merge_tags = array()) { |
|
154 | 154 | |
155 | - foreach ( $merge_tags as $key => $value ) { |
|
156 | - $text = str_replace( $key, $value, $text ); |
|
155 | + foreach ($merge_tags as $key => $value) { |
|
156 | + $text = str_replace($key, $value, $text); |
|
157 | 157 | } |
158 | 158 | |
159 | - return wptexturize( $text ); |
|
159 | + return wptexturize($text); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | * @param array $extra_args Extra template args |
167 | 167 | * @return string |
168 | 168 | */ |
169 | - public function get_content( $merge_tags = array(), $extra_args = array() ) { |
|
169 | + public function get_content($merge_tags = array(), $extra_args = array()) { |
|
170 | 170 | |
171 | 171 | $content = wpinv_get_template_html( |
172 | 172 | "emails/wpinv-email-{$this->id}.php", |
@@ -176,15 +176,15 @@ discard block |
||
176 | 176 | 'invoice' => $this->object, // Backwards compat. |
177 | 177 | 'object' => $this->object, |
178 | 178 | 'email_type' => $this->id, |
179 | - 'email_heading' => $this->add_merge_tags( $this->get_heading(), $merge_tags ), |
|
179 | + 'email_heading' => $this->add_merge_tags($this->get_heading(), $merge_tags), |
|
180 | 180 | 'sent_to_admin' => $this->is_admin_email(), |
181 | 181 | 'plain_text' => false, |
182 | - 'message_body' => wpautop( $this->add_merge_tags( $this->get_body(), $merge_tags ) ), |
|
182 | + 'message_body' => wpautop($this->add_merge_tags($this->get_body(), $merge_tags)), |
|
183 | 183 | ) |
184 | 184 | ) |
185 | 185 | ); |
186 | 186 | |
187 | - return wpinv_email_style_body( $content ); |
|
187 | + return wpinv_email_style_body($content); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | } |
@@ -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 | } |
@@ -7,11 +7,11 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div class='form-group'> |
15 | - <label :for="active_form_element.id + '_edit'"><?php esc_html_e( 'The total payable text', 'invoicing' ) ?></label> |
|
15 | + <label :for="active_form_element.id + '_edit'"><?php esc_html_e('The total payable text', 'invoicing') ?></label> |
|
16 | 16 | <textarea :id="active_form_element.id + '_edit'" v-model='active_form_element.text' class='form-control' rows='3'></textarea> |
17 | 17 | </div> |
@@ -7,10 +7,10 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 | <div class='form-group'> |
14 | - <label :for="active_form_element.id + '_edit'"><?php esc_html_e( 'The IP Address text', 'invoicing' ) ?></label> |
|
14 | + <label :for="active_form_element.id + '_edit'"><?php esc_html_e('The IP Address text', 'invoicing') ?></label> |
|
15 | 15 | <textarea :id="active_form_element.id + '_edit'" v-model='active_form_element.text' class='form-control' rows='3'></textarea> |
16 | 16 | </div> |
@@ -7,11 +7,11 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div class='form-group'> |
15 | - <label :for="active_form_element.id + '_edit'"><?php esc_html_e( 'The gateway select text', 'invoicing' ) ?></label> |
|
15 | + <label :for="active_form_element.id + '_edit'"><?php esc_html_e('The gateway select text', 'invoicing') ?></label> |
|
16 | 16 | <textarea :id="active_form_element.id + '_edit'" v-model='active_form_element.text' class='form-control' rows='3'></textarea> |
17 | 17 | </div> |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 |
@@ -7,6 +7,6 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | ?> |
12 | 12 | <hr class="featurette-divider" /> |
13 | 13 | \ No newline at end of file |
@@ -8,7 +8,7 @@ |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | ?> |
14 | 14 | <component :is='form_element.level' v-html='form_element.text'></component> |
15 | 15 | \ No newline at end of file |
@@ -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 | // Set the currency position. |
13 | 13 | $position = wpinv_currency_position(); |
14 | 14 | |
15 | -if ( $position == 'left_space' ) { |
|
15 | +if ($position == 'left_space') { |
|
16 | 16 | $position = 'left'; |
17 | 17 | } |
18 | 18 | |
19 | -if ( $position == 'right_space' ) { |
|
19 | +if ($position == 'right_space') { |
|
20 | 20 | $position = 'right'; |
21 | 21 | } |
22 | 22 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | <div class="input-group"> |
28 | 28 | |
29 | - <?php if ( $position == 'left' ) : ?> |
|
29 | + <?php if ($position == 'left') : ?> |
|
30 | 30 | <div class="input-group-prepend"> |
31 | 31 | <span class="input-group-text"><?php echo wpinv_currency_symbol() ?></span> |
32 | 32 | </div> |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | <input :placeholder='form_element.placeholder' class='form-control' type='text'> |
36 | 36 | |
37 | - <?php if ( $position == 'right' ) : ?> |
|
37 | + <?php if ($position == 'right') : ?> |
|
38 | 38 | <div class="input-group-append"> |
39 | 39 | <span class="input-group-text"><?php echo wpinv_currency_symbol() ?></span> |
40 | 40 | </div> |