@@ -4,8 +4,8 @@ |
||
4 | 4 | <p><strong><?php esc_html_e('Add New Price Type', 'event_espresso'); ?></strong></p> |
5 | 5 | <p> |
6 | 6 | <?php printf( |
7 | - esc_html__('This page allows you to create a new price type for %s.', 'event_espresso'), |
|
8 | - Domain::brandName() |
|
7 | + esc_html__('This page allows you to create a new price type for %s.', 'event_espresso'), |
|
8 | + Domain::brandName() |
|
9 | 9 | ); ?> |
10 | 10 | </p> |
11 | 11 | <ul> |
@@ -4,8 +4,8 @@ |
||
4 | 4 | <p><strong><?php esc_html_e('Edit Default Price', 'event_espresso'); ?></strong></p> |
5 | 5 | <p> |
6 | 6 | <?php printf( |
7 | - esc_html__('This page allows you to edit a default price for %s.', 'event_espresso'), |
|
8 | - Domain::brandName() |
|
7 | + esc_html__('This page allows you to edit a default price for %s.', 'event_espresso'), |
|
8 | + Domain::brandName() |
|
9 | 9 | ); ?> |
10 | 10 | </p> |
11 | 11 | <ul> |
@@ -4,8 +4,8 @@ |
||
4 | 4 | <p><strong><?php esc_html_e('Edit Price Type', 'event_espresso'); ?></strong></p> |
5 | 5 | <p> |
6 | 6 | <?php printf( |
7 | - esc_html__('This page allows you to edit a price type for %s.', 'event_espresso'), |
|
8 | - Domain::brandName() |
|
7 | + esc_html__('This page allows you to edit a price type for %s.', 'event_espresso'), |
|
8 | + Domain::brandName() |
|
9 | 9 | ); ?> |
10 | 10 | </p> |
11 | 11 | <ul> |
@@ -4,8 +4,8 @@ |
||
4 | 4 | <p><strong><?php esc_html_e('Add New Default Price', 'event_espresso'); ?></strong></p> |
5 | 5 | <p> |
6 | 6 | <?php printf( |
7 | - esc_html__('This page allows you to create a new default price for %s.', 'event_espresso'), |
|
8 | - Domain::brandName() |
|
7 | + esc_html__('This page allows you to create a new default price for %s.', 'event_espresso'), |
|
8 | + Domain::brandName() |
|
9 | 9 | ); ?> |
10 | 10 | </p> |
11 | 11 | <ul> |
@@ -59,7 +59,7 @@ |
||
59 | 59 | $this->loader->getShared( |
60 | 60 | 'EventEspresso\core\domain\services\admin\ajax\EventEditorHeartbeat' |
61 | 61 | ); |
62 | - } elseif ($screenID === 'front' && ! empty($heartbeat_data[ self::RESPONSE_KEY_THANK_YOU_PAGE ])) { |
|
62 | + } elseif ($screenID === 'front' && ! empty($heartbeat_data[self::RESPONSE_KEY_THANK_YOU_PAGE])) { |
|
63 | 63 | $this->loader->getShared( |
64 | 64 | 'EventEspresso\core\domain\services\admin\ajax\ThankYouPageIpnMonitor' |
65 | 65 | ); |
@@ -17,52 +17,52 @@ |
||
17 | 17 | class WordpressHeartbeat |
18 | 18 | { |
19 | 19 | |
20 | - const RESPONSE_KEY_THANK_YOU_PAGE = 'espresso_thank_you_page'; |
|
20 | + const RESPONSE_KEY_THANK_YOU_PAGE = 'espresso_thank_you_page'; |
|
21 | 21 | |
22 | - /** |
|
23 | - * @var LoaderInterface $loader |
|
24 | - */ |
|
25 | - protected $loader; |
|
22 | + /** |
|
23 | + * @var LoaderInterface $loader |
|
24 | + */ |
|
25 | + protected $loader; |
|
26 | 26 | |
27 | - /** |
|
28 | - * @var RequestInterface $request |
|
29 | - */ |
|
30 | - protected $request; |
|
27 | + /** |
|
28 | + * @var RequestInterface $request |
|
29 | + */ |
|
30 | + protected $request; |
|
31 | 31 | |
32 | 32 | |
33 | - /** |
|
34 | - * WordpressHeartbeat constructor. |
|
35 | - * |
|
36 | - * @param LoaderInterface $loader |
|
37 | - * @param RequestInterface $request |
|
38 | - */ |
|
39 | - public function __construct( |
|
40 | - LoaderInterface $loader, |
|
41 | - RequestInterface $request |
|
42 | - ) { |
|
43 | - $this->loader = $loader; |
|
44 | - $this->request = $request; |
|
45 | - do_action('AHEE__EventEspresso_core_domain_services_admin_ajax_WordpressHeartbeat__constructor', $this); |
|
46 | - add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'resolveRoutes')); |
|
47 | - } |
|
33 | + /** |
|
34 | + * WordpressHeartbeat constructor. |
|
35 | + * |
|
36 | + * @param LoaderInterface $loader |
|
37 | + * @param RequestInterface $request |
|
38 | + */ |
|
39 | + public function __construct( |
|
40 | + LoaderInterface $loader, |
|
41 | + RequestInterface $request |
|
42 | + ) { |
|
43 | + $this->loader = $loader; |
|
44 | + $this->request = $request; |
|
45 | + do_action('AHEE__EventEspresso_core_domain_services_admin_ajax_WordpressHeartbeat__constructor', $this); |
|
46 | + add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'resolveRoutes')); |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - /** |
|
51 | - * @since 4.9.76.p |
|
52 | - * @throws InvalidClassException |
|
53 | - */ |
|
54 | - public function resolveRoutes() |
|
55 | - { |
|
56 | - $screenID = $this->request->getRequestParam('screen_id'); |
|
57 | - $heartbeat_data = $this->request->getRequestParam('data', [], 'string', true); |
|
58 | - if ($screenID === 'espresso_events') { |
|
59 | - $this->loader->getShared( |
|
60 | - 'EventEspresso\core\domain\services\admin\ajax\EventEditorHeartbeat' |
|
61 | - ); |
|
62 | - } elseif ($screenID === 'front' && ! empty($heartbeat_data[ self::RESPONSE_KEY_THANK_YOU_PAGE ])) { |
|
63 | - $this->loader->getShared( |
|
64 | - 'EventEspresso\core\domain\services\admin\ajax\ThankYouPageIpnMonitor' |
|
65 | - ); |
|
66 | - } |
|
67 | - } |
|
50 | + /** |
|
51 | + * @since 4.9.76.p |
|
52 | + * @throws InvalidClassException |
|
53 | + */ |
|
54 | + public function resolveRoutes() |
|
55 | + { |
|
56 | + $screenID = $this->request->getRequestParam('screen_id'); |
|
57 | + $heartbeat_data = $this->request->getRequestParam('data', [], 'string', true); |
|
58 | + if ($screenID === 'espresso_events') { |
|
59 | + $this->loader->getShared( |
|
60 | + 'EventEspresso\core\domain\services\admin\ajax\EventEditorHeartbeat' |
|
61 | + ); |
|
62 | + } elseif ($screenID === 'front' && ! empty($heartbeat_data[ self::RESPONSE_KEY_THANK_YOU_PAGE ])) { |
|
63 | + $this->loader->getShared( |
|
64 | + 'EventEspresso\core\domain\services\admin\ajax\ThankYouPageIpnMonitor' |
|
65 | + ); |
|
66 | + } |
|
67 | + } |
|
68 | 68 | } |
@@ -7,24 +7,24 @@ |
||
7 | 7 | * ACF compatibility |
8 | 8 | */ |
9 | 9 | add_action( |
10 | - 'plugins_loaded', |
|
11 | - function () { |
|
12 | - if (function_exists('acf_include')) { |
|
13 | - add_filter( |
|
14 | - 'acf/get_post_types', |
|
15 | - function ($post_types, $args) { |
|
16 | - if (! empty($args['show_ui'])) { |
|
17 | - $ee_post_types = get_post_types(array('show_ee_ui' => 1)); |
|
18 | - $ee_post_types = array_keys($ee_post_types); |
|
19 | - $post_types = array_merge($post_types, $ee_post_types); |
|
20 | - $post_types = array_unique($post_types); |
|
21 | - } |
|
22 | - return $post_types; |
|
23 | - }, |
|
24 | - 10, |
|
25 | - 2 |
|
26 | - ); |
|
27 | - } |
|
28 | - }, |
|
29 | - 100 |
|
10 | + 'plugins_loaded', |
|
11 | + function () { |
|
12 | + if (function_exists('acf_include')) { |
|
13 | + add_filter( |
|
14 | + 'acf/get_post_types', |
|
15 | + function ($post_types, $args) { |
|
16 | + if (! empty($args['show_ui'])) { |
|
17 | + $ee_post_types = get_post_types(array('show_ee_ui' => 1)); |
|
18 | + $ee_post_types = array_keys($ee_post_types); |
|
19 | + $post_types = array_merge($post_types, $ee_post_types); |
|
20 | + $post_types = array_unique($post_types); |
|
21 | + } |
|
22 | + return $post_types; |
|
23 | + }, |
|
24 | + 10, |
|
25 | + 2 |
|
26 | + ); |
|
27 | + } |
|
28 | + }, |
|
29 | + 100 |
|
30 | 30 | ); |
@@ -8,12 +8,12 @@ |
||
8 | 8 | */ |
9 | 9 | add_action( |
10 | 10 | 'plugins_loaded', |
11 | - function () { |
|
11 | + function() { |
|
12 | 12 | if (function_exists('acf_include')) { |
13 | 13 | add_filter( |
14 | 14 | 'acf/get_post_types', |
15 | - function ($post_types, $args) { |
|
16 | - if (! empty($args['show_ui'])) { |
|
15 | + function($post_types, $args) { |
|
16 | + if ( ! empty($args['show_ui'])) { |
|
17 | 17 | $ee_post_types = get_post_types(array('show_ee_ui' => 1)); |
18 | 18 | $ee_post_types = array_keys($ee_post_types); |
19 | 19 | $post_types = array_merge($post_types, $ee_post_types); |
@@ -14,20 +14,20 @@ |
||
14 | 14 | */ |
15 | 15 | class CoreBlocksAssetManager extends BlockAssetManager |
16 | 16 | { |
17 | - const JS_HANDLE_CORE_BLOCKS_EDITOR = 'eventespresso-core-blocks'; |
|
18 | - const CSS_HANDLE_CORE_BLOCKS_EDITOR = 'eventespresso-core-blocks'; |
|
19 | - const JS_HANDLE_CORE_BLOCKS = 'eventespresso-core-blocks-frontend'; |
|
20 | - const CSS_HANDLE_CORE_BLOCKS = 'eventespresso-core-blocks-frontend'; |
|
17 | + const JS_HANDLE_CORE_BLOCKS_EDITOR = 'eventespresso-core-blocks'; |
|
18 | + const CSS_HANDLE_CORE_BLOCKS_EDITOR = 'eventespresso-core-blocks'; |
|
19 | + const JS_HANDLE_CORE_BLOCKS = 'eventespresso-core-blocks-frontend'; |
|
20 | + const CSS_HANDLE_CORE_BLOCKS = 'eventespresso-core-blocks-frontend'; |
|
21 | 21 | |
22 | 22 | |
23 | - /** |
|
24 | - * @since 4.9.71.p |
|
25 | - */ |
|
26 | - public function setAssetHandles() |
|
27 | - { |
|
28 | - $this->setEditorScriptHandle(self::JS_HANDLE_CORE_BLOCKS_EDITOR); |
|
29 | - $this->setEditorStyleHandle(self::CSS_HANDLE_CORE_BLOCKS_EDITOR); |
|
30 | - $this->setScriptHandle(self::JS_HANDLE_CORE_BLOCKS); |
|
31 | - $this->setStyleHandle(self::CSS_HANDLE_CORE_BLOCKS); |
|
32 | - } |
|
23 | + /** |
|
24 | + * @since 4.9.71.p |
|
25 | + */ |
|
26 | + public function setAssetHandles() |
|
27 | + { |
|
28 | + $this->setEditorScriptHandle(self::JS_HANDLE_CORE_BLOCKS_EDITOR); |
|
29 | + $this->setEditorStyleHandle(self::CSS_HANDLE_CORE_BLOCKS_EDITOR); |
|
30 | + $this->setScriptHandle(self::JS_HANDLE_CORE_BLOCKS); |
|
31 | + $this->setStyleHandle(self::CSS_HANDLE_CORE_BLOCKS); |
|
32 | + } |
|
33 | 33 | } |
@@ -22,249 +22,249 @@ |
||
22 | 22 | abstract class BlockAssetManager extends AssetManager implements BlockAssetManagerInterface |
23 | 23 | { |
24 | 24 | |
25 | - /** |
|
26 | - * @var string $editor_script_handle |
|
27 | - */ |
|
28 | - private $editor_script_handle; |
|
29 | - |
|
30 | - /** |
|
31 | - * @var string $editor_style_handle |
|
32 | - */ |
|
33 | - private $editor_style_handle; |
|
34 | - |
|
35 | - /** |
|
36 | - * @var string $script_handle |
|
37 | - */ |
|
38 | - private $script_handle; |
|
39 | - |
|
40 | - /** |
|
41 | - * @var string $style_handle |
|
42 | - */ |
|
43 | - private $style_handle; |
|
44 | - |
|
45 | - |
|
46 | - /** |
|
47 | - * @return string |
|
48 | - */ |
|
49 | - public function getEditorScriptHandle() |
|
50 | - { |
|
51 | - return $this->editor_script_handle; |
|
52 | - } |
|
53 | - |
|
54 | - |
|
55 | - /** |
|
56 | - * @param string $editor_script_handle |
|
57 | - */ |
|
58 | - public function setEditorScriptHandle($editor_script_handle) |
|
59 | - { |
|
60 | - if(strpos($editor_script_handle, BlockInterface::NAME_SPACE . '-') !== 0) { |
|
61 | - $editor_script_handle = BlockInterface::NAME_SPACE . '-' . $editor_script_handle; |
|
62 | - } |
|
63 | - $this->editor_script_handle = $editor_script_handle; |
|
64 | - } |
|
65 | - |
|
66 | - |
|
67 | - /** |
|
68 | - * @return string |
|
69 | - */ |
|
70 | - public function getEditorStyleHandle() |
|
71 | - { |
|
72 | - return $this->editor_style_handle; |
|
73 | - } |
|
74 | - |
|
75 | - |
|
76 | - /** |
|
77 | - * @param string $editor_style_handle |
|
78 | - */ |
|
79 | - public function setEditorStyleHandle($editor_style_handle) |
|
80 | - { |
|
81 | - if (strpos($editor_style_handle, BlockInterface::NAME_SPACE . '-') !== 0) { |
|
82 | - $editor_style_handle = BlockInterface::NAME_SPACE . '-' . $editor_style_handle; |
|
83 | - } |
|
84 | - $this->editor_style_handle = $editor_style_handle; |
|
85 | - } |
|
86 | - |
|
87 | - |
|
88 | - /** |
|
89 | - * @return string |
|
90 | - */ |
|
91 | - public function getScriptHandle() |
|
92 | - { |
|
93 | - return $this->script_handle; |
|
94 | - } |
|
95 | - |
|
96 | - |
|
97 | - /** |
|
98 | - * @param string $script_handle |
|
99 | - */ |
|
100 | - public function setScriptHandle($script_handle) |
|
101 | - { |
|
102 | - if (strpos($script_handle, BlockInterface::NAME_SPACE . '-') !== 0) { |
|
103 | - $script_handle = BlockInterface::NAME_SPACE . '-' . $script_handle; |
|
104 | - } |
|
105 | - $this->script_handle = $script_handle; |
|
106 | - } |
|
107 | - |
|
108 | - |
|
109 | - /** |
|
110 | - * @return string |
|
111 | - */ |
|
112 | - public function getStyleHandle() |
|
113 | - { |
|
114 | - return $this->style_handle; |
|
115 | - } |
|
116 | - |
|
117 | - |
|
118 | - /** |
|
119 | - * @param string $style_handle |
|
120 | - */ |
|
121 | - public function setStyleHandle($style_handle) |
|
122 | - { |
|
123 | - if (strpos($style_handle, BlockInterface::NAME_SPACE . '-') !== 0) { |
|
124 | - $style_handle = BlockInterface::NAME_SPACE . '-' . $style_handle; |
|
125 | - } |
|
126 | - $this->style_handle = $style_handle; |
|
127 | - } |
|
128 | - |
|
129 | - /** |
|
130 | - * @since 4.9.71.p |
|
131 | - * @throws InvalidDataTypeException |
|
132 | - * @throws InvalidEntityException |
|
133 | - * @throws DuplicateCollectionIdentifierException |
|
134 | - */ |
|
135 | - public function addAssets() |
|
136 | - { |
|
137 | - $this->addEditorScript($this->getEditorScriptHandle()); |
|
138 | - $this->addEditorStyle($this->getEditorStyleHandle()); |
|
139 | - $this->addScript($this->getScriptHandle()); |
|
140 | - $this->addStyle($this->getStyleHandle()); |
|
141 | - } |
|
142 | - |
|
143 | - |
|
144 | - /** |
|
145 | - * @param $handle |
|
146 | - * @param array $dependencies |
|
147 | - * @since 4.9.71.p |
|
148 | - * @return JavascriptAsset |
|
149 | - * @throws InvalidDataTypeException |
|
150 | - * @throws InvalidEntityException |
|
151 | - * @throws DuplicateCollectionIdentifierException |
|
152 | - */ |
|
153 | - public function addEditorScript($handle, array $dependencies = array()) |
|
154 | - { |
|
155 | - if ($this->assets->hasJavascriptAsset($handle)){ |
|
156 | - return $this->assets->getJavascriptAsset($handle); |
|
157 | - } |
|
158 | - return $this->addJs($handle, $dependencies)->setRequiresTranslation(); |
|
159 | - } |
|
160 | - |
|
161 | - |
|
162 | - /** |
|
163 | - * @param $handle |
|
164 | - * @param array $dependencies |
|
165 | - * @since 4.9.71.p |
|
166 | - * @return StylesheetAsset |
|
167 | - * @throws InvalidDataTypeException |
|
168 | - * @throws InvalidEntityException |
|
169 | - * @throws DuplicateCollectionIdentifierException |
|
170 | - */ |
|
171 | - public function addEditorStyle($handle, array $dependencies = array()) |
|
172 | - { |
|
173 | - if ($this->assets->hasStylesheetAsset($handle)) { |
|
174 | - return $this->assets->getStylesheetAsset($handle); |
|
175 | - } |
|
176 | - return $this->addCss($handle, $dependencies); |
|
177 | - } |
|
178 | - |
|
179 | - |
|
180 | - /** |
|
181 | - * @param $handle |
|
182 | - * @param array $dependencies |
|
183 | - * @since 4.9.71.p |
|
184 | - * @return JavascriptAsset |
|
185 | - * @throws InvalidDataTypeException |
|
186 | - * @throws InvalidEntityException |
|
187 | - * @throws DuplicateCollectionIdentifierException |
|
188 | - */ |
|
189 | - public function addScript($handle, array $dependencies = array()) |
|
190 | - { |
|
191 | - if ($this->assets->hasJavascriptAsset($handle)) { |
|
192 | - return $this->assets->getJavascriptAsset($handle); |
|
193 | - } |
|
194 | - return $this->addJs($handle, $dependencies)->setRequiresTranslation(); |
|
195 | - } |
|
196 | - |
|
197 | - |
|
198 | - /** |
|
199 | - * @param $handle |
|
200 | - * @param array $dependencies |
|
201 | - * @since 4.9.71.p |
|
202 | - * @return StylesheetAsset |
|
203 | - * @throws InvalidDataTypeException |
|
204 | - * @throws InvalidEntityException |
|
205 | - * @throws DuplicateCollectionIdentifierException |
|
206 | - */ |
|
207 | - public function addStyle($handle, array $dependencies = array()) |
|
208 | - { |
|
209 | - if ($this->assets->hasStylesheetAsset($handle)) { |
|
210 | - return $this->assets->getStylesheetAsset($handle); |
|
211 | - } |
|
212 | - return $this->addCss($handle, $dependencies); |
|
213 | - } |
|
214 | - |
|
215 | - |
|
216 | - /** |
|
217 | - * @return JavascriptAsset|null |
|
218 | - */ |
|
219 | - public function getEditorScript() |
|
220 | - { |
|
221 | - return $this->assets->getJavascriptAsset($this->editor_script_handle); |
|
222 | - } |
|
223 | - |
|
224 | - |
|
225 | - /** |
|
226 | - * @return StylesheetAsset|null |
|
227 | - */ |
|
228 | - public function getEditorStyle() |
|
229 | - { |
|
230 | - return $this->assets->getStylesheetAsset($this->editor_style_handle); |
|
231 | - } |
|
232 | - |
|
233 | - |
|
234 | - /** |
|
235 | - * @return JavascriptAsset|null |
|
236 | - */ |
|
237 | - public function getScript() |
|
238 | - { |
|
239 | - return $this->assets->getJavascriptAsset($this->script_handle); |
|
240 | - } |
|
241 | - |
|
242 | - |
|
243 | - /** |
|
244 | - * @return StylesheetAsset|null |
|
245 | - */ |
|
246 | - public function getStyle() |
|
247 | - { |
|
248 | - return $this->assets->getStylesheetAsset($this->style_handle); |
|
249 | - } |
|
250 | - |
|
251 | - |
|
252 | - /** |
|
253 | - * @return void |
|
254 | - */ |
|
255 | - public function enqueueAssets() |
|
256 | - { |
|
257 | - $assets = array( |
|
258 | - $this->getEditorScript(), |
|
259 | - $this->getEditorStyle(), |
|
260 | - $this->getScript(), |
|
261 | - $this->getStyle(), |
|
262 | - ); |
|
263 | - foreach ($assets as $asset) { |
|
264 | - if ($asset instanceof BrowserAsset && $asset->isRegistered()) { |
|
265 | - $asset->enqueueAsset(); |
|
266 | - } |
|
267 | - } |
|
268 | - } |
|
25 | + /** |
|
26 | + * @var string $editor_script_handle |
|
27 | + */ |
|
28 | + private $editor_script_handle; |
|
29 | + |
|
30 | + /** |
|
31 | + * @var string $editor_style_handle |
|
32 | + */ |
|
33 | + private $editor_style_handle; |
|
34 | + |
|
35 | + /** |
|
36 | + * @var string $script_handle |
|
37 | + */ |
|
38 | + private $script_handle; |
|
39 | + |
|
40 | + /** |
|
41 | + * @var string $style_handle |
|
42 | + */ |
|
43 | + private $style_handle; |
|
44 | + |
|
45 | + |
|
46 | + /** |
|
47 | + * @return string |
|
48 | + */ |
|
49 | + public function getEditorScriptHandle() |
|
50 | + { |
|
51 | + return $this->editor_script_handle; |
|
52 | + } |
|
53 | + |
|
54 | + |
|
55 | + /** |
|
56 | + * @param string $editor_script_handle |
|
57 | + */ |
|
58 | + public function setEditorScriptHandle($editor_script_handle) |
|
59 | + { |
|
60 | + if(strpos($editor_script_handle, BlockInterface::NAME_SPACE . '-') !== 0) { |
|
61 | + $editor_script_handle = BlockInterface::NAME_SPACE . '-' . $editor_script_handle; |
|
62 | + } |
|
63 | + $this->editor_script_handle = $editor_script_handle; |
|
64 | + } |
|
65 | + |
|
66 | + |
|
67 | + /** |
|
68 | + * @return string |
|
69 | + */ |
|
70 | + public function getEditorStyleHandle() |
|
71 | + { |
|
72 | + return $this->editor_style_handle; |
|
73 | + } |
|
74 | + |
|
75 | + |
|
76 | + /** |
|
77 | + * @param string $editor_style_handle |
|
78 | + */ |
|
79 | + public function setEditorStyleHandle($editor_style_handle) |
|
80 | + { |
|
81 | + if (strpos($editor_style_handle, BlockInterface::NAME_SPACE . '-') !== 0) { |
|
82 | + $editor_style_handle = BlockInterface::NAME_SPACE . '-' . $editor_style_handle; |
|
83 | + } |
|
84 | + $this->editor_style_handle = $editor_style_handle; |
|
85 | + } |
|
86 | + |
|
87 | + |
|
88 | + /** |
|
89 | + * @return string |
|
90 | + */ |
|
91 | + public function getScriptHandle() |
|
92 | + { |
|
93 | + return $this->script_handle; |
|
94 | + } |
|
95 | + |
|
96 | + |
|
97 | + /** |
|
98 | + * @param string $script_handle |
|
99 | + */ |
|
100 | + public function setScriptHandle($script_handle) |
|
101 | + { |
|
102 | + if (strpos($script_handle, BlockInterface::NAME_SPACE . '-') !== 0) { |
|
103 | + $script_handle = BlockInterface::NAME_SPACE . '-' . $script_handle; |
|
104 | + } |
|
105 | + $this->script_handle = $script_handle; |
|
106 | + } |
|
107 | + |
|
108 | + |
|
109 | + /** |
|
110 | + * @return string |
|
111 | + */ |
|
112 | + public function getStyleHandle() |
|
113 | + { |
|
114 | + return $this->style_handle; |
|
115 | + } |
|
116 | + |
|
117 | + |
|
118 | + /** |
|
119 | + * @param string $style_handle |
|
120 | + */ |
|
121 | + public function setStyleHandle($style_handle) |
|
122 | + { |
|
123 | + if (strpos($style_handle, BlockInterface::NAME_SPACE . '-') !== 0) { |
|
124 | + $style_handle = BlockInterface::NAME_SPACE . '-' . $style_handle; |
|
125 | + } |
|
126 | + $this->style_handle = $style_handle; |
|
127 | + } |
|
128 | + |
|
129 | + /** |
|
130 | + * @since 4.9.71.p |
|
131 | + * @throws InvalidDataTypeException |
|
132 | + * @throws InvalidEntityException |
|
133 | + * @throws DuplicateCollectionIdentifierException |
|
134 | + */ |
|
135 | + public function addAssets() |
|
136 | + { |
|
137 | + $this->addEditorScript($this->getEditorScriptHandle()); |
|
138 | + $this->addEditorStyle($this->getEditorStyleHandle()); |
|
139 | + $this->addScript($this->getScriptHandle()); |
|
140 | + $this->addStyle($this->getStyleHandle()); |
|
141 | + } |
|
142 | + |
|
143 | + |
|
144 | + /** |
|
145 | + * @param $handle |
|
146 | + * @param array $dependencies |
|
147 | + * @since 4.9.71.p |
|
148 | + * @return JavascriptAsset |
|
149 | + * @throws InvalidDataTypeException |
|
150 | + * @throws InvalidEntityException |
|
151 | + * @throws DuplicateCollectionIdentifierException |
|
152 | + */ |
|
153 | + public function addEditorScript($handle, array $dependencies = array()) |
|
154 | + { |
|
155 | + if ($this->assets->hasJavascriptAsset($handle)){ |
|
156 | + return $this->assets->getJavascriptAsset($handle); |
|
157 | + } |
|
158 | + return $this->addJs($handle, $dependencies)->setRequiresTranslation(); |
|
159 | + } |
|
160 | + |
|
161 | + |
|
162 | + /** |
|
163 | + * @param $handle |
|
164 | + * @param array $dependencies |
|
165 | + * @since 4.9.71.p |
|
166 | + * @return StylesheetAsset |
|
167 | + * @throws InvalidDataTypeException |
|
168 | + * @throws InvalidEntityException |
|
169 | + * @throws DuplicateCollectionIdentifierException |
|
170 | + */ |
|
171 | + public function addEditorStyle($handle, array $dependencies = array()) |
|
172 | + { |
|
173 | + if ($this->assets->hasStylesheetAsset($handle)) { |
|
174 | + return $this->assets->getStylesheetAsset($handle); |
|
175 | + } |
|
176 | + return $this->addCss($handle, $dependencies); |
|
177 | + } |
|
178 | + |
|
179 | + |
|
180 | + /** |
|
181 | + * @param $handle |
|
182 | + * @param array $dependencies |
|
183 | + * @since 4.9.71.p |
|
184 | + * @return JavascriptAsset |
|
185 | + * @throws InvalidDataTypeException |
|
186 | + * @throws InvalidEntityException |
|
187 | + * @throws DuplicateCollectionIdentifierException |
|
188 | + */ |
|
189 | + public function addScript($handle, array $dependencies = array()) |
|
190 | + { |
|
191 | + if ($this->assets->hasJavascriptAsset($handle)) { |
|
192 | + return $this->assets->getJavascriptAsset($handle); |
|
193 | + } |
|
194 | + return $this->addJs($handle, $dependencies)->setRequiresTranslation(); |
|
195 | + } |
|
196 | + |
|
197 | + |
|
198 | + /** |
|
199 | + * @param $handle |
|
200 | + * @param array $dependencies |
|
201 | + * @since 4.9.71.p |
|
202 | + * @return StylesheetAsset |
|
203 | + * @throws InvalidDataTypeException |
|
204 | + * @throws InvalidEntityException |
|
205 | + * @throws DuplicateCollectionIdentifierException |
|
206 | + */ |
|
207 | + public function addStyle($handle, array $dependencies = array()) |
|
208 | + { |
|
209 | + if ($this->assets->hasStylesheetAsset($handle)) { |
|
210 | + return $this->assets->getStylesheetAsset($handle); |
|
211 | + } |
|
212 | + return $this->addCss($handle, $dependencies); |
|
213 | + } |
|
214 | + |
|
215 | + |
|
216 | + /** |
|
217 | + * @return JavascriptAsset|null |
|
218 | + */ |
|
219 | + public function getEditorScript() |
|
220 | + { |
|
221 | + return $this->assets->getJavascriptAsset($this->editor_script_handle); |
|
222 | + } |
|
223 | + |
|
224 | + |
|
225 | + /** |
|
226 | + * @return StylesheetAsset|null |
|
227 | + */ |
|
228 | + public function getEditorStyle() |
|
229 | + { |
|
230 | + return $this->assets->getStylesheetAsset($this->editor_style_handle); |
|
231 | + } |
|
232 | + |
|
233 | + |
|
234 | + /** |
|
235 | + * @return JavascriptAsset|null |
|
236 | + */ |
|
237 | + public function getScript() |
|
238 | + { |
|
239 | + return $this->assets->getJavascriptAsset($this->script_handle); |
|
240 | + } |
|
241 | + |
|
242 | + |
|
243 | + /** |
|
244 | + * @return StylesheetAsset|null |
|
245 | + */ |
|
246 | + public function getStyle() |
|
247 | + { |
|
248 | + return $this->assets->getStylesheetAsset($this->style_handle); |
|
249 | + } |
|
250 | + |
|
251 | + |
|
252 | + /** |
|
253 | + * @return void |
|
254 | + */ |
|
255 | + public function enqueueAssets() |
|
256 | + { |
|
257 | + $assets = array( |
|
258 | + $this->getEditorScript(), |
|
259 | + $this->getEditorStyle(), |
|
260 | + $this->getScript(), |
|
261 | + $this->getStyle(), |
|
262 | + ); |
|
263 | + foreach ($assets as $asset) { |
|
264 | + if ($asset instanceof BrowserAsset && $asset->isRegistered()) { |
|
265 | + $asset->enqueueAsset(); |
|
266 | + } |
|
267 | + } |
|
268 | + } |
|
269 | 269 | |
270 | 270 | } |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function setEditorScriptHandle($editor_script_handle) |
59 | 59 | { |
60 | - if(strpos($editor_script_handle, BlockInterface::NAME_SPACE . '-') !== 0) { |
|
61 | - $editor_script_handle = BlockInterface::NAME_SPACE . '-' . $editor_script_handle; |
|
60 | + if (strpos($editor_script_handle, BlockInterface::NAME_SPACE.'-') !== 0) { |
|
61 | + $editor_script_handle = BlockInterface::NAME_SPACE.'-'.$editor_script_handle; |
|
62 | 62 | } |
63 | 63 | $this->editor_script_handle = $editor_script_handle; |
64 | 64 | } |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function setEditorStyleHandle($editor_style_handle) |
80 | 80 | { |
81 | - if (strpos($editor_style_handle, BlockInterface::NAME_SPACE . '-') !== 0) { |
|
82 | - $editor_style_handle = BlockInterface::NAME_SPACE . '-' . $editor_style_handle; |
|
81 | + if (strpos($editor_style_handle, BlockInterface::NAME_SPACE.'-') !== 0) { |
|
82 | + $editor_style_handle = BlockInterface::NAME_SPACE.'-'.$editor_style_handle; |
|
83 | 83 | } |
84 | 84 | $this->editor_style_handle = $editor_style_handle; |
85 | 85 | } |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function setScriptHandle($script_handle) |
101 | 101 | { |
102 | - if (strpos($script_handle, BlockInterface::NAME_SPACE . '-') !== 0) { |
|
103 | - $script_handle = BlockInterface::NAME_SPACE . '-' . $script_handle; |
|
102 | + if (strpos($script_handle, BlockInterface::NAME_SPACE.'-') !== 0) { |
|
103 | + $script_handle = BlockInterface::NAME_SPACE.'-'.$script_handle; |
|
104 | 104 | } |
105 | 105 | $this->script_handle = $script_handle; |
106 | 106 | } |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function setStyleHandle($style_handle) |
122 | 122 | { |
123 | - if (strpos($style_handle, BlockInterface::NAME_SPACE . '-') !== 0) { |
|
124 | - $style_handle = BlockInterface::NAME_SPACE . '-' . $style_handle; |
|
123 | + if (strpos($style_handle, BlockInterface::NAME_SPACE.'-') !== 0) { |
|
124 | + $style_handle = BlockInterface::NAME_SPACE.'-'.$style_handle; |
|
125 | 125 | } |
126 | 126 | $this->style_handle = $style_handle; |
127 | 127 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function addEditorScript($handle, array $dependencies = array()) |
154 | 154 | { |
155 | - if ($this->assets->hasJavascriptAsset($handle)){ |
|
155 | + if ($this->assets->hasJavascriptAsset($handle)) { |
|
156 | 156 | return $this->assets->getJavascriptAsset($handle); |
157 | 157 | } |
158 | 158 | return $this->addJs($handle, $dependencies)->setRequiresTranslation(); |
@@ -7,39 +7,39 @@ discard block |
||
7 | 7 | if ($display_ticket_price) { ?> |
8 | 8 | <section class="tckt-slctr-tkt-price-sctn"> |
9 | 9 | <h5><?php |
10 | - echo apply_filters( |
|
11 | - 'FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', |
|
12 | - esc_html__('Price', 'event_espresso') |
|
13 | - ); ?></h5> |
|
10 | + echo apply_filters( |
|
11 | + 'FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', |
|
12 | + esc_html__('Price', 'event_espresso') |
|
13 | + ); ?></h5> |
|
14 | 14 | <div class="tckt-slctr-tkt-details-tbl-wrap-dv"> |
15 | 15 | <table class="tckt-slctr-tkt-details-tbl"> |
16 | 16 | <thead> |
17 | 17 | <tr> |
18 | 18 | <th class="ee-third-width"><span class="small-text"> |
19 | 19 | <?php |
20 | - esc_html_e( |
|
21 | - 'Name', |
|
22 | - 'event_espresso' |
|
23 | - ); ?></span> |
|
20 | + esc_html_e( |
|
21 | + 'Name', |
|
22 | + 'event_espresso' |
|
23 | + ); ?></span> |
|
24 | 24 | </th> |
25 | 25 | <th class="jst-cntr"><span class="small-text"> |
26 | 26 | <?php |
27 | - esc_html_e( |
|
28 | - 'Description', |
|
29 | - 'event_espresso' |
|
30 | - ); ?></span> |
|
27 | + esc_html_e( |
|
28 | + 'Description', |
|
29 | + 'event_espresso' |
|
30 | + ); ?></span> |
|
31 | 31 | </th> |
32 | 32 | <th class="ee-fourth-width jst-rght"><span class="small-text"> |
33 | 33 | <?php |
34 | - esc_html_e( |
|
35 | - 'Amount', |
|
36 | - 'event_espresso' |
|
37 | - ); ?></span></th> |
|
34 | + esc_html_e( |
|
35 | + 'Amount', |
|
36 | + 'event_espresso' |
|
37 | + ); ?></span></th> |
|
38 | 38 | </tr> |
39 | 39 | </thead> |
40 | 40 | <tbody> |
41 | 41 | <?php |
42 | - if ($ticket->base_price() instanceof EE_Price) { ?> |
|
42 | + if ($ticket->base_price() instanceof EE_Price) { ?> |
|
43 | 43 | <tr> |
44 | 44 | <td data-th="<?php esc_html_e('Name', 'event_espresso'); ?>" class="small-text" colspan="2"> |
45 | 45 | <b><?php echo $ticket->base_price()->name(); ?></b></td> |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | class="jst-rght small-text"><?php echo $ticket->base_price()->pretty_price(); ?></td> |
48 | 48 | </tr> |
49 | 49 | <?php |
50 | - $running_total = $ticket->base_price()->amount(); |
|
51 | - } else { |
|
52 | - $running_total = 0; |
|
53 | - } |
|
54 | - // now add price modifiers |
|
55 | - foreach ($ticket->price_modifiers() as $price_mod) { ?> |
|
50 | + $running_total = $ticket->base_price()->amount(); |
|
51 | + } else { |
|
52 | + $running_total = 0; |
|
53 | + } |
|
54 | + // now add price modifiers |
|
55 | + foreach ($ticket->price_modifiers() as $price_mod) { ?> |
|
56 | 56 | <tr> |
57 | 57 | <td data-th="<?php esc_html_e('Name', 'event_espresso'); ?>" |
58 | 58 | class="jst-rght small-text"><?php echo $price_mod->name(); ?></td> |
@@ -62,23 +62,23 @@ discard block |
||
62 | 62 | % |
63 | 63 | </td> |
64 | 64 | <?php |
65 | - $new_sub_total = $running_total * ($price_mod->amount() / 100); |
|
66 | - $new_sub_total = $price_mod->is_discount() ? $new_sub_total * -1 : $new_sub_total; |
|
67 | - ?> |
|
65 | + $new_sub_total = $running_total * ($price_mod->amount() / 100); |
|
66 | + $new_sub_total = $price_mod->is_discount() ? $new_sub_total * -1 : $new_sub_total; |
|
67 | + ?> |
|
68 | 68 | <?php } else { ?> |
69 | 69 | <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1 |
70 | - : $price_mod->amount(); ?> |
|
70 | + : $price_mod->amount(); ?> |
|
71 | 71 | <td data-th="<?php esc_html_e('Description', 'event_espresso'); ?>" |
72 | 72 | class="small-text"><?php echo $price_mod->desc(); ?></td> |
73 | 73 | <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1 |
74 | - : $price_mod->amount(); ?> |
|
74 | + : $price_mod->amount(); ?> |
|
75 | 75 | <?php } ?> |
76 | 76 | <td data-th="<?php esc_html_e('Amount', 'event_espresso'); ?>" |
77 | 77 | class="jst-rght small-text"> |
78 | 78 | <?php |
79 | - echo EEH_Template::format_currency( |
|
80 | - $new_sub_total |
|
81 | - ); ?></td> |
|
79 | + echo EEH_Template::format_currency( |
|
80 | + $new_sub_total |
|
81 | + ); ?></td> |
|
82 | 82 | <?php $running_total += $new_sub_total; ?> |
83 | 83 | </tr> |
84 | 84 | <?php } ?> |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | <tr> |
88 | 88 | <td colspan="2" class="jst-rght small-text sbttl"><b> |
89 | 89 | <?php |
90 | - esc_html_e( |
|
91 | - 'subtotal', |
|
92 | - 'event_espresso' |
|
93 | - ); ?></b></td> |
|
90 | + esc_html_e( |
|
91 | + 'subtotal', |
|
92 | + 'event_espresso' |
|
93 | + ); ?></b></td> |
|
94 | 94 | <td data-th="<?php esc_html_e('subtotal', 'event_espresso'); ?>" class="jst-rght small-text"> |
95 | 95 | <b><?php echo EEH_Template::format_currency($running_total); ?></b></td> |
96 | 96 | </tr> |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | <td data-th="<?php esc_html_e('Amount', 'event_espresso'); ?>" |
107 | 107 | class="jst-rght small-text"> |
108 | 108 | <?php |
109 | - echo EEH_Template::format_currency( |
|
110 | - $tax_amount |
|
111 | - ); ?></td> |
|
109 | + echo EEH_Template::format_currency( |
|
110 | + $tax_amount |
|
111 | + ); ?></td> |
|
112 | 112 | <?php $running_total += $tax_amount; ?> |
113 | 113 | </tr> |
114 | 114 | <?php } ?> |
@@ -116,15 +116,15 @@ discard block |
||
116 | 116 | <tr> |
117 | 117 | <td colspan="2" class="jst-rght small-text ttl-lbl-td"> |
118 | 118 | <b><?php |
119 | - echo apply_filters( |
|
120 | - 'FHEE__ticket_selector_chart_template__ticket_details_total_price', |
|
121 | - esc_html__('Total', 'event_espresso') |
|
122 | - ); ?></b></td> |
|
119 | + echo apply_filters( |
|
120 | + 'FHEE__ticket_selector_chart_template__ticket_details_total_price', |
|
121 | + esc_html__('Total', 'event_espresso') |
|
122 | + ); ?></b></td> |
|
123 | 123 | <td data-th="<?php |
124 | - echo apply_filters( |
|
125 | - 'FHEE__ticket_selector_chart_template__ticket_details_total_price', |
|
126 | - esc_html__('Total', 'event_espresso') |
|
127 | - ); ?>" class="jst-rght small-text"> |
|
124 | + echo apply_filters( |
|
125 | + 'FHEE__ticket_selector_chart_template__ticket_details_total_price', |
|
126 | + esc_html__('Total', 'event_espresso') |
|
127 | + ); ?>" class="jst-rght small-text"> |
|
128 | 128 | <b><?php echo EEH_Template::format_currency($running_total); ?></b></td> |
129 | 129 | </tr> |
130 | 130 | </tbody> |