Completed
Branch BUG/default-css (a9f588)
by
unknown
16:44 queued 08:58
created
espresso.php 1 patch
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -38,103 +38,103 @@
 block discarded – undo
38 38
  * @since           4.0
39 39
  */
40 40
 if (function_exists('espresso_version')) {
41
-    if (! function_exists('espresso_duplicate_plugin_error')) {
42
-        /**
43
-         *    espresso_duplicate_plugin_error
44
-         *    displays if more than one version of EE is activated at the same time
45
-         */
46
-        function espresso_duplicate_plugin_error()
47
-        {
48
-            ?>
41
+	if (! function_exists('espresso_duplicate_plugin_error')) {
42
+		/**
43
+		 *    espresso_duplicate_plugin_error
44
+		 *    displays if more than one version of EE is activated at the same time
45
+		 */
46
+		function espresso_duplicate_plugin_error()
47
+		{
48
+			?>
49 49
             <div class="error">
50 50
                 <p>
51 51
                     <?php
52
-                    echo esc_html__(
53
-                        'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
-                        'event_espresso'
55
-                    ); ?>
52
+					echo esc_html__(
53
+						'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
+						'event_espresso'
55
+					); ?>
56 56
                 </p>
57 57
             </div>
58 58
             <?php
59
-            espresso_deactivate_plugin(plugin_basename(__FILE__));
60
-        }
61
-    }
62
-    add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
59
+			espresso_deactivate_plugin(plugin_basename(__FILE__));
60
+		}
61
+	}
62
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
63 63
 } else {
64
-    define('EE_MIN_PHP_VER_REQUIRED', '5.4.0');
65
-    if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
-        /**
67
-         * espresso_minimum_php_version_error
68
-         *
69
-         * @return void
70
-         */
71
-        function espresso_minimum_php_version_error()
72
-        {
73
-            ?>
64
+	define('EE_MIN_PHP_VER_REQUIRED', '5.4.0');
65
+	if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
+		/**
67
+		 * espresso_minimum_php_version_error
68
+		 *
69
+		 * @return void
70
+		 */
71
+		function espresso_minimum_php_version_error()
72
+		{
73
+			?>
74 74
             <div class="error">
75 75
                 <p>
76 76
                     <?php
77
-                    printf(
78
-                        esc_html__(
79
-                            'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
-                            'event_espresso'
81
-                        ),
82
-                        EE_MIN_PHP_VER_REQUIRED,
83
-                        PHP_VERSION,
84
-                        '<br/>',
85
-                        '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
-                    );
87
-                    ?>
77
+					printf(
78
+						esc_html__(
79
+							'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
+							'event_espresso'
81
+						),
82
+						EE_MIN_PHP_VER_REQUIRED,
83
+						PHP_VERSION,
84
+						'<br/>',
85
+						'<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
+					);
87
+					?>
88 88
                 </p>
89 89
             </div>
90 90
             <?php
91
-            espresso_deactivate_plugin(plugin_basename(__FILE__));
92
-        }
91
+			espresso_deactivate_plugin(plugin_basename(__FILE__));
92
+		}
93 93
 
94
-        add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
-    } else {
96
-        define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
97
-        /**
98
-         * espresso_version
99
-         * Returns the plugin version
100
-         *
101
-         * @return string
102
-         */
103
-        function espresso_version()
104
-        {
105
-            return apply_filters('FHEE__espresso__espresso_version', '4.10.7.rc.004');
106
-        }
94
+		add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
+	} else {
96
+		define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
97
+		/**
98
+		 * espresso_version
99
+		 * Returns the plugin version
100
+		 *
101
+		 * @return string
102
+		 */
103
+		function espresso_version()
104
+		{
105
+			return apply_filters('FHEE__espresso__espresso_version', '4.10.7.rc.004');
106
+		}
107 107
 
108
-        /**
109
-         * espresso_plugin_activation
110
-         * adds a wp-option to indicate that EE has been activated via the WP admin plugins page
111
-         */
112
-        function espresso_plugin_activation()
113
-        {
114
-            update_option('ee_espresso_activation', true);
115
-        }
108
+		/**
109
+		 * espresso_plugin_activation
110
+		 * adds a wp-option to indicate that EE has been activated via the WP admin plugins page
111
+		 */
112
+		function espresso_plugin_activation()
113
+		{
114
+			update_option('ee_espresso_activation', true);
115
+		}
116 116
 
117
-        register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
117
+		register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
118 118
 
119
-        require_once __DIR__ . '/core/bootstrap_espresso.php';
120
-        bootstrap_espresso();
121
-    }
119
+		require_once __DIR__ . '/core/bootstrap_espresso.php';
120
+		bootstrap_espresso();
121
+	}
122 122
 }
123 123
 if (! function_exists('espresso_deactivate_plugin')) {
124
-    /**
125
-     *    deactivate_plugin
126
-     * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
127
-     *
128
-     * @access public
129
-     * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
130
-     * @return    void
131
-     */
132
-    function espresso_deactivate_plugin($plugin_basename = '')
133
-    {
134
-        if (! function_exists('deactivate_plugins')) {
135
-            require_once ABSPATH . 'wp-admin/includes/plugin.php';
136
-        }
137
-        unset($_GET['activate'], $_REQUEST['activate']);
138
-        deactivate_plugins($plugin_basename);
139
-    }
124
+	/**
125
+	 *    deactivate_plugin
126
+	 * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
127
+	 *
128
+	 * @access public
129
+	 * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
130
+	 * @return    void
131
+	 */
132
+	function espresso_deactivate_plugin($plugin_basename = '')
133
+	{
134
+		if (! function_exists('deactivate_plugins')) {
135
+			require_once ABSPATH . 'wp-admin/includes/plugin.php';
136
+		}
137
+		unset($_GET['activate'], $_REQUEST['activate']);
138
+		deactivate_plugins($plugin_basename);
139
+	}
140 140
 }
