Completed
Branch BUG-10626-dst-unit-test (416d29)
by
unknown
14:25
created
modules/ticket_selector/EED_Ticket_Selector.module.php 2 patches
Indentation   +259 added lines, -259 removed lines patch added patch discarded remove patch
@@ -22,15 +22,15 @@  discard block
 block discarded – undo
22 22
  */
23 23
 class EED_Ticket_Selector extends  EED_Module {
24 24
 
25
-    /**
26
-     * @var EventEspresso\modules\ticket_selector\DisplayTicketSelector $ticket_selector
27
-     */
28
-    private static $ticket_selector;
25
+	/**
26
+	 * @var EventEspresso\modules\ticket_selector\DisplayTicketSelector $ticket_selector
27
+	 */
28
+	private static $ticket_selector;
29 29
 
30
-    /**
31
-     * @var EventEspresso\modules\ticket_selector\TicketSelectorIframeEmbedButton $iframe_embed_button
32
-     */
33
-    private static $iframe_embed_button;
30
+	/**
31
+	 * @var EventEspresso\modules\ticket_selector\TicketSelectorIframeEmbedButton $iframe_embed_button
32
+	 */
33
+	private static $iframe_embed_button;
34 34
 
35 35
 
36 36
 
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
 		// routing
62 62
 		EE_Config::register_route( 'iframe', 'EED_Ticket_Selector', 'ticket_selector_iframe', 'ticket_selector' );
63 63
 		EE_Config::register_route( 'process_ticket_selections', 'EED_Ticket_Selector', 'process_ticket_selections' );
64
-        EE_Config::register_route('cancel_ticket_selections', 'EED_Ticket_Selector', 'cancel_ticket_selections');
65
-        add_action( 'wp_loaded', array( 'EED_Ticket_Selector', 'set_definitions' ), 2 );
64
+		EE_Config::register_route('cancel_ticket_selections', 'EED_Ticket_Selector', 'cancel_ticket_selections');
65
+		add_action( 'wp_loaded', array( 'EED_Ticket_Selector', 'set_definitions' ), 2 );
66 66
 		add_action( 'AHEE_event_details_header_bottom', array( 'EED_Ticket_Selector', 'display_ticket_selector' ), 10, 1 );
67
-        add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'translate_js_strings' ), 0 );
68
-        add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'load_tckt_slctr_assets' ), 10 );
69
-        EED_Ticket_Selector::loadIframeAssets();
70
-    }
67
+		add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'translate_js_strings' ), 0 );
68
+		add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'load_tckt_slctr_assets' ), 10 );
69
+		EED_Ticket_Selector::loadIframeAssets();
70
+	}
71 71
 
72 72
 
73 73
 
@@ -86,16 +86,16 @@  discard block
 block discarded – undo
86 86
 			10
87 87
 		);
88 88
 
89
-        /**
90
-         * Make sure assets for the ticket selector are loaded on the espresso registrations route so  admin side
91
-         * registrations work.
92
-         */
89
+		/**
90
+		 * Make sure assets for the ticket selector are loaded on the espresso registrations route so  admin side
91
+		 * registrations work.
92
+		 */
93 93
 		add_action(
94
-		    'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_registrations__new_registration',
95
-            array('EED_Ticket_Selector', 'set_definitions'),
96
-            10
97
-        );
98
-    }
94
+			'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_registrations__new_registration',
95
+			array('EED_Ticket_Selector', 'set_definitions'),
96
+			10
97
+		);
98
+	}
99 99
 
100 100
 
101 101
 
@@ -111,23 +111,23 @@  discard block
 block discarded – undo
111 111
 
112 112
 		//if config is not set, initialize
113 113
 		if ( ! EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector instanceof EE_Ticket_Selector_Config ) {
114
-            \EED_Ticket_Selector::instance()->set_config();
115
-            \EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector = \EED_Ticket_Selector::instance()->config();
114
+			\EED_Ticket_Selector::instance()->set_config();
115
+			\EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector = \EED_Ticket_Selector::instance()->config();
116 116
 		}
117 117
 	}
118 118
 
119 119
 
120 120
 
121 121
 	/**
122
-     * @return \EventEspresso\modules\ticket_selector\DisplayTicketSelector
123
-     */
124
-    public static function ticketSelector()
125
-    {
126
-        if ( ! EED_Ticket_Selector::$ticket_selector instanceof DisplayTicketSelector) {
127
-            EED_Ticket_Selector::$ticket_selector = new DisplayTicketSelector();
128
-        }
129
-        return EED_Ticket_Selector::$ticket_selector;
130
-    }
122
+	 * @return \EventEspresso\modules\ticket_selector\DisplayTicketSelector
123
+	 */
124
+	public static function ticketSelector()
125
+	{
126
+		if ( ! EED_Ticket_Selector::$ticket_selector instanceof DisplayTicketSelector) {
127
+			EED_Ticket_Selector::$ticket_selector = new DisplayTicketSelector();
128
+		}
129
+		return EED_Ticket_Selector::$ticket_selector;
130
+	}
131 131
 
132 132
 
133 133
 	/**
@@ -180,15 +180,15 @@  discard block
 block discarded – undo
180 180
 
181 181
 
182 182
 
183
-    /**
184
-     *    creates buttons for selecting number of attendees for an event
185
-     *
186
-     * @access    public
187
-     * @param    WP_Post|int $event
188
-     * @param    bool        $view_details
189
-     * @return    string
190
-     * @throws \EE_Error
191
-     */
183
+	/**
184
+	 *    creates buttons for selecting number of attendees for an event
185
+	 *
186
+	 * @access    public
187
+	 * @param    WP_Post|int $event
188
+	 * @param    bool        $view_details
189
+	 * @return    string
190
+	 * @throws \EE_Error
191
+	 */
192 192
 	public static function display_ticket_selector( $event = NULL, $view_details = FALSE ) {
193 193
 		return EED_Ticket_Selector::ticketSelector()->display( $event, $view_details );
194 194
 	}
@@ -209,244 +209,244 @@  discard block
 block discarded – undo
209 209
 
210 210
 
211 211
 
212
-    /**
213
-     * cancel_ticket_selections
214
-     *
215
-     * @access        public
216
-     * @return        string
217
-     */
218
-    public static function cancel_ticket_selections()
219
-    {
220
-        $form = new ProcessTicketSelector();
221
-        return $form->cancelTicketSelections();
222
-    }
212
+	/**
213
+	 * cancel_ticket_selections
214
+	 *
215
+	 * @access        public
216
+	 * @return        string
217
+	 */
218
+	public static function cancel_ticket_selections()
219
+	{
220
+		$form = new ProcessTicketSelector();
221
+		return $form->cancelTicketSelections();
222
+	}
223 223
 
224 224
 
225 225
 
226 226
 	/**
227
-	* @return void
228
-	*/
227
+	 * @return void
228
+	 */
229 229
 	public static function translate_js_strings() {
230
-        EE_Registry::$i18n_js_strings['please_select_date_filter_notice'] = esc_html__(
231
-            'please select a datetime', 'event_espresso'
232
-        );
233
-    }
230
+		EE_Registry::$i18n_js_strings['please_select_date_filter_notice'] = esc_html__(
231
+			'please select a datetime', 'event_espresso'
232
+		);
233
+	}
234 234
 
235 235
 
236 236
 
