Completed
Branch Gutenberg/master (b7bbaa)
by
unknown
89:35 queued 70:51
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.9.64.rc.009');
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.9.64.rc.009');
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 1 patch
Indentation   +359 added lines, -359 removed lines patch added patch discarded remove patch
@@ -29,370 +29,370 @@
 block discarded – undo
29 29
 class CoreAssetManager extends AssetManager
30 30
 {
31 31
 
32
-    // WordPress core / Third party JS asset handles
33
-    const JS_HANDLE_JQUERY = 'jquery';
32
+	// WordPress core / Third party JS asset handles
33
+	const JS_HANDLE_JQUERY = 'jquery';
34 34
 
35
-    const JS_HANDLE_JQUERY_VALIDATE = 'jquery-validate';
35
+	const JS_HANDLE_JQUERY_VALIDATE = 'jquery-validate';
36 36
 
37
-    const JS_HANDLE_JQUERY_VALIDATE_EXTRA = 'jquery-validate-extra-methods';
37
+	const JS_HANDLE_JQUERY_VALIDATE_EXTRA = 'jquery-validate-extra-methods';
38 38
 
39
-    const JS_HANDLE_UNDERSCORE = 'underscore';
39
+	const JS_HANDLE_UNDERSCORE = 'underscore';
40 40
 
41
-    const JS_HANDLE_ACCOUNTING_CORE = 'ee-accounting-core';
41
+	const JS_HANDLE_ACCOUNTING_CORE = 'ee-accounting-core';
42 42
 
43
-    // EE JS assets handles
44
-    const JS_HANDLE_EE_MANIFEST = 'ee-manifest';
45
-
46
-    const JS_HANDLE_EE_JS_CORE = 'eejs-core';
47
-
48
-    const JS_HANDLE_EE_VENDOR = 'eventespresso-vendor';
43
+	// EE JS assets handles
44
+	const JS_HANDLE_EE_MANIFEST = 'ee-manifest';
45
+
46
+	const JS_HANDLE_EE_JS_CORE = 'eejs-core';
47
+
48
+	const JS_HANDLE_EE_VENDOR = 'eventespresso-vendor';
49 49
 
50
-    const JS_HANDLE_EE_DATA_STORES = 'eventespresso-data-stores';
51
-
52
-    const JS_HANDLE_EE_HELPERS = 'eventespresso-helpers';
53
-
54
-    const JS_HANDLE_EE_COMPONENTS = 'eventespresso-components';
55
-
56
-    const JS_HANDLE_EE_JS_API = 'eejs-api';
57
-
58
-    const JS_HANDLE_EE_CORE = 'espresso_core';
59
-
60
-    const JS_HANDLE_EE_I18N = 'eei18n';
61
-
62
-    const JS_HANDLE_EE_ACCOUNTING = 'ee-accounting';
63
-
64
-    const JS_HANDLE_EE_WP_PLUGINS_PAGE = 'ee-wp-plugins-page';
65
-
66
-    // EE CSS assets handles
67
-    const CSS_HANDLE_EE_DEFAULT = 'espresso_default';
68
-
69
-    const CSS_HANDLE_EE_CUSTOM = 'espresso_custom_css';
70
-
71
-    /**
72
-     * @var EE_Currency_Config $currency_config
73
-     */
74
-    protected $currency_config;
75
-
76
-    /**
77
-     * @var EE_Template_Config $template_config
78
-     */
79
-    protected $template_config;
80
-
81
-
82
-    /**
83
-     * CoreAssetRegister constructor.
84
-     *
85
-     * @param AssetCollection    $assets
86
-     * @param EE_Currency_Config $currency_config
87
-     * @param EE_Template_Config $template_config
88
-     * @param DomainInterface    $domain
89
-     * @param Registry           $registry
90
-     */
91
-    public function __construct(
92
-        AssetCollection $assets,
93
-        EE_Currency_Config $currency_config,
94
-        EE_Template_Config $template_config,
95
-        DomainInterface $domain,
96
-        Registry $registry
97
-    ) {
98
-        $this->currency_config = $currency_config;
99
-        $this->template_config = $template_config;
100
-        parent::__construct($domain, $assets, $registry);
101
-    }
102
-
103
-
104
-    /**
105
-     * @since 4.9.62.p
106
-     * @throws DuplicateCollectionIdentifierException
107
-     * @throws InvalidArgumentException
108
-     * @throws InvalidDataTypeException
109
-     * @throws InvalidEntityException
110
-     */
111
-    public function addAssets()
112
-    {
113
-        $this->addJavascriptFiles();
114
-        $this->addStylesheetFiles();
115
-    }
116
-
117
-
118
-    /**
119
-     * @since 4.9.62.p
120
-     * @throws DuplicateCollectionIdentifierException
121
-     * @throws InvalidArgumentException
122
-     * @throws InvalidDataTypeException
123
-     * @throws InvalidEntityException
124
-     */
125
-    public function addJavascriptFiles()
126
-    {
127
-        $this->loadCoreJs();
128
-        $this->loadJqueryValidate();
129
-        $this->loadAccountingJs();
130
-        add_action(
131
-            'AHEE__EventEspresso_core_services_assets_Registry__registerScripts__before_script',
132
-            array($this, 'loadQtipJs')
133
-        );
134
-        $this->registerAdminAssets();
135
-    }
136
-
137
-
138
-    /**
139
-     * @since 4.9.62.p
140
-     * @throws DuplicateCollectionIdentifierException
141
-     * @throws InvalidDataTypeException
142
-     * @throws InvalidEntityException
143
-     */
144
-    public function addStylesheetFiles()
145
-    {
146
-        $this->loadCoreCss();
147
-    }
148
-
149
-
150
-    /**
151
-     * core default javascript
152
-     *
153
-     * @since 4.9.62.p
154
-     * @throws DuplicateCollectionIdentifierException
155
-     * @throws InvalidArgumentException
156
-     * @throws InvalidDataTypeException
157
-     * @throws InvalidEntityException
158
-     */
159
-    private function loadCoreJs()
160
-    {
161
-        $this->addJavascript(
162
-            CoreAssetManager::JS_HANDLE_EE_MANIFEST,
163
-            $this->registry->getJsUrl($this->domain->assetNamespace(), 'manifest')
164
-        );
165
-
166
-        $this->addJavascript(
167
-            CoreAssetManager::JS_HANDLE_EE_JS_CORE,
168
-            $this->registry->getJsUrl($this->domain->assetNamespace(), 'eejs'),
169
-            array(CoreAssetManager::JS_HANDLE_EE_MANIFEST)
170
-        )
171
-        ->setHasInlineData();
172
-
173
-        $this->addJavascript(
174
-            CoreAssetManager::JS_HANDLE_EE_VENDOR,
175
-            $this->registry->getJsUrl($this->domain->assetNamespace(), 'vendor'),
176
-            array(CoreAssetManager::JS_HANDLE_EE_JS_CORE)
177
-        );
178
-
179
-        $this->addJavascript(
180
-            CoreAssetManager::JS_HANDLE_EE_DATA_STORES,
181
-            $this->registry->getJsUrl($this->domain->assetNamespace(), 'data-stores'),
182
-            array(CoreAssetManager::JS_HANDLE_EE_VENDOR, 'wp-data', 'wp-api-request')
183
-        )
184
-        ->setRequiresTranslation();
185
-
186
-        $this->addJavascript(
187
-            CoreAssetManager::JS_HANDLE_EE_HELPERS,
188
-            $this->registry->getJsUrl($this->domain->assetNamespace(), 'helpers')
189
-        )->setRequiresTranslation();
190
-
191
-        $this->addJavascript(
192
-            CoreAssetManager::JS_HANDLE_EE_COMPONENTS,
193
-            $this->registry->getJsUrl($this->domain->assetNamespace(), 'components'),
194
-            array(CoreAssetManager::JS_HANDLE_EE_DATA_STORES, CoreAssetManager::JS_HANDLE_EE_HELPERS)
195
-        )
196
-        ->setRequiresTranslation();
197
-
198
-        global $wp_version;
199
-        if (version_compare($wp_version, '4.4.0', '>')) {
200
-            //js.api
201
-            $this->addJavascript(
202
-                CoreAssetManager::JS_HANDLE_EE_JS_API,
203
-                EE_LIBRARIES_URL . 'rest_api/assets/js/eejs-api.min.js',
204
-                array(
205
-                    CoreAssetManager::JS_HANDLE_UNDERSCORE,
206
-                    CoreAssetManager::JS_HANDLE_EE_JS_CORE
207
-                )
208
-            );
209
-            $this->registry->addData('eejs_api_nonce', wp_create_nonce('wp_rest'));
210
-            $this->registry->addData(
211
-                'paths',
212
-                array(
213
-                    'rest_route' => rest_url('ee/v4.8.36/'),
214
-                    'collection_endpoints' => EED_Core_Rest_Api::getCollectionRoutesIndexedByModelName(),
215
-                    'primary_keys' => EED_Core_Rest_Api::getPrimaryKeyNamesIndexedByModelName(),
50
+	const JS_HANDLE_EE_DATA_STORES = 'eventespresso-data-stores';
51
+
52
+	const JS_HANDLE_EE_HELPERS = 'eventespresso-helpers';
53
+
54
+	const JS_HANDLE_EE_COMPONENTS = 'eventespresso-components';
55
+
56
+	const JS_HANDLE_EE_JS_API = 'eejs-api';
57
+
58
+	const JS_HANDLE_EE_CORE = 'espresso_core';
59
+
60
+	const JS_HANDLE_EE_I18N = 'eei18n';
61
+
62
+	const JS_HANDLE_EE_ACCOUNTING = 'ee-accounting';
63
+
64
+	const JS_HANDLE_EE_WP_PLUGINS_PAGE = 'ee-wp-plugins-page';
65
+
66
+	// EE CSS assets handles
67
+	const CSS_HANDLE_EE_DEFAULT = 'espresso_default';
68
+
69
+	const CSS_HANDLE_EE_CUSTOM = 'espresso_custom_css';
70
+
71
+	/**
72
+	 * @var EE_Currency_Config $currency_config
73
+	 */
74
+	protected $currency_config;
75
+
76
+	/**
77
+	 * @var EE_Template_Config $template_config
78
+	 */
79
+	protected $template_config;
80
+
81
+
82
+	/**
83
+	 * CoreAssetRegister constructor.
84
+	 *
85
+	 * @param AssetCollection    $assets
86
+	 * @param EE_Currency_Config $currency_config
87
+	 * @param EE_Template_Config $template_config
88
+	 * @param DomainInterface    $domain
89
+	 * @param Registry           $registry
90
+	 */
91
+	public function __construct(
92
+		AssetCollection $assets,
93
+		EE_Currency_Config $currency_config,
94
+		EE_Template_Config $template_config,
95
+		DomainInterface $domain,
96
+		Registry $registry
97
+	) {
98
+		$this->currency_config = $currency_config;
99
+		$this->template_config = $template_config;
100
+		parent::__construct($domain, $assets, $registry);
101
+	}
102
+
103
+
104
+	/**
105
+	 * @since 4.9.62.p
106
+	 * @throws DuplicateCollectionIdentifierException
107
+	 * @throws InvalidArgumentException
108
+	 * @throws InvalidDataTypeException
109
+	 * @throws InvalidEntityException
110
+	 */
111
+	public function addAssets()
112
+	{
113
+		$this->addJavascriptFiles();
114
+		$this->addStylesheetFiles();
115
+	}
116
+
117
+
118
+	/**
119
+	 * @since 4.9.62.p
120
+	 * @throws DuplicateCollectionIdentifierException
121
+	 * @throws InvalidArgumentException
122
+	 * @throws InvalidDataTypeException
123
+	 * @throws InvalidEntityException
124
+	 */
125
+	public function addJavascriptFiles()
126
+	{
127
+		$this->loadCoreJs();
128
+		$this->loadJqueryValidate();
129
+		$this->loadAccountingJs();
130
+		add_action(
131
+			'AHEE__EventEspresso_core_services_assets_Registry__registerScripts__before_script',
132
+			array($this, 'loadQtipJs')
133
+		);
134
+		$this->registerAdminAssets();
135
+	}
136
+
137
+
138
+	/**
139
+	 * @since 4.9.62.p
140
+	 * @throws DuplicateCollectionIdentifierException
141
+	 * @throws InvalidDataTypeException
142
+	 * @throws InvalidEntityException
143
+	 */
144
+	public function addStylesheetFiles()
145
+	{
146
+		$this->loadCoreCss();
147
+	}
148
+
149
+
150
+	/**
151
+	 * core default javascript
152
+	 *
153
+	 * @since 4.9.62.p
154
+	 * @throws DuplicateCollectionIdentifierException
155
+	 * @throws InvalidArgumentException
156
+	 * @throws InvalidDataTypeException
157
+	 * @throws InvalidEntityException
158
+	 */
159
+	private function loadCoreJs()
160
+	{
161
+		$this->addJavascript(
162
+			CoreAssetManager::JS_HANDLE_EE_MANIFEST,
163
+			$this->registry->getJsUrl($this->domain->assetNamespace(), 'manifest')
164
+		);
165
+
166
+		$this->addJavascript(
167
+			CoreAssetManager::JS_HANDLE_EE_JS_CORE,
168
+			$this->registry->getJsUrl($this->domain->assetNamespace(), 'eejs'),
169
+			array(CoreAssetManager::JS_HANDLE_EE_MANIFEST)
170
+		)
171
+		->setHasInlineData();
172
+
173
+		$this->addJavascript(
174
+			CoreAssetManager::JS_HANDLE_EE_VENDOR,
175
+			$this->registry->getJsUrl($this->domain->assetNamespace(), 'vendor'),
176
+			array(CoreAssetManager::JS_HANDLE_EE_JS_CORE)
177
+		);
178
+
179
+		$this->addJavascript(
180
+			CoreAssetManager::JS_HANDLE_EE_DATA_STORES,
181
+			$this->registry->getJsUrl($this->domain->assetNamespace(), 'data-stores'),
182
+			array(CoreAssetManager::JS_HANDLE_EE_VENDOR, 'wp-data', 'wp-api-request')
183
+		)
184
+		->setRequiresTranslation();
185
+
186
+		$this->addJavascript(
187
+			CoreAssetManager::JS_HANDLE_EE_HELPERS,
188
+			$this->registry->getJsUrl($this->domain->assetNamespace(), 'helpers')
189
+		)->setRequiresTranslation();
190
+
191
+		$this->addJavascript(
192
+			CoreAssetManager::JS_HANDLE_EE_COMPONENTS,
193
+			$this->registry->getJsUrl($this->domain->assetNamespace(), 'components'),
194
+			array(CoreAssetManager::JS_HANDLE_EE_DATA_STORES, CoreAssetManager::JS_HANDLE_EE_HELPERS)
195
+		)
196
+		->setRequiresTranslation();
197
+
198
+		global $wp_version;
199
+		if (version_compare($wp_version, '4.4.0', '>')) {
200
+			//js.api
201
+			$this->addJavascript(
202
+				CoreAssetManager::JS_HANDLE_EE_JS_API,
203
+				EE_LIBRARIES_URL . 'rest_api/assets/js/eejs-api.min.js',
204
+				array(
205
+					CoreAssetManager::JS_HANDLE_UNDERSCORE,
206
+					CoreAssetManager::JS_HANDLE_EE_JS_CORE
207
+				)
208
+			);
209
+			$this->registry->addData('eejs_api_nonce', wp_create_nonce('wp_rest'));
210
+			$this->registry->addData(
211
+				'paths',
212
+				array(
213
+					'rest_route' => rest_url('ee/v4.8.36/'),
214
+					'collection_endpoints' => EED_Core_Rest_Api::getCollectionRoutesIndexedByModelName(),
215
+					'primary_keys' => EED_Core_Rest_Api::getPrimaryKeyNamesIndexedByModelName(),
216 216
 					'site_url' => site_url('/'),
217
-                    'admin_url' => admin_url('/'),
218
-                )
219
-            );
220
-            /** site formatting values **/
221
-            $this->registry->addData(
222
-                'site_formats',
223
-                array(
224
-                    'date_formats' => EEH_DTT_Helper::convert_php_to_js_and_moment_date_formats()
225
-                )
226
-            );
227
-        }
228
-
229
-        $this->addJavascript(
230
-            CoreAssetManager::JS_HANDLE_EE_CORE,
231
-            EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js',
232
-            array(CoreAssetManager::JS_HANDLE_JQUERY)
233
-        )
234
-        ->setInlineDataCallback(
235
-            function () {
236
-                wp_localize_script(
237
-                    CoreAssetManager::JS_HANDLE_EE_CORE,
238
-                    CoreAssetManager::JS_HANDLE_EE_I18N,
239
-                    EE_Registry::$i18n_js_strings
240
-                );
241
-            }
242
-        );
243
-    }
244
-
245
-
246
-    /**
247
-     * @since 4.9.62.p
248
-     * @throws DuplicateCollectionIdentifierException
249
-     * @throws InvalidDataTypeException
250
-     * @throws InvalidEntityException
251
-     */
252
-    private function loadCoreCss()
253
-    {
254
-        if ($this->template_config->enable_default_style && ! is_admin()) {
255
-            $this->addStylesheet(
256
-                CoreAssetManager::CSS_HANDLE_EE_DEFAULT,
257
-                is_readable(EVENT_ESPRESSO_UPLOAD_DIR . 'css/style.css')
258
-                    ? EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css'
259
-                    : EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css',
260
-                array('dashicons')
261
-            );
262
-            //Load custom style sheet if available
263
-            if ($this->template_config->custom_style_sheet !== null) {
264
-                $this->addStylesheet(
265
-                    CoreAssetManager::CSS_HANDLE_EE_CUSTOM,
266
-                    EVENT_ESPRESSO_UPLOAD_URL . 'css/' . $this->template_config->custom_style_sheet,
267
-                    array(CoreAssetManager::CSS_HANDLE_EE_DEFAULT)
268
-                );
269
-            }
270
-        }
271
-    }
272
-
273
-
274
-    /**
275
-     * jQuery Validate for form validation
276
-     *
277
-     * @since 4.9.62.p
278
-     * @throws DuplicateCollectionIdentifierException
279
-     * @throws InvalidDataTypeException
280
-     * @throws InvalidEntityException
281
-     */
282
-    private function loadJqueryValidate()
283
-    {
284
-        $this->addJavascript(
285
-            CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE,
286
-            EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.min.js',
287
-            array(CoreAssetManager::JS_HANDLE_JQUERY)
288
-        )
289
-        ->setVersion('1.15.0');
290
-
291
-        $this->addJavascript(
292
-            CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE_EXTRA,
293
-            EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.additional-methods.min.js',
294
-            array(CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE)
295
-        )
296
-        ->setVersion('1.15.0');
297
-    }
298
-
299
-
300
-    /**
301
-     * accounting.js for performing client-side calculations
302
-     *
303
-     * @since 4.9.62.p
304
-     * @throws DuplicateCollectionIdentifierException
305
-     * @throws InvalidDataTypeException
306
-     * @throws InvalidEntityException
307
-     */
308
-    private function loadAccountingJs()
309
-    {
310
-        //accounting.js library
311
-        // @link http://josscrowcroft.github.io/accounting.js/
312
-        $this->addJavascript(
313
-            CoreAssetManager::JS_HANDLE_ACCOUNTING_CORE,
314
-            EE_THIRD_PARTY_URL . 'accounting/accounting.js',
315
-            array(CoreAssetManager::JS_HANDLE_UNDERSCORE)
316
-        )
317
-        ->setVersion('0.3.2');
318
-
319
-        $currency_config = $this->currency_config;
320
-        $this->addJavascript(
321
-            CoreAssetManager::JS_HANDLE_EE_ACCOUNTING,
322
-            EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js',
323
-            array(CoreAssetManager::JS_HANDLE_ACCOUNTING_CORE)
324
-        )
325
-        ->setInlineDataCallback(
326
-            function () use ($currency_config) {
327
-                 wp_localize_script(
328
-                     CoreAssetManager::JS_HANDLE_EE_ACCOUNTING,
329
-                     'EE_ACCOUNTING_CFG',
330
-                     array(
331
-                         'currency' => array(
332
-                             'symbol'    => $currency_config->sign,
333
-                             'format'    => array(
334
-                                 'pos'  => $currency_config->sign_b4 ? '%s%v' : '%v%s',
335
-                                 'neg'  => $currency_config->sign_b4 ? '- %s%v' : '- %v%s',
336
-                                 'zero' => $currency_config->sign_b4 ? '%s--' : '--%s',
337
-                             ),
338
-                             'decimal'   => $currency_config->dec_mrk,
339
-                             'thousand'  => $currency_config->thsnds,
340
-                             'precision' => $currency_config->dec_plc,
341
-                         ),
342
-                         'number'   => array(
343
-                             'precision' => $currency_config->dec_plc,
344
-                             'thousand'  => $currency_config->thsnds,
345
-                             'decimal'   => $currency_config->dec_mrk,
346
-                         ),
347
-                     )
348
-                 );
349
-            }
350
-        )
351
-        ->setVersion();
352
-    }
353
-
354
-
355
-    /**
356
-     * registers assets for cleaning your ears
357
-     *
358
-     * @param JavascriptAsset $script
359
-     */
360
-    public function loadQtipJs(JavascriptAsset $script)
361
-    {
362
-        // qtip is turned OFF by default, but prior to the wp_enqueue_scripts hook,
363
-        // can be turned back on again via: add_filter('FHEE_load_qtip', '__return_true' );
364
-        if (
365
-            $script->handle() === CoreAssetManager::JS_HANDLE_EE_WP_PLUGINS_PAGE
366
-            && apply_filters('FHEE_load_qtip', false)
367
-        ) {
368
-            EEH_Qtip_Loader::instance()->register_and_enqueue();
369
-        }
370
-    }
371
-
372
-
373
-    /**
374
-     * assets that are used in the WordPress admin
375
-     *
376
-     * @since 4.9.62.p
377
-     * @throws DuplicateCollectionIdentifierException
378
-     * @throws InvalidDataTypeException
379
-     * @throws InvalidEntityException
380
-     */
381
-    private function registerAdminAssets()
382
-    {
383
-        $this->addJavascript(
384
-            CoreAssetManager::JS_HANDLE_EE_WP_PLUGINS_PAGE,
385
-            $this->registry->getJsUrl($this->domain->assetNamespace(), 'wp-plugins-page'),
386
-            array(
387
-                CoreAssetManager::JS_HANDLE_JQUERY,
388
-                CoreAssetManager::JS_HANDLE_EE_VENDOR,
389
-            )
390
-        )
391
-        ->setRequiresTranslation();
392
-
393
-        $this->addStylesheet(
394
-            CoreAssetManager::JS_HANDLE_EE_WP_PLUGINS_PAGE,
395
-            $this->registry->getCssUrl($this->domain->assetNamespace(), 'wp-plugins-page')
396
-        );
397
-    }
217
+					'admin_url' => admin_url('/'),
218
+				)
219
+			);
220
+			/** site formatting values **/
221
+			$this->registry->addData(
222
+				'site_formats',
223
+				array(
224
+					'date_formats' => EEH_DTT_Helper::convert_php_to_js_and_moment_date_formats()
225
+				)
226
+			);
227
+		}
228
+
229
+		$this->addJavascript(
230
+			CoreAssetManager::JS_HANDLE_EE_CORE,
231
+			EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js',
232
+			array(CoreAssetManager::JS_HANDLE_JQUERY)
233
+		)
234
+		->setInlineDataCallback(
235
+			function () {
236
+				wp_localize_script(
237
+					CoreAssetManager::JS_HANDLE_EE_CORE,
238
+					CoreAssetManager::JS_HANDLE_EE_I18N,
239
+					EE_Registry::$i18n_js_strings
240
+				);
241
+			}
242
+		);
243
+	}
244
+
245
+
246
+	/**
247
+	 * @since 4.9.62.p
248
+	 * @throws DuplicateCollectionIdentifierException
249
+	 * @throws InvalidDataTypeException
250
+	 * @throws InvalidEntityException
251
+	 */
252
+	private function loadCoreCss()
253
+	{
254
+		if ($this->template_config->enable_default_style && ! is_admin()) {
255
+			$this->addStylesheet(
256
+				CoreAssetManager::CSS_HANDLE_EE_DEFAULT,
257
+				is_readable(EVENT_ESPRESSO_UPLOAD_DIR . 'css/style.css')
258
+					? EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css'
259
+					: EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css',
260
+				array('dashicons')
261
+			);
262
+			//Load custom style sheet if available
263
+			if ($this->template_config->custom_style_sheet !== null) {
264
+				$this->addStylesheet(
265
+					CoreAssetManager::CSS_HANDLE_EE_CUSTOM,
266
+					EVENT_ESPRESSO_UPLOAD_URL . 'css/' . $this->template_config->custom_style_sheet,
267
+					array(CoreAssetManager::CSS_HANDLE_EE_DEFAULT)
268
+				);
269
+			}
270
+		}
271
+	}
272
+
273
+
274
+	/**
275
+	 * jQuery Validate for form validation
276
+	 *
277
+	 * @since 4.9.62.p
278
+	 * @throws DuplicateCollectionIdentifierException
279
+	 * @throws InvalidDataTypeException
280
+	 * @throws InvalidEntityException
281
+	 */
282
+	private function loadJqueryValidate()
283
+	{
284
+		$this->addJavascript(
285
+			CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE,
286
+			EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.min.js',
287
+			array(CoreAssetManager::JS_HANDLE_JQUERY)
288
+		)
289
+		->setVersion('1.15.0');
290
+
291
+		$this->addJavascript(
292
+			CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE_EXTRA,
293
+			EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.additional-methods.min.js',
294
+			array(CoreAssetManager::JS_HANDLE_JQUERY_VALIDATE)
295
+		)
296
+		->setVersion('1.15.0');
297
+	}
298
+
299
+
300
+	/**
301
+	 * accounting.js for performing client-side calculations
302
+	 *
303
+	 * @since 4.9.62.p
304
+	 * @throws DuplicateCollectionIdentifierException
305
+	 * @throws InvalidDataTypeException
306
+	 * @throws InvalidEntityException
307
+	 */
308
+	private function loadAccountingJs()
309
+	{
310
+		//accounting.js library
311
+		// @link http://josscrowcroft.github.io/accounting.js/
312
+		$this->addJavascript(
313
+			CoreAssetManager::JS_HANDLE_ACCOUNTING_CORE,
314
+			EE_THIRD_PARTY_URL . 'accounting/accounting.js',
315
+			array(CoreAssetManager::JS_HANDLE_UNDERSCORE)
316
+		)
317
+		->setVersion('0.3.2');
318
+
319
+		$currency_config = $this->currency_config;
320
+		$this->addJavascript(
321
+			CoreAssetManager::JS_HANDLE_EE_ACCOUNTING,
322
+			EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js',
323
+			array(CoreAssetManager::JS_HANDLE_ACCOUNTING_CORE)
324
+		)
325
+		->setInlineDataCallback(
326
+			function () use ($currency_config) {
327
+				 wp_localize_script(
328
+					 CoreAssetManager::JS_HANDLE_EE_ACCOUNTING,
329
+					 'EE_ACCOUNTING_CFG',
330
+					 array(
331
+						 'currency' => array(
332
+							 'symbol'    => $currency_config->sign,
333
+							 'format'    => array(
334
+								 'pos'  => $currency_config->sign_b4 ? '%s%v' : '%v%s',
335
+								 'neg'  => $currency_config->sign_b4 ? '- %s%v' : '- %v%s',
336
+								 'zero' => $currency_config->sign_b4 ? '%s--' : '--%s',
337
+							 ),
338
+							 'decimal'   => $currency_config->dec_mrk,
339
+							 'thousand'  => $currency_config->thsnds,
340
+							 'precision' => $currency_config->dec_plc,
341
+						 ),
342
+						 'number'   => array(
343
+							 'precision' => $currency_config->dec_plc,
344
+							 'thousand'  => $currency_config->thsnds,
345
+							 'decimal'   => $currency_config->dec_mrk,
346
+						 ),
347
+					 )
348
+				 );
349
+			}
350
+		)
351
+		->setVersion();
352
+	}
353
+
354
+
355
+	/**
356
+	 * registers assets for cleaning your ears
357
+	 *
358
+	 * @param JavascriptAsset $script
359
+	 */
360
+	public function loadQtipJs(JavascriptAsset $script)
361
+	{
362
+		// qtip is turned OFF by default, but prior to the wp_enqueue_scripts hook,
363
+		// can be turned back on again via: add_filter('FHEE_load_qtip', '__return_true' );
364
+		if (
365
+			$script->handle() === CoreAssetManager::JS_HANDLE_EE_WP_PLUGINS_PAGE
366
+			&& apply_filters('FHEE_load_qtip', false)
367
+		) {
368
+			EEH_Qtip_Loader::instance()->register_and_enqueue();
369
+		}
370
+	}
371
+
372
+
373
+	/**
374
+	 * assets that are used in the WordPress admin
375
+	 *
376
+	 * @since 4.9.62.p
377
+	 * @throws DuplicateCollectionIdentifierException
378
+	 * @throws InvalidDataTypeException
379
+	 * @throws InvalidEntityException
380
+	 */
381
+	private function registerAdminAssets()
382
+	{
383
+		$this->addJavascript(
384
+			CoreAssetManager::JS_HANDLE_EE_WP_PLUGINS_PAGE,
385
+			$this->registry->getJsUrl($this->domain->assetNamespace(), 'wp-plugins-page'),
386
+			array(
387
+				CoreAssetManager::JS_HANDLE_JQUERY,
388
+				CoreAssetManager::JS_HANDLE_EE_VENDOR,
389
+			)
390
+		)
391
+		->setRequiresTranslation();
392
+
393
+		$this->addStylesheet(
394
+			CoreAssetManager::JS_HANDLE_EE_WP_PLUGINS_PAGE,
395
+			$this->registry->getCssUrl($this->domain->assetNamespace(), 'wp-plugins-page')
396
+		);
397
+	}
398 398
 }
Please login to merge, or discard this patch.