Please login to merge, or discard this patch.
core/domain/services/assets/CoreAssetManager.php 2 patches
Indentation   +438 added lines, -438 removed lines patch added patch discarded remove patch
@@ -32,461 +32,461 @@
 block discarded – undo
32 32
 class CoreAssetManager extends AssetManager
33 33
 {
34 34
 
35
-    // WordPress core / Third party JS asset handles
36
-    const JS_HANDLE_JQUERY = 'jquery';
35
+	// WordPress core / Third party JS asset handles
36
+	const JS_HANDLE_JQUERY = 'jquery';
37 37
 
38
-    const JS_HANDLE_JQUERY_VALIDATE = 'jquery-validate';
38
+	const JS_HANDLE_JQUERY_VALIDATE = 'jquery-validate';
39 39
 
40
-    const JS_HANDLE_JQUERY_VALIDATE_EXTRA = 'jquery-validate-extra-methods';
40
+	const JS_HANDLE_JQUERY_VALIDATE_EXTRA = 'jquery-validate-extra-methods';
41 41
 
42
-    const JS_HANDLE_UNDERSCORE = 'underscore';
42
+	const JS_HANDLE_UNDERSCORE = 'underscore';
43 43
 
44
-    const JS_HANDLE_ACCOUNTING_CORE = 'ee-accounting-core';
44
+	const JS_HANDLE_ACCOUNTING_CORE = 'ee-accounting-core';
45 45
 
46
-    /**
47
-     * @since 4.9.71.p
48
-     */
49
-    const JS_HANDLE_REACT = 'react';
46
+	/**
47
+	 * @since 4.9.71.p
48
+	 */
49
+	const JS_HANDLE_REACT = 'react';
50 50
 
51
-    /**
52
-     * @since 4.9.71.p
53
-     */
54
-    const JS_HANDLE_REACT_DOM = 'react-dom';
51
+	/**
52
+	 * @since 4.9.71.p
53
+	 */
54
+	const JS_HANDLE_REACT_DOM = 'react-dom';
55 55
 
56
-    /**
57
-     * @since 4.9.71.p
58
-     */
59
-    const JS_HANDLE_LODASH = 'lodash';
56
+	/**
57
+	 * @since 4.9.71.p
58
+	 */
59
+	const JS_HANDLE_LODASH = 'lodash';
60 60
 
61
-    const JS_HANDLE_JS_CORE = 'eejs-core';
61
+	const JS_HANDLE_JS_CORE = 'eejs-core';
62 62
 
63
-    const JS_HANDLE_VENDOR = 'eventespresso-vendor';
63
+	const JS_HANDLE_VENDOR = 'eventespresso-vendor';
64 64
 
65
-    const JS_HANDLE_DATA_STORES = 'eventespresso-data-stores';
65
+	const JS_HANDLE_DATA_STORES = 'eventespresso-data-stores';
66 66
 
67
-    const JS_HANDLE_HELPERS = 'eventespresso-helpers';
67
+	const JS_HANDLE_HELPERS = 'eventespresso-helpers';
68 68
 
69
-    const JS_HANDLE_MODEL = 'eventespresso-model';
69
+	const JS_HANDLE_MODEL = 'eventespresso-model';
70 70
 
71
-    const JS_HANDLE_VALUE_OBJECTS = 'eventespresso-value-objects';
71
+	const JS_HANDLE_VALUE_OBJECTS = 'eventespresso-value-objects';
72 72
 
73
-    const JS_HANDLE_HOCS = 'eventespresso-hocs';
73
+	const JS_HANDLE_HOCS = 'eventespresso-hocs';
74 74
 
75
-    const JS_HANDLE_COMPONENTS = 'eventespresso-components';
75
+	const JS_HANDLE_COMPONENTS = 'eventespresso-components';
76 76
 
77
-    const JS_HANDLE_EDITOR_HOCS = 'eventespresso-editor-hocs';
78
-
79
-    const JS_HANDLE_VALIDATORS = 'eventespresso-validators';
77
+	const JS_HANDLE_EDITOR_HOCS = 'eventespresso-editor-hocs';
78
+
79
+	const JS_HANDLE_VALIDATORS = 'eventespresso-validators';
80 80
 
81
-    const JS_HANDLE_CORE = 'espresso_core';
81
+	const JS_HANDLE_CORE = 'espresso_core';
82 82
 
83
-    const JS_HANDLE_I18N = 'eei18n';
83
+	const JS_HANDLE_I18N = 'eei18n';
84 84
 
85
-    const JS_HANDLE_ACCOUNTING = 'ee-accounting';
86
-
87
-    const JS_HANDLE_WP_PLUGINS_PAGE = 'ee-wp-plugins-page';
88
-
89
-    // EE CSS assets handles
90
-    const CSS_HANDLE_DEFAULT = 'espresso_default';
91
-
92
-    const CSS_HANDLE_CUSTOM = 'espresso_custom_css';
93
-
94
-    const CSS_HANDLE_COMPONENTS = 'eventespresso-components';
95
-
96
-    const CSS_HANDLE_CORE_CSS_DEFAULT = 'eventespresso-core-css-default';
97
-
98
-    /**
99
-     * @var EE_Currency_Config $currency_config
100
-     */
101
-    protected $currency_config;
102
-
103
-    /**
104
-     * @var EE_Template_Config $template_config
105
-     */
106
-    protected $template_config;
107
-
108
-
109
-    /**
110
-     * CoreAssetRegister constructor.
111
-     *
112
-     * @param AssetCollection    $assets
113
-     * @param EE_Currency_Config $currency_config
114
-     * @param EE_Template_Config $template_config
115
-     * @param DomainInterface    $domain
116
-     * @param Registry           $registry
117
-     */
118
-    public function __construct(
119
-        AssetCollection $assets,
120
-        EE_Currency_Config $currency_config,
121
-        EE_Template_Config $template_config,
122
-        DomainInterface $domain,
123
-        Registry $registry
124
-    ) {
125
-        $this->currency_config = $currency_config;
126
-        $this->template_config = $template_config;
127
-        parent::__construct($domain, $assets, $registry);
128
-    }
129
-
130
-
131
-    /**
132
-     * @since 4.9.62.p
133
-     * @throws DomainException
134
-     * @throws DuplicateCollectionIdentifierException
135
-     * @throws InvalidArgumentException
136
-     * @throws InvalidDataTypeException
137
-     * @throws InvalidEntityException
138
-     * @throws InvalidInterfaceException
139
-     */
140
-    public function addAssets()
141
-    {
142
-        $this->addJavascriptFiles();
143
-        $this->addStylesheetFiles();
144
-    }
145
-
146
-
147
-    /**
148
-     * @since 4.9.62.p
149
-     * @throws DomainException
150
-     * @throws DuplicateCollectionIdentifierException
151
-     * @throws InvalidArgumentException
152
-     * @throws InvalidDataTypeException
153
-     * @throws InvalidEntityException
154
-     * @throws InvalidInterfaceException
155
-     */
156
-    public function addJavascriptFiles()
157
-    {
158
-        $this->loadCoreJs();
159
-        $this->loadJqueryValidate();
160
-        $this->loadAccountingJs();
161
-        add_action(
162
-            'AHEE__EventEspresso_core_services_assets_Registry__registerScripts__before_script',
163
-            array($this, 'loadQtipJs')
164
-        );
165
-        $this->registerAdminAssets();
166
-    }
167
-
168
-
169
-    /**
170
-     * @throws DuplicateCollectionIdentifierException
171
-     * @throws InvalidDataTypeException
172
-     * @throws InvalidEntityException
173
-     * @throws DomainException
174
-     * @since 4.9.62.p
175
-     */
176
-    public function addStylesheetFiles()
177
-    {
178
-        $this->loadCoreCss();
179
-    }
180
-
181
-
182
-    /**
183
-     * core default javascript
184
-     *
185
-     * @since 4.9.62.p
186
-     * @throws DomainException
187
-     * @throws DuplicateCollectionIdentifierException
188
-     * @throws InvalidArgumentException
189
-     * @throws InvalidDataTypeException
190
-     * @throws InvalidEntityException
191
-     * @throws InvalidInterfaceException
192
-     */
193
-    private function loadCoreJs()
194
-    {
195
-        // conditionally load third-party libraries that WP core MIGHT have.
196
-        $this->registerWpAssets();
197
-
198
-        $this->addJs(self::JS_HANDLE_JS_CORE)->setHasInlineData();
199
-        $this->addJs(self::JS_HANDLE_VENDOR);
200
-        $this->addJs(self::JS_HANDLE_VALIDATORS)->setRequiresTranslation();
201
-        $this->addJs(self::JS_HANDLE_HELPERS)->setRequiresTranslation();
202
-        $this->addJs(self::JS_HANDLE_MODEL)->setRequiresTranslation();
203
-        $this->addJs(self::JS_HANDLE_VALUE_OBJECTS)->setRequiresTranslation();
204
-        $this->addJs(self::JS_HANDLE_DATA_STORES)->setRequiresTranslation()->setInlineDataCallback(
205
-            static function () {
206
-                wp_add_inline_script(
207
-                    CoreAssetManager::JS_HANDLE_DATA_STORES,
208
-                    is_admin()
209
-                        ? 'wp.apiFetch.use( eejs.middleWares.apiFetch.capsMiddleware( eejs.middleWares.apiFetch.CONTEXT_CAPS_EDIT ) )'
210
-                        : 'wp.apiFetch.use( eejs.middleWares.apiFetch.capsMiddleware )'
211
-                );
212
-            }
213
-        );
214
-        $this->addJs(self::JS_HANDLE_HOCS, [self::JS_HANDLE_DATA_STORES])->setRequiresTranslation();
215
-        $this->addJs(self::JS_HANDLE_COMPONENTS, [self::JS_HANDLE_DATA_STORES])->setRequiresTranslation();
216
-        $this->addJs(self::JS_HANDLE_EDITOR_HOCS)->setRequiresTranslation();
217
-
218
-        $this->registry->addData('eejs_api_nonce', wp_create_nonce('wp_rest'));
219
-        $this->registry->addData(
220
-            'paths',
221
-            array(
222
-                'base_rest_route' => rest_url(),
223
-                'rest_route' => rest_url('ee/v4.8.36/'),
224
-                'collection_endpoints' => EED_Core_Rest_Api::getCollectionRoutesIndexedByModelName(),
225
-                'primary_keys' => EED_Core_Rest_Api::getPrimaryKeyNamesIndexedByModelName(),
226
-                'site_url' => site_url('/'),
227
-                'admin_url' => admin_url('/'),
228
-            )
229
-        );
230
-        // Event Espresso brand name
231
-        $this->registry->addData('brandName', Domain::brandName());
232
-        /** site formatting values **/
233
-        $this->registry->addData(
234
-            'site_formats',
235
-            array(
236
-                'date_formats' => EEH_DTT_Helper::convert_php_to_js_and_moment_date_formats()
237
-            )
238
-        );
239
-        /** currency data **/
240
-        $this->registry->addData(
241
-            'currency_config',
242
-            $this->getCurrencySettings()
243
-        );
244
-        /** site timezone */
245
-        $this->registry->addData(
246
-            'default_timezone',
247
-            array(
248
-                'pretty' => EEH_DTT_Helper::get_timezone_string_for_display(),
249
-                'string' => get_option('timezone_string'),
250
-                'offset' => EEH_DTT_Helper::get_site_timezone_gmt_offset(),
251
-            )
252
-        );
253
-        /** site locale (user locale if user logged in) */
254
-        $this->registry->addData(
255
-            'locale',
256
-            array(
257
-                'user' => get_user_locale(),
258
-                'site' => get_locale()
259
-            )
260
-        );
261
-
262
-        $this->addJavascript(
263
-            CoreAssetManager::JS_HANDLE_CORE,
264
-            EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js',
265
-            array(CoreAssetManager::JS_HANDLE_JQUERY)
266
-        )
267
-        ->setInlineDataCallback(
268
-            static function () {
269
-                wp_localize_script(
270
-                    CoreAssetManager::JS_HANDLE_CORE,
271
-                    CoreAssetManager::JS_HANDLE_I18N,
272
-                    EE_Registry::$i18n_js_strings
273
-                );
274
-            }
275
-        );
276
-    }
277
-
278
-
279
-    /**
280
-     * Registers vendor files that are bundled with a later version WP but might not be for the current version of
281
-     * WordPress in the running environment.
282
-     *
283
-     * @throws DuplicateCollectionIdentifierException
284
-     * @throws InvalidDataTypeException
285
-     * @throws InvalidEntityException
286
-     * @throws DomainException
287
-     * @since 4.9.71.p
288
-     */
289
-    private function registerWpAssets()
290
-    {
291
-        global $wp_version;
292
-        if (version_compare($wp_version, '5.0.beta', '>=')) {
293
-            return;
294
-        }
295
-        $this->addVendorJavascript(CoreAssetManager::JS_HANDLE_REACT, [], true, '16.6.0');
296
-        $this->addVendorJavascript(
297
-            CoreAssetManager::JS_HANDLE_REACT_DOM,
298
-            array(CoreAssetManager::JS_HANDLE_REACT),
299
-            true,
300
-            '16.6.0'
301
-        );
302
-        $this->addVendorJavascript(CoreAssetManager::JS_HANDLE_LODASH, [], true, '4.17.11')
303
-            ->setInlineDataCallback(
304
-                static function() {
305
-                    wp_add_inline_script(
306
-                        CoreAssetManager::JS_HANDLE_LODASH,
307
-                        'window.lodash = _.noConflict();'
308
-                    );
309
-                }
310
-            );
311
-    }
312
-
313
-
314
-    /**
315
-     * Returns configuration data for the accounting-js library.
316
-     * @since 4.9.71.p
317
-     * @return array
318
-     */
319
-    private function getAccountingSettings() {
320
-        return array(
321
-            'currency' => array(
322
-                'symbol'    => $this->currency_config->sign,
323
-                'format'    => array(
324
-                    'pos'  => $this->currency_config->sign_b4 ? '%s%v' : '%v%s',
325
-                    'neg'  => $this->currency_config->sign_b4 ? '- %s%v' : '- %v%s',
326
-                    'zero' => $this->currency_config->sign_b4 ? '%s--' : '--%s',
327
-                ),
328
-                'decimal'   => $this->currency_config->dec_mrk,
329
-                'thousand'  => $this->currency_config->thsnds,
330
-                'precision' => $this->currency_config->dec_plc,
331
-            ),
332
-            'number'   => array(
333
-                'precision' => $this->currency_config->dec_plc,
334
-                'thousand'  => $this->currency_config->thsnds,
335
-                'decimal'   => $this->currency_config->dec_mrk,
336
-            ),
337
-        );
338
-    }
339
-
340
-
341
-    /**
342
-     * Returns configuration data for the js Currency VO.
343
-     * @since 4.9.71.p
344
-     * @return array
345
-     */
346
-    private function getCurrencySettings()
347
-    {
348
-        return array(
349
-            'code' => $this->currency_config->code,
350
-            'singularLabel' => $this->currency_config->name,
351
-            'pluralLabel' => $this->currency_config->plural,
352
-            'sign' => $this->currency_config->sign,
353
-            'signB4' => $this->currency_config->sign_b4,
354
-            'decimalPlaces' => $this->currency_config->dec_plc,
355
-            'decimalMark' => $this->currency_config->dec_mrk,
356
-            'thousandsSeparator' => $this->currency_config->thsnds,
357
-        );
358
-    }
359
-
360
-
361
-    /**
362
-     * @throws DuplicateCollectionIdentifierException
363
-     * @throws InvalidDataTypeException
364
-     * @throws InvalidEntityException
365
-     * @throws DomainException
366
-     * @since 4.9.62.p
367
-     */
368
-    private function loadCoreCss()
369
-    {
370
-        if ($this->template_config->enable_default_style && ! is_admin()) {
371
-            $this->addStylesheet(
372
-                CoreAssetManager::CSS_HANDLE_DEFAULT,
373
-                is_readable(EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css')
374
-                    ? EVENT_ESPRESSO_UPLOAD_URL . 'css/espresso_default.css'
375
-                    : EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css',
376
-                array('dashicons')
377
-            );
378
-            //Load custom style sheet if available
379
-            if ($this->template_config->custom_style_sheet !== null) {
380
-                $this->addStylesheet(
381
-                    CoreAssetManager::CSS_HANDLE_CUSTOM,
382
-                    EVENT_ESPRESSO_UPLOAD_URL . 'css/' . $this->template_config->custom_style_sheet,
383
-                    array(CoreAssetManager::CSS_HANDLE_DEFAULT)
384
-                );
385
-            }
386
-        }
387
-        $this->addCss(self::CSS_HANDLE_CORE_CSS_DEFAULT, ['dashicons']);
388
-        $this->addCss(self::CSS_HANDLE_COMPONENTS, [self::CSS_HANDLE_CORE_CSS_DEFAULT]);
389
-    }
390
-
391
-
392
-    /**
393
-     * jQuery Validate for form validation
394
-     *
395
-     * @since 4.9.62.p
396
-     * @throws DomainException
397
-     * @throws DuplicateCollectionIdentifierException
398
-     * @throws InvalidDataTypeException
399
-     * @throws InvalidEntityException
400
-     */
401
-    private function loadJqueryValidate()
402
-    {
403
-        $this->addJavascript(
404
-            CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE,
405
-            EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.min.js',
406
-            array(CoreAssetManager::JS_HANDLE_JQUERY),
407
-            true,
408
-            '1.15.0'
409
-        );
410
-
411
-        $this->addJavascript(
412
-            CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE_EXTRA,
413
-            EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.additional-methods.min.js',
414
-            array(CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE),
415
-            true,
416
-            '1.15.0'
417
-        );
418
-    }
419
-
420
-
421
-    /**
422
-     * accounting.js for performing client-side calculations
423
-     *
424
-     * @since 4.9.62.p
425
-     * @throws DomainException
426
-     * @throws DuplicateCollectionIdentifierException
427
-     * @throws InvalidDataTypeException
428
-     * @throws InvalidEntityException
429
-     */
430
-    private function loadAccountingJs()
431
-    {
432
-        //accounting.js library
433
-        // @link http://josscrowcroft.github.io/accounting.js/
434
-        $this->addJavascript(
435
-            CoreAssetManager::JS_HANDLE_ACCOUNTING_CORE,
436
-            EE_THIRD_PARTY_URL . 'accounting/accounting.js',
437
-            array(CoreAssetManager::JS_HANDLE_UNDERSCORE),
438
-            true,
439
-            '0.3.2'
440
-        );
441
-
442
-        $this->addJavascript(
443
-            CoreAssetManager::JS_HANDLE_ACCOUNTING,
444
-            EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js',
445
-            array(CoreAssetManager::JS_HANDLE_ACCOUNTING_CORE)
446
-        )
447
-        ->setInlineDataCallback(
448
-            function () {
449
-                 wp_localize_script(
450
-                     CoreAssetManager::JS_HANDLE_ACCOUNTING,
451
-                     'EE_ACCOUNTING_CFG',
452
-                     $this->getAccountingSettings()
453
-                 );
454
-            }
455
-        );
456
-    }
457
-
458
-
459
-    /**
460
-     * registers assets for cleaning your ears
461
-     *
462
-     * @param JavascriptAsset $script
463
-     */
464
-    public function loadQtipJs(JavascriptAsset $script)
465
-    {
466
-        // qtip is turned OFF by default, but prior to the wp_enqueue_scripts hook,
467
-        // can be turned back on again via: add_filter('FHEE_load_qtip', '__return_true' );
468
-        if (
469
-            $script->handle() === CoreAssetManager::JS_HANDLE_WP_PLUGINS_PAGE
470
-            && apply_filters('FHEE_load_qtip', false)
471
-        ) {
472
-            EEH_Qtip_Loader::instance()->register_and_enqueue();
473
-        }
474
-    }
475
-
476
-
477
-    /**
478
-     * assets that are used in the WordPress admin
479
-     *
480
-     * @throws DuplicateCollectionIdentifierException
481
-     * @throws InvalidDataTypeException
482
-     * @throws InvalidEntityException
483
-     * @throws DomainException
484
-     * @since 4.9.62.p
485
-     */
486
-    private function registerAdminAssets()
487
-    {
488
-        $this->addJs(self::JS_HANDLE_WP_PLUGINS_PAGE)->setRequiresTranslation();
489
-        // note usage of the "JS_HANDLE.." constant is intentional here because css uses the same handle.
490
-        $this->addCss(self::JS_HANDLE_WP_PLUGINS_PAGE);
491
-    }
85
+	const JS_HANDLE_ACCOUNTING = 'ee-accounting';
86
+
87
+	const JS_HANDLE_WP_PLUGINS_PAGE = 'ee-wp-plugins-page';
88
+
89
+	// EE CSS assets handles
90
+	const CSS_HANDLE_DEFAULT = 'espresso_default';
91
+
92
+	const CSS_HANDLE_CUSTOM = 'espresso_custom_css';
93
+
94
+	const CSS_HANDLE_COMPONENTS = 'eventespresso-components';
95
+
96
+	const CSS_HANDLE_CORE_CSS_DEFAULT = 'eventespresso-core-css-default';
97
+
98
+	/**
99
+	 * @var EE_Currency_Config $currency_config
100
+	 */
101
+	protected $currency_config;
102
+
103
+	/**
104
+	 * @var EE_Template_Config $template_config
105
+	 */
106
+	protected $template_config;
107
+
108
+
109
+	/**
110
+	 * CoreAssetRegister constructor.
111
+	 *
112
+	 * @param AssetCollection    $assets
113
+	 * @param EE_Currency_Config $currency_config
114
+	 * @param EE_Template_Config $template_config
115
+	 * @param DomainInterface    $domain
116
+	 * @param Registry           $registry
117
+	 */
118
+	public function __construct(
119
+		AssetCollection $assets,
120
+		EE_Currency_Config $currency_config,
121
+		EE_Template_Config $template_config,
122
+		DomainInterface $domain,
123
+		Registry $registry
124
+	) {
125
+		$this->currency_config = $currency_config;
126
+		$this->template_config = $template_config;
127
+		parent::__construct($domain, $assets, $registry);
128
+	}
129
+
130
+
131
+	/**
132
+	 * @since 4.9.62.p
133
+	 * @throws DomainException
134
+	 * @throws DuplicateCollectionIdentifierException
135
+	 * @throws InvalidArgumentException
136
+	 * @throws InvalidDataTypeException
137
+	 * @throws InvalidEntityException
138
+	 * @throws InvalidInterfaceException
139
+	 */
140
+	public function addAssets()
141
+	{
142
+		$this->addJavascriptFiles();
143
+		$this->addStylesheetFiles();
144
+	}
145
+
146
+
147
+	/**
148
+	 * @since 4.9.62.p
149
+	 * @throws DomainException
150
+	 * @throws DuplicateCollectionIdentifierException
151
+	 * @throws InvalidArgumentException
152
+	 * @throws InvalidDataTypeException
153
+	 * @throws InvalidEntityException
154
+	 * @throws InvalidInterfaceException
155
+	 */
156
+	public function addJavascriptFiles()
157
+	{
158
+		$this->loadCoreJs();
159
+		$this->loadJqueryValidate();
160
+		$this->loadAccountingJs();
161
+		add_action(
162
+			'AHEE__EventEspresso_core_services_assets_Registry__registerScripts__before_script',
163
+			array($this, 'loadQtipJs')
164
+		);
165
+		$this->registerAdminAssets();
166
+	}
167
+
168
+
169
+	/**
170
+	 * @throws DuplicateCollectionIdentifierException
171
+	 * @throws InvalidDataTypeException
172
+	 * @throws InvalidEntityException
173
+	 * @throws DomainException
174
+	 * @since 4.9.62.p
175
+	 */
176
+	public function addStylesheetFiles()
177
+	{
178
+		$this->loadCoreCss();
179
+	}
180
+
181
+
182
+	/**
183
+	 * core default javascript
184
+	 *
185
+	 * @since 4.9.62.p
186
+	 * @throws DomainException
187
+	 * @throws DuplicateCollectionIdentifierException
188
+	 * @throws InvalidArgumentException
189
+	 * @throws InvalidDataTypeException
190
+	 * @throws InvalidEntityException
191
+	 * @throws InvalidInterfaceException
192
+	 */
193
+	private function loadCoreJs()
194
+	{
195
+		// conditionally load third-party libraries that WP core MIGHT have.
196
+		$this->registerWpAssets();
197
+
198
+		$this->addJs(self::JS_HANDLE_JS_CORE)->setHasInlineData();
199
+		$this->addJs(self::JS_HANDLE_VENDOR);
200
+		$this->addJs(self::JS_HANDLE_VALIDATORS)->setRequiresTranslation();
201
+		$this->addJs(self::JS_HANDLE_HELPERS)->setRequiresTranslation();
202
+		$this->addJs(self::JS_HANDLE_MODEL)->setRequiresTranslation();
203
+		$this->addJs(self::JS_HANDLE_VALUE_OBJECTS)->setRequiresTranslation();
204
+		$this->addJs(self::JS_HANDLE_DATA_STORES)->setRequiresTranslation()->setInlineDataCallback(
205
+			static function () {
206
+				wp_add_inline_script(
207
+					CoreAssetManager::JS_HANDLE_DATA_STORES,
208
+					is_admin()
209
+						? 'wp.apiFetch.use( eejs.middleWares.apiFetch.capsMiddleware( eejs.middleWares.apiFetch.CONTEXT_CAPS_EDIT ) )'
210
+						: 'wp.apiFetch.use( eejs.middleWares.apiFetch.capsMiddleware )'
211
+				);
212
+			}
213
+		);
214
+		$this->addJs(self::JS_HANDLE_HOCS, [self::JS_HANDLE_DATA_STORES])->setRequiresTranslation();
215
+		$this->addJs(self::JS_HANDLE_COMPONENTS, [self::JS_HANDLE_DATA_STORES])->setRequiresTranslation();
216
+		$this->addJs(self::JS_HANDLE_EDITOR_HOCS)->setRequiresTranslation();
217
+
218
+		$this->registry->addData('eejs_api_nonce', wp_create_nonce('wp_rest'));
219
+		$this->registry->addData(
220
+			'paths',
221
+			array(
222
+				'base_rest_route' => rest_url(),
223
+				'rest_route' => rest_url('ee/v4.8.36/'),
224
+				'collection_endpoints' => EED_Core_Rest_Api::getCollectionRoutesIndexedByModelName(),
225
+				'primary_keys' => EED_Core_Rest_Api::getPrimaryKeyNamesIndexedByModelName(),
226
+				'site_url' => site_url('/'),
227
+				'admin_url' => admin_url('/'),
228
+			)
229
+		);
230
+		// Event Espresso brand name
231
+		$this->registry->addData('brandName', Domain::brandName());
232
+		/** site formatting values **/
233
+		$this->registry->addData(
234
+			'site_formats',
235
+			array(
236
+				'date_formats' => EEH_DTT_Helper::convert_php_to_js_and_moment_date_formats()
237
+			)
238
+		);
239
+		/** currency data **/
240
+		$this->registry->addData(
241
+			'currency_config',
242
+			$this->getCurrencySettings()
243
+		);
244
+		/** site timezone */
245
+		$this->registry->addData(
246
+			'default_timezone',
247
+			array(
248
+				'pretty' => EEH_DTT_Helper::get_timezone_string_for_display(),
249
+				'string' => get_option('timezone_string'),
250
+				'offset' => EEH_DTT_Helper::get_site_timezone_gmt_offset(),
251
+			)
252
+		);
253
+		/** site locale (user locale if user logged in) */
254
+		$this->registry->addData(
255
+			'locale',
256
+			array(
257
+				'user' => get_user_locale(),
258
+				'site' => get_locale()
259
+			)
260
+		);
261
+
262
+		$this->addJavascript(
263
+			CoreAssetManager::JS_HANDLE_CORE,
264
+			EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js',
265
+			array(CoreAssetManager::JS_HANDLE_JQUERY)
266
+		)
267
+		->setInlineDataCallback(
268
+			static function () {
269
+				wp_localize_script(
270
+					CoreAssetManager::JS_HANDLE_CORE,
271
+					CoreAssetManager::JS_HANDLE_I18N,
272
+					EE_Registry::$i18n_js_strings
273
+				);
274
+			}
275
+		);
276
+	}
277
+
278
+
279
+	/**
280
+	 * Registers vendor files that are bundled with a later version WP but might not be for the current version of
281
+	 * WordPress in the running environment.
282
+	 *
283
+	 * @throws DuplicateCollectionIdentifierException
284
+	 * @throws InvalidDataTypeException
285
+	 * @throws InvalidEntityException
286
+	 * @throws DomainException
287
+	 * @since 4.9.71.p
288
+	 */
289
+	private function registerWpAssets()
290
+	{
291
+		global $wp_version;
292
+		if (version_compare($wp_version, '5.0.beta', '>=')) {
293
+			return;
294
+		}
295
+		$this->addVendorJavascript(CoreAssetManager::JS_HANDLE_REACT, [], true, '16.6.0');
296
+		$this->addVendorJavascript(
297
+			CoreAssetManager::JS_HANDLE_REACT_DOM,
298
+			array(CoreAssetManager::JS_HANDLE_REACT),
299
+			true,
300
+			'16.6.0'
301
+		);
302
+		$this->addVendorJavascript(CoreAssetManager::JS_HANDLE_LODASH, [], true, '4.17.11')
303
+			->setInlineDataCallback(
304
+				static function() {
305
+					wp_add_inline_script(
306
+						CoreAssetManager::JS_HANDLE_LODASH,
307
+						'window.lodash = _.noConflict();'
308
+					);
309
+				}
310
+			);
311
+	}
312
+
313
+
314
+	/**
315
+	 * Returns configuration data for the accounting-js library.
316
+	 * @since 4.9.71.p
317
+	 * @return array
318
+	 */
319
+	private function getAccountingSettings() {
320
+		return array(
321
+			'currency' => array(
322
+				'symbol'    => $this->currency_config->sign,
323
+				'format'    => array(
324
+					'pos'  => $this->currency_config->sign_b4 ? '%s%v' : '%v%s',
325
+					'neg'  => $this->currency_config->sign_b4 ? '- %s%v' : '- %v%s',
326
+					'zero' => $this->currency_config->sign_b4 ? '%s--' : '--%s',
327
+				),
328
+				'decimal'   => $this->currency_config->dec_mrk,
329
+				'thousand'  => $this->currency_config->thsnds,
330
+				'precision' => $this->currency_config->dec_plc,
331
+			),
332
+			'number'   => array(
333
+				'precision' => $this->currency_config->dec_plc,
334
+				'thousand'  => $this->currency_config->thsnds,
335
+				'decimal'   => $this->currency_config->dec_mrk,
336
+			),
337
+		);
338
+	}
339
+
340
+
341
+	/**
342
+	 * Returns configuration data for the js Currency VO.
343
+	 * @since 4.9.71.p
344
+	 * @return array
345
+	 */
346
+	private function getCurrencySettings()
347
+	{
348
+		return array(
349
+			'code' => $this->currency_config->code,
350
+			'singularLabel' => $this->currency_config->name,
351
+			'pluralLabel' => $this->currency_config->plural,
352
+			'sign' => $this->currency_config->sign,
353
+			'signB4' => $this->currency_config->sign_b4,
354
+			'decimalPlaces' => $this->currency_config->dec_plc,
355
+			'decimalMark' => $this->currency_config->dec_mrk,
356
+			'thousandsSeparator' => $this->currency_config->thsnds,
357
+		);
358
+	}
359
+
360
+
361
+	/**
362
+	 * @throws DuplicateCollectionIdentifierException
363
+	 * @throws InvalidDataTypeException
364
+	 * @throws InvalidEntityException
365
+	 * @throws DomainException
366
+	 * @since 4.9.62.p
367
+	 */
368
+	private function loadCoreCss()
369
+	{
370
+		if ($this->template_config->enable_default_style && ! is_admin()) {
371
+			$this->addStylesheet(
372
+				CoreAssetManager::CSS_HANDLE_DEFAULT,
373
+				is_readable(EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css')
374
+					? EVENT_ESPRESSO_UPLOAD_URL . 'css/espresso_default.css'
375
+					: EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css',
376
+				array('dashicons')
377
+			);
378
+			//Load custom style sheet if available
379
+			if ($this->template_config->custom_style_sheet !== null) {
380
+				$this->addStylesheet(
381
+					CoreAssetManager::CSS_HANDLE_CUSTOM,
382
+					EVENT_ESPRESSO_UPLOAD_URL . 'css/' . $this->template_config->custom_style_sheet,
383
+					array(CoreAssetManager::CSS_HANDLE_DEFAULT)
384
+				);
385
+			}
386
+		}
387
+		$this->addCss(self::CSS_HANDLE_CORE_CSS_DEFAULT, ['dashicons']);
388
+		$this->addCss(self::CSS_HANDLE_COMPONENTS, [self::CSS_HANDLE_CORE_CSS_DEFAULT]);
389
+	}
390
+
391
+
392
+	/**
393
+	 * jQuery Validate for form validation
394
+	 *
395
+	 * @since 4.9.62.p
396
+	 * @throws DomainException
397
+	 * @throws DuplicateCollectionIdentifierException
398
+	 * @throws InvalidDataTypeException
399
+	 * @throws InvalidEntityException
400
+	 */
401
+	private function loadJqueryValidate()
402
+	{
403
+		$this->addJavascript(
404
+			CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE,
405
+			EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.min.js',
406
+			array(CoreAssetManager::JS_HANDLE_JQUERY),
407
+			true,
408
+			'1.15.0'
409
+		);
410
+
411
+		$this->addJavascript(
412
+			CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE_EXTRA,
413
+			EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.additional-methods.min.js',
414
+			array(CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE),
415
+			true,
416
+			'1.15.0'
417
+		);
418
+	}
419
+
420
+
421
+	/**
422
+	 * accounting.js for performing client-side calculations
423
+	 *
424
+	 * @since 4.9.62.p
425
+	 * @throws DomainException
426
+	 * @throws DuplicateCollectionIdentifierException
427
+	 * @throws InvalidDataTypeException
428
+	 * @throws InvalidEntityException
429
+	 */
430
+	private function loadAccountingJs()
431
+	{
432
+		//accounting.js library
433
+		// @link http://josscrowcroft.github.io/accounting.js/
434
+		$this->addJavascript(
435
+			CoreAssetManager::JS_HANDLE_ACCOUNTING_CORE,
436
+			EE_THIRD_PARTY_URL . 'accounting/accounting.js',
437
+			array(CoreAssetManager::JS_HANDLE_UNDERSCORE),
438
+			true,
439
+			'0.3.2'
440
+		);
441
+
442
+		$this->addJavascript(
443
+			CoreAssetManager::JS_HANDLE_ACCOUNTING,
444
+			EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js',
445
+			array(CoreAssetManager::JS_HANDLE_ACCOUNTING_CORE)
446
+		)
447
+		->setInlineDataCallback(
448
+			function () {
449
+				 wp_localize_script(
450
+					 CoreAssetManager::JS_HANDLE_ACCOUNTING,
451
+					 'EE_ACCOUNTING_CFG',
452
+					 $this->getAccountingSettings()
453
+				 );
454
+			}
455
+		);
456
+	}
457
+
458
+
459
+	/**
460
+	 * registers assets for cleaning your ears
461
+	 *
462
+	 * @param JavascriptAsset $script
463
+	 */
464
+	public function loadQtipJs(JavascriptAsset $script)
465
+	{
466
+		// qtip is turned OFF by default, but prior to the wp_enqueue_scripts hook,
467
+		// can be turned back on again via: add_filter('FHEE_load_qtip', '__return_true' );
468
+		if (
469
+			$script->handle() === CoreAssetManager::JS_HANDLE_WP_PLUGINS_PAGE
470
+			&& apply_filters('FHEE_load_qtip', false)
471
+		) {
472
+			EEH_Qtip_Loader::instance()->register_and_enqueue();
473
+		}
474
+	}
475
+
476
+
477
+	/**
478
+	 * assets that are used in the WordPress admin
479
+	 *
480
+	 * @throws DuplicateCollectionIdentifierException
481
+	 * @throws InvalidDataTypeException
482
+	 * @throws InvalidEntityException
483
+	 * @throws DomainException
484
+	 * @since 4.9.62.p
485
+	 */
486
+	private function registerAdminAssets()
487
+	{
488
+		$this->addJs(self::JS_HANDLE_WP_PLUGINS_PAGE)->setRequiresTranslation();
489
+		// note usage of the "JS_HANDLE.." constant is intentional here because css uses the same handle.
490
+		$this->addCss(self::JS_HANDLE_WP_PLUGINS_PAGE);
491
+	}
492 492
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         $this->addJs(self::JS_HANDLE_MODEL)->setRequiresTranslation();
203 203
         $this->addJs(self::JS_HANDLE_VALUE_OBJECTS)->setRequiresTranslation();
204 204
         $this->addJs(self::JS_HANDLE_DATA_STORES)->setRequiresTranslation()->setInlineDataCallback(
205
-            static function () {
205
+            static function() {
206 206
                 wp_add_inline_script(
207 207
                     CoreAssetManager::JS_HANDLE_DATA_STORES,
208 208
                     is_admin()
@@ -261,11 +261,11 @@  discard block
 block discarded – undo
261 261
 
262 262
         $this->addJavascript(
263 263
             CoreAssetManager::JS_HANDLE_CORE,
264
-            EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js',
264
+            EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js',
265 265
             array(CoreAssetManager::JS_HANDLE_JQUERY)
266 266
         )
267 267
         ->setInlineDataCallback(
268
-            static function () {
268
+            static function() {
269 269
                 wp_localize_script(
270 270
                     CoreAssetManager::JS_HANDLE_CORE,
271 271
                     CoreAssetManager::JS_HANDLE_I18N,
@@ -370,16 +370,16 @@  discard block
 block discarded – undo
370 370
         if ($this->template_config->enable_default_style && ! is_admin()) {
371 371
             $this->addStylesheet(
372 372
                 CoreAssetManager::CSS_HANDLE_DEFAULT,
373
-                is_readable(EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css')
373
+                is_readable(EVENT_ESPRESSO_UPLOAD_DIR.'css/espresso_default.css')
374 374
                     ? EVENT_ESPRESSO_UPLOAD_URL . 'css/espresso_default.css'
375
-                    : EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css',
375
+                    : EE_GLOBAL_ASSETS_URL.'css/espresso_default.css',
376 376
                 array('dashicons')
377 377
             );
378 378
             //Load custom style sheet if available
379 379
             if ($this->template_config->custom_style_sheet !== null) {
380 380
                 $this->addStylesheet(
381 381
                     CoreAssetManager::CSS_HANDLE_CUSTOM,
382
-                    EVENT_ESPRESSO_UPLOAD_URL . 'css/' . $this->template_config->custom_style_sheet,
382
+                    EVENT_ESPRESSO_UPLOAD_URL.'css/'.$this->template_config->custom_style_sheet,
383 383
                     array(CoreAssetManager::CSS_HANDLE_DEFAULT)
384 384
                 );
385 385
             }
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
     {
403 403
         $this->addJavascript(
404 404
             CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE,
405
-            EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.min.js',
405
+            EE_GLOBAL_ASSETS_URL.'scripts/jquery.validate.min.js',
406 406
             array(CoreAssetManager::JS_HANDLE_JQUERY),
407 407
             true,
408 408
             '1.15.0'
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 
411 411
         $this->addJavascript(
412 412
             CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE_EXTRA,
413
-            EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.additional-methods.min.js',
413
+            EE_GLOBAL_ASSETS_URL.'scripts/jquery.validate.additional-methods.min.js',
414 414
             array(CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE),
415 415
             true,
416 416
             '1.15.0'
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
         // @link http://josscrowcroft.github.io/accounting.js/
434 434
         $this->addJavascript(
435 435
             CoreAssetManager::JS_HANDLE_ACCOUNTING_CORE,
436
-            EE_THIRD_PARTY_URL . 'accounting/accounting.js',
436
+            EE_THIRD_PARTY_URL.'accounting/accounting.js',
437 437
             array(CoreAssetManager::JS_HANDLE_UNDERSCORE),
438 438
             true,
439 439
             '0.3.2'
@@ -441,11 +441,11 @@  discard block
 block discarded – undo
441 441
 
442 442
         $this->addJavascript(
443 443
             CoreAssetManager::JS_HANDLE_ACCOUNTING,
444
-            EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js',
444
+            EE_GLOBAL_ASSETS_URL.'scripts/ee-accounting-config.js',
445 445
             array(CoreAssetManager::JS_HANDLE_ACCOUNTING_CORE)
446 446
         )
447 447
         ->setInlineDataCallback(
448
-            function () {
448
+            function() {
449 449
                  wp_localize_script(
450 450
                      CoreAssetManager::JS_HANDLE_ACCOUNTING,
451 451
                      'EE_ACCOUNTING_CFG',
Please login to merge, or discard this patch.