237 237
 	/**
238
-	* 	load js
239
-	*
240
-	* 	@access 		public
241
-	* 	@return 		void
242
-	*/
238
+	 * 	load js
239
+	 *
240
+	 * 	@access 		public
241
+	 * 	@return 		void
242
+	 */
243 243
 	public static function load_tckt_slctr_assets() {
244 244
 		if ( apply_filters( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE ) ) {
245
-            // add some style
246
-            wp_register_style(
247
-                'ticket_selector', 
248
-                TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css',
249
-                array(),
250
-                EVENT_ESPRESSO_VERSION
251
-            );
252
-            wp_enqueue_style('ticket_selector');
253
-            // make it dance
254
-            wp_register_script(
255
-                'ticket_selector', 
256
-                TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js', 
257
-                array('espresso_core'), 
258
-                EVENT_ESPRESSO_VERSION, 
259
-                TRUE
260
-            );
245
+			// add some style
246
+			wp_register_style(
247
+				'ticket_selector', 
248
+				TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css',
249
+				array(),
250
+				EVENT_ESPRESSO_VERSION
251
+			);
252
+			wp_enqueue_style('ticket_selector');
253
+			// make it dance
254
+			wp_register_script(
255
+				'ticket_selector', 
256
+				TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js', 
257
+				array('espresso_core'), 
258
+				EVENT_ESPRESSO_VERSION, 
259
+				TRUE
260
+			);
261 261
 			wp_enqueue_script('ticket_selector');
262
-            require_once( EE_LIBRARIES.'form_sections/strategies/display/EE_Checkbox_Dropdown_Selector_Display_Strategy.strategy.php');
263
-            \EE_Checkbox_Dropdown_Selector_Display_Strategy::enqueue_styles_and_scripts();
264
-        }
262
+			require_once( EE_LIBRARIES.'form_sections/strategies/display/EE_Checkbox_Dropdown_Selector_Display_Strategy.strategy.php');
263
+			\EE_Checkbox_Dropdown_Selector_Display_Strategy::enqueue_styles_and_scripts();
264
+		}
265
+	}
266
+
267
+
268
+
269
+	/**
270
+	 * @return void
271
+	 */
272
+	public static function loadIframeAssets()
273
+	{
274
+		// for event lists
275
+		add_filter(
276
+			'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__css',
277
+			array('EED_Ticket_Selector', 'iframeCss')
278
+		);
279
+		add_filter(
280
+			'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__js',
281
+			array('EED_Ticket_Selector', 'iframeJs')
282
+		);
283
+		// for ticket selectors
284
+		add_filter(
285
+			'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css',
286
+			array('EED_Ticket_Selector', 'iframeCss')
287
+		);
288
+		add_filter(
289
+			'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js',
290
+			array('EED_Ticket_Selector', 'iframeJs')
291
+		);
292
+	}
293
+
294
+
295
+
296
+	/**
297
+	 * Informs the rest of the forms system what CSS and JS is needed to display the input
298
+	 *
299
+	 * @param array $iframe_css
300
+	 * @return array
301
+	 */
302
+	public static function iframeCss(array $iframe_css)
303
+	{
304
+		$iframe_css['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css';
305
+		return $iframe_css;
265 306
 	}
266 307
 
267 308
 
268 309
 
269
-    /**
270
-     * @return void
271
-     */
272
-    public static function loadIframeAssets()
273
-    {
274
-        // for event lists
275
-        add_filter(
276
-            'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__css',
277
-            array('EED_Ticket_Selector', 'iframeCss')
278
-        );
279
-        add_filter(
280
-            'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__js',
281
-            array('EED_Ticket_Selector', 'iframeJs')
282
-        );
283
-        // for ticket selectors
284
-        add_filter(
285
-            'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css',
286
-            array('EED_Ticket_Selector', 'iframeCss')
287
-        );
288
-        add_filter(
289
-            'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js',
290
-            array('EED_Ticket_Selector', 'iframeJs')
291
-        );
292
-    }
293
-
294
-
295
-
296
-    /**
297
-     * Informs the rest of the forms system what CSS and JS is needed to display the input
298
-     *
299
-     * @param array $iframe_css
300
-     * @return array
301
-     */
302
-    public static function iframeCss(array $iframe_css)
303
-    {
304
-        $iframe_css['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css';
305
-        return $iframe_css;
306
-    }
307
-
308
-
309
-
310
-    /**
311
-     * Informs the rest of the forms system what CSS and JS is needed to display the input
312
-     *
313
-     * @param array $iframe_js
314
-     * @return array
315
-     */
316
-    public static function iframeJs(array $iframe_js)
317
-    {
318
-        $iframe_js['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js';
319
-        return $iframe_js;
320
-    }
310
+	/**
311
+	 * Informs the rest of the forms system what CSS and JS is needed to display the input
312
+	 *
313
+	 * @param array $iframe_js
314
+	 * @return array
315
+	 */
316
+	public static function iframeJs(array $iframe_js)
317
+	{
318
+		$iframe_js['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js';
319
+		return $iframe_js;
320
+	}
321 321
 
322 322
 
323 323
 	/****************************** DEPRECATED ******************************/
324 324
 
325 325
 
326 326
 
327
-    /**
328
-     * @deprecated
329
-     * @return string
330
-     * @throws \EE_Error
331
-     */
332
-    public static function display_view_details_btn()
333
-    {
334
-        // todo add doing_it_wrong() notice during next major version
335
-        return EED_Ticket_Selector::ticketSelector()->displayViewDetailsButton();
336
-    }
337
-
338
-
339
-
340
-    /**
341
-     * @deprecated
342
-     * @return string
343
-     * @throws \EE_Error
344
-     */
345
-    public static function display_ticket_selector_submit()
346
-    {
347
-        // todo add doing_it_wrong() notice during next major version
348
-        return EED_Ticket_Selector::ticketSelector()->displaySubmitButton();
349
-    }
350
-
351
-
352
-
353
-    /**
354
-     * @deprecated
355
-     * @param string $permalink_string
356
-     * @param int    $id
357
-     * @param string $new_title
358
-     * @param string $new_slug
359
-     * @return string
360
-     */
361
-    public static function iframe_code_button($permalink_string, $id, $new_title = '', $new_slug = '')
362
-    {
363
-        // todo add doing_it_wrong() notice during next major version
364
-        if (
365
-        	\EE_Registry::instance()->REQ->get('page') === 'espresso_events'
366
-        	&& \EE_Registry::instance()->REQ->get('action') === 'edit'
367
-        ) {
368
-            $iframe_embed_button = \EED_Ticket_Selector::getIframeEmbedButton();
369
-            $iframe_embed_button->addEventEditorIframeEmbedButton();
370
-        }
371
-        return '';
372
-    }
373
-
374
-
375
-
376
-    /**
377
-     * @deprecated
378
-     * @param int    $ID
379
-     * @param string $external_url
380
-     * @return string
381
-     */
382
-    public static function ticket_selector_form_open($ID = 0, $external_url = '')
383
-    {
384
-        // todo add doing_it_wrong() notice during next major version
385
-        return EED_Ticket_Selector::ticketSelector()->formOpen($ID, $external_url);
386
-    }
387
-
388
-
389
-
390
-    /**
391
-     * @deprecated
392
-     * @return string
393
-     */
394
-    public static function ticket_selector_form_close()
395
-    {
396
-        // todo add doing_it_wrong() notice during next major version
397
-        return EED_Ticket_Selector::ticketSelector()->formClose();
398
-    }
399
-
400
-
401
-
402
-    /**
403
-     * @deprecated
404
-     * @return string
405
-     */
406
-    public static function no_tkt_slctr_end_dv()
407
-    {
408
-        // todo add doing_it_wrong() notice during next major version
409
-        return EED_Ticket_Selector::ticketSelector()->ticketSelectorEndDiv();
410
-    }
411
-
412
-
413
-
414
-    /**
415
-     * @deprecated 4.9.13
416
-     * @return string
417
-     */
418
-    public static function tkt_slctr_end_dv()
419
-    {
420
-        return EED_Ticket_Selector::ticketSelector()->clearTicketSelector();
421
-    }
422
-
423
-
424
-
425
-    /**
426
-     * @deprecated
427
-     * @return string
428
-     */
429
-    public static function clear_tkt_slctr()
430
-    {
431
-        return EED_Ticket_Selector::ticketSelector()->clearTicketSelector();
432
-    }
433
-
434
-
435
-
436
-    /**
437
-     * @deprecated
438
-     */
439
-    public static function load_tckt_slctr_assets_admin()
440
-    {
441
-        // todo add doing_it_wrong() notice during next major version
442
-	    if (
443
-		    \EE_Registry::instance()->REQ->get( 'page' ) === 'espresso_events'
444
-		    && \EE_Registry::instance()->REQ->get( 'action' ) === 'edit'
445
-	    ) {
446
-		    $iframe_embed_button = \EED_Ticket_Selector::getIframeEmbedButton();
447
-            $iframe_embed_button->embedButtonAssets();
448
-        }
449
-    }
327
+	/**
328
+	 * @deprecated
329
+	 * @return string
330
+	 * @throws \EE_Error
331
+	 */
332
+	public static function display_view_details_btn()
333
+	{
334
+		// todo add doing_it_wrong() notice during next major version
335
+		return EED_Ticket_Selector::ticketSelector()->displayViewDetailsButton();
336
+	}
337
+
338
+
339
+
340
+	/**
341
+	 * @deprecated
342
+	 * @return string
343
+	 * @throws \EE_Error
344
+	 */
345
+	public static function display_ticket_selector_submit()
346
+	{
347
+		// todo add doing_it_wrong() notice during next major version
348
+		return EED_Ticket_Selector::ticketSelector()->displaySubmitButton();
349
+	}
350
+
351
+
352
+
353
+	/**
354
+	 * @deprecated
355
+	 * @param string $permalink_string
356
+	 * @param int    $id
357
+	 * @param string $new_title
358
+	 * @param string $new_slug
359
+	 * @return string
360
+	 */
361
+	public static function iframe_code_button($permalink_string, $id, $new_title = '', $new_slug = '')
362
+	{
363
+		// todo add doing_it_wrong() notice during next major version
364
+		if (
365
+			\EE_Registry::instance()->REQ->get('page') === 'espresso_events'
366
+			&& \EE_Registry::instance()->REQ->get('action') === 'edit'
367
+		) {
368
+			$iframe_embed_button = \EED_Ticket_Selector::getIframeEmbedButton();
369
+			$iframe_embed_button->addEventEditorIframeEmbedButton();
370
+		}
371
+		return '';
372
+	}
373
+
374
+
375
+
376
+	/**
377
+	 * @deprecated
378
+	 * @param int    $ID
379
+	 * @param string $external_url
380
+	 * @return string
381
+	 */
382
+	public static function ticket_selector_form_open($ID = 0, $external_url = '')
383
+	{
384
+		// todo add doing_it_wrong() notice during next major version
385
+		return EED_Ticket_Selector::ticketSelector()->formOpen($ID, $external_url);
386
+	}
387
+
388
+
389
+
390
+	/**
391
+	 * @deprecated
392
+	 * @return string
393
+	 */
394
+	public static function ticket_selector_form_close()
395
+	{
396
+		// todo add doing_it_wrong() notice during next major version
397
+		return EED_Ticket_Selector::ticketSelector()->formClose();
398
+	}
399
+
400
+
401
+
402
+	/**
403
+	 * @deprecated
404
+	 * @return string
405
+	 */
406
+	public static function no_tkt_slctr_end_dv()
407
+	{
408
+		// todo add doing_it_wrong() notice during next major version
409
+		return EED_Ticket_Selector::ticketSelector()->ticketSelectorEndDiv();
410
+	}
411
+
412
+
413
+
414
+	/**
415
+	 * @deprecated 4.9.13
416
+	 * @return string
417
+	 */
418
+	public static function tkt_slctr_end_dv()
419
+	{
420
+		return EED_Ticket_Selector::ticketSelector()->clearTicketSelector();
421
+	}
422
+
423
+
424
+
425
+	/**
426
+	 * @deprecated
427
+	 * @return string
428
+	 */
429
+	public static function clear_tkt_slctr()
430
+	{
431
+		return EED_Ticket_Selector::ticketSelector()->clearTicketSelector();
432
+	}
433
+
434
+
435
+
436
+	/**
437
+	 * @deprecated
438
+	 */
439
+	public static function load_tckt_slctr_assets_admin()
440
+	{
441
+		// todo add doing_it_wrong() notice during next major version
442
+		if (
443
+			\EE_Registry::instance()->REQ->get( 'page' ) === 'espresso_events'
444
+			&& \EE_Registry::instance()->REQ->get( 'action' ) === 'edit'
445
+		) {
446
+			$iframe_embed_button = \EED_Ticket_Selector::getIframeEmbedButton();
447
+			$iframe_embed_button->embedButtonAssets();
448
+		}
449
+	}
450 450
 
451 451
 
452 452
 }
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 use EventEspresso\modules\ticket_selector\TicketSelectorIframe;
4 4
 use EventEspresso\modules\ticket_selector\TicketSelectorIframeEmbedButton;
5 5
 
6
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
7
-	exit( 'No direct script access allowed' );
6
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
7
+	exit('No direct script access allowed');
8 8
 }
9 9
 
10 10
 
@@ -38,15 +38,15 @@  discard block
 block discarded – undo
38 38
 	 * @return EED_Ticket_Selector
39 39
 	 */
40 40
 	public static function instance() {
41
-		return parent::get_instance( __CLASS__ );
41
+		return parent::get_instance(__CLASS__);
42 42
 	}
43 43
 
44 44
 
45 45
 
46
-	protected function set_config(){
47
-		$this->set_config_section( 'template_settings' );
48
-		$this->set_config_class( 'EE_Ticket_Selector_Config' );
49
-		$this->set_config_name( 'EED_Ticket_Selector' );
46
+	protected function set_config() {
47
+		$this->set_config_section('template_settings');
48
+		$this->set_config_class('EE_Ticket_Selector_Config');
49
+		$this->set_config_name('EED_Ticket_Selector');
50 50
 	}
51 51
 
52 52
 
@@ -59,13 +59,13 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	public static function set_hooks() {
61 61
 		// routing
62
-		EE_Config::register_route( 'iframe', 'EED_Ticket_Selector', 'ticket_selector_iframe', 'ticket_selector' );
63
-		EE_Config::register_route( 'process_ticket_selections', 'EED_Ticket_Selector', 'process_ticket_selections' );
62
+		EE_Config::register_route('iframe', 'EED_Ticket_Selector', 'ticket_selector_iframe', 'ticket_selector');
63
+		EE_Config::register_route('process_ticket_selections', 'EED_Ticket_Selector', 'process_ticket_selections');
64 64
         EE_Config::register_route('cancel_ticket_selections', 'EED_Ticket_Selector', 'cancel_ticket_selections');
65
-        add_action( 'wp_loaded', array( 'EED_Ticket_Selector', 'set_definitions' ), 2 );
66
-		add_action( 'AHEE_event_details_header_bottom', array( 'EED_Ticket_Selector', 'display_ticket_selector' ), 10, 1 );
67
-        add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'translate_js_strings' ), 0 );
68
-        add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'load_tckt_slctr_assets' ), 10 );
65
+        add_action('wp_loaded', array('EED_Ticket_Selector', 'set_definitions'), 2);
66
+		add_action('AHEE_event_details_header_bottom', array('EED_Ticket_Selector', 'display_ticket_selector'), 10, 1);
67
+        add_action('wp_enqueue_scripts', array('EED_Ticket_Selector', 'translate_js_strings'), 0);
68
+        add_action('wp_enqueue_scripts', array('EED_Ticket_Selector', 'load_tckt_slctr_assets'), 10);
69 69
         EED_Ticket_Selector::loadIframeAssets();
70 70
     }
71 71
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 		// to load assets for "espresso_events" page on the "edit" route (action)
83 83
 		add_action(
84 84
 			'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_events__edit',
85
-			array( 'EED_Ticket_Selector', 'ticket_selector_iframe_embed_button' ),
85
+			array('EED_Ticket_Selector', 'ticket_selector_iframe_embed_button'),
86 86
 			10
87 87
 		);
88 88
 
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 	 *  @return 	void
107 107
 	 */
108 108
 	public static function set_definitions() {
109
-		define( 'TICKET_SELECTOR_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS );
110
-		define( 'TICKET_SELECTOR_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS );
109
+		define('TICKET_SELECTOR_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS);
110
+		define('TICKET_SELECTOR_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS);
111 111
 
112 112
 		//if config is not set, initialize
113
-		if ( ! EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector instanceof EE_Ticket_Selector_Config ) {
113
+		if ( ! EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector instanceof EE_Ticket_Selector_Config) {
114 114
             \EED_Ticket_Selector::instance()->set_config();
115 115
             \EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector = \EED_Ticket_Selector::instance()->config();
116 116
 		}
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 * 	@param	WP $WP
138 138
 	 * 	@return void
139 139
 	 */
140
-	public function run( $WP ) {}
140
+	public function run($WP) {}
141 141
 
142 142
 
143 143
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	 * @return \EventEspresso\modules\ticket_selector\TicketSelectorIframeEmbedButton
146 146
 	 */
147 147
 	public static function getIframeEmbedButton() {
148
-		if ( ! self::$iframe_embed_button instanceof TicketSelectorIframeEmbedButton ) {
148
+		if ( ! self::$iframe_embed_button instanceof TicketSelectorIframeEmbedButton) {
149 149
 			self::$iframe_embed_button = new TicketSelectorIframeEmbedButton();
150 150
 		}
151 151
 		return self::$iframe_embed_button;
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
      * @return    string
190 190
      * @throws \EE_Error
191 191
      */
192
-	public static function display_ticket_selector( $event = NULL, $view_details = FALSE ) {
193
-		return EED_Ticket_Selector::ticketSelector()->display( $event, $view_details );
192
+	public static function display_ticket_selector($event = NULL, $view_details = FALSE) {
193
+		return EED_Ticket_Selector::ticketSelector()->display($event, $view_details);
194 194
 	}
195 195
 
196 196
 
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
 	* 	@return 		void
242 242
 	*/
243 243
 	public static function load_tckt_slctr_assets() {
244
-		if ( apply_filters( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE ) ) {
244
+		if (apply_filters('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE)) {
245 245
             // add some style
246 246
             wp_register_style(
247 247
                 'ticket_selector', 
248
-                TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css',
248
+                TICKET_SELECTOR_ASSETS_URL.'ticket_selector.css',
249 249
                 array(),
250 250
                 EVENT_ESPRESSO_VERSION
251 251
             );
@@ -253,13 +253,13 @@  discard block
 block discarded – undo
253 253
             // make it dance
254 254
             wp_register_script(
255 255
                 'ticket_selector', 
256
-                TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js', 
256
+                TICKET_SELECTOR_ASSETS_URL.'ticket_selector.js', 
257 257
                 array('espresso_core'), 
258 258
                 EVENT_ESPRESSO_VERSION, 
259 259
                 TRUE
260 260
             );
261 261
 			wp_enqueue_script('ticket_selector');
262
-            require_once( EE_LIBRARIES.'form_sections/strategies/display/EE_Checkbox_Dropdown_Selector_Display_Strategy.strategy.php');
262
+            require_once(EE_LIBRARIES.'form_sections/strategies/display/EE_Checkbox_Dropdown_Selector_Display_Strategy.strategy.php');
263 263
             \EE_Checkbox_Dropdown_Selector_Display_Strategy::enqueue_styles_and_scripts();
264 264
         }
265 265
 	}
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
      */
302 302
     public static function iframeCss(array $iframe_css)
303 303
     {
304
-        $iframe_css['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css';
304
+        $iframe_css['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL.'ticket_selector.css';
305 305
         return $iframe_css;
306 306
     }
307 307
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
      */
316 316
     public static function iframeJs(array $iframe_js)
317 317
     {
318
-        $iframe_js['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js';
318
+        $iframe_js['ticket_selector'] = TICKET_SELECTOR_ASSETS_URL.'ticket_selector.js';
319 319
         return $iframe_js;
320 320
     }
321 321
 
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
     {
441 441
         // todo add doing_it_wrong() notice during next major version
442 442
 	    if (
443
-		    \EE_Registry::instance()->REQ->get( 'page' ) === 'espresso_events'
444
-		    && \EE_Registry::instance()->REQ->get( 'action' ) === 'edit'
443
+		    \EE_Registry::instance()->REQ->get('page') === 'espresso_events'
444
+		    && \EE_Registry::instance()->REQ->get('action') === 'edit'
445 445
 	    ) {
446 446
 		    $iframe_embed_button = \EED_Ticket_Selector::getIframeEmbedButton();
447 447
             $iframe_embed_button->embedButtonAssets();
Please login to merge, or discard this patch.
admin_pages/support/Support_Admin_Page.core.php 2 patches
Indentation   +234 added lines, -234 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if (! defined('EVENT_ESPRESSO_VERSION')) {
3
-    exit('NO direct script access allowed');
3
+	exit('NO direct script access allowed');
4 4
 }
5 5
 
6 6
 
@@ -19,263 +19,263 @@  discard block
 block discarded – undo
19 19
 
20 20
 
21 21
 
22
-    protected function _init_page_props()
23
-    {
24
-        $this->page_slug = EE_SUPPORT_PG_SLUG;
25
-        $this->page_label = esc_html__('Help & Support', 'event_espresso');
26
-        $this->_admin_base_url = EE_SUPPORT_ADMIN_URL;
27
-        $this->_admin_base_path = EE_SUPPORT_ADMIN;
28
-    }
22
+	protected function _init_page_props()
23
+	{
24
+		$this->page_slug = EE_SUPPORT_PG_SLUG;
25
+		$this->page_label = esc_html__('Help & Support', 'event_espresso');
26
+		$this->_admin_base_url = EE_SUPPORT_ADMIN_URL;
27
+		$this->_admin_base_path = EE_SUPPORT_ADMIN;
28
+	}
29 29
 
30 30
 
31 31
 
32
-    protected function _ajax_hooks()
33
-    {
34
-    }
32
+	protected function _ajax_hooks()
33
+	{
34
+	}
35 35
 
36 36
 
37 37
 
38
-    protected function _define_page_props()
39
-    {
40
-        $this->_labels = array();
41
-        $this->_admin_page_title = $this->page_label;
42
-    }
38
+	protected function _define_page_props()
39
+	{
40
+		$this->_labels = array();
41
+		$this->_admin_page_title = $this->page_label;
42
+	}
43 43
 
44 44
 
45 45
 
46
-    protected function _set_page_routes()
47
-    {
48
-        $this->_page_routes = array(
49
-            'default'    => array(
50
-                'func'       => '_contact_support',
51
-                'capability' => 'ee_read_ee',
52
-            ),
53
-            'developers' => array(
54
-                'func'       => '_developers',
55
-                'capability' => 'ee_read_ee',
56
-            ),
57
-            'shortcodes' => array(
58
-                'func'       => '_shortcodes',
59
-                'capability' => 'ee_read_ee',
60
-            ),
61
-        );
62
-    }
46
+	protected function _set_page_routes()
47
+	{
48
+		$this->_page_routes = array(
49
+			'default'    => array(
50
+				'func'       => '_contact_support',
51
+				'capability' => 'ee_read_ee',
52
+			),
53
+			'developers' => array(
54
+				'func'       => '_developers',
55
+				'capability' => 'ee_read_ee',
56
+			),
57
+			'shortcodes' => array(
58
+				'func'       => '_shortcodes',
59
+				'capability' => 'ee_read_ee',
60
+			),
61
+		);
62
+	}
63 63
 
64 64
 
65 65
 
66
-    protected function _set_page_config()
67
-    {
68
-        $this->_page_config = array(
69
-            'default'    => array(
70
-                'nav'           => array(
71
-                    'label' => esc_html__('Support', 'event_espresso'),
72
-                    'order' => 30,
73
-                ),
74
-                'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_support_boxes')),
75
-                'require_nonce' => false,
76
-            ),
77
-            'developers' => array(
78
-                'nav'           => array(
79
-                    'label' => esc_html__('Developers', 'event_espresso'),
80
-                    'order' => 50,
81
-                ),
82
-                'metaboxes'     => $this->_default_espresso_metaboxes,
83
-                'require_nonce' => false,
84
-            ),
85
-            'shortcodes' => array(
86
-                'nav'           => array(
87
-                    'label' => esc_html__('Shortcodes', 'event_espresso'),
88
-                    'order' => 60,
89
-                ),
90
-                'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_shortcodes_boxes')),
91
-                'require_nonce' => false,
92
-            ),
93
-        );
94
-    }
66
+	protected function _set_page_config()
67
+	{
68
+		$this->_page_config = array(
69
+			'default'    => array(
70
+				'nav'           => array(
71
+					'label' => esc_html__('Support', 'event_espresso'),
72
+					'order' => 30,
73
+				),
74
+				'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_support_boxes')),
75
+				'require_nonce' => false,
76
+			),
77
+			'developers' => array(
78
+				'nav'           => array(
79
+					'label' => esc_html__('Developers', 'event_espresso'),
80
+					'order' => 50,
81
+				),
82
+				'metaboxes'     => $this->_default_espresso_metaboxes,
83
+				'require_nonce' => false,
84
+			),
85
+			'shortcodes' => array(
86
+				'nav'           => array(
87
+					'label' => esc_html__('Shortcodes', 'event_espresso'),
88
+					'order' => 60,
89
+				),
90
+				'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_shortcodes_boxes')),
91
+				'require_nonce' => false,
92
+			),
93
+		);
94
+	}
95 95
 
96 96
 
97 97
 
98
-    //none of the below group are currently used for Support pages
99
-    protected function _add_screen_options()
100
-    {
101
-    }
102
-
98
+	//none of the below group are currently used for Support pages
99
+	protected function _add_screen_options()
100
+	{
101
+	}
102
+
103 103
 
104 104
 
105
-    protected function _add_feature_pointers()
106
-    {
107
-    }
105
+	protected function _add_feature_pointers()
106
+	{
107
+	}
108 108
 
109 109
 
110 110
 
111
-    public function admin_init()
112
-    {
113
-    }
111
+	public function admin_init()
112
+	{
113
+	}
114 114
 
115 115
 
116 116
 
117
-    public function admin_notices()
118
-    {
119
-    }
117
+	public function admin_notices()
118
+	{
119
+	}
120 120
 
121
-
122
-
123
-    public function admin_footer_scripts()
124
-    {
125
-    }
126
-
127
-
128
-
129
-    public function load_scripts_styles()
130
-    {
131
-    }
132
-
133
-
134
-
135
-    protected function _installation()
136
-    {
137
-        $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php';
138
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template(
139
-            $template_path,
140
-            '',
141
-            true
142
-        );
143
-        $this->display_admin_page_with_sidebar();
144
-    }
145
-
146
-
147
-
148
-    protected function _resources()
149
-    {
150
-        $this->display_admin_page_with_sidebar();
151
-    }
152
-
153
-
154
-
155
-    protected function _add_settings_metabox($box, $label, array $args)
156
-    {
157
-        add_meta_box(
158
-            "espresso_{$box}_settings",
159
-            $label,
160
-            function ($post, $metabox) {
161
-                echo EEH_Template::display_template(
162
-                    $metabox['args']['template_path'],
163
-                    $metabox['args']['template_args'],
164
-                    true
165
-                );
166
-            },
167
-            $this->_current_screen->id,
168
-            'normal',
169
-            'high',
170
-            apply_filters(
171
-                "FHEE__Support_Admin_Page___add_settings_metabox__{$box}_args_array",
172
-                $args
173
-            )
174
-        );
175
-    }
176
-
177
-
178
-
179
-    protected function _resources_boxes()
180
-    {
181
-        $boxes = apply_filters(
182
-            'FHEE__Support_Admin_Page___resources_boxes__boxes_array',
183
-            array(
184
-                'favorite_theme_developers' => esc_html__('Favorite Theme Developers', 'event_espresso'),
185
-                'highly_recommended_themes' => esc_html__('Highly Recommended Themes', 'event_espresso'),
186
-                'hire_developer'            => esc_html__('Hire a Developer', 'event_espresso'),
187
-                'partners'                  => esc_html__('Partners', 'event_espresso'),
188
-                'recommended_plugins'       => esc_html__('Recommended Plugins', 'event_espresso'),
189
-                'other_resources'           => esc_html__('Other Resources', 'event_espresso'),
190
-            )
191
-        );
192
-        foreach ($boxes as $box => $label) {
193
-            $this->_add_settings_metabox(
194
-                $box,
195
-                $label,
196
-                array(
197
-                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
198
-                    'template_args' => $this->_template_args,
199
-                )
200
-            );
201
-        }
202
-    }
203
-
204
-
205
-
206
-    protected function _shortcodes()
207
-    {
208
-        $this->display_admin_page_with_sidebar();
209
-    }
210
-
211
-
212
-
213
-    protected function _shortcodes_boxes()
214
-    {
215
-        $boxes = apply_filters(
216
-            'FHEE__Support_Admin_Page___shortcodes_boxes__boxes_array',
217
-            array(
218
-                'shortcodes_event_listings'  => esc_html__('Event Listings', 'event_espresso'),
219
-                'shortcodes_ticket_selector' => esc_html__('Event Ticket Selector', 'event_espresso'),
220
-                'shortcodes_category'        => esc_html__('Event Categories', 'event_espresso'),
221
-                'shortcodes_attendee'        => esc_html__('Event Attendees', 'event_espresso')
222
-                /*'shortcodes_single_events' => esc_html__('Single Events', 'event_espresso'),*/
223
-                /*'shortcodes_attendee_listings' => esc_html__('Attendee Listings', 'event_espresso'),*/
224
-            )
225
-        );
226
-        foreach ($boxes as $box => $label) {
227
-            $this->_add_settings_metabox(
228
-                $box,
229
-                $label,
230
-                array(
231
-                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
232
-                    'template_args' => $this->_template_args,
233
-                )
234
-            );
235
-        }
236
-    }
237
-
238
-
239
-
240
-    protected function _contact_support()
241
-    {
242
-        $this->display_admin_page_with_sidebar();
243
-    }
244
-
245
-
246
-
247
-    protected function _support_boxes()
248
-    {
249
-        $boxes = apply_filters(
250
-            'FHEE__Support_Admin_Page___support_boxes__boxes_array',
251
-            array(
252
-                'contact_support'       => esc_html__('Contact Support', 'event_espresso'),
253
-                'important_information' => esc_html__('Important Information', 'event_espresso'),
254
-            )
255
-        );
256
-        foreach ($boxes as $box => $label) {
257
-            $this->_add_settings_metabox(
258
-                $box,
259
-                $label,
260
-                array(
261
-                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
262
-                    'template_args' => $this->_template_args,
263
-                )
264
-            );
265
-        }
266
-    }
267
-
268
-
269
-
270
-    protected function _developers()
271
-    {
272
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template(
273
-            EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php',
274
-            array(),
275
-            true
276
-        );
277
-        $this->display_admin_page_with_sidebar();
278
-    }
121
+
122
+
123
+	public function admin_footer_scripts()
124
+	{
125
+	}
126
+
127
+
128
+
129
+	public function load_scripts_styles()
130
+	{
131
+	}
132
+
133
+
134
+
135
+	protected function _installation()
136
+	{
137
+		$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php';
138
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
139
+			$template_path,
140
+			'',
141
+			true
142
+		);
143
+		$this->display_admin_page_with_sidebar();
144
+	}
145
+
146
+
147
+
148
+	protected function _resources()
149
+	{
150
+		$this->display_admin_page_with_sidebar();
151
+	}
152
+
153
+
154
+
155
+	protected function _add_settings_metabox($box, $label, array $args)
156
+	{
157
+		add_meta_box(
158
+			"espresso_{$box}_settings",
159
+			$label,
160
+			function ($post, $metabox) {
161
+				echo EEH_Template::display_template(
162
+					$metabox['args']['template_path'],
163
+					$metabox['args']['template_args'],
164
+					true
165
+				);
166
+			},
167
+			$this->_current_screen->id,
168
+			'normal',
169
+			'high',
170
+			apply_filters(
171
+				"FHEE__Support_Admin_Page___add_settings_metabox__{$box}_args_array",
172
+				$args
173
+			)
174
+		);
175
+	}
176
+
177
+
178
+
179
+	protected function _resources_boxes()
180
+	{
181
+		$boxes = apply_filters(
182
+			'FHEE__Support_Admin_Page___resources_boxes__boxes_array',
183
+			array(
184
+				'favorite_theme_developers' => esc_html__('Favorite Theme Developers', 'event_espresso'),
185
+				'highly_recommended_themes' => esc_html__('Highly Recommended Themes', 'event_espresso'),
186
+				'hire_developer'            => esc_html__('Hire a Developer', 'event_espresso'),
187
+				'partners'                  => esc_html__('Partners', 'event_espresso'),
188
+				'recommended_plugins'       => esc_html__('Recommended Plugins', 'event_espresso'),
189
+				'other_resources'           => esc_html__('Other Resources', 'event_espresso'),
190
+			)
191
+		);
192
+		foreach ($boxes as $box => $label) {
193
+			$this->_add_settings_metabox(
194
+				$box,
195
+				$label,
196
+				array(
197
+					'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
198
+					'template_args' => $this->_template_args,
199
+				)
200
+			);
201
+		}
202
+	}
203
+
204
+
205
+
206
+	protected function _shortcodes()
207
+	{
208
+		$this->display_admin_page_with_sidebar();
209
+	}
210
+
211
+
212
+
213
+	protected function _shortcodes_boxes()
214
+	{
215
+		$boxes = apply_filters(
216
+			'FHEE__Support_Admin_Page___shortcodes_boxes__boxes_array',
217
+			array(
218
+				'shortcodes_event_listings'  => esc_html__('Event Listings', 'event_espresso'),
219
+				'shortcodes_ticket_selector' => esc_html__('Event Ticket Selector', 'event_espresso'),
220
+				'shortcodes_category'        => esc_html__('Event Categories', 'event_espresso'),
221
+				'shortcodes_attendee'        => esc_html__('Event Attendees', 'event_espresso')
222
+				/*'shortcodes_single_events' => esc_html__('Single Events', 'event_espresso'),*/
223
+				/*'shortcodes_attendee_listings' => esc_html__('Attendee Listings', 'event_espresso'),*/
224
+			)
225
+		);
226
+		foreach ($boxes as $box => $label) {
227
+			$this->_add_settings_metabox(
228
+				$box,
229
+				$label,
230
+				array(
231
+					'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
232
+					'template_args' => $this->_template_args,
233
+				)
234
+			);
235
+		}
236
+	}
237
+
238
+
239
+
240
+	protected function _contact_support()
241
+	{
242
+		$this->display_admin_page_with_sidebar();
243
+	}
244
+
245
+
246
+
247
+	protected function _support_boxes()
248
+	{
249
+		$boxes = apply_filters(
250
+			'FHEE__Support_Admin_Page___support_boxes__boxes_array',
251
+			array(
252
+				'contact_support'       => esc_html__('Contact Support', 'event_espresso'),
253
+				'important_information' => esc_html__('Important Information', 'event_espresso'),
254
+			)
255
+		);
256
+		foreach ($boxes as $box => $label) {
257
+			$this->_add_settings_metabox(
258
+				$box,
259
+				$label,
260
+				array(
261
+					'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
262
+					'template_args' => $this->_template_args,
263
+				)
264
+			);
265
+		}
266
+	}
267
+
268
+
269
+
270
+	protected function _developers()
271
+	{
272
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
273
+			EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php',
274
+			array(),
275
+			true
276
+		);
277
+		$this->display_admin_page_with_sidebar();
278
+	}
279 279
 
280 280
 
281 281
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined('EVENT_ESPRESSO_VERSION')) {
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3 3
     exit('NO direct script access allowed');
4 4
 }
5 5
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
     protected function _installation()
136 136
     {
137
-        $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php';
137
+        $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_installation.template.php';
138 138
         $this->_template_args['admin_page_content'] = EEH_Template::display_template(
139 139
             $template_path,
140 140
             '',
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         add_meta_box(
158 158
             "espresso_{$box}_settings",
159 159
             $label,
160
-            function ($post, $metabox) {
160
+            function($post, $metabox) {
161 161
                 echo EEH_Template::display_template(
162 162
                     $metabox['args']['template_path'],
163 163
                     $metabox['args']['template_args'],
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                 $box,
195 195
                 $label,
196 196
                 array(
197
-                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
197
+                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH."support_admin_details_{$box}.template.php",
198 198
                     'template_args' => $this->_template_args,
199 199
                 )
200 200
             );
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
                 $box,
229 229
                 $label,
230 230
                 array(
231
-                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
231
+                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH."support_admin_details_{$box}.template.php",
232 232
                     'template_args' => $this->_template_args,
233 233
                 )
234 234
             );
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
                 $box,
259 259
                 $label,
260 260
                 array(
261
-                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
261
+                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH."support_admin_details_{$box}.template.php",
262 262
                     'template_args' => $this->_template_args,
263 263
                 )
264 264
             );
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
     protected function _developers()
271 271
     {
272 272
         $this->_template_args['admin_page_content'] = EEH_Template::display_template(
273
-            EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php',
273
+            EE_SUPPORT_ADMIN_TEMPLATE_PATH.'developers_admin_details.template.php',
274 274
             array(),
275 275
             true
276 276
         );
Please login to merge, or discard this patch.
form_sections/strategies/normalization/EE_Int_Normalization.strategy.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 		}
21 21
 
22 22
 		if ( is_null( $value_to_normalize ) || $value_to_normalize === '' ) {
23
-		    return null;
24
-        }
23
+			return null;
24
+		}
25 25
 
26 26
 		if( ! is_string( $value_to_normalize )){
27 27
 			throw new EE_Validation_Error( sprintf( __( 'The value "%s" must be a string submitted for normalization, it was %s', 'event_espresso' ), print_r( $value_to_normalize, TRUE), gettype( $value_to_normalize ) ) );
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
 	 * @return string
57 57
 	 */
58 58
 	public function unnormalize( $normalized_value ) {
59
-	    if ($normalized_value === null || $normalized_value === '') {
60
-	        return '';
61
-        }elseif( empty( $normalized_value ) ){
59
+		if ($normalized_value === null || $normalized_value === '') {
60
+			return '';
61
+		}elseif( empty( $normalized_value ) ){
62 62
 			return '0';
63 63
 		}else{
64 64
 			return "$normalized_value";
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  * @subpackage
8 8
  * @author				Mike Nelson
9 9
  */
10
-class EE_Int_Normalization extends EE_Normalization_Strategy_Base{
10
+class EE_Int_Normalization extends EE_Normalization_Strategy_Base {
11 11
 
12 12
 	/**
13 13
 	 * @param string $value_to_normalize
@@ -15,38 +15,38 @@  discard block
 block discarded – undo
15 15
 	 * @throws \EE_Validation_Error
16 16
 	 */
17 17
 	public function normalize($value_to_normalize) {
18
-		if( is_int( $value_to_normalize ) ){
18
+		if (is_int($value_to_normalize)) {
19 19
 			return $value_to_normalize;
20 20
 		}
21 21
 
22
-		if ( is_null( $value_to_normalize ) || $value_to_normalize === '' ) {
22
+		if (is_null($value_to_normalize) || $value_to_normalize === '') {
23 23
 		    return null;
24 24
         }
25 25
 
26
-		if( ! is_string( $value_to_normalize )){
27
-			throw new EE_Validation_Error( sprintf( __( 'The value "%s" must be a string submitted for normalization, it was %s', 'event_espresso' ), print_r( $value_to_normalize, TRUE), gettype( $value_to_normalize ) ) );
26
+		if ( ! is_string($value_to_normalize)) {
27
+			throw new EE_Validation_Error(sprintf(__('The value "%s" must be a string submitted for normalization, it was %s', 'event_espresso'), print_r($value_to_normalize, TRUE), gettype($value_to_normalize)));
28 28
 		}
29 29
 		$thousands_separator = EE_Config::instance()->currency->thsnds;
30
-		$value_to_normalize = str_replace( $thousands_separator, "", $value_to_normalize );
31
-		$value_to_normalize = str_replace( array(" ","\t"), '', $value_to_normalize );
32
-		if ( preg_match( '/^\d+$/', $value_to_normalize )) {
33
-			return intval( $value_to_normalize );
30
+		$value_to_normalize = str_replace($thousands_separator, "", $value_to_normalize);
31
+		$value_to_normalize = str_replace(array(" ", "\t"), '', $value_to_normalize);
32
+		if (preg_match('/^\d+$/', $value_to_normalize)) {
33
+			return intval($value_to_normalize);
34 34
 		} else {
35 35
 			//find if this input has a int validation strategy
36 36
 			//in which case, use its message
37 37
 			$validation_error_message = NULL;
38
-			foreach( $this->_input->get_validation_strategies() as $validation_strategy ){
39
-				if( $validation_strategy instanceof EE_Int_Validation_Strategy ){
38
+			foreach ($this->_input->get_validation_strategies() as $validation_strategy) {
39
+				if ($validation_strategy instanceof EE_Int_Validation_Strategy) {
40 40
 					$validation_error_message = $validation_strategy->get_validation_error_message();
41 41
 				}
42 42
 			}
43 43
 			//this really shouldn't ever happen because fields with a int normalization strategy
44 44
 			//should also have a int validation strategy, but in case it doesnt use the default
45
-			if( ! $validation_error_message ){
45
+			if ( ! $validation_error_message) {
46 46
 				$default_validation_strategy = new EE_Int_Validation_Strategy();
47 47
 				$validation_error_message = $default_validation_strategy->get_validation_error_message();
48 48
 			}
49
-			throw new EE_Validation_Error( $validation_error_message, 'numeric_only' );
49
+			throw new EE_Validation_Error($validation_error_message, 'numeric_only');
50 50
 		}
51 51
 	}
52 52
 
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
 	 * @param int $normalized_value
56 56
 	 * @return string
57 57
 	 */
58
-	public function unnormalize( $normalized_value ) {
58
+	public function unnormalize($normalized_value) {
59 59
 	    if ($normalized_value === null || $normalized_value === '') {
60 60
 	        return '';
61
-        }elseif( empty( $normalized_value ) ){
61
+        }elseif (empty($normalized_value)) {
62 62
 			return '0';
63
-		}else{
63
+		} else {
64 64
 			return "$normalized_value";
65 65
 		}
66 66
 	}
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,9 +58,9 @@
 block discarded – undo
58 58
 	public function unnormalize( $normalized_value ) {
59 59
 	    if ($normalized_value === null || $normalized_value === '') {
60 60
 	        return '';
61
-        }elseif( empty( $normalized_value ) ){
61
+        } elseif( empty( $normalized_value ) ){
62 62
 			return '0';
63
-		}else{
63
+		} else{
64 64
 			return "$normalized_value";
65 65
 		}
66 66
 	}
Please login to merge, or discard this patch.
core/libraries/rest_api/calculations/Registration.php 1 patch
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  * @since                 $VID:$
14 14
  */
15 15
 if (! defined('EVENT_ESPRESSO_VERSION')) {
16
-    exit('No direct script access allowed');
16
+	exit('No direct script access allowed');
17 17
 }
18 18
 
19 19
 
@@ -21,58 +21,58 @@  discard block
 block discarded – undo
21 21
 class Registration extends Calculations_Base
22 22
 {
23 23
 
24
-    /**
25
-     * Calculates the checkin status for each datetime this registration has access to
26
-     *
27
-     * @param array            $wpdb_row
28
-     * @param \WP_REST_Request $request
29
-     * @param Base             $controller
30
-     * @return int
31
-     * @throws \EE_Error
32
-     */
33
-    public static function datetime_checkin_stati($wpdb_row, $request, $controller)
34
-    {
35
-        if (is_array($wpdb_row) && isset($wpdb_row['Registration.REG_ID'])) {
36
-            $reg = \EEM_Registration::instance()->get_one_by_ID($wpdb_row['Registration.REG_ID']);
37
-        } else {
38
-            $reg = null;
39
-        }
40
-        if (! $reg instanceof \EE_Registration
41
-        ) {
42
-            throw new \EE_Error(
43
-                sprintf(
44
-                    __('Cannot calculate datetime_checkin_stati because the registration with ID %1$s (from database row %2$s) was not found',
45
-                        'event_espresso'),
46
-                    $wpdb_row['Registration.REG_ID'],
47
-                    print_r($wpdb_row, true)
48
-                )
49
-            );
50
-        }
51
-        $datetime_ids = \EEM_Datetime::instance()->get_col(
52
-            array(
53
-                array(
54
-                    'Ticket.TKT_ID' => $reg->ticket_ID(),
55
-                ),
56
-                'default_where_conditions' => \EEM_Base::default_where_conditions_minimum_all
57
-            )
58
-        );
59
-        $checkin_stati = array();
60
-        foreach ($datetime_ids as $datetime_id) {
61
-            $status = $reg->check_in_status_for_datetime($datetime_id);
62
-            switch ($status) {
63
-                case \EE_Registration::checkin_status_out:
64
-                    $status_pretty = 'OUT';
65
-                    break;
66
-                case \EE_Registration::checkin_status_in:
67
-                    $status_pretty = 'IN';
68
-                    break;
69
-                case \EE_Registration::checkin_status_never:
70
-                default:
71
-                    $status_pretty = 'NEVER';
72
-                    break;
73
-            }
74
-            $checkin_stati[$datetime_id] = $status_pretty;
75
-        }
76
-        return $checkin_stati;
77
-    }
24
+	/**
25
+	 * Calculates the checkin status for each datetime this registration has access to
26
+	 *
27
+	 * @param array            $wpdb_row
28
+	 * @param \WP_REST_Request $request
29
+	 * @param Base             $controller
30
+	 * @return int
31
+	 * @throws \EE_Error
32
+	 */
33
+	public static function datetime_checkin_stati($wpdb_row, $request, $controller)
34
+	{
35
+		if (is_array($wpdb_row) && isset($wpdb_row['Registration.REG_ID'])) {
36
+			$reg = \EEM_Registration::instance()->get_one_by_ID($wpdb_row['Registration.REG_ID']);
37
+		} else {
38
+			$reg = null;
39
+		}
40
+		if (! $reg instanceof \EE_Registration
41
+		) {
42
+			throw new \EE_Error(
43
+				sprintf(
44
+					__('Cannot calculate datetime_checkin_stati because the registration with ID %1$s (from database row %2$s) was not found',
45
+						'event_espresso'),
46
+					$wpdb_row['Registration.REG_ID'],
47
+					print_r($wpdb_row, true)
48
+				)
49
+			);
50
+		}
51
+		$datetime_ids = \EEM_Datetime::instance()->get_col(
52
+			array(
53
+				array(
54
+					'Ticket.TKT_ID' => $reg->ticket_ID(),
55
+				),
56
+				'default_where_conditions' => \EEM_Base::default_where_conditions_minimum_all
57
+			)
58
+		);
59
+		$checkin_stati = array();
60
+		foreach ($datetime_ids as $datetime_id) {
61
+			$status = $reg->check_in_status_for_datetime($datetime_id);
62
+			switch ($status) {
63
+				case \EE_Registration::checkin_status_out:
64
+					$status_pretty = 'OUT';
65
+					break;
66
+				case \EE_Registration::checkin_status_in:
67
+					$status_pretty = 'IN';
68
+					break;
69
+				case \EE_Registration::checkin_status_never:
70
+				default:
71
+					$status_pretty = 'NEVER';
72
+					break;
73
+			}
74
+			$checkin_stati[$datetime_id] = $status_pretty;
75
+		}
76
+		return $checkin_stati;
77
+	}
78 78
 }
Please login to merge, or discard this patch.
espresso.php 1 patch
Indentation   +219 added lines, -219 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('ABSPATH')) {
2
-    exit('No direct script access allowed');
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /*
5 5
   Plugin Name:		Event Espresso
@@ -40,243 +40,243 @@  discard block
 block discarded – undo
40 40
  * @since            4.0
41 41
  */
42 42
 if (function_exists('espresso_version')) {
43
-    /**
44
-     *    espresso_duplicate_plugin_error
45
-     *    displays if more than one version of EE is activated at the same time
46
-     */
47
-    function espresso_duplicate_plugin_error()
48
-    {
49
-        ?>
43
+	/**
44
+	 *    espresso_duplicate_plugin_error
45
+	 *    displays if more than one version of EE is activated at the same time
46
+	 */
47
+	function espresso_duplicate_plugin_error()
48
+	{
49
+		?>
50 50
         <div class="error">
51 51
             <p>
52 52
                 <?php 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
-                ); ?>
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
-    }
59
+		espresso_deactivate_plugin(plugin_basename(__FILE__));
60
+	}
61 61
 
62
-    add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
62
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
63 63
 } else {
64
-    define('EE_MIN_PHP_VER_REQUIRED', '5.3.9');
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.3.9');
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
-        /**
97
-         * espresso_version
98
-         * Returns the plugin version
99
-         *
100
-         * @return string
101
-         */
102
-        function espresso_version()
103
-        {
104
-            return apply_filters('FHEE__espresso__espresso_version', '4.9.37.rc.007');
105
-        }
94
+		add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
+	} else {
96
+		/**
97
+		 * espresso_version
98
+		 * Returns the plugin version
99
+		 *
100
+		 * @return string
101
+		 */
102
+		function espresso_version()
103
+		{
104
+			return apply_filters('FHEE__espresso__espresso_version', '4.9.37.rc.007');
105
+		}
106 106
 
107
-        // define versions
108
-        define('EVENT_ESPRESSO_VERSION', espresso_version());
109
-        define('EE_MIN_WP_VER_REQUIRED', '4.1');
110
-        define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2');
111
-        define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44');
112
-        define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
113
-        //used to be DIRECTORY_SEPARATOR, but that caused issues on windows
114
-        if ( ! defined('DS')) {
115
-            define('DS', '/');
116
-        }
117
-        if ( ! defined('PS')) {
118
-            define('PS', PATH_SEPARATOR);
119
-        }
120
-        if ( ! defined('SP')) {
121
-            define('SP', ' ');
122
-        }
123
-        if ( ! defined('EENL')) {
124
-            define('EENL', "\n");
125
-        }
126
-        define('EE_SUPPORT_EMAIL', '[email protected]');
127
-        // define the plugin directory and URL
128
-        define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE));
129
-        define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE));
130
-        define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE));
131
-        // main root folder paths
132
-        define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS);
133
-        define('EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS);
134
-        define('EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS);
135
-        define('EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS);
136
-        define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS);
137
-        define('EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS);
138
-        define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS);
139
-        define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS);
140
-        // core system paths
141
-        define('EE_ADMIN', EE_CORE . 'admin' . DS);
142
-        define('EE_CPTS', EE_CORE . 'CPTs' . DS);
143
-        define('EE_CLASSES', EE_CORE . 'db_classes' . DS);
144
-        define('EE_INTERFACES', EE_CORE . 'interfaces' . DS);
145
-        define('EE_BUSINESS', EE_CORE . 'business' . DS);
146
-        define('EE_MODELS', EE_CORE . 'db_models' . DS);
147
-        define('EE_HELPERS', EE_CORE . 'helpers' . DS);
148
-        define('EE_LIBRARIES', EE_CORE . 'libraries' . DS);
149
-        define('EE_TEMPLATES', EE_CORE . 'templates' . DS);
150
-        define('EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS);
151
-        define('EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS);
152
-        define('EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS);
153
-        // gateways
154
-        define('EE_GATEWAYS', EE_MODULES . 'gateways' . DS);
155
-        define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS);
156
-        // asset URL paths
157
-        define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS);
158
-        define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS);
159
-        define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS);
160
-        define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS);
161
-        define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/');
162
-        define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/');
163
-        // define upload paths
164
-        $uploads = wp_upload_dir();
165
-        // define the uploads directory and URL
166
-        define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'] . DS . 'espresso' . DS);
167
-        define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'] . DS . 'espresso' . DS);
168
-        // define the templates directory and URL
169
-        define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'templates' . DS);
170
-        define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'templates' . DS);
171
-        // define the gateway directory and URL
172
-        define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'gateways' . DS);
173
-        define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'gateways' . DS);
174
-        // languages folder/path
175
-        define('EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS);
176
-        define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS);
177
-        //check for dompdf fonts in uploads
178
-        if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS)) {
179
-            define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS);
180
-        }
181
-        //ajax constants
182
-        define(
183
-                'EE_FRONT_AJAX',
184
-                isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false
185
-        );
186
-        define(
187
-                'EE_ADMIN_AJAX',
188
-                isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false
189
-        );
190
-        //just a handy constant occasionally needed for finding values representing infinity in the DB
191
-        //you're better to use this than its straight value (currently -1) in case you ever
192
-        //want to change its default value! or find when -1 means infinity
193
-        define('EE_INF_IN_DB', -1);
194
-        define('EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX);
195
-        define('EE_DEBUG', false);
196
-        // for older WP versions
197
-        if ( ! defined('MONTH_IN_SECONDS')) {
198
-            define('MONTH_IN_SECONDS', DAY_IN_SECONDS * 30);
199
-        }
200
-        /**
201
-         *    espresso_plugin_activation
202
-         *    adds a wp-option to indicate that EE has been activated via the WP admin plugins page
203
-         */
204
-        function espresso_plugin_activation()
205
-        {
206
-            update_option('ee_espresso_activation', true);
207
-        }
107
+		// define versions
108
+		define('EVENT_ESPRESSO_VERSION', espresso_version());
109
+		define('EE_MIN_WP_VER_REQUIRED', '4.1');
110
+		define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2');
111
+		define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44');
112
+		define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
113
+		//used to be DIRECTORY_SEPARATOR, but that caused issues on windows
114
+		if ( ! defined('DS')) {
115
+			define('DS', '/');
116
+		}
117
+		if ( ! defined('PS')) {
118
+			define('PS', PATH_SEPARATOR);
119
+		}
120
+		if ( ! defined('SP')) {
121
+			define('SP', ' ');
122
+		}
123
+		if ( ! defined('EENL')) {
124
+			define('EENL', "\n");
125
+		}
126
+		define('EE_SUPPORT_EMAIL', '[email protected]');
127
+		// define the plugin directory and URL
128
+		define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE));
129
+		define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE));
130
+		define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE));
131
+		// main root folder paths
132
+		define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS);
133
+		define('EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS);
134
+		define('EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS);
135
+		define('EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS);
136
+		define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS);
137
+		define('EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS);
138
+		define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS);
139
+		define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS);
140
+		// core system paths
141
+		define('EE_ADMIN', EE_CORE . 'admin' . DS);
142
+		define('EE_CPTS', EE_CORE . 'CPTs' . DS);
143
+		define('EE_CLASSES', EE_CORE . 'db_classes' . DS);
144
+		define('EE_INTERFACES', EE_CORE . 'interfaces' . DS);
145
+		define('EE_BUSINESS', EE_CORE . 'business' . DS);
146
+		define('EE_MODELS', EE_CORE . 'db_models' . DS);
147
+		define('EE_HELPERS', EE_CORE . 'helpers' . DS);
148
+		define('EE_LIBRARIES', EE_CORE . 'libraries' . DS);
149
+		define('EE_TEMPLATES', EE_CORE . 'templates' . DS);
150
+		define('EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS);
151
+		define('EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS);
152
+		define('EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS);
153
+		// gateways
154
+		define('EE_GATEWAYS', EE_MODULES . 'gateways' . DS);
155
+		define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS);
156
+		// asset URL paths
157
+		define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS);
158
+		define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS);
159
+		define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS);
160
+		define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS);
161
+		define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/');
162
+		define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/');
163
+		// define upload paths
164
+		$uploads = wp_upload_dir();
165
+		// define the uploads directory and URL
166
+		define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'] . DS . 'espresso' . DS);
167
+		define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'] . DS . 'espresso' . DS);
168
+		// define the templates directory and URL
169
+		define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'templates' . DS);
170
+		define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'templates' . DS);
171
+		// define the gateway directory and URL
172
+		define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'gateways' . DS);
173
+		define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'gateways' . DS);
174
+		// languages folder/path
175
+		define('EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS);
176
+		define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS);
177
+		//check for dompdf fonts in uploads
178
+		if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS)) {
179
+			define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS);
180
+		}
181
+		//ajax constants
182
+		define(
183
+				'EE_FRONT_AJAX',
184
+				isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false
185
+		);
186
+		define(
187
+				'EE_ADMIN_AJAX',
188
+				isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false
189
+		);
190
+		//just a handy constant occasionally needed for finding values representing infinity in the DB
191
+		//you're better to use this than its straight value (currently -1) in case you ever
192
+		//want to change its default value! or find when -1 means infinity
193
+		define('EE_INF_IN_DB', -1);
194
+		define('EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX);
195
+		define('EE_DEBUG', false);
196
+		// for older WP versions
197
+		if ( ! defined('MONTH_IN_SECONDS')) {
198
+			define('MONTH_IN_SECONDS', DAY_IN_SECONDS * 30);
199
+		}
200
+		/**
201
+		 *    espresso_plugin_activation
202
+		 *    adds a wp-option to indicate that EE has been activated via the WP admin plugins page
203
+		 */
204
+		function espresso_plugin_activation()
205
+		{
206
+			update_option('ee_espresso_activation', true);
207
+		}
208 208
 
209
-        register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
210
-        /**
211
-         *    espresso_load_error_handling
212
-         *    this function loads EE's class for handling exceptions and errors
213
-         */
214
-        function espresso_load_error_handling()
215
-        {
216
-            // load debugging tools
217
-            if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) {
218
-                require_once(EE_HELPERS . 'EEH_Debug_Tools.helper.php');
219
-                EEH_Debug_Tools::instance();
220
-            }
221
-            // load error handling
222
-            if (is_readable(EE_CORE . 'EE_Error.core.php')) {
223
-                require_once(EE_CORE . 'EE_Error.core.php');
224
-            } else {
225
-                wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso'));
226
-            }
227
-        }
209
+		register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
210
+		/**
211
+		 *    espresso_load_error_handling
212
+		 *    this function loads EE's class for handling exceptions and errors
213
+		 */
214
+		function espresso_load_error_handling()
215
+		{
216
+			// load debugging tools
217
+			if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) {
218
+				require_once(EE_HELPERS . 'EEH_Debug_Tools.helper.php');
219
+				EEH_Debug_Tools::instance();
220
+			}
221
+			// load error handling
222
+			if (is_readable(EE_CORE . 'EE_Error.core.php')) {
223
+				require_once(EE_CORE . 'EE_Error.core.php');
224
+			} else {
225
+				wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso'));
226
+			}
227
+		}
228 228
 
229
-        /**
230
-         *    espresso_load_required
231
-         *    given a class name and path, this function will load that file or throw an exception
232
-         *
233
-         * @param    string $classname
234
-         * @param    string $full_path_to_file
235
-         * @throws    EE_Error
236
-         */
237
-        function espresso_load_required($classname, $full_path_to_file)
238
-        {
239
-            static $error_handling_loaded = false;
240
-            if ( ! $error_handling_loaded) {
241
-                espresso_load_error_handling();
242
-                $error_handling_loaded = true;
243
-            }
244
-            if (is_readable($full_path_to_file)) {
245
-                require_once($full_path_to_file);
246
-            } else {
247
-                throw new EE_Error (
248
-                        sprintf(
249
-                                esc_html__(
250
-                                        'The %s class file could not be located or is not readable due to file permissions.',
251
-                                        'event_espresso'
252
-                                ),
253
-                                $classname
254
-                        )
255
-                );
256
-            }
257
-        }
229
+		/**
230
+		 *    espresso_load_required
231
+		 *    given a class name and path, this function will load that file or throw an exception
232
+		 *
233
+		 * @param    string $classname
234
+		 * @param    string $full_path_to_file
235
+		 * @throws    EE_Error
236
+		 */
237
+		function espresso_load_required($classname, $full_path_to_file)
238
+		{
239
+			static $error_handling_loaded = false;
240
+			if ( ! $error_handling_loaded) {
241
+				espresso_load_error_handling();
242
+				$error_handling_loaded = true;
243
+			}
244
+			if (is_readable($full_path_to_file)) {
245
+				require_once($full_path_to_file);
246
+			} else {
247
+				throw new EE_Error (
248
+						sprintf(
249
+								esc_html__(
250
+										'The %s class file could not be located or is not readable due to file permissions.',
251
+										'event_espresso'
252
+								),
253
+								$classname
254
+						)
255
+				);
256
+			}
257
+		}
258 258
 
259
-        espresso_load_required('EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php');
260
-        espresso_load_required('EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php');
261
-        espresso_load_required('EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php');
262
-        new EE_Bootstrap();
263
-    }
259
+		espresso_load_required('EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php');
260
+		espresso_load_required('EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php');
261
+		espresso_load_required('EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php');
262
+		new EE_Bootstrap();
263
+	}
264 264
 }
265 265
 if ( ! function_exists('espresso_deactivate_plugin')) {
266
-    /**
267
-     *    deactivate_plugin
268
-     * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
269
-     *
270
-     * @access public
271
-     * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
272
-     * @return    void
273
-     */
274
-    function espresso_deactivate_plugin($plugin_basename = '')
275
-    {
276
-        if ( ! function_exists('deactivate_plugins')) {
277
-            require_once(ABSPATH . 'wp-admin/includes/plugin.php');
278
-        }
279
-        unset($_GET['activate'], $_REQUEST['activate']);
280
-        deactivate_plugins($plugin_basename);
281
-    }
266
+	/**
267
+	 *    deactivate_plugin
268
+	 * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
269
+	 *
270
+	 * @access public
271
+	 * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
272
+	 * @return    void
273
+	 */
274
+	function espresso_deactivate_plugin($plugin_basename = '')
275
+	{
276
+		if ( ! function_exists('deactivate_plugins')) {
277
+			require_once(ABSPATH . 'wp-admin/includes/plugin.php');
278
+		}
279
+		unset($_GET['activate'], $_REQUEST['activate']);
280
+		deactivate_plugins($plugin_basename);
281
+	}
282 282
 }
283 283
\ No newline at end of file
Please login to merge, or discard this patch.