Completed
Branch FET-9576-iframes (7043fb)
by
unknown
486:30 queued 469:44
created
core/libraries/iframe_display/Iframe.php 2 patches
Indentation   +440 added lines, -440 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 namespace EventEspresso\core\libraries\iframe_display;
3 3
 
4 4
 if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
-    exit('No direct script access allowed');
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -18,472 +18,472 @@  discard block
 block discarded – undo
18 18
 class Iframe
19 19
 {
20 20
 
21
-    /*
21
+	/*
22 22
     * HTML for notices and ajax gif
23 23
     * @var string $title
24 24
     */
25
-    protected $title = '';
25
+	protected $title = '';
26 26
 
27
-    /*
27
+	/*
28 28
     * HTML for the content being displayed
29 29
     * @var string $content
30 30
     */
31
-    protected $content = '';
31
+	protected $content = '';
32 32
 
33
-    /*
33
+	/*
34 34
     * whether or not to call wp_head() and wp_footer()
35 35
     * @var boolean $enqueue_wp_assets
36 36
     */
37
-    protected $enqueue_wp_assets = false;
37
+	protected $enqueue_wp_assets = false;
38 38
 
39
-    /*
39
+	/*
40 40
     * an array of CSS URLs
41 41
     * @var array $css
42 42
     */
43
-    protected $css = array();
43
+	protected $css = array();
44 44
 
45
-    /*
45
+	/*
46 46
     * an array of JS URLs to be set in the HTML header.
47 47
     * @var array $header_js
48 48
     */
49
-    protected $header_js = array();
49
+	protected $header_js = array();
50 50
 
51
-    /*
51
+	/*
52 52
     * an array of JS URLs to be displayed before the HTML </body> tag
53 53
     * @var array $footer_js
54 54
     */
55
-    protected $footer_js = array();
55
+	protected $footer_js = array();
56 56
 
57
-    /*
57
+	/*
58 58
     * an array of JSON vars to be set in the HTML header.
59 59
     * @var array $localized_vars
60 60
     */
61
-    protected $localized_vars = array();
62
-
63
-
64
-
65
-    /**
66
-     * Iframe constructor
67
-     *
68
-     * @param string $title
69
-     * @param string $content
70
-     * @throws \EE_Error
71
-     */
72
-    public function __construct($title, $content)
73
-    {
74
-        global $wp_version;
75
-        if ( ! defined('EE_IFRAME_DIR_URL')) {
76
-            define('EE_IFRAME_DIR_URL', plugin_dir_url(__FILE__));
77
-        }
78
-        $this->setContent($content);
79
-        $this->setTitle($title);
80
-        $this->addStylesheets(
81
-            apply_filters(
82
-                'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__construct__default_css',
83
-                array(
84
-                    'dashicons'        => includes_url('css/dashicons.min.css?ver=' . $wp_version),
85
-                    'espresso_default' => EE_GLOBAL_ASSETS_URL
86
-                                          . 'css/espresso_default.css?ver='
87
-                                          . EVENT_ESPRESSO_VERSION,
88
-                )
89
-            )
90
-        );
91
-        $this->addScripts(
92
-            apply_filters(
93
-                'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__construct__default_js',
94
-                array(
95
-                    'jquery'        => includes_url('js/jquery/jquery.js?ver=' . $wp_version),
96
-                    'espresso_core' => EE_GLOBAL_ASSETS_URL
97
-                                       . 'scripts/espresso_core.js?ver='
98
-                                       . EVENT_ESPRESSO_VERSION,
99
-                )
100
-            )
101
-        );
102
-    }
103
-
104
-
105
-
106
-    /**
107
-     * @param string $title
108
-     * @throws \EE_Error
109
-     */
110
-    public function setTitle($title)
111
-    {
112
-        if (empty($title)) {
113
-            throw new \EE_Error(
114
-                __('You must provide a page title in order to create an iframe.', 'event_espresso')
115
-            );
116
-        }
117
-        $this->title = $title;
118
-    }
119
-
120
-
121
-
122
-    /**
123
-     * @param string $content
124
-     * @throws \EE_Error
125
-     */
126
-    public function setContent($content)
127
-    {
128
-        if (empty($content)) {
129
-            throw new \EE_Error(
130
-                __('You must provide content in order to create an iframe.', 'event_espresso')
131
-            );
132
-        }
133
-        $this->content = $content;
134
-    }
135
-
136
-
137
-
138
-    /**
139
-     * @param boolean $enqueue_wp_assets
140
-     */
141
-    public function setEnqueueWpAssets($enqueue_wp_assets)
142
-    {
143
-        $this->enqueue_wp_assets = filter_var($enqueue_wp_assets, FILTER_VALIDATE_BOOLEAN);
144
-    }
145
-
146
-
147
-
148
-    /**
149
-     * @param array $stylesheets
150
-     * @throws \EE_Error
151
-     */
152
-    public function addStylesheets(array $stylesheets)
153
-    {
154
-        if (empty($stylesheets)) {
155
-            throw new \EE_Error(
156
-                __('A non-empty array of URLs, is required to add a CSS stylesheet to an iframe.', 'event_espresso')
157
-            );
158
-        }
159
-        foreach ($stylesheets as $handle => $stylesheet) {
160
-            $this->css[$handle] = $stylesheet;
161
-        }
162
-    }
163
-
164
-
165
-
166
-    /**
167
-     * @param array $scripts
168
-     * @param bool  $add_to_header
169
-     * @throws \EE_Error
170
-     */
171
-    public function addScripts(array $scripts, $add_to_header = false)
172
-    {
173
-        if (empty($scripts)) {
174
-            throw new \EE_Error(
175
-                __('A non-empty array of URLs, is required to add Javascript to an iframe.', 'event_espresso')
176
-            );
177
-        }
178
-        foreach ($scripts as $handle => $script) {
179
-            if ($add_to_header) {
180
-                $this->header_js[$handle] = $script;
181
-            } else {
182
-                $this->footer_js[$handle] = $script;
183
-            }
184
-        }
185
-    }
186
-
187
-
188
-
189
-    /**
190
-     * @param array  $vars
191
-     * @param string $var_name
192
-     * @throws \EE_Error
193
-     */
194
-    public function addLocalizedVars(array $vars, $var_name = 'eei18n')
195
-    {
196
-        if (empty($vars)) {
197
-            throw new \EE_Error(
198
-                __('A non-empty array of vars, is required to add localized Javascript vars to an iframe.',
199
-                    'event_espresso')
200
-            );
201
-        }
202
-        foreach ($vars as $handle => $var) {
203
-            if ($var_name === 'eei18n') {
204
-                \EE_Registry::$i18n_js_strings[$handle] = $var;
205
-            } else {
206
-                if ( ! isset($this->localized_vars[$var_name])) {
207
-                    $this->localized_vars[$var_name] = array();
208
-                }
209
-                $this->localized_vars[$var_name][$handle] = $var;
210
-            }
211
-        }
212
-    }
213
-
214
-
215
-
216
-    /**
217
-     * @return void
218
-     */
219
-    public function display()
220
-    {
221
-        echo $this->getTemplate();
222
-        exit;
223
-    }
224
-
225
-
226
-
227
-    /**
228
-     * @return string
229
-     */
230
-    public function getTemplate()
231
-    {
232
-        return \EEH_Template::display_template(
233
-            __DIR__ . '\iframe_wrapper.template.php',
234
-            array(
235
-                'title'             => apply_filters(
236
-                    'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__title',
237
-                    $this->title
238
-                ),
239
-                'content'           => apply_filters(
240
-                    'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__content',
241
-                    $this->content
242
-                ),
243
-                'enqueue_wp_assets' => apply_filters(
244
-                    'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__enqueue_wp_assets',
245
-                    $this->enqueue_wp_assets
246
-                ),
247
-                'css'               => (array)apply_filters(
248
-                    'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__css_urls',
249
-                    $this->css
250
-                ),
251
-                'header_js'         => (array)apply_filters(
252
-                    'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__header_js_urls',
253
-                    $this->header_js
254
-                ),
255
-                'footer_js'         => (array)apply_filters(
256
-                    'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__footer_js_urls',
257
-                    $this->footer_js
258
-                ),
259
-                'eei18n'            => apply_filters(
260
-                    'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__eei18n_js_strings',
261
-                    \EE_Registry::localize_i18n_js_strings() . $this->localizeJsonVars()
262
-                ),
263
-                'notices'           => \EEH_Template::display_template(
264
-                    EE_TEMPLATES . 'espresso-ajax-notices.template.php',
265
-                    array(),
266
-                    true
267
-                ),
268
-            ),
269
-            true
270
-        );
271
-    }
272
-
273
-
274
-
275
-    /**
276
-     * localizeJsonVars
277
-     *
278
-     * @return string
279
-     */
280
-    public function localizeJsonVars()
281
-    {
282
-        $JSON = '';
283
-        $localized_vars = (array)$this->localized_vars;
284
-        foreach ($localized_vars as $var_name => $vars) {
285
-            foreach ($vars as $key => $value) {
286
-                if (is_scalar($value)) {
287
-                    $localized_vars[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
288
-                }
289
-            }
290
-            $JSON .= "/* <![CDATA[ */ var $var_name = " . wp_json_encode($localized_vars) . '; /* ]]> */';
291
-        }
292
-        return $JSON;
293
-    }
294
-
295
-
296
-
297
-    /**
298
-     * Adds an iframe embed code button to the Event editor.
299
-     *
300
-     * @param string $route_name the named module route that generates the iframe
301
-     */
302
-    public static function addEventEditorIframeEmbedButton($route_name)
303
-    {
304
-        // add button for iframe code to event editor.
305
-        add_filter(
306
-            'get_sample_permalink_html',
307
-            function ($permalink_string, $id, $new_title = '', $new_slug = '') use ($route_name) {
308
-                return Iframe::eventListIframeEmbedButton($permalink_string, $id, $new_title, $new_slug, $route_name);
309
-            },
310
-            10, 2
311
-        );
312
-        add_action(
313
-            'admin_enqueue_scripts',
314
-            array('\EventEspresso\core\libraries\iframe_display\Iframe', 'EventsAdminEmbedButtonAssets'),
315
-            10
316
-        );
317
-    }
318
-
319
-
320
-
321
-    /**
322
-     * iframe embed code button to the Event editor.
323
-     *
324
-     * @param string $permalink_string
325
-     * @param int    $id
326
-     * @param string $new_title  (unused)
327
-     * @param string $new_slug   (unused)
328
-     * @param string $route_name the named module route that generates the iframe
329
-     * @return string
330
-     */
331
-    public static function eventListIframeEmbedButton(
332
-        $permalink_string,
333
-        $id,
334
-        $new_title = '',
335
-        $new_slug = '',
336
-        $route_name = ''
337
-    ) {
338
-        //make sure this is ONLY when editing and the event id has been set.
339
-        if ( ! empty($id)) {
340
-            $post = get_post($id);
341
-            //if NOT event then let's get out.
342
-            if ($post->post_type !== 'espresso_events') {
343
-                return $permalink_string;
344
-            }
345
-            $permalink_string .= Iframe::embedButtonHtml(
346
-                'Event',
347
-                $route_name,
348
-                array('event' => $id),
349
-                'button-small'
350
-            );
351
-        }
352
-        return $permalink_string;
353
-    }
354
-
355
-
356
-
357
-    /**
358
-     * Adds an iframe embed code button to the Event editor.
359
-     *
360
-     * return string
361
-     */
362
-    public static function addEventListIframeEmbedButton()
363
-    {
364
-        // add button for iframe code to event editor.
365
-        $iframe_embed = '';
366
-        //make sure this is ONLY when editing and the event id has been set.
367
-        if ($_GET['page'] === 'espresso_events') {
368
-            $iframe_embed .= \EEH_HTML::h3(__('iFrame Embed Code', 'event_espresso'));
369
-            $iframe_embed .= \EEH_HTML::p(
370
-                __('Click the following button(s) to generate iframe HTML that will allow you to embed your event content within the content of other websites.',
371
-                'event_espresso')
372
-            );
373
-            $iframe_embed .= ' &nbsp; ' . Iframe::embedButtonHtml(
374
-                'Events List',
375
-                'event_list'
376
-            ) . ' ';
377
-            add_action(
378
-                'admin_enqueue_scripts',
379
-                array('\EventEspresso\core\libraries\iframe_display\Iframe', 'EventsAdminEmbedButtonAssets'),
380
-                10
381
-            );
382
-        }
383
-        return $iframe_embed;
384
-    }
385
-
386
-
387
-
388
-    /**
389
-     * Adds an iframe embed code button via a WP do_action() as determined by the first parameter
390
-     *
391
-     * @param string $iframe_name
392
-     * @param string $route_name the named module route that generates the iframe
393
-     * @param string $action     name of the WP do_action() to hook into
394
-     */
395
-    public static function addActionIframeEmbedButton($iframe_name, $route_name, $action)
396
-    {
397
-        // add button for iframe code to event editor.
398
-        add_action(
399
-            $action,
400
-            function () use ($iframe_name, $route_name) {
401
-                echo Iframe::embedButtonHtml($iframe_name, $route_name);
402
-            },
403
-            10
404
-        );
405
-    }
406
-
407
-
408
-
409
-    /**
410
-     * iframe_embed_html
411
-     *
412
-     * @param string $iframe_name
413
-     * @param string $route_name the named module route that generates the iframe
414
-     * @param array  $query_args
415
-     * @param string $button_class
416
-     * @return string
417
-     */
418
-    public static function embedButtonHtml($iframe_name, $route_name, $query_args = array(), $button_class = '')
419
-    {
420
-        $query_args = ! empty($query_args) ? $query_args : array($route_name => 'iframe');
421
-        // add this route to our localized vars
422
-        $iframe_module_routes = isset(\EE_Registry::$i18n_js_strings['iframe_module_routes'])
423
-            ? \EE_Registry::$i18n_js_strings['iframe_module_routes']
424
-            : array();
425
-        $iframe_module_routes[$route_name] = $route_name;
426
-        \EE_Registry::$i18n_js_strings['iframe_module_routes'] = $iframe_module_routes;
427
-        $iframe_embed_html = \EEH_HTML::link(
428
-            '#',
429
-            sprintf(__('Embed %1$s', 'event_espresso'), $iframe_name),
430
-            sprintf(
431
-                __(
432
-                    'click here to generate code for embedding an %1$s iframe into another site.',
433
-                    'event_espresso'
434
-                ),
435
-                $iframe_name
436
-            ),
437
-            "$route_name-iframe-embed-trigger-js",
438
-            'iframe-embed-trigger-js button ' . $button_class,
439
-            '',
440
-            ' data-iframe_embed_button="#' . $route_name . '-iframe-js" tabindex="-1"'
441
-        );
442
-        $iframe_embed_html .= \EEH_HTML::div('', "$route_name-iframe-js", 'iframe-embed-wrapper-js', 'display:none;');
443
-        $iframe_embed_html .= \EEH_HTML::div(
444
-            '<iframe src="' . add_query_arg($query_args, site_url()) . '" width="100%" height="100%"></iframe>',
445
-            '', '', 'width:100%; height: 500px;'
446
-        );
447
-        $iframe_embed_html .= \EEH_HTML::divx();
448
-        return $iframe_embed_html;
449
-    }
450
-
451
-
452
-
453
-    /**
454
-     * iframe button js on admin events list or event editor page
455
-     */
456
-    public static function EventsAdminEmbedButtonAssets()
457
-    {
458
-        if (\EE_Registry::instance()->REQ->get('page') === 'espresso_events') {
459
-            Iframe::embedButtonAssets();
460
-            \EE_Registry::$i18n_js_strings['iframe_embed_title'] = __(
461
-                'copy and paste the following into any other site\'s content to display this event:',
462
-                'event_espresso'
463
-            );
464
-        }
465
-    }
466
-
467
-
468
-
469
-    /**
470
-     * enqueue iframe button js
471
-     */
472
-    public static function embedButtonAssets()
473
-    {
474
-        \EE_Registry::$i18n_js_strings['iframe_embed_close_msg'] = __(
475
-            'click anywhere outside of this window to close it.',
476
-            'event_espresso'
477
-        );
478
-        wp_register_script(
479
-            'iframe_embed_button',
480
-            plugin_dir_url(__FILE__) . 'iframe-embed-button.js',
481
-            array('ee-dialog'),
482
-            EVENT_ESPRESSO_VERSION,
483
-            true
484
-        );
485
-        wp_enqueue_script('iframe_embed_button');
486
-    }
61
+	protected $localized_vars = array();
62
+
63
+
64
+
65
+	/**
66
+	 * Iframe constructor
67
+	 *
68
+	 * @param string $title
69
+	 * @param string $content
70
+	 * @throws \EE_Error
71
+	 */
72
+	public function __construct($title, $content)
73
+	{
74
+		global $wp_version;
75
+		if ( ! defined('EE_IFRAME_DIR_URL')) {
76
+			define('EE_IFRAME_DIR_URL', plugin_dir_url(__FILE__));
77
+		}
78
+		$this->setContent($content);
79
+		$this->setTitle($title);
80
+		$this->addStylesheets(
81
+			apply_filters(
82
+				'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__construct__default_css',
83
+				array(
84
+					'dashicons'        => includes_url('css/dashicons.min.css?ver=' . $wp_version),
85
+					'espresso_default' => EE_GLOBAL_ASSETS_URL
86
+										  . 'css/espresso_default.css?ver='
87
+										  . EVENT_ESPRESSO_VERSION,
88
+				)
89
+			)
90
+		);
91
+		$this->addScripts(
92
+			apply_filters(
93
+				'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__construct__default_js',
94
+				array(
95
+					'jquery'        => includes_url('js/jquery/jquery.js?ver=' . $wp_version),
96
+					'espresso_core' => EE_GLOBAL_ASSETS_URL
97
+									   . 'scripts/espresso_core.js?ver='
98
+									   . EVENT_ESPRESSO_VERSION,
99
+				)
100
+			)
101
+		);
102
+	}
103
+
104
+
105
+
106
+	/**
107
+	 * @param string $title
108
+	 * @throws \EE_Error
109
+	 */
110
+	public function setTitle($title)
111
+	{
112
+		if (empty($title)) {
113
+			throw new \EE_Error(
114
+				__('You must provide a page title in order to create an iframe.', 'event_espresso')
115
+			);
116
+		}
117
+		$this->title = $title;
118
+	}
119
+
120
+
121
+
122
+	/**
123
+	 * @param string $content
124
+	 * @throws \EE_Error
125
+	 */
126
+	public function setContent($content)
127
+	{
128
+		if (empty($content)) {
129
+			throw new \EE_Error(
130
+				__('You must provide content in order to create an iframe.', 'event_espresso')
131
+			);
132
+		}
133
+		$this->content = $content;
134
+	}
135
+
136
+
137
+
138
+	/**
139
+	 * @param boolean $enqueue_wp_assets
140
+	 */
141
+	public function setEnqueueWpAssets($enqueue_wp_assets)
142
+	{
143
+		$this->enqueue_wp_assets = filter_var($enqueue_wp_assets, FILTER_VALIDATE_BOOLEAN);
144
+	}
145
+
146
+
147
+
148
+	/**
149
+	 * @param array $stylesheets
150
+	 * @throws \EE_Error
151
+	 */
152
+	public function addStylesheets(array $stylesheets)
153
+	{
154
+		if (empty($stylesheets)) {
155
+			throw new \EE_Error(
156
+				__('A non-empty array of URLs, is required to add a CSS stylesheet to an iframe.', 'event_espresso')
157
+			);
158
+		}
159
+		foreach ($stylesheets as $handle => $stylesheet) {
160
+			$this->css[$handle] = $stylesheet;
161
+		}
162
+	}
163
+
164
+
165
+
166
+	/**
167
+	 * @param array $scripts
168
+	 * @param bool  $add_to_header
169
+	 * @throws \EE_Error
170
+	 */
171
+	public function addScripts(array $scripts, $add_to_header = false)
172
+	{
173
+		if (empty($scripts)) {
174
+			throw new \EE_Error(
175
+				__('A non-empty array of URLs, is required to add Javascript to an iframe.', 'event_espresso')
176
+			);
177
+		}
178
+		foreach ($scripts as $handle => $script) {
179
+			if ($add_to_header) {
180
+				$this->header_js[$handle] = $script;
181
+			} else {
182
+				$this->footer_js[$handle] = $script;
183
+			}
184
+		}
185
+	}
186
+
187
+
188
+
189
+	/**
190
+	 * @param array  $vars
191
+	 * @param string $var_name
192
+	 * @throws \EE_Error
193
+	 */
194
+	public function addLocalizedVars(array $vars, $var_name = 'eei18n')
195
+	{
196
+		if (empty($vars)) {
197
+			throw new \EE_Error(
198
+				__('A non-empty array of vars, is required to add localized Javascript vars to an iframe.',
199
+					'event_espresso')
200
+			);
201
+		}
202
+		foreach ($vars as $handle => $var) {
203
+			if ($var_name === 'eei18n') {
204
+				\EE_Registry::$i18n_js_strings[$handle] = $var;
205
+			} else {
206
+				if ( ! isset($this->localized_vars[$var_name])) {
207
+					$this->localized_vars[$var_name] = array();
208
+				}
209
+				$this->localized_vars[$var_name][$handle] = $var;
210
+			}
211
+		}
212
+	}
213
+
214
+
215
+
216
+	/**
217
+	 * @return void
218
+	 */
219
+	public function display()
220
+	{
221
+		echo $this->getTemplate();
222
+		exit;
223
+	}
224
+
225
+
226
+
227
+	/**
228
+	 * @return string
229
+	 */
230
+	public function getTemplate()
231
+	{
232
+		return \EEH_Template::display_template(
233
+			__DIR__ . '\iframe_wrapper.template.php',
234
+			array(
235
+				'title'             => apply_filters(
236
+					'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__title',
237
+					$this->title
238
+				),
239
+				'content'           => apply_filters(
240
+					'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__content',
241
+					$this->content
242
+				),
243
+				'enqueue_wp_assets' => apply_filters(
244
+					'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__enqueue_wp_assets',
245
+					$this->enqueue_wp_assets
246
+				),
247
+				'css'               => (array)apply_filters(
248
+					'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__css_urls',
249
+					$this->css
250
+				),
251
+				'header_js'         => (array)apply_filters(
252
+					'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__header_js_urls',
253
+					$this->header_js
254
+				),
255
+				'footer_js'         => (array)apply_filters(
256
+					'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__footer_js_urls',
257
+					$this->footer_js
258
+				),
259
+				'eei18n'            => apply_filters(
260
+					'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__eei18n_js_strings',
261
+					\EE_Registry::localize_i18n_js_strings() . $this->localizeJsonVars()
262
+				),
263
+				'notices'           => \EEH_Template::display_template(
264
+					EE_TEMPLATES . 'espresso-ajax-notices.template.php',
265
+					array(),
266
+					true
267
+				),
268
+			),
269
+			true
270
+		);
271
+	}
272
+
273
+
274
+
275
+	/**
276
+	 * localizeJsonVars
277
+	 *
278
+	 * @return string
279
+	 */
280
+	public function localizeJsonVars()
281
+	{
282
+		$JSON = '';
283
+		$localized_vars = (array)$this->localized_vars;
284
+		foreach ($localized_vars as $var_name => $vars) {
285
+			foreach ($vars as $key => $value) {
286
+				if (is_scalar($value)) {
287
+					$localized_vars[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
288
+				}
289
+			}
290
+			$JSON .= "/* <![CDATA[ */ var $var_name = " . wp_json_encode($localized_vars) . '; /* ]]> */';
291
+		}
292
+		return $JSON;
293
+	}
294
+
295
+
296
+
297
+	/**
298
+	 * Adds an iframe embed code button to the Event editor.
299
+	 *
300
+	 * @param string $route_name the named module route that generates the iframe
301
+	 */
302
+	public static function addEventEditorIframeEmbedButton($route_name)
303
+	{
304
+		// add button for iframe code to event editor.
305
+		add_filter(
306
+			'get_sample_permalink_html',
307
+			function ($permalink_string, $id, $new_title = '', $new_slug = '') use ($route_name) {
308
+				return Iframe::eventListIframeEmbedButton($permalink_string, $id, $new_title, $new_slug, $route_name);
309
+			},
310
+			10, 2
311
+		);
312
+		add_action(
313
+			'admin_enqueue_scripts',
314
+			array('\EventEspresso\core\libraries\iframe_display\Iframe', 'EventsAdminEmbedButtonAssets'),
315
+			10
316
+		);
317
+	}
318
+
319
+
320
+
321
+	/**
322
+	 * iframe embed code button to the Event editor.
323
+	 *
324
+	 * @param string $permalink_string
325
+	 * @param int    $id
326
+	 * @param string $new_title  (unused)
327
+	 * @param string $new_slug   (unused)
328
+	 * @param string $route_name the named module route that generates the iframe
329
+	 * @return string
330
+	 */
331
+	public static function eventListIframeEmbedButton(
332
+		$permalink_string,
333
+		$id,
334
+		$new_title = '',
335
+		$new_slug = '',
336
+		$route_name = ''
337
+	) {
338
+		//make sure this is ONLY when editing and the event id has been set.
339
+		if ( ! empty($id)) {
340
+			$post = get_post($id);
341
+			//if NOT event then let's get out.
342
+			if ($post->post_type !== 'espresso_events') {
343
+				return $permalink_string;
344
+			}
345
+			$permalink_string .= Iframe::embedButtonHtml(
346
+				'Event',
347
+				$route_name,
348
+				array('event' => $id),
349
+				'button-small'
350
+			);
351
+		}
352
+		return $permalink_string;
353
+	}
354
+
355
+
356
+
357
+	/**
358
+	 * Adds an iframe embed code button to the Event editor.
359
+	 *
360
+	 * return string
361
+	 */
362
+	public static function addEventListIframeEmbedButton()
363
+	{
364
+		// add button for iframe code to event editor.
365
+		$iframe_embed = '';
366
+		//make sure this is ONLY when editing and the event id has been set.
367
+		if ($_GET['page'] === 'espresso_events') {
368
+			$iframe_embed .= \EEH_HTML::h3(__('iFrame Embed Code', 'event_espresso'));
369
+			$iframe_embed .= \EEH_HTML::p(
370
+				__('Click the following button(s) to generate iframe HTML that will allow you to embed your event content within the content of other websites.',
371
+				'event_espresso')
372
+			);
373
+			$iframe_embed .= ' &nbsp; ' . Iframe::embedButtonHtml(
374
+				'Events List',
375
+				'event_list'
376
+			) . ' ';
377
+			add_action(
378
+				'admin_enqueue_scripts',
379
+				array('\EventEspresso\core\libraries\iframe_display\Iframe', 'EventsAdminEmbedButtonAssets'),
380
+				10
381
+			);
382
+		}
383
+		return $iframe_embed;
384
+	}
385
+
386
+
387
+
388
+	/**
389
+	 * Adds an iframe embed code button via a WP do_action() as determined by the first parameter
390
+	 *
391
+	 * @param string $iframe_name
392
+	 * @param string $route_name the named module route that generates the iframe
393
+	 * @param string $action     name of the WP do_action() to hook into
394
+	 */
395
+	public static function addActionIframeEmbedButton($iframe_name, $route_name, $action)
396
+	{
397
+		// add button for iframe code to event editor.
398
+		add_action(
399
+			$action,
400
+			function () use ($iframe_name, $route_name) {
401
+				echo Iframe::embedButtonHtml($iframe_name, $route_name);
402
+			},
403
+			10
404
+		);
405
+	}
406
+
407
+
408
+
409
+	/**
410
+	 * iframe_embed_html
411
+	 *
412
+	 * @param string $iframe_name
413
+	 * @param string $route_name the named module route that generates the iframe
414
+	 * @param array  $query_args
415
+	 * @param string $button_class
416
+	 * @return string
417
+	 */
418
+	public static function embedButtonHtml($iframe_name, $route_name, $query_args = array(), $button_class = '')
419
+	{
420
+		$query_args = ! empty($query_args) ? $query_args : array($route_name => 'iframe');
421
+		// add this route to our localized vars
422
+		$iframe_module_routes = isset(\EE_Registry::$i18n_js_strings['iframe_module_routes'])
423
+			? \EE_Registry::$i18n_js_strings['iframe_module_routes']
424
+			: array();
425
+		$iframe_module_routes[$route_name] = $route_name;
426
+		\EE_Registry::$i18n_js_strings['iframe_module_routes'] = $iframe_module_routes;
427
+		$iframe_embed_html = \EEH_HTML::link(
428
+			'#',
429
+			sprintf(__('Embed %1$s', 'event_espresso'), $iframe_name),
430
+			sprintf(
431
+				__(
432
+					'click here to generate code for embedding an %1$s iframe into another site.',
433
+					'event_espresso'
434
+				),
435
+				$iframe_name
436
+			),
437
+			"$route_name-iframe-embed-trigger-js",
438
+			'iframe-embed-trigger-js button ' . $button_class,
439
+			'',
440
+			' data-iframe_embed_button="#' . $route_name . '-iframe-js" tabindex="-1"'
441
+		);
442
+		$iframe_embed_html .= \EEH_HTML::div('', "$route_name-iframe-js", 'iframe-embed-wrapper-js', 'display:none;');
443
+		$iframe_embed_html .= \EEH_HTML::div(
444
+			'<iframe src="' . add_query_arg($query_args, site_url()) . '" width="100%" height="100%"></iframe>',
445
+			'', '', 'width:100%; height: 500px;'
446
+		);
447
+		$iframe_embed_html .= \EEH_HTML::divx();
448
+		return $iframe_embed_html;
449
+	}
450
+
451
+
452
+
453
+	/**
454
+	 * iframe button js on admin events list or event editor page
455
+	 */
456
+	public static function EventsAdminEmbedButtonAssets()
457
+	{
458
+		if (\EE_Registry::instance()->REQ->get('page') === 'espresso_events') {
459
+			Iframe::embedButtonAssets();
460
+			\EE_Registry::$i18n_js_strings['iframe_embed_title'] = __(
461
+				'copy and paste the following into any other site\'s content to display this event:',
462
+				'event_espresso'
463
+			);
464
+		}
465
+	}
466
+
467
+
468
+
469
+	/**
470
+	 * enqueue iframe button js
471
+	 */
472
+	public static function embedButtonAssets()
473
+	{
474
+		\EE_Registry::$i18n_js_strings['iframe_embed_close_msg'] = __(
475
+			'click anywhere outside of this window to close it.',
476
+			'event_espresso'
477
+		);
478
+		wp_register_script(
479
+			'iframe_embed_button',
480
+			plugin_dir_url(__FILE__) . 'iframe-embed-button.js',
481
+			array('ee-dialog'),
482
+			EVENT_ESPRESSO_VERSION,
483
+			true
484
+		);
485
+		wp_enqueue_script('iframe_embed_button');
486
+	}
487 487
 
488 488
 
489 489
 
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             apply_filters(
82 82
                 'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__construct__default_css',
83 83
                 array(
84
-                    'dashicons'        => includes_url('css/dashicons.min.css?ver=' . $wp_version),
84
+                    'dashicons'        => includes_url('css/dashicons.min.css?ver='.$wp_version),
85 85
                     'espresso_default' => EE_GLOBAL_ASSETS_URL
86 86
                                           . 'css/espresso_default.css?ver='
87 87
                                           . EVENT_ESPRESSO_VERSION,
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             apply_filters(
93 93
                 'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__construct__default_js',
94 94
                 array(
95
-                    'jquery'        => includes_url('js/jquery/jquery.js?ver=' . $wp_version),
95
+                    'jquery'        => includes_url('js/jquery/jquery.js?ver='.$wp_version),
96 96
                     'espresso_core' => EE_GLOBAL_ASSETS_URL
97 97
                                        . 'scripts/espresso_core.js?ver='
98 98
                                        . EVENT_ESPRESSO_VERSION,
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     public function getTemplate()
231 231
     {
232 232
         return \EEH_Template::display_template(
233
-            __DIR__ . '\iframe_wrapper.template.php',
233
+            __DIR__.'\iframe_wrapper.template.php',
234 234
             array(
235 235
                 'title'             => apply_filters(
236 236
                     'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__title',
@@ -244,24 +244,24 @@  discard block
 block discarded – undo
244 244
                     'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__enqueue_wp_assets',
245 245
                     $this->enqueue_wp_assets
246 246
                 ),
247
-                'css'               => (array)apply_filters(
247
+                'css'               => (array) apply_filters(
248 248
                     'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__css_urls',
249 249
                     $this->css
250 250
                 ),
251
-                'header_js'         => (array)apply_filters(
251
+                'header_js'         => (array) apply_filters(
252 252
                     'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__header_js_urls',
253 253
                     $this->header_js
254 254
                 ),
255
-                'footer_js'         => (array)apply_filters(
255
+                'footer_js'         => (array) apply_filters(
256 256
                     'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__footer_js_urls',
257 257
                     $this->footer_js
258 258
                 ),
259 259
                 'eei18n'            => apply_filters(
260 260
                     'FHEE__\EventEspresso\core\libraries\iframe_display\Iframe__getTemplate__eei18n_js_strings',
261
-                    \EE_Registry::localize_i18n_js_strings() . $this->localizeJsonVars()
261
+                    \EE_Registry::localize_i18n_js_strings().$this->localizeJsonVars()
262 262
                 ),
263 263
                 'notices'           => \EEH_Template::display_template(
264
-                    EE_TEMPLATES . 'espresso-ajax-notices.template.php',
264
+                    EE_TEMPLATES.'espresso-ajax-notices.template.php',
265 265
                     array(),
266 266
                     true
267 267
                 ),
@@ -280,14 +280,14 @@  discard block
 block discarded – undo
280 280
     public function localizeJsonVars()
281 281
     {
282 282
         $JSON = '';
283
-        $localized_vars = (array)$this->localized_vars;
283
+        $localized_vars = (array) $this->localized_vars;
284 284
         foreach ($localized_vars as $var_name => $vars) {
285 285
             foreach ($vars as $key => $value) {
286 286
                 if (is_scalar($value)) {
287
-                    $localized_vars[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
287
+                    $localized_vars[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
288 288
                 }
289 289
             }
290
-            $JSON .= "/* <![CDATA[ */ var $var_name = " . wp_json_encode($localized_vars) . '; /* ]]> */';
290
+            $JSON .= "/* <![CDATA[ */ var $var_name = ".wp_json_encode($localized_vars).'; /* ]]> */';
291 291
         }
292 292
         return $JSON;
293 293
     }
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
         // add button for iframe code to event editor.
305 305
         add_filter(
306 306
             'get_sample_permalink_html',
307
-            function ($permalink_string, $id, $new_title = '', $new_slug = '') use ($route_name) {
307
+            function($permalink_string, $id, $new_title = '', $new_slug = '') use ($route_name) {
308 308
                 return Iframe::eventListIframeEmbedButton($permalink_string, $id, $new_title, $new_slug, $route_name);
309 309
             },
310 310
             10, 2
@@ -370,10 +370,10 @@  discard block
 block discarded – undo
370 370
                 __('Click the following button(s) to generate iframe HTML that will allow you to embed your event content within the content of other websites.',
371 371
                 'event_espresso')
372 372
             );
373
-            $iframe_embed .= ' &nbsp; ' . Iframe::embedButtonHtml(
373
+            $iframe_embed .= ' &nbsp; '.Iframe::embedButtonHtml(
374 374
                 'Events List',
375 375
                 'event_list'
376
-            ) . ' ';
376
+            ).' ';
377 377
             add_action(
378 378
                 'admin_enqueue_scripts',
379 379
                 array('\EventEspresso\core\libraries\iframe_display\Iframe', 'EventsAdminEmbedButtonAssets'),
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
         // add button for iframe code to event editor.
398 398
         add_action(
399 399
             $action,
400
-            function () use ($iframe_name, $route_name) {
400
+            function() use ($iframe_name, $route_name) {
401 401
                 echo Iframe::embedButtonHtml($iframe_name, $route_name);
402 402
             },
403 403
             10
@@ -435,13 +435,13 @@  discard block
 block discarded – undo
435 435
                 $iframe_name
436 436
             ),
437 437
             "$route_name-iframe-embed-trigger-js",
438
-            'iframe-embed-trigger-js button ' . $button_class,
438
+            'iframe-embed-trigger-js button '.$button_class,
439 439
             '',
440
-            ' data-iframe_embed_button="#' . $route_name . '-iframe-js" tabindex="-1"'
440
+            ' data-iframe_embed_button="#'.$route_name.'-iframe-js" tabindex="-1"'
441 441
         );
442 442
         $iframe_embed_html .= \EEH_HTML::div('', "$route_name-iframe-js", 'iframe-embed-wrapper-js', 'display:none;');
443 443
         $iframe_embed_html .= \EEH_HTML::div(
444
-            '<iframe src="' . add_query_arg($query_args, site_url()) . '" width="100%" height="100%"></iframe>',
444
+            '<iframe src="'.add_query_arg($query_args, site_url()).'" width="100%" height="100%"></iframe>',
445 445
             '', '', 'width:100%; height: 500px;'
446 446
         );
447 447
         $iframe_embed_html .= \EEH_HTML::divx();
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
         );
478 478
         wp_register_script(
479 479
             'iframe_embed_button',
480
-            plugin_dir_url(__FILE__) . 'iframe-embed-button.js',
480
+            plugin_dir_url(__FILE__).'iframe-embed-button.js',
481 481
             array('ee-dialog'),
482 482
             EVENT_ESPRESSO_VERSION,
483 483
             true
Please login to merge, or discard this patch.
core/EE_Load_Espresso_Core.core.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 /**
6 6
  *
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	 */
52 52
 	public function __construct() {
53 53
 		// deprecated functions
54
-		espresso_load_required( 'EventEspresso\core\Factory', EE_CORE . 'Factory.php' );
54
+		espresso_load_required('EventEspresso\core\Factory', EE_CORE.'Factory.php');
55 55
 	}
56 56
 
57 57
 
@@ -67,26 +67,26 @@  discard block
 block discarded – undo
67 67
 	 * @param 	EE_Response $response
68 68
 	 * @return 	EE_Response
69 69
 	 */
70
-	public function handle_request( EE_Request $request, EE_Response $response ) {
70
+	public function handle_request(EE_Request $request, EE_Response $response) {
71 71
 		$this->request = $request;
72 72
 		$this->response = $response;
73 73
 		// info about how to load classes required by other classes
74 74
 		$this->dependency_map = $this->_load_dependency_map();
75 75
 		// central repository for classes
76 76
 		$this->registry = $this->_load_registry();
77
-		do_action( 'EE_Load_Espresso_Core__handle_request__initialize_core_loading' );
77
+		do_action('EE_Load_Espresso_Core__handle_request__initialize_core_loading');
78 78
 		// PSR4 Autoloaders
79
-		$this->registry->load_core( 'EE_Psr4AutoloaderInit' );
79
+		$this->registry->load_core('EE_Psr4AutoloaderInit');
80 80
 		// workarounds for PHP < 5.3
81 81
 		$this->_load_class_tools();
82 82
 		// load interfaces
83
-		espresso_load_required( 'EEI_Payment_Method_Interfaces', EE_LIBRARIES . 'payment_methods' . DS . 'EEI_Payment_Method_Interfaces.php' );
83
+		espresso_load_required('EEI_Payment_Method_Interfaces', EE_LIBRARIES.'payment_methods'.DS.'EEI_Payment_Method_Interfaces.php');
84 84
 		// deprecated functions
85
-		espresso_load_required( 'EE_Deprecated', EE_CORE . 'EE_Deprecated.core.php' );
85
+		espresso_load_required('EE_Deprecated', EE_CORE.'EE_Deprecated.core.php');
86 86
 		// WP cron jobs
87
-		$this->registry->load_core( 'Cron_Tasks' );
88
-		$this->registry->load_core( 'EE_Request_Handler' );
89
-		$this->registry->load_core( 'EE_System' );
87
+		$this->registry->load_core('Cron_Tasks');
88
+		$this->registry->load_core('EE_Request_Handler');
89
+		$this->registry->load_core('EE_System');
90 90
 
91 91
 		return $this->response;
92 92
 	}
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
 	 * @throws \EE_Error
117 117
 	 */
118 118
 	public function dependency_map() {
119
-		if ( ! $this->dependency_map instanceof EE_Dependency_Map ) {
119
+		if ( ! $this->dependency_map instanceof EE_Dependency_Map) {
120 120
 			throw new EE_Error(
121 121
 				sprintf(
122
-					__( 'Invalid EE_Dependency_Map: "%1$s"', 'event_espresso' ),
123
-					print_r( $this->dependency_map, true )
122
+					__('Invalid EE_Dependency_Map: "%1$s"', 'event_espresso'),
123
+					print_r($this->dependency_map, true)
124 124
 				)
125 125
 			);
126 126
 		}
@@ -134,11 +134,11 @@  discard block
 block discarded – undo
134 134
 	 * @throws \EE_Error
135 135
 	 */
136 136
 	public function registry() {
137
-		if ( ! $this->registry instanceof EE_Registry ) {
137
+		if ( ! $this->registry instanceof EE_Registry) {
138 138
 			throw new EE_Error(
139 139
 				sprintf(
140
-					__( 'Invalid EE_Registry: "%1$s"', 'event_espresso' ),
141
-					print_r( $this->registry, true )
140
+					__('Invalid EE_Registry: "%1$s"', 'event_espresso'),
141
+					print_r($this->registry, true)
142 142
 				)
143 143
 			);
144 144
 		}
@@ -154,15 +154,15 @@  discard block
 block discarded – undo
154 154
 	 * 	@return EE_Dependency_Map
155 155
 	 */
156 156
 	private function _load_dependency_map() {
157
-		if ( ! is_readable( EE_CORE . 'EE_Dependency_Map.core.php' ) ) {
157
+		if ( ! is_readable(EE_CORE.'EE_Dependency_Map.core.php')) {
158 158
 			EE_Error::add_error(
159
-				__( 'The EE_Dependency_Map core class could not be loaded.', 'event_espresso' ),
159
+				__('The EE_Dependency_Map core class could not be loaded.', 'event_espresso'),
160 160
 				__FILE__, __FUNCTION__, __LINE__
161 161
 			);
162
-			wp_die( EE_Error::get_notices() );
162
+			wp_die(EE_Error::get_notices());
163 163
 		}
164
-		require_once( EE_CORE . 'EE_Dependency_Map.core.php' );
165
-		return EE_Dependency_Map::instance( $this->request, $this->response );
164
+		require_once(EE_CORE.'EE_Dependency_Map.core.php');
165
+		return EE_Dependency_Map::instance($this->request, $this->response);
166 166
 	}
167 167
 
168 168
 
@@ -174,15 +174,15 @@  discard block
 block discarded – undo
174 174
 	 * 	@return EE_Registry
175 175
 	 */
176 176
 	private function _load_registry() {
177
-		if ( ! is_readable( EE_CORE . 'EE_Registry.core.php' )) {
177
+		if ( ! is_readable(EE_CORE.'EE_Registry.core.php')) {
178 178
 			EE_Error::add_error(
179
-				__( 'The EE_Registry core class could not be loaded.', 'event_espresso' ),
179
+				__('The EE_Registry core class could not be loaded.', 'event_espresso'),
180 180
 				__FILE__, __FUNCTION__, __LINE__
181 181
 			);
182
-			wp_die( EE_Error::get_notices() );
182
+			wp_die(EE_Error::get_notices());
183 183
 		}
184
-		require_once( EE_CORE . 'EE_Registry.core.php' );
185
-		return EE_Registry::instance( $this->dependency_map );
184
+		require_once(EE_CORE.'EE_Registry.core.php');
185
+		return EE_Registry::instance($this->dependency_map);
186 186
 	}
187 187
 
188 188
 
@@ -193,13 +193,13 @@  discard block
 block discarded – undo
193 193
 	 * 	@return void
194 194
 	 */
195 195
 	private function _load_class_tools() {
196
-		if ( ! is_readable( EE_HELPERS . 'EEH_Class_Tools.helper.php' )) {
196
+		if ( ! is_readable(EE_HELPERS.'EEH_Class_Tools.helper.php')) {
197 197
 			EE_Error::add_error(
198
-				__( 'The EEH_Class_Tools helper could not be loaded.', 'event_espresso' ),
198
+				__('The EEH_Class_Tools helper could not be loaded.', 'event_espresso'),
199 199
 				__FILE__, __FUNCTION__, __LINE__
200 200
 			);
201 201
 		}
202
-		require_once( EE_HELPERS . 'EEH_Class_Tools.helper.php' );
202
+		require_once(EE_HELPERS.'EEH_Class_Tools.helper.php');
203 203
 	}
204 204
 
205 205
 
@@ -213,13 +213,13 @@  discard block
 block discarded – undo
213 213
 	 * @param \EE_Request $request
214 214
 	 * @param \EE_Response $response
215 215
 	 */
216
-	public function handle_response( EE_Request $request, EE_Response $response ) {
216
+	public function handle_response(EE_Request $request, EE_Response $response) {
217 217
 		//\EEH_Debug_Tools::printr( __FUNCTION__, __CLASS__, __FILE__, __LINE__, 2 );
218 218
 		//EEH_Debug_Tools::printr( $request, '$request', __FILE__, __LINE__ );
219 219
 		//EEH_Debug_Tools::printr( $response, '$response', __FILE__, __LINE__ );
220 220
 		//die();
221
-		if ( $response->plugin_deactivated() ) {
222
-			espresso_deactivate_plugin( EE_PLUGIN_BASENAME );
221
+		if ($response->plugin_deactivated()) {
222
+			espresso_deactivate_plugin(EE_PLUGIN_BASENAME);
223 223
 		}
224 224
 	}
225 225
 
Please login to merge, or discard this patch.
core/admin/EE_Admin_Page.core.php 2 patches
Indentation   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -1307,8 +1307,8 @@  discard block
 block discarded – undo
1307 1307
 	 * 		verifies user access for this admin page
1308 1308
 	 * 		@param string $route_to_check if present then the capability for the route matching this string is checked.
1309 1309
 	 * 		@param bool   $verify_only Default is FALSE which means if user check fails then wp_die().  Otherwise just return false if verify fail.
1310
-	*		@return 		BOOL|wp_die()
1311
-	*/
1310
+	 *		@return 		BOOL|wp_die()
1311
+	 */
1312 1312
 	public function check_user_access( $route_to_check = '', $verify_only = FALSE ) {
1313 1313
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1314 1314
 		$route_to_check = empty( $route_to_check ) ? $this->_req_action : $route_to_check;
@@ -1694,11 +1694,11 @@  discard block
 block discarded – undo
1694 1694
 
1695 1695
 
1696 1696
 	/**
1697
-	*		admin_footer_scripts_eei18n_js_strings
1698
-	*
1699
-	*		@access 		public
1700
-	*		@return 		void
1701
-	*/
1697
+	 *		admin_footer_scripts_eei18n_js_strings
1698
+	 *
1699
+	 *		@access 		public
1700
+	 *		@return 		void
1701
+	 */
1702 1702
 	public function admin_footer_scripts_eei18n_js_strings() {
1703 1703
 
1704 1704
 		EE_Registry::$i18n_js_strings['ajax_url'] = WP_AJAX_URL;
@@ -1754,11 +1754,11 @@  discard block
 block discarded – undo
1754 1754
 
1755 1755
 
1756 1756
 	/**
1757
-	*		load enhanced xdebug styles for ppl with failing eyesight
1758
-	*
1759
-	*		@access 		public
1760
-	*		@return 		void
1761
-	*/
1757
+	 *		load enhanced xdebug styles for ppl with failing eyesight
1758
+	 *
1759
+	 *		@access 		public
1760
+	 *		@return 		void
1761
+	 */
1762 1762
 	public function add_xdebug_style() {
1763 1763
 		echo '<style>.xdebug-error { font-size:1.5em; }</style>';
1764 1764
 	}
@@ -1815,9 +1815,9 @@  discard block
 block discarded – undo
1815 1815
 
1816 1816
 	/**
1817 1817
 	 * 		set current view for List Table
1818
-	*		@access public
1819
-	*		@return array
1820
-	*/
1818
+	 *		@access public
1819
+	 *		@return array
1820
+	 */
1821 1821
 	protected function _set_list_table_view() {
1822 1822
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1823 1823
 
@@ -1894,7 +1894,7 @@  discard block
 block discarded – undo
1894 1894
 	 * @access protected
1895 1895
 	 * @param int $max_entries total number of rows in the table
1896 1896
 	 * @return string
1897
-	*/
1897
+	 */
1898 1898
 	protected function _entries_per_page_dropdown( $max_entries = FALSE ) {
1899 1899
 
1900 1900
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -1939,9 +1939,9 @@  discard block
 block discarded – undo
1939 1939
 
1940 1940
 	/**
1941 1941
 	 * 		_set_search_attributes
1942
-	*		@access 		protected
1943
-	*		@return 		void
1944
-	*/
1942
+	 *		@access 		protected
1943
+	 *		@return 		void
1944
+	 */
1945 1945
 	public function _set_search_attributes() {
1946 1946
 		$this->_template_args['search']['btn_label'] = sprintf( __( 'Search %s', 'event_espresso' ), empty( $this->_search_btn_label ) ? $this->page_label : $this->_search_btn_label );
1947 1947
 		$this->_template_args['search']['callback'] = 'search_' . $this->page_slug;
@@ -1961,7 +1961,7 @@  discard block
 block discarded – undo
1961 1961
 	 * @link http://codex.wordpress.org/Function_Reference/add_meta_box
1962 1962
 	 * @access private
1963 1963
 	 * @return void
1964
-	*/
1964
+	 */
1965 1965
 	private function _add_registered_meta_boxes() {
1966 1966
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1967 1967
 
@@ -2220,9 +2220,9 @@  discard block
 block discarded – undo
2220 2220
 
2221 2221
 	/**
2222 2222
 	 * 		displays an error message to ppl who have javascript disabled
2223
-	*		@access 		private
2224
-	*		@return 		string
2225
-	*/
2223
+	 *		@access 		private
2224
+	 *		@return 		string
2225
+	 */
2226 2226
 	private function _display_no_javascript_warning() {
2227 2227
 		?>
2228 2228
 		<noscript>
@@ -2245,9 +2245,9 @@  discard block
 block discarded – undo
2245 2245
 
2246 2246
 	/**
2247 2247
 	 * 		displays espresso success and/or error notices
2248
-	*		@access 		private
2249
-	*		@return 		string
2250
-	*/
2248
+	 *		@access 		private
2249
+	 *		@return 		string
2250
+	 */
2251 2251
 	private function _display_espresso_notices() {
2252 2252
 		$notices = $this->_get_transient( TRUE );
2253 2253
 		echo stripslashes($notices);
@@ -2259,10 +2259,10 @@  discard block
 block discarded – undo
2259 2259
 
2260 2260
 
2261 2261
 	/**
2262
-	*		spinny things pacify the masses
2263
-	*		@access private
2264
-	*		@return string
2265
-	*/
2262
+	 *		spinny things pacify the masses
2263
+	 *		@access private
2264
+	 *		@return string
2265
+	 */
2266 2266
 	protected function _add_admin_page_ajax_loading_img() {
2267 2267
 		?>
2268 2268
 			<div id="espresso-ajax-loading" class="ajax-loading-grey">
@@ -2276,10 +2276,10 @@  discard block
 block discarded – undo
2276 2276
 
2277 2277
 
2278 2278
 	/**
2279
-	*		add admin page overlay for modal boxes
2280
-	*		@access private
2281
-	*		@return string
2282
-	*/
2279
+	 *		add admin page overlay for modal boxes
2280
+	 *		@access private
2281
+	 *		@return string
2282
+	 */
2283 2283
 	protected function _add_admin_page_overlay() {
2284 2284
 		?>
2285 2285
 		<div id="espresso-admin-page-overlay-dv" class=""></div>
@@ -2341,10 +2341,10 @@  discard block
 block discarded – undo
2341 2341
 
2342 2342
 
2343 2343
 	/**
2344
-	*		generates  HTML wrapper for an admin details page
2345
-	*		@access public
2346
-	*		@return void
2347
-	*/
2344
+	 *		generates  HTML wrapper for an admin details page
2345
+	 *		@access public
2346
+	 *		@return void
2347
+	 */
2348 2348
 	public function display_admin_page_with_sidebar() {
2349 2349
 
2350 2350
 		$this->_display_admin_page(TRUE);
@@ -2354,10 +2354,10 @@  discard block
 block discarded – undo
2354 2354
 
2355 2355
 
2356 2356
 	/**
2357
-	*		generates  HTML wrapper for an admin details page (except no sidebar)
2358
-	*		@access public
2359
-	*		@return void
2360
-	*/
2357
+	 *		generates  HTML wrapper for an admin details page (except no sidebar)
2358
+	 *		@access public
2359
+	 *		@return void
2360
+	 */
2361 2361
 	public function display_admin_page_with_no_sidebar() {
2362 2362
 		$this->_display_admin_page();
2363 2363
 	}
@@ -2505,31 +2505,31 @@  discard block
 block discarded – undo
2505 2505
 		$this->_template_args['list_table_hidden_fields'] = $hidden_form_fields;
2506 2506
 
2507 2507
 		//display message about search results?
2508
-        $this->_template_args['before_list_table'] .= ! empty($this->_req_data['s'])
2509
-            ? '<p class="ee-search-results">' . sprintf(
2510
-                    __('Displaying search results for the search string: <strong><em>%s</em></strong>',
2511
-                            'event_espresso'),
2512
-                    trim($this->_req_data['s'], '%')
2513
-            ) . '</p>'
2514
-            : '';
2515
-        // filter before_list_table template arg
2508
+		$this->_template_args['before_list_table'] .= ! empty($this->_req_data['s'])
2509
+			? '<p class="ee-search-results">' . sprintf(
2510
+					__('Displaying search results for the search string: <strong><em>%s</em></strong>',
2511
+							'event_espresso'),
2512
+					trim($this->_req_data['s'], '%')
2513
+			) . '</p>'
2514
+			: '';
2515
+		// filter before_list_table template arg
2516 2516
 		$this->_template_args['before_list_table'] = apply_filters(
2517
-            'FHEE__EE_Admin_Page___display_admin_list_table_page__before_list_table__template_arg',
2518
-                $this->_template_args['before_list_table'],
2519
-                $this->page_slug,
2520
-                $this->_req_data,
2521
-                $this->_req_action
2522
-        );
2523
-        // filter after_list_table template arg
2524
-        $this->_template_args['after_list_table'] = apply_filters(
2525
-            'FHEE__EE_Admin_Page___display_admin_list_table_page__after_list_table__template_arg',
2526
-            $this->_template_args['after_list_table'],
2527
-            $this->page_slug,
2528
-            $this->_req_data,
2529
-            $this->_req_action
2530
-        );
2531
-
2532
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2517
+			'FHEE__EE_Admin_Page___display_admin_list_table_page__before_list_table__template_arg',
2518
+				$this->_template_args['before_list_table'],
2519
+				$this->page_slug,
2520
+				$this->_req_data,
2521
+				$this->_req_action
2522
+		);
2523
+		// filter after_list_table template arg
2524
+		$this->_template_args['after_list_table'] = apply_filters(
2525
+			'FHEE__EE_Admin_Page___display_admin_list_table_page__after_list_table__template_arg',
2526
+			$this->_template_args['after_list_table'],
2527
+			$this->page_slug,
2528
+			$this->_req_data,
2529
+			$this->_req_action
2530
+		);
2531
+
2532
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2533 2533
 
2534 2534
 		// the final template wrapper
2535 2535
 		if ( $sidebar )
@@ -2605,11 +2605,11 @@  discard block
 block discarded – undo
2605 2605
 		// make sure there are no php errors or headers_sent.  Then we can set correct json header.
2606 2606
 		if ( NULL === error_get_last() || ! headers_sent() )
2607 2607
 			header('Content-Type: application/json; charset=UTF-8');
2608
-                if( function_exists( 'wp_json_encode' ) ) {
2609
-                    echo wp_json_encode( $json );
2610
-                } else {
2611
-                    echo json_encode( $json );
2612
-                }
2608
+				if( function_exists( 'wp_json_encode' ) ) {
2609
+					echo wp_json_encode( $json );
2610
+				} else {
2611
+					echo json_encode( $json );
2612
+				}
2613 2613
 		exit();
2614 2614
 	}
2615 2615
 
@@ -2648,11 +2648,11 @@  discard block
 block discarded – undo
2648 2648
 
2649 2649
 
2650 2650
 	/**
2651
-	*		generates  HTML wrapper with Tabbed nav for an admin page
2652
-	*		@access public
2653
-	*		@param  boolean $about whether to use the special about page wrapper or default.
2654
-	*		@return void
2655
-	*/
2651
+	 *		generates  HTML wrapper with Tabbed nav for an admin page
2652
+	 *		@access public
2653
+	 *		@param  boolean $about whether to use the special about page wrapper or default.
2654
+	 *		@return void
2655
+	 */
2656 2656
 	public function admin_page_wrapper($about = FALSE) {
2657 2657
 
2658 2658
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -2705,15 +2705,15 @@  discard block
 block discarded – undo
2705 2705
 
2706 2706
 
2707 2707
 	/**
2708
-	*		sort nav tabs
2709
-	*		@access public
2710
-	*		@return void
2711
-	*/
2708
+	 *		sort nav tabs
2709
+	 *		@access public
2710
+	 *		@return void
2711
+	 */
2712 2712
 	private function _sort_nav_tabs( $a, $b ) {
2713 2713
 		if ($a['order'] == $b['order']) {
2714
-	        return 0;
2715
-	    }
2716
-	    return ($a['order'] < $b['order']) ? -1 : 1;
2714
+			return 0;
2715
+		}
2716
+		return ($a['order'] < $b['order']) ? -1 : 1;
2717 2717
 	}
2718 2718
 
2719 2719
 
Please login to merge, or discard this patch.
Spacing   +605 added lines, -605 removed lines patch added patch discarded remove patch
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
 	 * 		@param bool $routing indicate whether we want to just load the object and handle routing or just load the object.
155 155
 	 * 		@access public
156 156
 	 */
157
-	public function __construct( $routing = TRUE ) {
157
+	public function __construct($routing = TRUE) {
158 158
 
159
-		if ( strpos( $this->_get_dir(), 'caffeinated' ) !== false )
159
+		if (strpos($this->_get_dir(), 'caffeinated') !== false)
160 160
 			$this->_is_caf = TRUE;
161 161
 
162 162
 		$this->_yes_no_values = array(
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
 
169 169
 		//set the _req_data property.
170
-		$this->_req_data = array_merge( $_GET, $_POST );
170
+		$this->_req_data = array_merge($_GET, $_POST);
171 171
 
172 172
 
173 173
 		//routing enabled?
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 		$this->_do_other_page_hooks();
189 189
 
190 190
 		//This just allows us to have extending clases do something specific before the parent constructor runs _page_setup.
191
-		if ( method_exists( $this, '_before_page_setup' ) )
191
+		if (method_exists($this, '_before_page_setup'))
192 192
 			$this->_before_page_setup();
193 193
 
194 194
 		//set up page dependencies
@@ -458,16 +458,16 @@  discard block
 block discarded – undo
458 458
 	 */
459 459
 	protected function _global_ajax_hooks() {
460 460
 		//for lazy loading of metabox content
461
-		add_action( 'wp_ajax_espresso-ajax-content', array( $this, 'ajax_metabox_content'), 10 );
461
+		add_action('wp_ajax_espresso-ajax-content', array($this, 'ajax_metabox_content'), 10);
462 462
 	}
463 463
 
464 464
 
465 465
 
466 466
 	public function ajax_metabox_content() {
467
-		$contentid = isset( $this->_req_data['contentid'] ) ? $this->_req_data['contentid'] : '';
468
-		$url = isset( $this->_req_data['contenturl'] ) ? $this->_req_data['contenturl'] : '';
467
+		$contentid = isset($this->_req_data['contentid']) ? $this->_req_data['contentid'] : '';
468
+		$url = isset($this->_req_data['contenturl']) ? $this->_req_data['contenturl'] : '';
469 469
 
470
-		self::cached_rss_display( $contentid, $url );
470
+		self::cached_rss_display($contentid, $url);
471 471
 		wp_die();
472 472
 	}
473 473
 
@@ -486,87 +486,87 @@  discard block
 block discarded – undo
486 486
 		//requires?
487 487
 
488 488
 		//admin_init stuff - global - we're setting this REALLY early so if EE_Admin pages have to hook into other WP pages they can.  But keep in mind, not everything is available from the EE_Admin Page object at this point.
489
-		add_action( 'admin_init', array( $this, 'admin_init_global' ), 5 );
489
+		add_action('admin_init', array($this, 'admin_init_global'), 5);
490 490
 
491 491
 
492 492
 		//next verify if we need to load anything...
493
-		$this->_current_page = !empty( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : FALSE;
494
-		$this->page_folder = strtolower( str_replace( '_Admin_Page', '', str_replace( 'Extend_', '', get_class($this) ) ) );
493
+		$this->_current_page = ! empty($_GET['page']) ? sanitize_key($_GET['page']) : FALSE;
494
+		$this->page_folder = strtolower(str_replace('_Admin_Page', '', str_replace('Extend_', '', get_class($this))));
495 495
 
496 496
 		global $ee_menu_slugs;
497 497
 		$ee_menu_slugs = (array) $ee_menu_slugs;
498 498
 
499
-		if ( ( !$this->_current_page || ! isset( $ee_menu_slugs[$this->_current_page] ) ) && !defined( 'DOING_AJAX') ) return FALSE;
499
+		if (( ! $this->_current_page || ! isset($ee_menu_slugs[$this->_current_page])) && ! defined('DOING_AJAX')) return FALSE;
500 500
 
501 501
 
502 502
 		// becuz WP List tables have two duplicate select inputs for choosing bulk actions, we need to copy the action from the second to the first
503
-		if ( isset( $this->_req_data['action2'] ) && $this->_req_data['action'] == -1 ) {
504
-			$this->_req_data['action'] = ! empty( $this->_req_data['action2'] ) && $this->_req_data['action2'] != -1 ? $this->_req_data['action2'] : $this->_req_data['action'];
503
+		if (isset($this->_req_data['action2']) && $this->_req_data['action'] == -1) {
504
+			$this->_req_data['action'] = ! empty($this->_req_data['action2']) && $this->_req_data['action2'] != -1 ? $this->_req_data['action2'] : $this->_req_data['action'];
505 505
 		}
506 506
 		// then set blank or -1 action values to 'default'
507
-		$this->_req_action = isset( $this->_req_data['action'] ) && ! empty( $this->_req_data['action'] ) && $this->_req_data['action'] != -1 ? sanitize_key( $this->_req_data['action'] ) : 'default';
507
+		$this->_req_action = isset($this->_req_data['action']) && ! empty($this->_req_data['action']) && $this->_req_data['action'] != -1 ? sanitize_key($this->_req_data['action']) : 'default';
508 508
 
509 509
 		//if action is 'default' after the above BUT we have  'route' var set, then let's use the route as the action.  This covers cases where we're coming in from a list table that isn't on the default route.
510
-		$this->_req_action = $this->_req_action == 'default' && isset( $this->_req_data['route'] ) ? $this->_req_data['route'] : $this->_req_action;
510
+		$this->_req_action = $this->_req_action == 'default' && isset($this->_req_data['route']) ? $this->_req_data['route'] : $this->_req_action;
511 511
 
512 512
 		//however if we are doing_ajax and we've got a 'route' set then that's what the req_action will be
513 513
 		$this->_req_action = defined('DOING_AJAX') && isset($this->_req_data['route']) ? $this->_req_data['route'] : $this->_req_action;
514 514
 
515 515
 		$this->_current_view = $this->_req_action;
516
-		$this->_req_nonce = $this->_req_action . '_nonce';
516
+		$this->_req_nonce = $this->_req_action.'_nonce';
517 517
 		$this->_define_page_props();
518 518
 
519
-		$this->_current_page_view_url = add_query_arg( array( 'page' => $this->_current_page, 'action' => $this->_current_view ),  $this->_admin_base_url );
519
+		$this->_current_page_view_url = add_query_arg(array('page' => $this->_current_page, 'action' => $this->_current_view), $this->_admin_base_url);
520 520
 
521 521
 		//default things
522
-		$this->_default_espresso_metaboxes = array('_espresso_news_post_box', '_espresso_links_post_box', '_espresso_ratings_request', '_espresso_sponsors_post_box' );
522
+		$this->_default_espresso_metaboxes = array('_espresso_news_post_box', '_espresso_links_post_box', '_espresso_ratings_request', '_espresso_sponsors_post_box');
523 523
 
524 524
 		//set page configs
525 525
 		$this->_set_page_routes();
526 526
 		$this->_set_page_config();
527 527
 
528 528
 		//let's include any referrer data in our default_query_args for this route for "stickiness".
529
-		if ( isset( $this->_req_data['wp_referer'] ) ) {
529
+		if (isset($this->_req_data['wp_referer'])) {
530 530
 			$this->_default_route_query_args['wp_referer'] = $this->_req_data['wp_referer'];
531 531
 		}
532 532
 
533 533
 		//for caffeinated and other extended functionality.  If there is a _extend_page_config method then let's run that to modify the all the various page configuration arrays
534
-		if ( method_exists( $this, '_extend_page_config' ) )
534
+		if (method_exists($this, '_extend_page_config'))
535 535
 			$this->_extend_page_config();
536 536
 
537 537
 		//for CPT and other extended functionality. If there is an _extend_page_config_for_cpt then let's run that to modify all the various page configuration arrays.
538
-		if ( method_exists( $this, '_extend_page_config_for_cpt' ) )
538
+		if (method_exists($this, '_extend_page_config_for_cpt'))
539 539
 			$this->_extend_page_config_for_cpt();
540 540
 
541 541
 		//filter routes and page_config so addons can add their stuff. Filtering done per class
542
-		$this->_page_routes = apply_filters( 'FHEE__' . get_class($this) . '__page_setup__page_routes', $this->_page_routes, $this );
543
-		$this->_page_config = apply_filters( 'FHEE__' . get_class($this) . '__page_setup__page_config', $this->_page_config, $this );
542
+		$this->_page_routes = apply_filters('FHEE__'.get_class($this).'__page_setup__page_routes', $this->_page_routes, $this);
543
+		$this->_page_config = apply_filters('FHEE__'.get_class($this).'__page_setup__page_config', $this->_page_config, $this);
544 544
 
545 545
 
546 546
 		//if AHEE__EE_Admin_Page__route_admin_request_$this->_current_view method is present then we call it hooked into the AHEE__EE_Admin_Page__route_admin_request action
547
-		if ( method_exists( $this, 'AHEE__EE_Admin_Page__route_admin_request_' . $this->_current_view ) ) {
548
-			add_action( 'AHEE__EE_Admin_Page__route_admin_request', array( $this, 'AHEE__EE_Admin_Page__route_admin_request_' . $this->_current_view ), 10, 2 );
547
+		if (method_exists($this, 'AHEE__EE_Admin_Page__route_admin_request_'.$this->_current_view)) {
548
+			add_action('AHEE__EE_Admin_Page__route_admin_request', array($this, 'AHEE__EE_Admin_Page__route_admin_request_'.$this->_current_view), 10, 2);
549 549
 		}
550 550
 
551 551
 
552 552
 		//next route only if routing enabled
553
-		if ( $this->_routing && !defined('DOING_AJAX') ) {
553
+		if ($this->_routing && ! defined('DOING_AJAX')) {
554 554
 
555 555
 			$this->_verify_routes();
556 556
 
557 557
 			//next let's just check user_access and kill if no access
558 558
 			$this->check_user_access();
559 559
 
560
-			if ( $this->_is_UI_request ) {
560
+			if ($this->_is_UI_request) {
561 561
 				//admin_init stuff - global, all views for this page class, specific view
562
-				add_action( 'admin_init', array( $this, 'admin_init' ), 10 );
563
-				if ( method_exists( $this, 'admin_init_' . $this->_current_view )) {
564
-					add_action( 'admin_init', array( $this, 'admin_init_' . $this->_current_view ), 15 );
562
+				add_action('admin_init', array($this, 'admin_init'), 10);
563
+				if (method_exists($this, 'admin_init_'.$this->_current_view)) {
564
+					add_action('admin_init', array($this, 'admin_init_'.$this->_current_view), 15);
565 565
 				}
566 566
 
567 567
 			} else {
568 568
 				//hijack regular WP loading and route admin request immediately
569
-				@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
569
+				@ini_set('memory_limit', apply_filters('admin_memory_limit', WP_MAX_MEMORY_LIMIT));
570 570
 				$this->route_admin_request();
571 571
 			}
572 572
 		}
@@ -583,18 +583,18 @@  discard block
 block discarded – undo
583 583
 	 * @return void
584 584
 	 */
585 585
 	private function _do_other_page_hooks() {
586
-		$registered_pages = apply_filters( 'FHEE_do_other_page_hooks_' . $this->page_slug, array() );
586
+		$registered_pages = apply_filters('FHEE_do_other_page_hooks_'.$this->page_slug, array());
587 587
 
588
-		foreach ( $registered_pages as $page ) {
588
+		foreach ($registered_pages as $page) {
589 589
 
590 590
 			//now let's setup the file name and class that should be present
591 591
 			$classname = str_replace('.class.php', '', $page);
592 592
 
593 593
 			//autoloaders should take care of loading file
594
-			if ( !class_exists( $classname ) ) {
595
-				$error_msg[] = sprintf( __('Something went wrong with loading the %s admin hooks page.', 'event_espresso' ), $page);
596
-				$error_msg[] = $error_msg[0] . "\r\n" . sprintf( __( 'There is no class in place for the %s admin hooks page.%sMake sure you have <strong>%s</strong> defined. If this is a non-EE-core admin page then you also must have an autoloader in place for your class', 'event_espresso'), $page, '<br />', $classname );
597
-				throw new EE_Error( implode( '||', $error_msg ));
594
+			if ( ! class_exists($classname)) {
595
+				$error_msg[] = sprintf(__('Something went wrong with loading the %s admin hooks page.', 'event_espresso'), $page);
596
+				$error_msg[] = $error_msg[0]."\r\n".sprintf(__('There is no class in place for the %s admin hooks page.%sMake sure you have <strong>%s</strong> defined. If this is a non-EE-core admin page then you also must have an autoloader in place for your class', 'event_espresso'), $page, '<br />', $classname);
597
+				throw new EE_Error(implode('||', $error_msg));
598 598
 			}
599 599
 
600 600
 			$a = new ReflectionClass($classname);
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 	public function load_page_dependencies() {
610 610
 		try {
611 611
 			$this->_load_page_dependencies();
612
-		} catch ( EE_Error $e ) {
612
+		} catch (EE_Error $e) {
613 613
 			$e->get_error();
614 614
 		}
615 615
 	}
@@ -627,16 +627,16 @@  discard block
 block discarded – undo
627 627
 		$this->_current_screen = get_current_screen();
628 628
 
629 629
 		//load admin_notices - global, page class, and view specific
630
-		add_action( 'admin_notices', array( $this, 'admin_notices_global'), 5 );
631
-		add_action( 'admin_notices', array( $this, 'admin_notices' ), 10 );
632
-		if ( method_exists( $this, 'admin_notices_' . $this->_current_view ) ) {
633
-			add_action( 'admin_notices', array( $this, 'admin_notices_' . $this->_current_view ), 15 );
630
+		add_action('admin_notices', array($this, 'admin_notices_global'), 5);
631
+		add_action('admin_notices', array($this, 'admin_notices'), 10);
632
+		if (method_exists($this, 'admin_notices_'.$this->_current_view)) {
633
+			add_action('admin_notices', array($this, 'admin_notices_'.$this->_current_view), 15);
634 634
 		}
635 635
 
636 636
 		//load network admin_notices - global, page class, and view specific
637
-		add_action( 'network_admin_notices', array( $this, 'network_admin_notices_global'), 5 );
638
-		if ( method_exists( $this, 'network_admin_notices_' . $this->_current_view ) ) {
639
-			add_action( 'network_admin_notices', array( $this, 'network_admin_notices_' . $this->_current_view ) );
637
+		add_action('network_admin_notices', array($this, 'network_admin_notices_global'), 5);
638
+		if (method_exists($this, 'network_admin_notices_'.$this->_current_view)) {
639
+			add_action('network_admin_notices', array($this, 'network_admin_notices_'.$this->_current_view));
640 640
 		}
641 641
 
642 642
 		//this will save any per_page screen options if they are present
@@ -652,8 +652,8 @@  discard block
 block discarded – undo
652 652
 		//add screen options - global, page child class, and view specific
653 653
 		$this->_add_global_screen_options();
654 654
 		$this->_add_screen_options();
655
-		if ( method_exists( $this, '_add_screen_options_' . $this->_current_view ) )
656
-			call_user_func( array( $this, '_add_screen_options_' . $this->_current_view ) );
655
+		if (method_exists($this, '_add_screen_options_'.$this->_current_view))
656
+			call_user_func(array($this, '_add_screen_options_'.$this->_current_view));
657 657
 
658 658
 
659 659
 		//add help tab(s) and tours- set via page_config and qtips.
@@ -664,33 +664,33 @@  discard block
 block discarded – undo
664 664
 		//add feature_pointers - global, page child class, and view specific
665 665
 		$this->_add_feature_pointers();
666 666
 		$this->_add_global_feature_pointers();
667
-		if ( method_exists( $this, '_add_feature_pointer_' . $this->_current_view ) )
668
-			call_user_func( array( $this, '_add_feature_pointer_' . $this->_current_view ) );
667
+		if (method_exists($this, '_add_feature_pointer_'.$this->_current_view))
668
+			call_user_func(array($this, '_add_feature_pointer_'.$this->_current_view));
669 669
 
670 670
 		//enqueue scripts/styles - global, page class, and view specific
671
-		add_action('admin_enqueue_scripts', array($this, 'load_global_scripts_styles'), 5 );
672
-		add_action('admin_enqueue_scripts', array($this, 'load_scripts_styles'), 10 );
673
-		if ( method_exists( $this, 'load_scripts_styles_' . $this->_current_view ) )
674
-			add_action('admin_enqueue_scripts', array($this, 'load_scripts_styles_' . $this->_current_view ), 15 );
671
+		add_action('admin_enqueue_scripts', array($this, 'load_global_scripts_styles'), 5);
672
+		add_action('admin_enqueue_scripts', array($this, 'load_scripts_styles'), 10);
673
+		if (method_exists($this, 'load_scripts_styles_'.$this->_current_view))
674
+			add_action('admin_enqueue_scripts', array($this, 'load_scripts_styles_'.$this->_current_view), 15);
675 675
 
676
-		add_action('admin_enqueue_scripts', array( $this, 'admin_footer_scripts_eei18n_js_strings' ), 100 );
676
+		add_action('admin_enqueue_scripts', array($this, 'admin_footer_scripts_eei18n_js_strings'), 100);
677 677
 
678 678
 		//admin_print_footer_scripts - global, page child class, and view specific.  NOTE, despite the name, whenever possible, scripts should NOT be loaded using this.  In most cases that's doing_it_wrong().  But adding hidden container elements etc. is a good use case. Notice the late priority we're giving these
679
-		add_action('admin_print_footer_scripts', array( $this, 'admin_footer_scripts_global' ), 99 );
680
-		add_action('admin_print_footer_scripts', array( $this, 'admin_footer_scripts' ), 100 );
681
-		if ( method_exists( $this, 'admin_footer_scripts_' . $this->_current_view ) )
682
-			add_action('admin_print_footer_scripts', array( $this, 'admin_footer_scripts_' . $this->_current_view ), 101 );
679
+		add_action('admin_print_footer_scripts', array($this, 'admin_footer_scripts_global'), 99);
680
+		add_action('admin_print_footer_scripts', array($this, 'admin_footer_scripts'), 100);
681
+		if (method_exists($this, 'admin_footer_scripts_'.$this->_current_view))
682
+			add_action('admin_print_footer_scripts', array($this, 'admin_footer_scripts_'.$this->_current_view), 101);
683 683
 
684 684
 		//admin footer scripts
685
-		add_action('admin_footer', array( $this, 'admin_footer_global' ), 99 );
686
-		add_action('admin_footer', array( $this, 'admin_footer'), 100 );
687
-		if ( method_exists( $this, 'admin_footer_' . $this->_current_view ) )
688
-			add_action('admin_footer', array( $this, 'admin_footer_' . $this->_current_view ), 101 );
685
+		add_action('admin_footer', array($this, 'admin_footer_global'), 99);
686
+		add_action('admin_footer', array($this, 'admin_footer'), 100);
687
+		if (method_exists($this, 'admin_footer_'.$this->_current_view))
688
+			add_action('admin_footer', array($this, 'admin_footer_'.$this->_current_view), 101);
689 689
 
690 690
 
691
-		do_action( 'FHEE__EE_Admin_Page___load_page_dependencies__after_load', $this->page_slug );
691
+		do_action('FHEE__EE_Admin_Page___load_page_dependencies__after_load', $this->page_slug);
692 692
 		//targeted hook
693
-		do_action( 'FHEE__EE_Admin_Page___load_page_dependencies__after_load__' . $this->page_slug . '__' . $this->_req_action );
693
+		do_action('FHEE__EE_Admin_Page___load_page_dependencies__after_load__'.$this->page_slug.'__'.$this->_req_action);
694 694
 
695 695
 	}
696 696
 
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 	private function _set_defaults() {
706 706
 		$this->_current_screen = $this->_admin_page_title = $this->_req_action = $this->_req_nonce = $this->_event = $this->_template_path = $this->_column_template_path = NULL;
707 707
 
708
-		$this->_nav_tabs = $this_views = $this->_page_routes = $this->_page_config =  $this->_default_route_query_args = array();
708
+		$this->_nav_tabs = $this_views = $this->_page_routes = $this->_page_config = $this->_default_route_query_args = array();
709 709
 
710 710
 		$this->default_nav_tab_name = 'overview';
711 711
 
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 	public function route_admin_request() {
733 733
 		try {
734 734
 			$this->_route_admin_request();
735
-		} catch ( EE_Error $e ) {
735
+		} catch (EE_Error $e) {
736 736
 			$e->get_error();
737 737
 		}
738 738
 	}
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
 		$this->_wp_page_slug = $wp_page_slug;
744 744
 
745 745
 		//if in network admin then we need to append "-network" to the page slug. Why? Because that's how WP rolls...
746
-		if ( is_network_admin() ) {
746
+		if (is_network_admin()) {
747 747
 			$this->_wp_page_slug .= '-network';
748 748
 		}
749 749
 	}
@@ -756,53 +756,53 @@  discard block
 block discarded – undo
756 756
 	 * @return void
757 757
 	 */
758 758
 	protected function _verify_routes() {
759
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
759
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
760 760
 
761
-		if ( !$this->_current_page && !defined( 'DOING_AJAX')) return FALSE;
761
+		if ( ! $this->_current_page && ! defined('DOING_AJAX')) return FALSE;
762 762
 
763 763
 		$this->_route = FALSE;
764 764
 		$func = FALSE;
765 765
 		$args = array();
766 766
 
767 767
 		// check that the page_routes array is not empty
768
-		if ( empty( $this->_page_routes )) {
768
+		if (empty($this->_page_routes)) {
769 769
 			// user error msg
770
-			$error_msg = sprintf( __('No page routes have been set for the %s admin page.', 'event_espresso'), $this->_admin_page_title );
770
+			$error_msg = sprintf(__('No page routes have been set for the %s admin page.', 'event_espresso'), $this->_admin_page_title);
771 771
 			// developer error msg
772
-			$error_msg .=  '||' . $error_msg . __( ' Make sure the "set_page_routes()" method exists, and is setting the "_page_routes" array properly.', 'event_espresso' );
773
-			throw new EE_Error( $error_msg );
772
+			$error_msg .= '||'.$error_msg.__(' Make sure the "set_page_routes()" method exists, and is setting the "_page_routes" array properly.', 'event_espresso');
773
+			throw new EE_Error($error_msg);
774 774
 		}
775 775
 
776 776
 		// and that the requested page route exists
777
-		if ( array_key_exists( $this->_req_action, $this->_page_routes )) {
778
-			$this->_route = $this->_page_routes[ $this->_req_action ];
777
+		if (array_key_exists($this->_req_action, $this->_page_routes)) {
778
+			$this->_route = $this->_page_routes[$this->_req_action];
779 779
 			$this->_route_config = isset($this->_page_config[$this->_req_action]) ? $this->_page_config[$this->_req_action] : array();
780 780
 		} else {
781 781
 			// user error msg
782
-			$error_msg =  sprintf( __( 'The requested page route does not exist for the %s admin page.', 'event_espresso' ), $this->_admin_page_title );
782
+			$error_msg = sprintf(__('The requested page route does not exist for the %s admin page.', 'event_espresso'), $this->_admin_page_title);
783 783
 			// developer error msg
784
-			$error_msg .=  '||' . $error_msg . sprintf( __( ' Create a key in the "_page_routes" array named "%s" and set its value to the appropriate method.', 'event_espresso' ), $this->_req_action );
785
-			throw new EE_Error( $error_msg );
784
+			$error_msg .= '||'.$error_msg.sprintf(__(' Create a key in the "_page_routes" array named "%s" and set its value to the appropriate method.', 'event_espresso'), $this->_req_action);
785
+			throw new EE_Error($error_msg);
786 786
 		}
787 787
 
788 788
 		// and that a default route exists
789
-		if ( ! array_key_exists( 'default', $this->_page_routes )) {
789
+		if ( ! array_key_exists('default', $this->_page_routes)) {
790 790
 			// user error msg
791
-			$error_msg = sprintf( __( 'A default page route has not been set for the % admin page.', 'event_espresso' ), $this->_admin_page_title );
791
+			$error_msg = sprintf(__('A default page route has not been set for the % admin page.', 'event_espresso'), $this->_admin_page_title);
792 792
 			// developer error msg
793
-			$error_msg .=  '||' . $error_msg . __( ' Create a key in the "_page_routes" array named "default" and set its value to your default page method.', 'event_espresso' );
794
-			throw new EE_Error( $error_msg );
793
+			$error_msg .= '||'.$error_msg.__(' Create a key in the "_page_routes" array named "default" and set its value to your default page method.', 'event_espresso');
794
+			throw new EE_Error($error_msg);
795 795
 		}
796 796
 
797 797
 
798 798
 		//first lets' catch if the UI request has EVER been set.
799
-		if ( $this->_is_UI_request === NULL ) {
799
+		if ($this->_is_UI_request === NULL) {
800 800
 			//lets set if this is a UI request or not.
801
-			$this->_is_UI_request = ( ! isset( $this->_req_data['noheader'] ) || $this->_req_data['noheader'] !== TRUE ) ? TRUE : FALSE;
801
+			$this->_is_UI_request = ( ! isset($this->_req_data['noheader']) || $this->_req_data['noheader'] !== TRUE) ? TRUE : FALSE;
802 802
 
803 803
 
804 804
 			//wait a minute... we might have a noheader in the route array
805
-			$this->_is_UI_request = is_array($this->_route) && isset($this->_route['noheader'] ) && $this->_route['noheader'] ? FALSE : $this->_is_UI_request;
805
+			$this->_is_UI_request = is_array($this->_route) && isset($this->_route['noheader']) && $this->_route['noheader'] ? FALSE : $this->_is_UI_request;
806 806
 		}
807 807
 
808 808
 		$this->_set_current_labels();
@@ -817,15 +817,15 @@  discard block
 block discarded – undo
817 817
 	 * @param  string $route the route name we're verifying
818 818
 	 * @return mixed  (bool|Exception)      we'll throw an exception if this isn't a valid route.
819 819
 	 */
820
-	protected function _verify_route( $route ) {
821
-		if ( array_key_exists( $this->_req_action, $this->_page_routes )) {
820
+	protected function _verify_route($route) {
821
+		if (array_key_exists($this->_req_action, $this->_page_routes)) {
822 822
 			return true;
823 823
 		} else {
824 824
 			// user error msg
825
-			$error_msg =  sprintf( __( 'The given page route does not exist for the %s admin page.', 'event_espresso' ), $this->_admin_page_title );
825
+			$error_msg = sprintf(__('The given page route does not exist for the %s admin page.', 'event_espresso'), $this->_admin_page_title);
826 826
 			// developer error msg
827
-			$error_msg .=  '||' . $error_msg . sprintf( __( ' Check the route you are using in your method (%s) and make sure it matches a route set in your "_page_routes" array property', 'event_espresso' ), $route );
828
-			throw new EE_Error( $error_msg );
827
+			$error_msg .= '||'.$error_msg.sprintf(__(' Check the route you are using in your method (%s) and make sure it matches a route set in your "_page_routes" array property', 'event_espresso'), $route);
828
+			throw new EE_Error($error_msg);
829 829
 		}
830 830
 	}
831 831
 
@@ -839,18 +839,18 @@  discard block
 block discarded – undo
839 839
 	 * @param  string $nonce_ref The nonce reference string (name0)
840 840
 	 * @return mixed (bool|die)
841 841
 	 */
842
-	protected function _verify_nonce( $nonce, $nonce_ref ) {
842
+	protected function _verify_nonce($nonce, $nonce_ref) {
843 843
 		// verify nonce against expected value
844
-		if ( ! wp_verify_nonce( $nonce, $nonce_ref) ) {
844
+		if ( ! wp_verify_nonce($nonce, $nonce_ref)) {
845 845
 			// these are not the droids you are looking for !!!
846
-			$msg = sprintf(__('%sNonce Fail.%s' , 'event_espresso'), '<a href="http://www.youtube.com/watch?v=56_S0WeTkzs">', '</a>' );
847
-			if ( WP_DEBUG ) {
848
-				$msg .= "\n  " . sprintf( __('In order to dynamically generate nonces for your actions, use the %s::add_query_args_and_nonce() method. May the Nonce be with you!', 'event_espresso' ), __CLASS__  );
846
+			$msg = sprintf(__('%sNonce Fail.%s', 'event_espresso'), '<a href="http://www.youtube.com/watch?v=56_S0WeTkzs">', '</a>');
847
+			if (WP_DEBUG) {
848
+				$msg .= "\n  ".sprintf(__('In order to dynamically generate nonces for your actions, use the %s::add_query_args_and_nonce() method. May the Nonce be with you!', 'event_espresso'), __CLASS__);
849 849
 			}
850
-			if ( ! defined( 'DOING_AJAX' )) {
851
-				wp_die( $msg );
850
+			if ( ! defined('DOING_AJAX')) {
851
+				wp_die($msg);
852 852
 			} else {
853
-				EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
853
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
854 854
 				$this->_return_json();
855 855
 			}
856 856
 		}
@@ -868,63 +868,63 @@  discard block
 block discarded – undo
868 868
 	 * @return void
869 869
 	 */
870 870
 	protected function _route_admin_request() {
871
-		if (  ! $this->_is_UI_request )
871
+		if ( ! $this->_is_UI_request)
872 872
 			$this->_verify_routes();
873 873
 
874
-		$nonce_check = isset( $this->_route_config['require_nonce'] ) ? $this->_route_config['require_nonce'] : TRUE;
874
+		$nonce_check = isset($this->_route_config['require_nonce']) ? $this->_route_config['require_nonce'] : TRUE;
875 875
 
876
-		if ( $this->_req_action != 'default' && $nonce_check ) {
876
+		if ($this->_req_action != 'default' && $nonce_check) {
877 877
 			// set nonce from post data
878
-			$nonce = isset($this->_req_data[ $this->_req_nonce  ]) ? sanitize_text_field( $this->_req_data[ $this->_req_nonce  ] ) : '';
879
-			$this->_verify_nonce( $nonce, $this->_req_nonce );
878
+			$nonce = isset($this->_req_data[$this->_req_nonce]) ? sanitize_text_field($this->_req_data[$this->_req_nonce]) : '';
879
+			$this->_verify_nonce($nonce, $this->_req_nonce);
880 880
 		}
881 881
 		//set the nav_tabs array but ONLY if this is  UI_request
882
-		if ( $this->_is_UI_request )
882
+		if ($this->_is_UI_request)
883 883
 			$this->_set_nav_tabs();
884 884
 
885 885
 		// grab callback function
886
-		$func = is_array( $this->_route ) ? $this->_route['func'] : $this->_route;
886
+		$func = is_array($this->_route) ? $this->_route['func'] : $this->_route;
887 887
 
888 888
 		// check if callback has args
889
-		$args = is_array( $this->_route ) && isset( $this->_route['args'] ) ? $this->_route['args'] : array();
889
+		$args = is_array($this->_route) && isset($this->_route['args']) ? $this->_route['args'] : array();
890 890
 
891 891
 		$error_msg = '';
892 892
 
893 893
 		//action right before calling route (hook is something like 'AHEE__Registrations_Admin_Page__route_admin_request')
894
-		if ( !did_action('AHEE__EE_Admin_Page__route_admin_request')) {
895
-			do_action( 'AHEE__EE_Admin_Page__route_admin_request', $this->_current_view, $this );
894
+		if ( ! did_action('AHEE__EE_Admin_Page__route_admin_request')) {
895
+			do_action('AHEE__EE_Admin_Page__route_admin_request', $this->_current_view, $this);
896 896
 		}
897 897
 
898 898
 		//right before calling the route, let's remove _wp_http_referer from the $_SERVER[REQUEST_URI] global (its now in _req_data for route processing).
899
-		$_SERVER['REQUEST_URI'] = remove_query_arg( '_wp_http_referer', wp_unslash( $_SERVER['REQUEST_URI'] ) );
899
+		$_SERVER['REQUEST_URI'] = remove_query_arg('_wp_http_referer', wp_unslash($_SERVER['REQUEST_URI']));
900 900
 
901
-		if ( ! empty( $func )) {
901
+		if ( ! empty($func)) {
902 902
 			$base_call = $addon_call = FALSE;
903 903
 			//try to access page route via this class
904
-			if ( ! is_array( $func ) && method_exists( $this, $func ) && ( $base_call = call_user_func_array( array( $this, &$func  ), $args ) ) === FALSE ) {
904
+			if ( ! is_array($func) && method_exists($this, $func) && ($base_call = call_user_func_array(array($this, &$func), $args)) === FALSE) {
905 905
 				// user error msg
906
-				$error_msg =  __( 'An error occurred. The  requested page route could not be found.', 'event_espresso' );
906
+				$error_msg = __('An error occurred. The  requested page route could not be found.', 'event_espresso');
907 907
 				// developer error msg
908
-				$error_msg .= '||' . sprintf( __( 'Page route "%s" could not be called. Check that the spelling for method names and actions in the "_page_routes" array are all correct.', 'event_espresso' ), $func );
908
+				$error_msg .= '||'.sprintf(__('Page route "%s" could not be called. Check that the spelling for method names and actions in the "_page_routes" array are all correct.', 'event_espresso'), $func);
909 909
 			}
910 910
 
911 911
 			//for pluggability by addons first let's see if just the function exists (this will also work in the case where $func is an array indicating class/method)
912 912
 			$args['admin_page_object'] = $this; //send along this admin page object for access by addons.
913 913
 
914
-			if ( $base_call === FALSE && ( $addon_call = call_user_func_array( $func, $args ) )=== FALSE ) {
915
-				$error_msg = __('An error occurred. The requested page route could not be found', 'event_espresso' );
916
-				$error_msg .= '||' . sprintf( __('Page route "%s" could not be called.  Check that the spelling for the function name and action in the "_page_routes" array filtered by your plugin is correct.', 'event_espresso'), $func );
914
+			if ($base_call === FALSE && ($addon_call = call_user_func_array($func, $args)) === FALSE) {
915
+				$error_msg = __('An error occurred. The requested page route could not be found', 'event_espresso');
916
+				$error_msg .= '||'.sprintf(__('Page route "%s" could not be called.  Check that the spelling for the function name and action in the "_page_routes" array filtered by your plugin is correct.', 'event_espresso'), $func);
917 917
 			}
918 918
 
919 919
 
920
-			if ( !empty( $error_msg ) && $base_call === FALSE && $addon_call === FALSE )
921
-				throw new EE_Error( $error_msg );
920
+			if ( ! empty($error_msg) && $base_call === FALSE && $addon_call === FALSE)
921
+				throw new EE_Error($error_msg);
922 922
 		}
923 923
 
924 924
 		//if we've routed and this route has a no headers route AND a sent_headers_route, then we need to reset the routing properties to the new route.
925 925
 		//now if UI request is FALSE and noheader is true AND we have a headers_sent_route in the route array then let's set UI_request to true because the no header route has a second func after headers have been sent.
926
-		if ( $this->_is_UI_request === FALSE && is_array( $this->_route) && ! empty( $this->_route['headers_sent_route'] ) ) {
927
-			$this->_reset_routing_properties( $this->_route['headers_sent_route'] );
926
+		if ($this->_is_UI_request === FALSE && is_array($this->_route) && ! empty($this->_route['headers_sent_route'])) {
927
+			$this->_reset_routing_properties($this->_route['headers_sent_route']);
928 928
 		}
929 929
 	}
930 930
 
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
 	 * @param  string    $new_route   New (non header) route to redirect to.
941 941
 	 * @return   void
942 942
 	 */
943
-	protected function _reset_routing_properties( $new_route ) {
943
+	protected function _reset_routing_properties($new_route) {
944 944
 		$this->_is_UI_request = TRUE;
945 945
 		//now we set the current route to whatever the headers_sent_route is set at
946 946
 		$this->_req_data['action'] = $new_route;
@@ -986,23 +986,23 @@  discard block
 block discarded – undo
986 986
 	 * @param   bool    $exclude_nonce  If true, the the nonce will be excluded from the generated nonce.
987 987
 	 * 	@return string
988 988
 	 */
989
-	public static function add_query_args_and_nonce( $args = array(), $url = false, $sticky = false, $exclude_nonce = false ) {
989
+	public static function add_query_args_and_nonce($args = array(), $url = false, $sticky = false, $exclude_nonce = false) {
990 990
 
991 991
 		//if there is a _wp_http_referer include the values from the request but only if sticky = true
992
-		if ( $sticky ) {
992
+		if ($sticky) {
993 993
 			$request = $_REQUEST;
994
-			unset( $request['_wp_http_referer'] );
995
-			unset( $request['wp_referer'] );
996
-			foreach ( $request as $key => $value ) {
994
+			unset($request['_wp_http_referer']);
995
+			unset($request['wp_referer']);
996
+			foreach ($request as $key => $value) {
997 997
 				//do not add nonces
998
-				if ( strpos( $key, 'nonce' ) !== false ) {
998
+				if (strpos($key, 'nonce') !== false) {
999 999
 					continue;
1000 1000
 				}
1001
-				$args['wp_referer[' . $key . ']'] = $value;
1001
+				$args['wp_referer['.$key.']'] = $value;
1002 1002
 			}
1003 1003
 		}
1004 1004
 
1005
-		return EEH_URL::add_query_args_and_nonce( $args, $url, $exclude_nonce );
1005
+		return EEH_URL::add_query_args_and_nonce($args, $url, $exclude_nonce);
1006 1006
 	}
1007 1007
 
1008 1008
 
@@ -1018,8 +1018,8 @@  discard block
 block discarded – undo
1018 1018
 	 * @uses EEH_Template::get_help_tab_link()
1019 1019
 	 * @return string              generated link
1020 1020
 	 */
1021
-	protected function _get_help_tab_link( $help_tab_id, $icon_style = FALSE, $help_text = FALSE ) {
1022
-		return EEH_Template::get_help_tab_link( $help_tab_id, $this->page_slug, $this->_req_action, $icon_style, $help_text );
1021
+	protected function _get_help_tab_link($help_tab_id, $icon_style = FALSE, $help_text = FALSE) {
1022
+		return EEH_Template::get_help_tab_link($help_tab_id, $this->page_slug, $this->_req_action, $icon_style, $help_text);
1023 1023
 	}
1024 1024
 
1025 1025
 
@@ -1036,30 +1036,30 @@  discard block
 block discarded – undo
1036 1036
 	 */
1037 1037
 	protected function _add_help_tabs() {
1038 1038
 		$tour_buttons = '';
1039
-		if ( isset( $this->_page_config[$this->_req_action] ) ) {
1039
+		if (isset($this->_page_config[$this->_req_action])) {
1040 1040
 			$config = $this->_page_config[$this->_req_action];
1041 1041
 
1042 1042
 			//is there a help tour for the current route?  if there is let's setup the tour buttons
1043
-			if ( isset( $this->_help_tour[$this->_req_action]) ) {
1043
+			if (isset($this->_help_tour[$this->_req_action])) {
1044 1044
 				$tb = array();
1045 1045
 				$tour_buttons = '<div class="ee-abs-container"><div class="ee-help-tour-restart-buttons">';
1046
-				foreach ( $this->_help_tour['tours'] as $tour ) {
1046
+				foreach ($this->_help_tour['tours'] as $tour) {
1047 1047
 					//if this is the end tour then we don't need to setup a button
1048
-					if ( $tour instanceof EE_Help_Tour_final_stop )
1048
+					if ($tour instanceof EE_Help_Tour_final_stop)
1049 1049
 						continue;
1050
-					$tb[] = '<button id="trigger-tour-' . $tour->get_slug() . '" class="button-primary trigger-ee-help-tour">' . $tour->get_label() . '</button>';
1050
+					$tb[] = '<button id="trigger-tour-'.$tour->get_slug().'" class="button-primary trigger-ee-help-tour">'.$tour->get_label().'</button>';
1051 1051
 				}
1052 1052
 				$tour_buttons .= implode('<br />', $tb);
1053 1053
 				$tour_buttons .= '</div></div>';
1054 1054
 			}
1055 1055
 
1056 1056
 			// let's see if there is a help_sidebar set for the current route and we'll set that up for usage as well.
1057
-			if ( is_array( $config ) && isset( $config['help_sidebar'] ) ) {
1057
+			if (is_array($config) && isset($config['help_sidebar'])) {
1058 1058
 				//check that the callback given is valid
1059
-				if ( !method_exists($this, $config['help_sidebar'] ) )
1060
-					throw new EE_Error( sprintf( __('The _page_config array has a callback set for the "help_sidebar" option.  However the callback given (%s) is not a valid callback.  Doublecheck the spelling and make sure this method exists for the class %s', 'event_espresso'), $config['help_sidebar'], get_class($this) ) );
1059
+				if ( ! method_exists($this, $config['help_sidebar']))
1060
+					throw new EE_Error(sprintf(__('The _page_config array has a callback set for the "help_sidebar" option.  However the callback given (%s) is not a valid callback.  Doublecheck the spelling and make sure this method exists for the class %s', 'event_espresso'), $config['help_sidebar'], get_class($this)));
1061 1061
 
1062
-				$content = apply_filters( 'FHEE__' . get_class($this) . '__add_help_tabs__help_sidebar', call_user_func( array( $this, $config['help_sidebar'] ) ) );
1062
+				$content = apply_filters('FHEE__'.get_class($this).'__add_help_tabs__help_sidebar', call_user_func(array($this, $config['help_sidebar'])));
1063 1063
 
1064 1064
 				$content .= $tour_buttons; //add help tour buttons.
1065 1065
 
@@ -1068,49 +1068,49 @@  discard block
 block discarded – undo
1068 1068
 			}
1069 1069
 
1070 1070
 			//if we DON'T have config help sidebar and there ARE toure buttons then we'll just add the tour buttons to the sidebar.
1071
-			if ( !isset( $config['help_sidebar'] ) && !empty( $tour_buttons ) ) {
1071
+			if ( ! isset($config['help_sidebar']) && ! empty($tour_buttons)) {
1072 1072
 				$this->_current_screen->set_help_sidebar($tour_buttons);
1073 1073
 			}
1074 1074
 
1075 1075
 			//handle if no help_tabs are set so the sidebar will still show for the help tour buttons
1076
-			if ( !isset( $config['help_tabs'] ) && !empty($tour_buttons) ) {
1076
+			if ( ! isset($config['help_tabs']) && ! empty($tour_buttons)) {
1077 1077
 				$_ht['id'] = $this->page_slug;
1078 1078
 				$_ht['title'] = __('Help Tours', 'event_espresso');
1079
-				$_ht['content'] = '<p>' . __('The buttons to the right allow you to start/restart any help tours available for this page', 'event_espresso') . '</p>';
1079
+				$_ht['content'] = '<p>'.__('The buttons to the right allow you to start/restart any help tours available for this page', 'event_espresso').'</p>';
1080 1080
 				$this->_current_screen->add_help_tab($_ht);
1081 1081
 				}/**/
1082 1082
 
1083 1083
 
1084
-			if ( !isset( $config['help_tabs'] ) ) return; //no help tabs for this route
1084
+			if ( ! isset($config['help_tabs'])) return; //no help tabs for this route
1085 1085
 
1086
-			foreach ( (array) $config['help_tabs'] as $tab_id => $cfg ) {
1086
+			foreach ((array) $config['help_tabs'] as $tab_id => $cfg) {
1087 1087
 				//we're here so there ARE help tabs!
1088 1088
 
1089 1089
 				//make sure we've got what we need
1090
-				if ( !isset( $cfg['title'] ) )
1091
-					throw new EE_Error( __('The _page_config array is not set up properly for help tabs.  It is missing a title', 'event_espresso') );
1090
+				if ( ! isset($cfg['title']))
1091
+					throw new EE_Error(__('The _page_config array is not set up properly for help tabs.  It is missing a title', 'event_espresso'));
1092 1092
 
1093 1093
 
1094
-				if ( !isset($cfg['filename']) && !isset( $cfg['callback'] ) && !isset( $cfg['content'] ) )
1095
-					throw new EE_Error( __('The _page_config array is not setup properly for help tabs. It is missing a either a filename reference, or a callback reference or a content reference so there is no way to know the content for the help tab', 'event_espresso') );
1094
+				if ( ! isset($cfg['filename']) && ! isset($cfg['callback']) && ! isset($cfg['content']))
1095
+					throw new EE_Error(__('The _page_config array is not setup properly for help tabs. It is missing a either a filename reference, or a callback reference or a content reference so there is no way to know the content for the help tab', 'event_espresso'));
1096 1096
 
1097 1097
 
1098 1098
 
1099 1099
 				//first priority goes to content.
1100
-				if ( !empty($cfg['content'] ) ) {
1101
-					$content = !empty($cfg['content']) ? $cfg['content'] : NULL;
1100
+				if ( ! empty($cfg['content'])) {
1101
+					$content = ! empty($cfg['content']) ? $cfg['content'] : NULL;
1102 1102
 
1103 1103
 				//second priority goes to filename
1104
-				} else if ( !empty($cfg['filename'] ) ) {
1105
-					$file_path = $this->_get_dir() . '/help_tabs/' . $cfg['filename'] . '.help_tab.php';
1104
+				} else if ( ! empty($cfg['filename'])) {
1105
+					$file_path = $this->_get_dir().'/help_tabs/'.$cfg['filename'].'.help_tab.php';
1106 1106
 
1107 1107
 
1108 1108
 					//it's possible that the file is located on decaf route (and above sets up for caf route, if this is the case then lets check decaf route too)
1109
-					$file_path = !is_readable($file_path) ? EE_ADMIN_PAGES . basename($this->_get_dir()) . '/help_tabs/' . $cfg['filename'] . '.help_tab.php' : $file_path;
1109
+					$file_path = ! is_readable($file_path) ? EE_ADMIN_PAGES.basename($this->_get_dir()).'/help_tabs/'.$cfg['filename'].'.help_tab.php' : $file_path;
1110 1110
 
1111 1111
 					//if file is STILL not readable then let's do a EE_Error so its more graceful than a fatal error.
1112
-					if ( !is_readable($file_path) && !isset($cfg['callback']) ) {
1113
-						EE_Error::add_error( sprintf( __('The filename given for the help tab %s is not a valid file and there is no other configuration for the tab content.  Please check that the string you set for the help tab on this route (%s) is the correct spelling.  The file should be in %s', 'event_espresso'), $tab_id, key($config), $file_path ), __FILE__, __FUNCTION__, __LINE__ );
1112
+					if ( ! is_readable($file_path) && ! isset($cfg['callback'])) {
1113
+						EE_Error::add_error(sprintf(__('The filename given for the help tab %s is not a valid file and there is no other configuration for the tab content.  Please check that the string you set for the help tab on this route (%s) is the correct spelling.  The file should be in %s', 'event_espresso'), $tab_id, key($config), $file_path), __FILE__, __FUNCTION__, __LINE__);
1114 1114
 						return;
1115 1115
 					}
1116 1116
 					$template_args['admin_page_obj'] = $this;
@@ -1121,21 +1121,21 @@  discard block
 block discarded – undo
1121 1121
 
1122 1122
 
1123 1123
 				//check if callback is valid
1124
-				if ( empty($content) && ( !isset($cfg['callback']) || !method_exists( $this, $cfg['callback'] ) ) ) {
1125
-					EE_Error::add_error( sprintf( __('The callback given for a %s help tab on this page does not content OR a corresponding method for generating the content.  Check the spelling or make sure the method is present.', 'event_espresso'), $cfg['title'] ), __FILE__, __FUNCTION__, __LINE__ );
1124
+				if (empty($content) && ( ! isset($cfg['callback']) || ! method_exists($this, $cfg['callback']))) {
1125
+					EE_Error::add_error(sprintf(__('The callback given for a %s help tab on this page does not content OR a corresponding method for generating the content.  Check the spelling or make sure the method is present.', 'event_espresso'), $cfg['title']), __FILE__, __FUNCTION__, __LINE__);
1126 1126
 					return;
1127 1127
 				}
1128 1128
 
1129 1129
 				//setup config array for help tab method
1130
-				$id = $this->page_slug . '-' . $this->_req_action . '-' . $tab_id;
1130
+				$id = $this->page_slug.'-'.$this->_req_action.'-'.$tab_id;
1131 1131
 				$_ht = array(
1132 1132
 					'id' => $id,
1133 1133
 					'title' => $cfg['title'],
1134
-					'callback' => isset( $cfg['callback'] ) && empty($content) ? array( $this, $cfg['callback'] ) : NULL,
1134
+					'callback' => isset($cfg['callback']) && empty($content) ? array($this, $cfg['callback']) : NULL,
1135 1135
 					'content' => $content
1136 1136
 					);
1137 1137
 
1138
-				$this->_current_screen->add_help_tab( $_ht );
1138
+				$this->_current_screen->add_help_tab($_ht);
1139 1139
 			}
1140 1140
 		}
1141 1141
 	}
@@ -1155,49 +1155,49 @@  discard block
 block discarded – undo
1155 1155
 		$this->_help_tour = array();
1156 1156
 
1157 1157
 		//exit early if help tours are turned off globally
1158
-		if ( ! EE_Registry::instance()->CFG->admin->help_tour_activation || ( defined( 'EE_DISABLE_HELP_TOURS' ) && EE_DISABLE_HELP_TOURS ) )
1158
+		if ( ! EE_Registry::instance()->CFG->admin->help_tour_activation || (defined('EE_DISABLE_HELP_TOURS') && EE_DISABLE_HELP_TOURS))
1159 1159
 			return;
1160 1160
 
1161 1161
 		//loop through _page_config to find any help_tour defined
1162
-		foreach ( $this->_page_config as $route => $config ) {
1162
+		foreach ($this->_page_config as $route => $config) {
1163 1163
 			//we're only going to set things up for this route
1164
-			if ( $route !== $this->_req_action )
1164
+			if ($route !== $this->_req_action)
1165 1165
 				continue;
1166 1166
 
1167
-			if ( isset( $config['help_tour'] ) ) {
1167
+			if (isset($config['help_tour'])) {
1168 1168
 
1169
-				foreach( $config['help_tour'] as $tour ) {
1170
-					$file_path = $this->_get_dir() . '/help_tours/' . $tour . '.class.php';
1169
+				foreach ($config['help_tour'] as $tour) {
1170
+					$file_path = $this->_get_dir().'/help_tours/'.$tour.'.class.php';
1171 1171
 					//let's see if we can get that file... if not its possible this is a decaf route not set in caffienated so lets try and get the caffeinated equivalent
1172
-					$file_path = !is_readable($file_path) ? EE_ADMIN_PAGES . basename($this->_get_dir()) . '/help_tours/' . $tour . '.class.php' : $file_path;
1172
+					$file_path = ! is_readable($file_path) ? EE_ADMIN_PAGES.basename($this->_get_dir()).'/help_tours/'.$tour.'.class.php' : $file_path;
1173 1173
 
1174 1174
 					//if file is STILL not readable then let's do a EE_Error so its more graceful than a fatal error.
1175
-					if ( !is_readable($file_path) ) {
1176
-						EE_Error::add_error( sprintf( __('The file path given for the help tour (%s) is not a valid path.  Please check that the string you set for the help tour on this route (%s) is the correct spelling', 'event_espresso'), $file_path, $tour ), __FILE__, __FUNCTION__, __LINE__ );
1175
+					if ( ! is_readable($file_path)) {
1176
+						EE_Error::add_error(sprintf(__('The file path given for the help tour (%s) is not a valid path.  Please check that the string you set for the help tour on this route (%s) is the correct spelling', 'event_espresso'), $file_path, $tour), __FILE__, __FUNCTION__, __LINE__);
1177 1177
 						return;
1178 1178
 					}
1179 1179
 
1180 1180
 					require_once $file_path;
1181
-					if ( !class_exists( $tour ) ) {
1182
-						$error_msg[] = sprintf( __('Something went wrong with loading the %s Help Tour Class.', 'event_espresso' ), $tour);
1183
-						$error_msg[] = $error_msg[0] . "\r\n" . sprintf( __( 'There is no class in place for the %s help tour.%s Make sure you have <strong>%s</strong> defined in the "help_tour" array for the %s route of the % admin page.', 'event_espresso'), $tour, '<br />', $tour, $this->_req_action, get_class($this) );
1184
-						throw new EE_Error( implode( '||', $error_msg ));
1181
+					if ( ! class_exists($tour)) {
1182
+						$error_msg[] = sprintf(__('Something went wrong with loading the %s Help Tour Class.', 'event_espresso'), $tour);
1183
+						$error_msg[] = $error_msg[0]."\r\n".sprintf(__('There is no class in place for the %s help tour.%s Make sure you have <strong>%s</strong> defined in the "help_tour" array for the %s route of the % admin page.', 'event_espresso'), $tour, '<br />', $tour, $this->_req_action, get_class($this));
1184
+						throw new EE_Error(implode('||', $error_msg));
1185 1185
 					}
1186 1186
 					$a = new ReflectionClass($tour);
1187 1187
 					$tour_obj = $a->newInstance($this->_is_caf);
1188 1188
 
1189 1189
 					$tours[] = $tour_obj;
1190
-					$this->_help_tour[$route][] = EEH_Template::help_tour_stops_generator( $tour_obj );
1190
+					$this->_help_tour[$route][] = EEH_Template::help_tour_stops_generator($tour_obj);
1191 1191
 				}
1192 1192
 
1193 1193
 				//let's inject the end tour stop element common to all pages... this will only get seen once per machine.
1194 1194
 				$end_stop_tour = new EE_Help_Tour_final_stop($this->_is_caf);
1195 1195
 				$tours[] = $end_stop_tour;
1196
-				$this->_help_tour[$route][] = EEH_Template::help_tour_stops_generator( $end_stop_tour );
1196
+				$this->_help_tour[$route][] = EEH_Template::help_tour_stops_generator($end_stop_tour);
1197 1197
 			}
1198 1198
 		}
1199 1199
 
1200
-		if ( !empty( $tours ) )
1200
+		if ( ! empty($tours))
1201 1201
 			$this->_help_tour['tours'] = $tours;
1202 1202
 
1203 1203
 		//thats it!  Now that the $_help_tours property is set (or not) the scripts and html should be taken care of automatically.
@@ -1213,12 +1213,12 @@  discard block
 block discarded – undo
1213 1213
 	 * @return void
1214 1214
 	 */
1215 1215
 	protected function _add_qtips() {
1216
-		if ( isset( $this->_route_config['qtips'] ) ) {
1216
+		if (isset($this->_route_config['qtips'])) {
1217 1217
 			$qtips = (array) $this->_route_config['qtips'];
1218 1218
 			//load qtip loader
1219 1219
 			$path = array(
1220
-				$this->_get_dir() . '/qtips/',
1221
-				EE_ADMIN_PAGES . basename($this->_get_dir()) . '/qtips/'
1220
+				$this->_get_dir().'/qtips/',
1221
+				EE_ADMIN_PAGES.basename($this->_get_dir()).'/qtips/'
1222 1222
 				);
1223 1223
 			EEH_Qtip_Loader::instance()->register($qtips, $path);
1224 1224
 		}
@@ -1235,41 +1235,41 @@  discard block
 block discarded – undo
1235 1235
 	 * @return void
1236 1236
 	 */
1237 1237
 	protected function _set_nav_tabs() {
1238
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1238
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1239 1239
 		$i = 0;
1240
-		foreach ( $this->_page_config as $slug => $config ) {
1241
-			if ( !is_array( $config ) || ( is_array($config) && (isset($config['nav']) && !$config['nav'] ) || !isset($config['nav'] ) ) )
1240
+		foreach ($this->_page_config as $slug => $config) {
1241
+			if ( ! is_array($config) || (is_array($config) && (isset($config['nav']) && ! $config['nav']) || ! isset($config['nav'])))
1242 1242
 				continue; //no nav tab for this config
1243 1243
 
1244 1244
 			//check for persistent flag
1245
-			if ( isset( $config['nav']['persistent']) && !$config['nav']['persistent'] && $slug !== $this->_req_action )
1245
+			if (isset($config['nav']['persistent']) && ! $config['nav']['persistent'] && $slug !== $this->_req_action)
1246 1246
 				continue; //nav tab is only to appear when route requested.
1247 1247
 
1248
-			if ( ! $this->check_user_access( $slug, TRUE ) )
1248
+			if ( ! $this->check_user_access($slug, TRUE))
1249 1249
 				continue; //no nav tab becasue current user does not have access.
1250 1250
 
1251
-			$css_class = isset( $config['css_class'] ) ? $config['css_class'] . ' ' : '';
1251
+			$css_class = isset($config['css_class']) ? $config['css_class'].' ' : '';
1252 1252
 			$this->_nav_tabs[$slug] = array(
1253
-				'url' => isset($config['nav']['url']) ? $config['nav']['url'] : self::add_query_args_and_nonce( array( 'action'=>$slug ), $this->_admin_base_url ),
1254
-				'link_text' => isset( $config['nav']['label'] ) ? $config['nav']['label'] : ucwords(str_replace('_', ' ', $slug ) ),
1255
-				'css_class' => $this->_req_action == $slug ? $css_class . 'nav-tab-active' : $css_class,
1256
-				'order' => isset( $config['nav']['order'] ) ? $config['nav']['order'] : $i
1253
+				'url' => isset($config['nav']['url']) ? $config['nav']['url'] : self::add_query_args_and_nonce(array('action'=>$slug), $this->_admin_base_url),
1254
+				'link_text' => isset($config['nav']['label']) ? $config['nav']['label'] : ucwords(str_replace('_', ' ', $slug)),
1255
+				'css_class' => $this->_req_action == $slug ? $css_class.'nav-tab-active' : $css_class,
1256
+				'order' => isset($config['nav']['order']) ? $config['nav']['order'] : $i
1257 1257
 				);
1258 1258
 			$i++;
1259 1259
 		}
1260 1260
 
1261 1261
 		//if $this->_nav_tabs is empty then lets set the default
1262
-		if ( empty( $this->_nav_tabs ) ) {
1262
+		if (empty($this->_nav_tabs)) {
1263 1263
 			$this->_nav_tabs[$this->default_nav_tab_name] = array(
1264 1264
 				'url' => $this->admin_base_url,
1265
-				'link_text' => ucwords( str_replace( '_', ' ', $this->default_nav_tab_name ) ),
1265
+				'link_text' => ucwords(str_replace('_', ' ', $this->default_nav_tab_name)),
1266 1266
 				'css_class' => 'nav-tab-active',
1267 1267
 				'order' => 10
1268 1268
 				);
1269 1269
 		}
1270 1270
 
1271 1271
 		//now let's sort the tabs according to order
1272
-		usort( $this->_nav_tabs, array($this, '_sort_nav_tabs' ));
1272
+		usort($this->_nav_tabs, array($this, '_sort_nav_tabs'));
1273 1273
 
1274 1274
 	}
1275 1275
 
@@ -1285,10 +1285,10 @@  discard block
 block discarded – undo
1285 1285
 	 * @return void
1286 1286
 	 */
1287 1287
 	private function _set_current_labels() {
1288
-		if ( is_array($this->_route_config) && isset($this->_route_config['labels']) ) {
1289
-			foreach ( $this->_route_config['labels'] as $label => $text ) {
1290
-				if ( is_array($text) ) {
1291
-					foreach ( $text as $sublabel => $subtext ) {
1288
+		if (is_array($this->_route_config) && isset($this->_route_config['labels'])) {
1289
+			foreach ($this->_route_config['labels'] as $label => $text) {
1290
+				if (is_array($text)) {
1291
+					foreach ($text as $sublabel => $subtext) {
1292 1292
 						$this->_labels[$label][$sublabel] = $subtext;
1293 1293
 					}
1294 1294
 				} else {
@@ -1309,24 +1309,24 @@  discard block
 block discarded – undo
1309 1309
 	 * 		@param bool   $verify_only Default is FALSE which means if user check fails then wp_die().  Otherwise just return false if verify fail.
1310 1310
 	*		@return 		BOOL|wp_die()
1311 1311
 	*/
1312
-	public function check_user_access( $route_to_check = '', $verify_only = FALSE ) {
1313
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1314
-		$route_to_check = empty( $route_to_check ) ? $this->_req_action : $route_to_check;
1315
-		$capability = ! empty( $route_to_check ) && isset( $this->_page_routes[$route_to_check] ) && is_array( $this->_page_routes[$route_to_check] ) && ! empty( $this->_page_routes[$route_to_check]['capability'] ) ? $this->_page_routes[$route_to_check]['capability'] : NULL;
1312
+	public function check_user_access($route_to_check = '', $verify_only = FALSE) {
1313
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1314
+		$route_to_check = empty($route_to_check) ? $this->_req_action : $route_to_check;
1315
+		$capability = ! empty($route_to_check) && isset($this->_page_routes[$route_to_check]) && is_array($this->_page_routes[$route_to_check]) && ! empty($this->_page_routes[$route_to_check]['capability']) ? $this->_page_routes[$route_to_check]['capability'] : NULL;
1316 1316
 
1317
-		if ( empty( $capability ) && empty( $route_to_check )  ) {
1318
-			$capability = is_array( $this->_route ) && empty( $this->_route['capability'] ) ? 'manage_options' : $this->_route['capability'];
1317
+		if (empty($capability) && empty($route_to_check)) {
1318
+			$capability = is_array($this->_route) && empty($this->_route['capability']) ? 'manage_options' : $this->_route['capability'];
1319 1319
 		} else {
1320
-			$capability = empty( $capability ) ? 'manage_options' : $capability;
1320
+			$capability = empty($capability) ? 'manage_options' : $capability;
1321 1321
 		}
1322 1322
 
1323
-		$id = is_array( $this->_route ) && ! empty( $this->_route['obj_id'] ) ? $this->_route['obj_id'] : 0;
1323
+		$id = is_array($this->_route) && ! empty($this->_route['obj_id']) ? $this->_route['obj_id'] : 0;
1324 1324
 
1325
-		if (( ! function_exists( 'is_admin' ) || ! EE_Registry::instance()->CAP->current_user_can( $capability, $this->page_slug . '_' . $route_to_check, $id ) ) && ! defined( 'DOING_AJAX')) {
1326
-			if ( $verify_only ) {
1325
+		if (( ! function_exists('is_admin') || ! EE_Registry::instance()->CAP->current_user_can($capability, $this->page_slug.'_'.$route_to_check, $id)) && ! defined('DOING_AJAX')) {
1326
+			if ($verify_only) {
1327 1327
 				return FALSE;
1328 1328
 			} else {
1329
-				wp_die( __('You do not have access to this route.', 'event_espresso' ) );
1329
+				wp_die(__('You do not have access to this route.', 'event_espresso'));
1330 1330
 			}
1331 1331
 		}
1332 1332
 		return TRUE;
@@ -1403,7 +1403,7 @@  discard block
 block discarded – undo
1403 1403
 		$this->_add_admin_page_overlay();
1404 1404
 
1405 1405
 		//if metaboxes are present we need to add the nonce field
1406
-		if ( ( isset($this->_route_config['metaboxes']) || ( isset($this->_route_config['has_metaboxes']) && $this->_route_config['has_metaboxes'] ) || isset($this->_route_config['list_table']) ) ) {
1406
+		if ((isset($this->_route_config['metaboxes']) || (isset($this->_route_config['has_metaboxes']) && $this->_route_config['has_metaboxes']) || isset($this->_route_config['list_table']))) {
1407 1407
 			wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
1408 1408
 			wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
1409 1409
 		}
@@ -1422,19 +1422,19 @@  discard block
 block discarded – undo
1422 1422
 	 */
1423 1423
 	public function admin_footer_global() {
1424 1424
 		//dialog container for dialog helper
1425
-		$d_cont = '<div class="ee-admin-dialog-container auto-hide hidden">' . "\n";
1425
+		$d_cont = '<div class="ee-admin-dialog-container auto-hide hidden">'."\n";
1426 1426
 		$d_cont .= '<div class="ee-notices"></div>';
1427 1427
 		$d_cont .= '<div class="ee-admin-dialog-container-inner-content"></div>';
1428 1428
 		$d_cont .= '</div>';
1429 1429
 		echo $d_cont;
1430 1430
 
1431 1431
 		//help tour stuff?
1432
-		if ( isset( $this->_help_tour[$this->_req_action] ) ) {
1432
+		if (isset($this->_help_tour[$this->_req_action])) {
1433 1433
 			echo implode('<br />', $this->_help_tour[$this->_req_action]);
1434 1434
 		}
1435 1435
 
1436 1436
 		//current set timezone for timezone js
1437
-		echo '<span id="current_timezone" class="hidden">' . EEH_DTT_Helper::get_timezone() . '</span>';
1437
+		echo '<span id="current_timezone" class="hidden">'.EEH_DTT_Helper::get_timezone().'</span>';
1438 1438
 	}
1439 1439
 
1440 1440
 
@@ -1458,18 +1458,18 @@  discard block
 block discarded – undo
1458 1458
 	 * @access protected
1459 1459
 	 * @return string content
1460 1460
 	 */
1461
-	protected function _set_help_popup_content( $help_array = array(), $display = FALSE ) {
1461
+	protected function _set_help_popup_content($help_array = array(), $display = FALSE) {
1462 1462
 		$content = '';
1463 1463
 
1464
-		$help_array = empty( $help_array ) ? $this->_get_help_content() : $help_array;
1465
-		$template_path = EE_ADMIN_TEMPLATE . 'admin_help_popup.template.php';
1464
+		$help_array = empty($help_array) ? $this->_get_help_content() : $help_array;
1465
+		$template_path = EE_ADMIN_TEMPLATE.'admin_help_popup.template.php';
1466 1466
 
1467 1467
 
1468 1468
 		//loop through the array and setup content
1469
-		foreach ( $help_array as $trigger => $help ) {
1469
+		foreach ($help_array as $trigger => $help) {
1470 1470
 			//make sure the array is setup properly
1471
-			if ( !isset($help['title']) || !isset($help['content'] ) ) {
1472
-				throw new EE_Error( __('Does not look like the popup content array has been setup correctly.  Might want to double check that.  Read the comments for the _get_help_popup_content method found in "EE_Admin_Page" class', 'event_espresso') );
1471
+			if ( ! isset($help['title']) || ! isset($help['content'])) {
1472
+				throw new EE_Error(__('Does not look like the popup content array has been setup correctly.  Might want to double check that.  Read the comments for the _get_help_popup_content method found in "EE_Admin_Page" class', 'event_espresso'));
1473 1473
 			}
1474 1474
 
1475 1475
 			//we're good so let'd setup the template vars and then assign parsed template content to our content.
@@ -1479,10 +1479,10 @@  discard block
 block discarded – undo
1479 1479
 				'help_popup_content' => $help['content']
1480 1480
 				);
1481 1481
 
1482
-			$content .= EEH_Template::display_template( $template_path, $template_args, TRUE );
1482
+			$content .= EEH_Template::display_template($template_path, $template_args, TRUE);
1483 1483
 		}
1484 1484
 
1485
-		if ( $display )
1485
+		if ($display)
1486 1486
 			echo $content;
1487 1487
 		else
1488 1488
 			return $content;
@@ -1499,18 +1499,18 @@  discard block
 block discarded – undo
1499 1499
 	 */
1500 1500
 	private function _get_help_content() {
1501 1501
 		//what is the method we're looking for?
1502
-		$method_name = '_help_popup_content_' . $this->_req_action;
1502
+		$method_name = '_help_popup_content_'.$this->_req_action;
1503 1503
 
1504 1504
 		//if method doesn't exist let's get out.
1505
-		if ( !method_exists( $this, $method_name ) )
1505
+		if ( ! method_exists($this, $method_name))
1506 1506
 			return array();
1507 1507
 
1508 1508
 		//k we're good to go let's retrieve the help array
1509
-		$help_array = call_user_func( array( $this, $method_name ) );
1509
+		$help_array = call_user_func(array($this, $method_name));
1510 1510
 
1511 1511
 		//make sure we've got an array!
1512
-		if ( !is_array($help_array) ) {
1513
-			throw new EE_Error( __('Something went wrong with help popup content generation. Expecting an array and well, this ain\'t no array bub.', 'event_espresso' ) );
1512
+		if ( ! is_array($help_array)) {
1513
+			throw new EE_Error(__('Something went wrong with help popup content generation. Expecting an array and well, this ain\'t no array bub.', 'event_espresso'));
1514 1514
 		}
1515 1515
 
1516 1516
 		return $help_array;
@@ -1532,27 +1532,27 @@  discard block
 block discarded – undo
1532 1532
 	 * @param array $dimensions an array of dimensions for the box (array(h,w))
1533 1533
 	 * @return string
1534 1534
 	 */
1535
-	protected function _set_help_trigger( $trigger_id, $display = TRUE, $dimensions = array( '400', '640') ) {
1535
+	protected function _set_help_trigger($trigger_id, $display = TRUE, $dimensions = array('400', '640')) {
1536 1536
 
1537
-		if ( defined('DOING_AJAX') ) return;
1537
+		if (defined('DOING_AJAX')) return;
1538 1538
 
1539 1539
 		//let's check and see if there is any content set for this popup.  If there isn't then we'll include a default title and content so that developers know something needs to be corrected
1540 1540
 		$help_array = $this->_get_help_content();
1541 1541
 		$help_content = '';
1542 1542
 
1543
-		if ( empty( $help_array ) || !isset( $help_array[$trigger_id] ) ) {
1543
+		if (empty($help_array) || ! isset($help_array[$trigger_id])) {
1544 1544
 			$help_array[$trigger_id] = array(
1545 1545
 				'title' => __('Missing Content', 'event_espresso'),
1546 1546
 				'content' => __('A trigger has been set that doesn\'t have any corresponding content. Make sure you have set the help content. (see the "_set_help_popup_content" method in the EE_Admin_Page for instructions.)', 'event_espresso')
1547 1547
 				);
1548
-			$help_content = $this->_set_help_popup_content( $help_array, FALSE );
1548
+			$help_content = $this->_set_help_popup_content($help_array, FALSE);
1549 1549
 		}
1550 1550
 
1551 1551
 		//let's setup the trigger
1552
-		$content = '<a class="ee-dialog" href="?height='. $dimensions[0] . '&width=' . $dimensions[1] . '&inlineId=' . $trigger_id . '" target="_blank"><span class="question ee-help-popup-question"></span></a>';
1553
-		$content = $content . $help_content;
1552
+		$content = '<a class="ee-dialog" href="?height='.$dimensions[0].'&width='.$dimensions[1].'&inlineId='.$trigger_id.'" target="_blank"><span class="question ee-help-popup-question"></span></a>';
1553
+		$content = $content.$help_content;
1554 1554
 
1555
-		if ( $display )
1555
+		if ($display)
1556 1556
 			echo $content;
1557 1557
 		else
1558 1558
 			return $content;
@@ -1609,15 +1609,15 @@  discard block
 block discarded – undo
1609 1609
 	public function load_global_scripts_styles() {
1610 1610
 		/** STYLES **/
1611 1611
 		// add debugging styles
1612
-		if ( WP_DEBUG ) {
1613
-			add_action('admin_head', array( $this, 'add_xdebug_style' ));
1612
+		if (WP_DEBUG) {
1613
+			add_action('admin_head', array($this, 'add_xdebug_style'));
1614 1614
 		}
1615 1615
 
1616 1616
 		//register all styles
1617
-		wp_register_style( 'espresso-ui-theme', EE_GLOBAL_ASSETS_URL . 'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css', array(),EVENT_ESPRESSO_VERSION );
1618
-		wp_register_style('ee-admin-css', EE_ADMIN_URL . 'assets/ee-admin-page.css', array(), EVENT_ESPRESSO_VERSION);
1617
+		wp_register_style('espresso-ui-theme', EE_GLOBAL_ASSETS_URL.'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css', array(), EVENT_ESPRESSO_VERSION);
1618
+		wp_register_style('ee-admin-css', EE_ADMIN_URL.'assets/ee-admin-page.css', array(), EVENT_ESPRESSO_VERSION);
1619 1619
 		//helpers styles
1620
-		wp_register_style('ee-text-links', EE_PLUGIN_DIR_URL . 'core/helpers/assets/ee_text_list_helper.css', array(), EVENT_ESPRESSO_VERSION );
1620
+		wp_register_style('ee-text-links', EE_PLUGIN_DIR_URL.'core/helpers/assets/ee_text_list_helper.css', array(), EVENT_ESPRESSO_VERSION);
1621 1621
 		//enqueue global styles
1622 1622
 		wp_enqueue_style('ee-admin-css');
1623 1623
 
@@ -1625,66 +1625,66 @@  discard block
 block discarded – undo
1625 1625
 		/** SCRIPTS **/
1626 1626
 
1627 1627
 		//register all scripts
1628
-		wp_register_script( 'espresso_core', EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE );
1629
-		wp_register_script('ee-dialog', EE_ADMIN_URL . 'assets/ee-dialog-helper.js', array('jquery', 'jquery-ui-draggable'), EVENT_ESPRESSO_VERSION, TRUE );
1630
-		wp_register_script('ee_admin_js', EE_ADMIN_URL . 'assets/ee-admin-page.js', array( 'espresso_core', 'ee-parse-uri', 'ee-dialog'), EVENT_ESPRESSO_VERSION, true );
1628
+		wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
1629
+		wp_register_script('ee-dialog', EE_ADMIN_URL.'assets/ee-dialog-helper.js', array('jquery', 'jquery-ui-draggable'), EVENT_ESPRESSO_VERSION, TRUE);
1630
+		wp_register_script('ee_admin_js', EE_ADMIN_URL.'assets/ee-admin-page.js', array('espresso_core', 'ee-parse-uri', 'ee-dialog'), EVENT_ESPRESSO_VERSION, true);
1631 1631
 
1632
-		wp_register_script('jquery-ui-timepicker-addon', EE_GLOBAL_ASSETS_URL . 'scripts/jquery-ui-timepicker-addon.js', array('jquery-ui-datepicker', 'jquery-ui-slider'), EVENT_ESPRESSO_VERSION, true );
1632
+		wp_register_script('jquery-ui-timepicker-addon', EE_GLOBAL_ASSETS_URL.'scripts/jquery-ui-timepicker-addon.js', array('jquery-ui-datepicker', 'jquery-ui-slider'), EVENT_ESPRESSO_VERSION, true);
1633 1633
 		// register jQuery Validate - see /includes/functions/wp_hooks.php
1634
-		add_filter( 'FHEE_load_jquery_validate', '__return_true' );
1634
+		add_filter('FHEE_load_jquery_validate', '__return_true');
1635 1635
 		add_filter('FHEE_load_joyride', '__return_true');
1636 1636
 
1637 1637
 		//script for sorting tables
1638
-		wp_register_script('espresso_ajax_table_sorting', EE_ADMIN_URL . "assets/espresso_ajax_table_sorting.js", array('ee_admin_js', 'jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, TRUE);
1638
+		wp_register_script('espresso_ajax_table_sorting', EE_ADMIN_URL."assets/espresso_ajax_table_sorting.js", array('ee_admin_js', 'jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, TRUE);
1639 1639
 		//script for parsing uri's
1640
-		wp_register_script( 'ee-parse-uri', EE_GLOBAL_ASSETS_URL . 'scripts/parseuri.js', array(), EVENT_ESPRESSO_VERSION, TRUE );
1640
+		wp_register_script('ee-parse-uri', EE_GLOBAL_ASSETS_URL.'scripts/parseuri.js', array(), EVENT_ESPRESSO_VERSION, TRUE);
1641 1641
 		//and parsing associative serialized form elements
1642
-		wp_register_script( 'ee-serialize-full-array', EE_GLOBAL_ASSETS_URL . 'scripts/jquery.serializefullarray.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE );
1642
+		wp_register_script('ee-serialize-full-array', EE_GLOBAL_ASSETS_URL.'scripts/jquery.serializefullarray.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
1643 1643
 		//helpers scripts
1644
-		wp_register_script('ee-text-links', EE_PLUGIN_DIR_URL . 'core/helpers/assets/ee_text_list_helper.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE );
1645
-		wp_register_script( 'ee-moment-core', EE_THIRD_PARTY_URL . 'moment/moment-with-locales.min.js', array(), EVENT_ESPRESSO_VERSION, TRUE );
1646
-		wp_register_script( 'ee-moment', EE_THIRD_PARTY_URL . 'moment/moment-timezone-with-data.min.js', array('ee-moment-core'), EVENT_ESPRESSO_VERSION, TRUE );
1647
-		wp_register_script( 'ee-datepicker', EE_ADMIN_URL . 'assets/ee-datepicker.js', array('jquery-ui-timepicker-addon','ee-moment'), EVENT_ESPRESSO_VERSION, TRUE );
1644
+		wp_register_script('ee-text-links', EE_PLUGIN_DIR_URL.'core/helpers/assets/ee_text_list_helper.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
1645
+		wp_register_script('ee-moment-core', EE_THIRD_PARTY_URL.'moment/moment-with-locales.min.js', array(), EVENT_ESPRESSO_VERSION, TRUE);
1646
+		wp_register_script('ee-moment', EE_THIRD_PARTY_URL.'moment/moment-timezone-with-data.min.js', array('ee-moment-core'), EVENT_ESPRESSO_VERSION, TRUE);
1647
+		wp_register_script('ee-datepicker', EE_ADMIN_URL.'assets/ee-datepicker.js', array('jquery-ui-timepicker-addon', 'ee-moment'), EVENT_ESPRESSO_VERSION, TRUE);
1648 1648
 
1649 1649
 		//google charts
1650
-		wp_register_script( 'google-charts', 'https://www.gstatic.com/charts/loader.js', array(), EVENT_ESPRESSO_VERSION, false );
1650
+		wp_register_script('google-charts', 'https://www.gstatic.com/charts/loader.js', array(), EVENT_ESPRESSO_VERSION, false);
1651 1651
 
1652 1652
 		//enqueue global scripts
1653 1653
 
1654 1654
 		//taking care of metaboxes
1655
-		if ( ( isset($this->_route_config['metaboxes'] ) || isset($this->_route_config['has_metaboxes']) ) && empty( $this->_cpt_route) ) {
1655
+		if ((isset($this->_route_config['metaboxes']) || isset($this->_route_config['has_metaboxes'])) && empty($this->_cpt_route)) {
1656 1656
 			wp_enqueue_script('dashboard');
1657 1657
 		}
1658 1658
 
1659 1659
 		//enqueue thickbox for ee help popups.  default is to enqueue unless its explicitly set to false since we're assuming all EE pages will have popups
1660
-		if ( ! isset( $this->_route_config['has_help_popups']) || ( isset( $this->_route_config['has_help_popups']) && $this->_route_config['has_help_popups'] ) ) {
1660
+		if ( ! isset($this->_route_config['has_help_popups']) || (isset($this->_route_config['has_help_popups']) && $this->_route_config['has_help_popups'])) {
1661 1661
 			wp_enqueue_script('ee_admin_js');
1662 1662
 			wp_enqueue_style('ee-admin-css');
1663 1663
 		}
1664 1664
 
1665 1665
 
1666 1666
 		//localize script for ajax lazy loading
1667
-		$lazy_loader_container_ids = apply_filters( 'FHEE__EE_Admin_Page_Core__load_global_scripts_styles__loader_containers', array('espresso_news_post_box_content') );
1668
-		wp_localize_script( 'ee_admin_js', 'eeLazyLoadingContainers', $lazy_loader_container_ids);
1667
+		$lazy_loader_container_ids = apply_filters('FHEE__EE_Admin_Page_Core__load_global_scripts_styles__loader_containers', array('espresso_news_post_box_content'));
1668
+		wp_localize_script('ee_admin_js', 'eeLazyLoadingContainers', $lazy_loader_container_ids);
1669 1669
 
1670 1670
 
1671 1671
 		/**
1672 1672
 		 * help tour stuff
1673 1673
 		 */
1674
-		if ( !empty( $this->_help_tour ) ) {
1674
+		if ( ! empty($this->_help_tour)) {
1675 1675
 
1676 1676
 			//register the js for kicking things off
1677
-			wp_enqueue_script('ee-help-tour', EE_ADMIN_URL . 'assets/ee-help-tour.js', array('jquery-joyride'), EVENT_ESPRESSO_VERSION, TRUE );
1677
+			wp_enqueue_script('ee-help-tour', EE_ADMIN_URL.'assets/ee-help-tour.js', array('jquery-joyride'), EVENT_ESPRESSO_VERSION, TRUE);
1678 1678
 
1679 1679
 			//setup tours for the js tour object
1680
-			foreach ( $this->_help_tour['tours'] as $tour ) {
1680
+			foreach ($this->_help_tour['tours'] as $tour) {
1681 1681
 				$tours[] = array(
1682 1682
 					'id' => $tour->get_slug(),
1683 1683
 					'options' => $tour->get_options()
1684 1684
 					);
1685 1685
 			}
1686 1686
 
1687
-			wp_localize_script('ee-help-tour', 'EE_HELP_TOUR', array('tours' => $tours ) );
1687
+			wp_localize_script('ee-help-tour', 'EE_HELP_TOUR', array('tours' => $tours));
1688 1688
 
1689 1689
 			//admin_footer_global will take care of making sure our help_tour skeleton gets printed via the info stored in $this->_help_tour
1690 1690
 		}
@@ -1702,52 +1702,52 @@  discard block
 block discarded – undo
1702 1702
 	public function admin_footer_scripts_eei18n_js_strings() {
1703 1703
 
1704 1704
 		EE_Registry::$i18n_js_strings['ajax_url'] = WP_AJAX_URL;
1705
-		EE_Registry::$i18n_js_strings['confirm_delete'] = __( 'Are you absolutely sure you want to delete this item?\nThis action will delete ALL DATA associated with this item!!!\nThis can NOT be undone!!!', 'event_espresso' );
1706
-
1707
-		EE_Registry::$i18n_js_strings['January'] = __( 'January', 'event_espresso' );
1708
-		EE_Registry::$i18n_js_strings['February'] = __( 'February', 'event_espresso' );
1709
-		EE_Registry::$i18n_js_strings['March'] = __( 'March', 'event_espresso' );
1710
-		EE_Registry::$i18n_js_strings['April'] = __( 'April', 'event_espresso' );
1711
-		EE_Registry::$i18n_js_strings['May'] = __( 'May', 'event_espresso' );
1712
-		EE_Registry::$i18n_js_strings['June'] = __( 'June', 'event_espresso' );
1713
-		EE_Registry::$i18n_js_strings['July'] = __( 'July', 'event_espresso' );
1714
-		EE_Registry::$i18n_js_strings['August'] = __( 'August', 'event_espresso' );
1715
-		EE_Registry::$i18n_js_strings['September'] = __( 'September', 'event_espresso' );
1716
-		EE_Registry::$i18n_js_strings['October'] = __( 'October', 'event_espresso' );
1717
-		EE_Registry::$i18n_js_strings['November'] = __( 'November', 'event_espresso' );
1718
-		EE_Registry::$i18n_js_strings['December'] = __( 'December', 'event_espresso' );
1719
-		EE_Registry::$i18n_js_strings['Jan'] = __( 'Jan', 'event_espresso' );
1720
-		EE_Registry::$i18n_js_strings['Feb'] = __( 'Feb', 'event_espresso' );
1721
-		EE_Registry::$i18n_js_strings['Mar'] = __( 'Mar', 'event_espresso' );
1722
-		EE_Registry::$i18n_js_strings['Apr'] = __( 'Apr', 'event_espresso' );
1723
-		EE_Registry::$i18n_js_strings['May'] = __( 'May', 'event_espresso' );
1724
-		EE_Registry::$i18n_js_strings['Jun'] = __( 'Jun', 'event_espresso' );
1725
-		EE_Registry::$i18n_js_strings['Jul'] = __( 'Jul', 'event_espresso' );
1726
-		EE_Registry::$i18n_js_strings['Aug'] = __( 'Aug', 'event_espresso' );
1727
-		EE_Registry::$i18n_js_strings['Sep'] = __( 'Sep', 'event_espresso' );
1728
-		EE_Registry::$i18n_js_strings['Oct'] = __( 'Oct', 'event_espresso' );
1729
-		EE_Registry::$i18n_js_strings['Nov'] = __( 'Nov', 'event_espresso' );
1730
-		EE_Registry::$i18n_js_strings['Dec'] = __( 'Dec', 'event_espresso' );
1731
-
1732
-		EE_Registry::$i18n_js_strings['Sunday'] = __( 'Sunday', 'event_espresso' );
1733
-		EE_Registry::$i18n_js_strings['Monday'] = __( 'Monday', 'event_espresso' );
1734
-		EE_Registry::$i18n_js_strings['Tuesday'] = __( 'Tuesday', 'event_espresso' );
1735
-		EE_Registry::$i18n_js_strings['Wednesday'] = __( 'Wednesday', 'event_espresso' );
1736
-		EE_Registry::$i18n_js_strings['Thursday'] = __( 'Thursday', 'event_espresso' );
1737
-		EE_Registry::$i18n_js_strings['Friday'] = __( 'Friday', 'event_espresso' );
1738
-		EE_Registry::$i18n_js_strings['Saturday'] = __( 'Saturday', 'event_espresso' );
1739
-		EE_Registry::$i18n_js_strings['Sun'] = __( 'Sun', 'event_espresso' );
1740
-		EE_Registry::$i18n_js_strings['Mon'] = __( 'Mon', 'event_espresso' );
1741
-		EE_Registry::$i18n_js_strings['Tue'] = __( 'Tue', 'event_espresso' );
1742
-		EE_Registry::$i18n_js_strings['Wed'] = __( 'Wed', 'event_espresso' );
1743
-		EE_Registry::$i18n_js_strings['Thu'] = __( 'Thu', 'event_espresso' );
1744
-		EE_Registry::$i18n_js_strings['Fri'] = __( 'Fri', 'event_espresso' );
1745
-		EE_Registry::$i18n_js_strings['Sat'] = __( 'Sat', 'event_espresso' );
1705
+		EE_Registry::$i18n_js_strings['confirm_delete'] = __('Are you absolutely sure you want to delete this item?\nThis action will delete ALL DATA associated with this item!!!\nThis can NOT be undone!!!', 'event_espresso');
1706
+
1707
+		EE_Registry::$i18n_js_strings['January'] = __('January', 'event_espresso');
1708
+		EE_Registry::$i18n_js_strings['February'] = __('February', 'event_espresso');
1709
+		EE_Registry::$i18n_js_strings['March'] = __('March', 'event_espresso');
1710
+		EE_Registry::$i18n_js_strings['April'] = __('April', 'event_espresso');
1711
+		EE_Registry::$i18n_js_strings['May'] = __('May', 'event_espresso');
1712
+		EE_Registry::$i18n_js_strings['June'] = __('June', 'event_espresso');
1713
+		EE_Registry::$i18n_js_strings['July'] = __('July', 'event_espresso');
1714
+		EE_Registry::$i18n_js_strings['August'] = __('August', 'event_espresso');
1715
+		EE_Registry::$i18n_js_strings['September'] = __('September', 'event_espresso');
1716
+		EE_Registry::$i18n_js_strings['October'] = __('October', 'event_espresso');
1717
+		EE_Registry::$i18n_js_strings['November'] = __('November', 'event_espresso');
1718
+		EE_Registry::$i18n_js_strings['December'] = __('December', 'event_espresso');
1719
+		EE_Registry::$i18n_js_strings['Jan'] = __('Jan', 'event_espresso');
1720
+		EE_Registry::$i18n_js_strings['Feb'] = __('Feb', 'event_espresso');
1721
+		EE_Registry::$i18n_js_strings['Mar'] = __('Mar', 'event_espresso');
1722
+		EE_Registry::$i18n_js_strings['Apr'] = __('Apr', 'event_espresso');
1723
+		EE_Registry::$i18n_js_strings['May'] = __('May', 'event_espresso');
1724
+		EE_Registry::$i18n_js_strings['Jun'] = __('Jun', 'event_espresso');
1725
+		EE_Registry::$i18n_js_strings['Jul'] = __('Jul', 'event_espresso');
1726
+		EE_Registry::$i18n_js_strings['Aug'] = __('Aug', 'event_espresso');
1727
+		EE_Registry::$i18n_js_strings['Sep'] = __('Sep', 'event_espresso');
1728
+		EE_Registry::$i18n_js_strings['Oct'] = __('Oct', 'event_espresso');
1729
+		EE_Registry::$i18n_js_strings['Nov'] = __('Nov', 'event_espresso');
1730
+		EE_Registry::$i18n_js_strings['Dec'] = __('Dec', 'event_espresso');
1731
+
1732
+		EE_Registry::$i18n_js_strings['Sunday'] = __('Sunday', 'event_espresso');
1733
+		EE_Registry::$i18n_js_strings['Monday'] = __('Monday', 'event_espresso');
1734
+		EE_Registry::$i18n_js_strings['Tuesday'] = __('Tuesday', 'event_espresso');
1735
+		EE_Registry::$i18n_js_strings['Wednesday'] = __('Wednesday', 'event_espresso');
1736
+		EE_Registry::$i18n_js_strings['Thursday'] = __('Thursday', 'event_espresso');
1737
+		EE_Registry::$i18n_js_strings['Friday'] = __('Friday', 'event_espresso');
1738
+		EE_Registry::$i18n_js_strings['Saturday'] = __('Saturday', 'event_espresso');
1739
+		EE_Registry::$i18n_js_strings['Sun'] = __('Sun', 'event_espresso');
1740
+		EE_Registry::$i18n_js_strings['Mon'] = __('Mon', 'event_espresso');
1741
+		EE_Registry::$i18n_js_strings['Tue'] = __('Tue', 'event_espresso');
1742
+		EE_Registry::$i18n_js_strings['Wed'] = __('Wed', 'event_espresso');
1743
+		EE_Registry::$i18n_js_strings['Thu'] = __('Thu', 'event_espresso');
1744
+		EE_Registry::$i18n_js_strings['Fri'] = __('Fri', 'event_espresso');
1745
+		EE_Registry::$i18n_js_strings['Sat'] = __('Sat', 'event_espresso');
1746 1746
 
1747 1747
 		//setting on espresso_core instead of ee_admin_js because espresso_core is enqueued by the maintenance
1748 1748
 		//admin page when in maintenance mode and ee_admin_js is not loaded then.  This works everywhere else because
1749 1749
 		//espresso_core is listed as a dependency of ee_admin_js.
1750
-		wp_localize_script( 'espresso_core', 'eei18n', EE_Registry::$i18n_js_strings );
1750
+		wp_localize_script('espresso_core', 'eei18n', EE_Registry::$i18n_js_strings);
1751 1751
 
1752 1752
 	}
1753 1753
 
@@ -1781,23 +1781,23 @@  discard block
 block discarded – undo
1781 1781
 	protected function _set_list_table() {
1782 1782
 
1783 1783
 		//first is this a list_table view?
1784
-		if ( !isset($this->_route_config['list_table']) )
1784
+		if ( ! isset($this->_route_config['list_table']))
1785 1785
 			return; //not a list_table view so get out.
1786 1786
 
1787 1787
 		//list table functions are per view specific (because some admin pages might have more than one listtable!)
1788 1788
 
1789
-		if ( call_user_func( array( $this, '_set_list_table_views_' . $this->_req_action ) ) === FALSE ) {
1789
+		if (call_user_func(array($this, '_set_list_table_views_'.$this->_req_action)) === FALSE) {
1790 1790
 			//user error msg
1791
-			$error_msg = __('An error occurred. The requested list table views could not be found.', 'event_espresso' );
1791
+			$error_msg = __('An error occurred. The requested list table views could not be found.', 'event_espresso');
1792 1792
 			//developer error msg
1793
-			$error_msg .= '||' . sprintf( __('List table views for "%s" route could not be setup. Check that you have the corresponding method, "%s" set up for defining list_table_views for this route.', 'event_espresso' ), $this->_req_action, '_set_list_table_views_' . $this->_req_action );
1794
-			throw new EE_Error( $error_msg );
1793
+			$error_msg .= '||'.sprintf(__('List table views for "%s" route could not be setup. Check that you have the corresponding method, "%s" set up for defining list_table_views for this route.', 'event_espresso'), $this->_req_action, '_set_list_table_views_'.$this->_req_action);
1794
+			throw new EE_Error($error_msg);
1795 1795
 		}
1796 1796
 
1797 1797
 		//let's provide the ability to filter the views per PAGE AND ROUTE, per PAGE, and globally
1798
-		$this->_views = apply_filters( 'FHEE_list_table_views_' . $this->page_slug . '_' . $this->_req_action, $this->_views );
1799
-		$this->_views = apply_filters( 'FHEE_list_table_views_' . $this->page_slug, $this->_views );
1800
-		$this->_views = apply_filters( 'FHEE_list_table_views', $this->_views );
1798
+		$this->_views = apply_filters('FHEE_list_table_views_'.$this->page_slug.'_'.$this->_req_action, $this->_views);
1799
+		$this->_views = apply_filters('FHEE_list_table_views_'.$this->page_slug, $this->_views);
1800
+		$this->_views = apply_filters('FHEE_list_table_views', $this->_views);
1801 1801
 
1802 1802
 		$this->_set_list_table_view();
1803 1803
 		$this->_set_list_table_object();
@@ -1819,14 +1819,14 @@  discard block
 block discarded – undo
1819 1819
 	*		@return array
1820 1820
 	*/
1821 1821
 	protected function _set_list_table_view() {
1822
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1822
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1823 1823
 
1824 1824
 
1825 1825
 		// looking at active items or dumpster diving ?
1826
-		if ( ! isset( $this->_req_data['status'] ) || ! array_key_exists( $this->_req_data['status'], $this->_views )) {
1827
-			$this->_view = isset( $this->_views['in_use'] ) ? 'in_use' : 'all';
1826
+		if ( ! isset($this->_req_data['status']) || ! array_key_exists($this->_req_data['status'], $this->_views)) {
1827
+			$this->_view = isset($this->_views['in_use']) ? 'in_use' : 'all';
1828 1828
 		} else {
1829
-			$this->_view = sanitize_key( $this->_req_data['status'] );
1829
+			$this->_view = sanitize_key($this->_req_data['status']);
1830 1830
 		}
1831 1831
 	}
1832 1832
 
@@ -1837,9 +1837,9 @@  discard block
 block discarded – undo
1837 1837
 	 * WP_List_Table objects need to be loaded fairly early so automatic stuff WP does is taken care of.
1838 1838
 	 */
1839 1839
 	protected function _set_list_table_object() {
1840
-		if ( isset($this->_route_config['list_table'] ) ) {
1841
-			if ( !class_exists( $this->_route_config['list_table'] ) )
1842
-				throw new EE_Error( sprintf( __('The %s class defined for the list table does not exist.  Please check the spelling of the class ref in the $_page_config property on %s.', 'event_espresso'), $this->_route_config['list_table'], get_class($this) ) );
1840
+		if (isset($this->_route_config['list_table'])) {
1841
+			if ( ! class_exists($this->_route_config['list_table']))
1842
+				throw new EE_Error(sprintf(__('The %s class defined for the list table does not exist.  Please check the spelling of the class ref in the $_page_config property on %s.', 'event_espresso'), $this->_route_config['list_table'], get_class($this)));
1843 1843
 			$a = new ReflectionClass($this->_route_config['list_table']);
1844 1844
 			$this->_list_table_object = $a->newInstance($this);
1845 1845
 		}
@@ -1858,27 +1858,27 @@  discard block
 block discarded – undo
1858 1858
 	 *
1859 1859
 	 * @return array
1860 1860
 	 */
1861
-	public function get_list_table_view_RLs( $extra_query_args = array() ) {
1861
+	public function get_list_table_view_RLs($extra_query_args = array()) {
1862 1862
 
1863
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1863
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1864 1864
 
1865
-		if ( empty( $this->_views )) {
1865
+		if (empty($this->_views)) {
1866 1866
 			$this->_views = array();
1867 1867
 		}
1868 1868
 
1869 1869
 		// cycle thru views
1870
-		foreach ( $this->_views as $key => $view ) {
1870
+		foreach ($this->_views as $key => $view) {
1871 1871
 			$query_args = array();
1872 1872
 			// check for current view
1873
-			$this->_views[ $key ]['class'] = $this->_view == $view['slug'] ? 'current' : '';
1873
+			$this->_views[$key]['class'] = $this->_view == $view['slug'] ? 'current' : '';
1874 1874
 			$query_args['action'] = $this->_req_action;
1875
-			$query_args[$this->_req_action.'_nonce'] = wp_create_nonce( $query_args['action'] . '_nonce' );
1875
+			$query_args[$this->_req_action.'_nonce'] = wp_create_nonce($query_args['action'].'_nonce');
1876 1876
 			$query_args['status'] = $view['slug'];
1877 1877
 			//merge any other arguments sent in.
1878
-			if ( isset( $extra_query_args[$view['slug']] ) ) {
1879
-				$query_args = array_merge( $query_args, $extra_query_args[$view['slug']] );
1878
+			if (isset($extra_query_args[$view['slug']])) {
1879
+				$query_args = array_merge($query_args, $extra_query_args[$view['slug']]);
1880 1880
 			}
1881
-			$this->_views[ $key ]['url'] = EE_Admin_Page::add_query_args_and_nonce( $query_args, $this->_admin_base_url );
1881
+			$this->_views[$key]['url'] = EE_Admin_Page::add_query_args_and_nonce($query_args, $this->_admin_base_url);
1882 1882
 		}
1883 1883
 
1884 1884
 		return $this->_views;
@@ -1895,15 +1895,15 @@  discard block
 block discarded – undo
1895 1895
 	 * @param int $max_entries total number of rows in the table
1896 1896
 	 * @return string
1897 1897
 	*/
1898
-	protected function _entries_per_page_dropdown( $max_entries = FALSE ) {
1898
+	protected function _entries_per_page_dropdown($max_entries = FALSE) {
1899 1899
 
1900
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1901
-		$values = array( 10, 25, 50, 100 );
1902
-		$per_page = ( ! empty( $this->_req_data['per_page'] )) ? absint( $this->_req_data['per_page'] ) : 10;
1900
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1901
+		$values = array(10, 25, 50, 100);
1902
+		$per_page = ( ! empty($this->_req_data['per_page'])) ? absint($this->_req_data['per_page']) : 10;
1903 1903
 
1904
-		if ( $max_entries ) {
1904
+		if ($max_entries) {
1905 1905
 			$values[] = $max_entries;
1906
-			sort( $values );
1906
+			sort($values);
1907 1907
 		}
1908 1908
 
1909 1909
 		$entries_per_page_dropdown = '
@@ -1912,15 +1912,15 @@  discard block
 block discarded – undo
1912 1912
 					Show
1913 1913
 					<select id="entries-per-page-slct" name="entries-per-page-slct">';
1914 1914
 
1915
-		foreach ( $values as $value ) {
1916
-			if ( $value < $max_entries ) {
1917
-				$selected = $value == $per_page ?  ' selected="' . $per_page . '"' : '';
1915
+		foreach ($values as $value) {
1916
+			if ($value < $max_entries) {
1917
+				$selected = $value == $per_page ? ' selected="'.$per_page.'"' : '';
1918 1918
 				$entries_per_page_dropdown .= '
1919 1919
 						<option value="'.$value.'"'.$selected.'>'.$value.'&nbsp;&nbsp;</option>';
1920 1920
 			}
1921 1921
 		}
1922 1922
 
1923
-		$selected = $max_entries == $per_page ?  ' selected="' . $per_page . '"' : '';
1923
+		$selected = $max_entries == $per_page ? ' selected="'.$per_page.'"' : '';
1924 1924
 		$entries_per_page_dropdown .= '
1925 1925
 						<option value="'.$max_entries.'"'.$selected.'>All&nbsp;&nbsp;</option>';
1926 1926
 
@@ -1943,8 +1943,8 @@  discard block
 block discarded – undo
1943 1943
 	*		@return 		void
1944 1944
 	*/
1945 1945
 	public function _set_search_attributes() {
1946
-		$this->_template_args['search']['btn_label'] = sprintf( __( 'Search %s', 'event_espresso' ), empty( $this->_search_btn_label ) ? $this->page_label : $this->_search_btn_label );
1947
-		$this->_template_args['search']['callback'] = 'search_' . $this->page_slug;
1946
+		$this->_template_args['search']['btn_label'] = sprintf(__('Search %s', 'event_espresso'), empty($this->_search_btn_label) ? $this->page_label : $this->_search_btn_label);
1947
+		$this->_template_args['search']['callback'] = 'search_'.$this->page_slug;
1948 1948
 	}
1949 1949
 
1950 1950
 	/*** END LIST TABLE METHODS **/
@@ -1963,20 +1963,20 @@  discard block
 block discarded – undo
1963 1963
 	 * @return void
1964 1964
 	*/
1965 1965
 	private function _add_registered_meta_boxes() {
1966
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1966
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1967 1967
 
1968 1968
 		//we only add meta boxes if the page_route calls for it
1969
-		if ( is_array($this->_route_config) && isset( $this->_route_config['metaboxes'] ) && is_array($this->_route_config['metaboxes']) ) {
1969
+		if (is_array($this->_route_config) && isset($this->_route_config['metaboxes']) && is_array($this->_route_config['metaboxes'])) {
1970 1970
 
1971 1971
 
1972 1972
 			//this simply loops through the callbacks provided and checks if there is a corresponding callback registered by the child - if there is then we go ahead and process the metabox loader.
1973
-			foreach ( $this->_route_config['metaboxes'] as $metabox_callback ) {
1974
-				if ( call_user_func( array($this, &$metabox_callback) ) === FALSE ) {
1973
+			foreach ($this->_route_config['metaboxes'] as $metabox_callback) {
1974
+				if (call_user_func(array($this, &$metabox_callback)) === FALSE) {
1975 1975
 					// user error msg
1976
-				$error_msg =  __( 'An error occurred. The  requested metabox could not be found.', 'event_espresso' );
1976
+				$error_msg = __('An error occurred. The  requested metabox could not be found.', 'event_espresso');
1977 1977
 				// developer error msg
1978
-				$error_msg .= '||' . sprintf( __( 'The metabox with the string "%s" could not be called. Check that the spelling for method names and actions in the "_page_config[\'metaboxes\']" array are all correct.', 'event_espresso' ), $metabox_callback );
1979
-				throw new EE_Error( $error_msg );
1978
+				$error_msg .= '||'.sprintf(__('The metabox with the string "%s" could not be called. Check that the spelling for method names and actions in the "_page_config[\'metaboxes\']" array are all correct.', 'event_espresso'), $metabox_callback);
1979
+				throw new EE_Error($error_msg);
1980 1980
 				}
1981 1981
 			}
1982 1982
 		}
@@ -1993,17 +1993,17 @@  discard block
 block discarded – undo
1993 1993
 	 * @return void
1994 1994
 	 */
1995 1995
 	private function _add_screen_columns() {
1996
-		if ( is_array($this->_route_config) && isset( $this->_route_config['columns'] ) && is_array($this->_route_config['columns']) && count( $this->_route_config['columns'] == 2 ) ) {
1996
+		if (is_array($this->_route_config) && isset($this->_route_config['columns']) && is_array($this->_route_config['columns']) && count($this->_route_config['columns'] == 2)) {
1997 1997
 
1998
-			add_screen_option('layout_columns', array('max' => (int) $this->_route_config['columns'][0], 'default' => (int) $this->_route_config['columns'][1] ) );
1998
+			add_screen_option('layout_columns', array('max' => (int) $this->_route_config['columns'][0], 'default' => (int) $this->_route_config['columns'][1]));
1999 1999
 			$this->_template_args['num_columns'] = $this->_route_config['columns'][0];
2000 2000
 			$screen_id = $this->_current_screen->id;
2001 2001
 			$screen_columns = (int) get_user_option("screen_layout_$screen_id");
2002
-			$total_columns = !empty($screen_columns) ? $screen_columns : $this->_route_config['columns'][1];
2003
-			$this->_template_args['current_screen_widget_class'] = 'columns-' . $total_columns;
2002
+			$total_columns = ! empty($screen_columns) ? $screen_columns : $this->_route_config['columns'][1];
2003
+			$this->_template_args['current_screen_widget_class'] = 'columns-'.$total_columns;
2004 2004
 			$this->_template_args['current_page'] = $this->_wp_page_slug;
2005 2005
 			$this->_template_args['screen'] = $this->_current_screen;
2006
-			$this->_column_template_path = EE_ADMIN_TEMPLATE . 'admin_details_metabox_column_wrapper.template.php';
2006
+			$this->_column_template_path = EE_ADMIN_TEMPLATE.'admin_details_metabox_column_wrapper.template.php';
2007 2007
 
2008 2008
 			//finally if we don't have has_metaboxes set in the route config let's make sure it IS set other wise the necessary hidden fields for this won't be loaded.
2009 2009
 			$this->_route_config['has_metaboxes'] = TRUE;
@@ -2020,11 +2020,11 @@  discard block
 block discarded – undo
2020 2020
 	 */
2021 2021
 
2022 2022
 	private function _espresso_news_post_box() {
2023
-		$news_box_title = apply_filters( 'FHEE__EE_Admin_Page___espresso_news_post_box__news_box_title', __( 'New @ Event Espresso', 'event_espresso' ) );
2024
-		add_meta_box( 'espresso_news_post_box', $news_box_title, array(
2023
+		$news_box_title = apply_filters('FHEE__EE_Admin_Page___espresso_news_post_box__news_box_title', __('New @ Event Espresso', 'event_espresso'));
2024
+		add_meta_box('espresso_news_post_box', $news_box_title, array(
2025 2025
 			$this,
2026 2026
 			'espresso_news_post_box'
2027
-		), $this->_wp_page_slug, 'side' );
2027
+		), $this->_wp_page_slug, 'side');
2028 2028
 	}
2029 2029
 
2030 2030
 
@@ -2032,14 +2032,14 @@  discard block
 block discarded – undo
2032 2032
 	 * Code for setting up espresso ratings request metabox.
2033 2033
 	 */
2034 2034
 	protected function _espresso_ratings_request() {
2035
-		if ( ! apply_filters( 'FHEE_show_ratings_request_meta_box', true ) ) {
2035
+		if ( ! apply_filters('FHEE_show_ratings_request_meta_box', true)) {
2036 2036
 			return '';
2037 2037
 		}
2038
-		$ratings_box_title = apply_filters( 'FHEE__EE_Admin_Page___espresso_news_post_box__news_box_title', __('Keep Event Espresso Decaf Free', 'event_espresso') );
2039
-		add_meta_box( 'espresso_ratings_request', $ratings_box_title, array(
2038
+		$ratings_box_title = apply_filters('FHEE__EE_Admin_Page___espresso_news_post_box__news_box_title', __('Keep Event Espresso Decaf Free', 'event_espresso'));
2039
+		add_meta_box('espresso_ratings_request', $ratings_box_title, array(
2040 2040
 			$this,
2041 2041
 			'espresso_ratings_request'
2042
-		), $this->_wp_page_slug, 'side' );
2042
+		), $this->_wp_page_slug, 'side');
2043 2043
 	}
2044 2044
 
2045 2045
 
@@ -2047,34 +2047,34 @@  discard block
 block discarded – undo
2047 2047
 	 * Code for setting up espresso ratings request metabox content.
2048 2048
 	 */
2049 2049
 	public function espresso_ratings_request() {
2050
-		$template_path = EE_ADMIN_TEMPLATE . 'espresso_ratings_request_content.template.php';
2051
-		EEH_Template::display_template( $template_path, array() );
2050
+		$template_path = EE_ADMIN_TEMPLATE.'espresso_ratings_request_content.template.php';
2051
+		EEH_Template::display_template($template_path, array());
2052 2052
 	}
2053 2053
 
2054 2054
 
2055 2055
 
2056 2056
 
2057
-	public static function cached_rss_display( $rss_id, $url ) {
2058
-		$loading = '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="hide-if-js">' . __( 'This widget requires JavaScript.' ) . '</p>';
2059
-		$doing_ajax = ( defined( 'DOING_AJAX' ) && DOING_AJAX );
2060
-		$pre = '<div class="espresso-rss-display">' . "\n\t";
2061
-		$pre .= '<span id="' . $rss_id . '_url" class="hidden">' . $url . '</span>';
2062
-		$post = '</div>' . "\n";
2057
+	public static function cached_rss_display($rss_id, $url) {
2058
+		$loading = '<p class="widget-loading hide-if-no-js">'.__('Loading&#8230;').'</p><p class="hide-if-js">'.__('This widget requires JavaScript.').'</p>';
2059
+		$doing_ajax = (defined('DOING_AJAX') && DOING_AJAX);
2060
+		$pre = '<div class="espresso-rss-display">'."\n\t";
2061
+		$pre .= '<span id="'.$rss_id.'_url" class="hidden">'.$url.'</span>';
2062
+		$post = '</div>'."\n";
2063 2063
 
2064
-		$cache_key = 'ee_rss_' . md5( $rss_id );
2065
-		if ( FALSE != ( $output = get_transient( $cache_key ) ) ) {
2066
-			echo $pre . $output . $post;
2064
+		$cache_key = 'ee_rss_'.md5($rss_id);
2065
+		if (FALSE != ($output = get_transient($cache_key))) {
2066
+			echo $pre.$output.$post;
2067 2067
 			return TRUE;
2068 2068
 		}
2069 2069
 
2070
-		if ( ! $doing_ajax ) {
2071
-			echo $pre . $loading . $post;
2070
+		if ( ! $doing_ajax) {
2071
+			echo $pre.$loading.$post;
2072 2072
 			return FALSE;
2073 2073
 		}
2074 2074
 
2075 2075
 		ob_start();
2076
-		wp_widget_rss_output($url, array('show_date' => 0, 'items' => 5) );
2077
-		set_transient( $cache_key, ob_get_flush(), 12 * HOUR_IN_SECONDS );
2076
+		wp_widget_rss_output($url, array('show_date' => 0, 'items' => 5));
2077
+		set_transient($cache_key, ob_get_flush(), 12 * HOUR_IN_SECONDS);
2078 2078
 		return TRUE;
2079 2079
 
2080 2080
 	}
@@ -2086,13 +2086,13 @@  discard block
 block discarded – undo
2086 2086
 	  	<div id="espresso_news_post_box_content" class="infolinks">
2087 2087
 	  		<?php
2088 2088
 	  		// Get RSS Feed(s)
2089
-	  		$feed_url = apply_filters( 'FHEE__EE_Admin_Page__espresso_news_post_box__feed_url', 'http://eventespresso.com/feed/' );
2089
+	  		$feed_url = apply_filters('FHEE__EE_Admin_Page__espresso_news_post_box__feed_url', 'http://eventespresso.com/feed/');
2090 2090
 	  		$url = urlencode($feed_url);
2091
-	  		self::cached_rss_display( 'espresso_news_post_box_content', $url );
2091
+	  		self::cached_rss_display('espresso_news_post_box_content', $url);
2092 2092
 
2093 2093
 	  		?>
2094 2094
 	  	</div>
2095
-	  	<?php do_action( 'AHEE__EE_Admin_Page__espresso_news_post_box__after_content'); ?>
2095
+	  	<?php do_action('AHEE__EE_Admin_Page__espresso_news_post_box__after_content'); ?>
2096 2096
 	  </div>
2097 2097
 		<?php
2098 2098
 	}
@@ -2113,32 +2113,32 @@  discard block
 block discarded – undo
2113 2113
 
2114 2114
 	protected function _espresso_sponsors_post_box() {
2115 2115
 
2116
-		$show_sponsors = apply_filters( 'FHEE_show_sponsors_meta_box', TRUE );
2117
-		if ( $show_sponsors )
2118
-			add_meta_box('espresso_sponsors_post_box', __('Event Espresso Highlights', 'event_espresso'), array( $this, 'espresso_sponsors_post_box'), $this->_wp_page_slug, 'side');
2116
+		$show_sponsors = apply_filters('FHEE_show_sponsors_meta_box', TRUE);
2117
+		if ($show_sponsors)
2118
+			add_meta_box('espresso_sponsors_post_box', __('Event Espresso Highlights', 'event_espresso'), array($this, 'espresso_sponsors_post_box'), $this->_wp_page_slug, 'side');
2119 2119
 	}
2120 2120
 
2121 2121
 
2122 2122
 	public function espresso_sponsors_post_box() {
2123
-		$templatepath = EE_ADMIN_TEMPLATE . 'admin_general_metabox_contents_espresso_sponsors.template.php';
2124
-		EEH_Template::display_template( $templatepath );
2123
+		$templatepath = EE_ADMIN_TEMPLATE.'admin_general_metabox_contents_espresso_sponsors.template.php';
2124
+		EEH_Template::display_template($templatepath);
2125 2125
 	}
2126 2126
 
2127 2127
 
2128 2128
 
2129 2129
 	private function _publish_post_box() {
2130
-		$meta_box_ref = 'espresso_' . $this->page_slug . '_editor_overview';
2130
+		$meta_box_ref = 'espresso_'.$this->page_slug.'_editor_overview';
2131 2131
 
2132 2132
 		//if there is a array('label' => array('publishbox' => 'some title') ) present in the _page_config array then we'll use that for the metabox label.  Otherwise we'll just use publish (publishbox itself could be an array of labels indexed by routes)
2133
-		if ( !empty( $this->_labels['publishbox'] ) ) {
2134
-			$box_label = is_array( $this->_labels['publishbox'] ) ? $this->_labels['publishbox'][$this->_req_action] : $this->_labels['publishbox'];
2133
+		if ( ! empty($this->_labels['publishbox'])) {
2134
+			$box_label = is_array($this->_labels['publishbox']) ? $this->_labels['publishbox'][$this->_req_action] : $this->_labels['publishbox'];
2135 2135
 		} else {
2136 2136
 			$box_label = __('Publish', 'event_espresso');
2137 2137
 		}
2138 2138
 
2139
-		$box_label = apply_filters( 'FHEE__EE_Admin_Page___publish_post_box__box_label', $box_label, $this->_req_action, $this );
2139
+		$box_label = apply_filters('FHEE__EE_Admin_Page___publish_post_box__box_label', $box_label, $this->_req_action, $this);
2140 2140
 
2141
-		add_meta_box( $meta_box_ref, $box_label, array( $this, 'editor_overview' ), $this->_current_screen->id, 'side', 'high' );
2141
+		add_meta_box($meta_box_ref, $box_label, array($this, 'editor_overview'), $this->_current_screen->id, 'side', 'high');
2142 2142
 
2143 2143
 	}
2144 2144
 
@@ -2146,9 +2146,9 @@  discard block
 block discarded – undo
2146 2146
 
2147 2147
 	public function editor_overview() {
2148 2148
 		//if we have extra content set let's add it in if not make sure its empty
2149
-		$this->_template_args['publish_box_extra_content'] = isset( $this->_template_args['publish_box_extra_content'] ) ? $this->_template_args['publish_box_extra_content'] : '';
2150
-		$template_path = EE_ADMIN_TEMPLATE . 'admin_details_publish_metabox.template.php';
2151
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2149
+		$this->_template_args['publish_box_extra_content'] = isset($this->_template_args['publish_box_extra_content']) ? $this->_template_args['publish_box_extra_content'] : '';
2150
+		$template_path = EE_ADMIN_TEMPLATE.'admin_details_publish_metabox.template.php';
2151
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
2152 2152
 	}
2153 2153
 
2154 2154
 
@@ -2164,8 +2164,8 @@  discard block
 block discarded – undo
2164 2164
 	 * @see $this->_set_publish_post_box_vars for param details
2165 2165
 	 * @since 4.6.0
2166 2166
 	 */
2167
-	public function set_publish_post_box_vars( $name = null, $id = false, $delete = false, $save_close_redirect_URL = null, $both_btns = true ) {
2168
-		$this->_set_publish_post_box_vars( $name, $id, $delete, $save_close_redirect_URL, $both_btns );
2167
+	public function set_publish_post_box_vars($name = null, $id = false, $delete = false, $save_close_redirect_URL = null, $both_btns = true) {
2168
+		$this->_set_publish_post_box_vars($name, $id, $delete, $save_close_redirect_URL, $both_btns);
2169 2169
 	}
2170 2170
 
2171 2171
 
@@ -2184,24 +2184,24 @@  discard block
 block discarded – undo
2184 2184
 	 * @param	string	$post_save_redirect_URL	custom URL to redirect to after Save & Close has been completed
2185 2185
 	 * @param	boolean	$both_btns	whether to display BOTH the "Save & Close" and "Save" buttons or just the Save button
2186 2186
 	 */
2187
-	protected function _set_publish_post_box_vars( $name = NULL, $id = FALSE, $delete = FALSE, $save_close_redirect_URL = NULL, $both_btns = TRUE ) {
2187
+	protected function _set_publish_post_box_vars($name = NULL, $id = FALSE, $delete = FALSE, $save_close_redirect_URL = NULL, $both_btns = TRUE) {
2188 2188
 
2189 2189
 		// if Save & Close, use a custom redirect URL or default to the main page?
2190
-		$save_close_redirect_URL = ! empty( $save_close_redirect_URL ) ? $save_close_redirect_URL : $this->_admin_base_url;
2190
+		$save_close_redirect_URL = ! empty($save_close_redirect_URL) ? $save_close_redirect_URL : $this->_admin_base_url;
2191 2191
 		// create the Save & Close and Save buttons
2192
-		$this->_set_save_buttons( $both_btns, array(), array(), $save_close_redirect_URL );
2192
+		$this->_set_save_buttons($both_btns, array(), array(), $save_close_redirect_URL);
2193 2193
 		//if we have extra content set let's add it in if not make sure its empty
2194
-		$this->_template_args['publish_box_extra_content'] = isset( $this->_template_args['publish_box_extra_content'] ) ? $this->_template_args['publish_box_extra_content'] : '';
2194
+		$this->_template_args['publish_box_extra_content'] = isset($this->_template_args['publish_box_extra_content']) ? $this->_template_args['publish_box_extra_content'] : '';
2195 2195
 
2196 2196
 
2197
-		if ( $delete && ! empty( $id )  ) {
2197
+		if ($delete && ! empty($id)) {
2198 2198
 			$delete = is_bool($delete) ? 'delete' : $delete; //make sure we have a default if just true is sent.
2199
-			$delete_link_args = array( $name => $id );
2200
-			$delete = $this->get_action_link_or_button( $delete, $delete, $delete_link_args, 'submitdelete deletion');
2199
+			$delete_link_args = array($name => $id);
2200
+			$delete = $this->get_action_link_or_button($delete, $delete, $delete_link_args, 'submitdelete deletion');
2201 2201
 		}
2202 2202
 
2203
-		$this->_template_args['publish_delete_link'] = !empty( $id ) ? $delete : '';
2204
-		if ( ! empty( $name ) && ! empty( $id ) ) {
2203
+		$this->_template_args['publish_delete_link'] = ! empty($id) ? $delete : '';
2204
+		if ( ! empty($name) && ! empty($id)) {
2205 2205
 			$hidden_field_arr[$name] = array(
2206 2206
 				'type' => 'hidden',
2207 2207
 				'value' => $id
@@ -2211,7 +2211,7 @@  discard block
 block discarded – undo
2211 2211
 			$hf = '';
2212 2212
 		}
2213 2213
 		// add hidden field
2214
-		$this->_template_args['publish_hidden_fields'] = ! empty( $hf ) ? $hf[$name]['field'] : $hf;
2214
+		$this->_template_args['publish_hidden_fields'] = ! empty($hf) ? $hf[$name]['field'] : $hf;
2215 2215
 
2216 2216
 	}
2217 2217
 
@@ -2228,8 +2228,8 @@  discard block
 block discarded – undo
2228 2228
 		<noscript>
2229 2229
 			<div id="no-js-message" class="error">
2230 2230
 				<p style="font-size:1.3em;">
2231
-					<span style="color:red;"><?php _e( 'Warning!', 'event_espresso' ); ?></span>
2232
-					<?php _e( 'Javascript is currently turned off for your browser. Javascript must be enabled in order for all of the features on this page to function properly. Please turn your javascript back on.', 'event_espresso' ); ?>
2231
+					<span style="color:red;"><?php _e('Warning!', 'event_espresso'); ?></span>
2232
+					<?php _e('Javascript is currently turned off for your browser. Javascript must be enabled in order for all of the features on this page to function properly. Please turn your javascript back on.', 'event_espresso'); ?>
2233 2233
 				</p>
2234 2234
 			</div>
2235 2235
 		</noscript>
@@ -2249,7 +2249,7 @@  discard block
 block discarded – undo
2249 2249
 	*		@return 		string
2250 2250
 	*/
2251 2251
 	private function _display_espresso_notices() {
2252
-		$notices = $this->_get_transient( TRUE );
2252
+		$notices = $this->_get_transient(TRUE);
2253 2253
 		echo stripslashes($notices);
2254 2254
 	}
2255 2255
 
@@ -2301,11 +2301,11 @@  discard block
 block discarded – undo
2301 2301
 	 * @param string  $priority      give this metabox a priority (using accepted priorities for wp meta boxes)
2302 2302
 	 * @param boolean $create_func   default is true.  Basically we can say we don't WANT to have the runtime function created but just set our own callback for wp's add_meta_box.
2303 2303
 	 */
2304
-	public function _add_admin_page_meta_box( $action, $title, $callback, $callback_args, $column = 'normal', $priority = 'high', $create_func = true ) {
2305
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, $callback );
2304
+	public function _add_admin_page_meta_box($action, $title, $callback, $callback_args, $column = 'normal', $priority = 'high', $create_func = true) {
2305
+		do_action('AHEE_log', __FILE__, __FUNCTION__, $callback);
2306 2306
 
2307 2307
 		//if we have empty callback args and we want to automatically create the metabox callback then we need to make sure the callback args are generated.
2308
-		if ( empty( $callback_args ) && $create_func ) {
2308
+		if (empty($callback_args) && $create_func) {
2309 2309
 			$callback_args = array(
2310 2310
 				'template_path' => $this->_template_path,
2311 2311
 				'template_args' => $this->_template_args,
@@ -2315,7 +2315,7 @@  discard block
 block discarded – undo
2315 2315
 		//if $create_func is true (default) then we automatically create the function for displaying the actual meta box.  If false then we take the $callback reference passed through and use it instead (so callers can define their own callback function/method if they wish)
2316 2316
 		$call_back_func = $create_func ? create_function('$post, $metabox', 'do_action( "AHEE_log", __FILE__, __FUNCTION__, ""); echo EEH_Template::display_template( $metabox["args"]["template_path"], $metabox["args"]["template_args"], TRUE );') : $callback;
2317 2317
 
2318
-		add_meta_box( str_replace( '_', '-', $action ) . '-mbox', $title, $call_back_func, $this->_wp_page_slug, $column, $priority, $callback_args );
2318
+		add_meta_box(str_replace('_', '-', $action).'-mbox', $title, $call_back_func, $this->_wp_page_slug, $column, $priority, $callback_args);
2319 2319
 	}
2320 2320
 
2321 2321
 
@@ -2328,7 +2328,7 @@  discard block
 block discarded – undo
2328 2328
 	 */
2329 2329
 	public function display_admin_page_with_metabox_columns() {
2330 2330
 		$this->_template_args['post_body_content'] = $this->_template_args['admin_page_content'];
2331
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $this->_column_template_path, $this->_template_args, TRUE);
2331
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($this->_column_template_path, $this->_template_args, TRUE);
2332 2332
 
2333 2333
 		//the final wrapper
2334 2334
 		$this->admin_page_wrapper();
@@ -2371,7 +2371,7 @@  discard block
 block discarded – undo
2371 2371
 	 * @return void
2372 2372
 	 */
2373 2373
 	public function display_about_admin_page() {
2374
-		$this->_display_admin_page( FALSE, TRUE );
2374
+		$this->_display_admin_page(FALSE, TRUE);
2375 2375
 	}
2376 2376
 
2377 2377
 
@@ -2387,26 +2387,26 @@  discard block
 block discarded – undo
2387 2387
 	 * @return html           admin_page
2388 2388
 	 */
2389 2389
 	private function _display_admin_page($sidebar = false, $about = FALSE) {
2390
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2390
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2391 2391
 
2392 2392
 		//custom remove metaboxes hook to add or remove any metaboxes to/from Admin pages.
2393
-		do_action( 'AHEE__EE_Admin_Page___display_admin_page__modify_metaboxes' );
2393
+		do_action('AHEE__EE_Admin_Page___display_admin_page__modify_metaboxes');
2394 2394
 
2395 2395
 		// set current wp page slug - looks like: event-espresso_page_event_categories
2396 2396
 		// keep in mind "event-espresso" COULD be something else if the top level menu label has been translated.
2397 2397
 		$this->_template_args['current_page'] = $this->_wp_page_slug;
2398 2398
 
2399
-		$template_path = $sidebar ?  EE_ADMIN_TEMPLATE . 'admin_details_wrapper.template.php' : EE_ADMIN_TEMPLATE . 'admin_details_wrapper_no_sidebar.template.php';
2399
+		$template_path = $sidebar ? EE_ADMIN_TEMPLATE.'admin_details_wrapper.template.php' : EE_ADMIN_TEMPLATE.'admin_details_wrapper_no_sidebar.template.php';
2400 2400
 
2401
-		if ( defined('DOING_AJAX' ) )
2402
-			$template_path = EE_ADMIN_TEMPLATE . 'admin_details_wrapper_no_sidebar_ajax.template.php';
2401
+		if (defined('DOING_AJAX'))
2402
+			$template_path = EE_ADMIN_TEMPLATE.'admin_details_wrapper_no_sidebar_ajax.template.php';
2403 2403
 
2404
-		$template_path = !empty($this->_column_template_path) ? $this->_column_template_path : $template_path;
2404
+		$template_path = ! empty($this->_column_template_path) ? $this->_column_template_path : $template_path;
2405 2405
 
2406
-		$this->_template_args['post_body_content'] = isset( $this->_template_args['admin_page_content'] ) ? $this->_template_args['admin_page_content'] : '';
2406
+		$this->_template_args['post_body_content'] = isset($this->_template_args['admin_page_content']) ? $this->_template_args['admin_page_content'] : '';
2407 2407
 		$this->_template_args['before_admin_page_content'] = isset($this->_template_args['before_admin_page_content']) ? $this->_template_args['before_admin_page_content'] : '';
2408 2408
 		$this->_template_args['after_admin_page_content'] = isset($this->_template_args['after_admin_page_content']) ? $this->_template_args['after_admin_page_content'] : '';
2409
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2409
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
2410 2410
 
2411 2411
 
2412 2412
 		// the final template wrapper
@@ -2426,7 +2426,7 @@  discard block
 block discarded – undo
2426 2426
 	 * @param bool   $display_sidebar whether to use the sidebar template or the full template for the page.  TRUE = SHOW sidebar, FALSE = no sidebar. Default no sidebar.
2427 2427
 	 * @return void
2428 2428
 	 */
2429
-	public function display_admin_caf_preview_page( $utm_campaign_source = '', $display_sidebar = TRUE ) {
2429
+	public function display_admin_caf_preview_page($utm_campaign_source = '', $display_sidebar = TRUE) {
2430 2430
 		//let's generate a default preview action button if there isn't one already present.
2431 2431
 		$this->_labels['buttons']['buy_now'] = __('Upgrade Now', 'event_espresso');
2432 2432
 		$buy_now_url = add_query_arg(
@@ -2439,10 +2439,10 @@  discard block
 block discarded – undo
2439 2439
 			),
2440 2440
 		'http://eventespresso.com/pricing/'
2441 2441
 		);
2442
-		$this->_template_args['preview_action_button'] = ! isset( $this->_template_args['preview_action_button'] ) ? $this->get_action_link_or_button( '', 'buy_now', array(), 'button-primary button-large', $buy_now_url, true ) : $this->_template_args['preview_action_button'];
2443
-		$template_path = EE_ADMIN_TEMPLATE . 'admin_caf_full_page_preview.template.php';
2444
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2445
-		$this->_display_admin_page( $display_sidebar );
2442
+		$this->_template_args['preview_action_button'] = ! isset($this->_template_args['preview_action_button']) ? $this->get_action_link_or_button('', 'buy_now', array(), 'button-primary button-large', $buy_now_url, true) : $this->_template_args['preview_action_button'];
2443
+		$template_path = EE_ADMIN_TEMPLATE.'admin_caf_full_page_preview.template.php';
2444
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
2445
+		$this->_display_admin_page($display_sidebar);
2446 2446
 	}
2447 2447
 
2448 2448
 
@@ -2476,41 +2476,41 @@  discard block
 block discarded – undo
2476 2476
 	 * @param boolean $sidebar whether to display with sidebar or not.
2477 2477
 	 * @return html
2478 2478
 	 */
2479
-	private function _display_admin_list_table_page( $sidebar = false ) {
2479
+	private function _display_admin_list_table_page($sidebar = false) {
2480 2480
 		//setup search attributes
2481 2481
 		$this->_set_search_attributes();
2482 2482
 		$this->_template_args['current_page'] = $this->_wp_page_slug;
2483
-		$template_path = EE_ADMIN_TEMPLATE . 'admin_list_wrapper.template.php';
2483
+		$template_path = EE_ADMIN_TEMPLATE.'admin_list_wrapper.template.php';
2484 2484
 
2485
-		$this->_template_args['table_url'] = defined( 'DOING_AJAX') ? add_query_arg( array( 'noheader' => 'true', 'route' => $this->_req_action), $this->_admin_base_url ) : add_query_arg( array( 'route' => $this->_req_action), $this->_admin_base_url);
2485
+		$this->_template_args['table_url'] = defined('DOING_AJAX') ? add_query_arg(array('noheader' => 'true', 'route' => $this->_req_action), $this->_admin_base_url) : add_query_arg(array('route' => $this->_req_action), $this->_admin_base_url);
2486 2486
 		$this->_template_args['list_table'] = $this->_list_table_object;
2487 2487
 		$this->_template_args['current_route'] = $this->_req_action;
2488
-		$this->_template_args['list_table_class'] = get_class( $this->_list_table_object );
2488
+		$this->_template_args['list_table_class'] = get_class($this->_list_table_object);
2489 2489
 
2490 2490
 		$ajax_sorting_callback = $this->_list_table_object->get_ajax_sorting_callback();
2491
-		if( ! empty( $ajax_sorting_callback )) {
2492
-			$sortable_list_table_form_fields = wp_nonce_field( $ajax_sorting_callback . '_nonce', $ajax_sorting_callback . '_nonce', FALSE, FALSE );
2491
+		if ( ! empty($ajax_sorting_callback)) {
2492
+			$sortable_list_table_form_fields = wp_nonce_field($ajax_sorting_callback.'_nonce', $ajax_sorting_callback.'_nonce', FALSE, FALSE);
2493 2493
 //			$reorder_action = 'espresso_' . $ajax_sorting_callback . '_nonce';
2494 2494
 //			$sortable_list_table_form_fields = wp_nonce_field( $reorder_action, 'ajax_table_sort_nonce', FALSE, FALSE );
2495
-			$sortable_list_table_form_fields .= '<input type="hidden" id="ajax_table_sort_page" name="ajax_table_sort_page" value="' . $this->page_slug .'" />';
2496
-			$sortable_list_table_form_fields .= '<input type="hidden" id="ajax_table_sort_action" name="ajax_table_sort_action" value="' . $ajax_sorting_callback . '" />';
2495
+			$sortable_list_table_form_fields .= '<input type="hidden" id="ajax_table_sort_page" name="ajax_table_sort_page" value="'.$this->page_slug.'" />';
2496
+			$sortable_list_table_form_fields .= '<input type="hidden" id="ajax_table_sort_action" name="ajax_table_sort_action" value="'.$ajax_sorting_callback.'" />';
2497 2497
 		} else {
2498 2498
 			$sortable_list_table_form_fields = '';
2499 2499
 		}
2500 2500
 
2501 2501
 		$this->_template_args['sortable_list_table_form_fields'] = $sortable_list_table_form_fields;
2502
-		$hidden_form_fields = isset( $this->_template_args['list_table_hidden_fields'] ) ? $this->_template_args['list_table_hidden_fields'] : '';
2503
-		$nonce_ref = $this->_req_action . '_nonce';
2504
-		$hidden_form_fields .= '<input type="hidden" name="' . $nonce_ref . '" value="' . wp_create_nonce( $nonce_ref ) . '">';
2502
+		$hidden_form_fields = isset($this->_template_args['list_table_hidden_fields']) ? $this->_template_args['list_table_hidden_fields'] : '';
2503
+		$nonce_ref = $this->_req_action.'_nonce';
2504
+		$hidden_form_fields .= '<input type="hidden" name="'.$nonce_ref.'" value="'.wp_create_nonce($nonce_ref).'">';
2505 2505
 		$this->_template_args['list_table_hidden_fields'] = $hidden_form_fields;
2506 2506
 
2507 2507
 		//display message about search results?
2508 2508
         $this->_template_args['before_list_table'] .= ! empty($this->_req_data['s'])
2509
-            ? '<p class="ee-search-results">' . sprintf(
2509
+            ? '<p class="ee-search-results">'.sprintf(
2510 2510
                     __('Displaying search results for the search string: <strong><em>%s</em></strong>',
2511 2511
                             'event_espresso'),
2512 2512
                     trim($this->_req_data['s'], '%')
2513
-            ) . '</p>'
2513
+            ).'</p>'
2514 2514
             : '';
2515 2515
         // filter before_list_table template arg
2516 2516
 		$this->_template_args['before_list_table'] = apply_filters(
@@ -2529,10 +2529,10 @@  discard block
 block discarded – undo
2529 2529
             $this->_req_action
2530 2530
         );
2531 2531
 
2532
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2532
+        $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
2533 2533
 
2534 2534
 		// the final template wrapper
2535
-		if ( $sidebar )
2535
+		if ($sidebar)
2536 2536
 			$this->display_admin_page_with_sidebar();
2537 2537
 		else
2538 2538
 			$this->display_admin_page_with_no_sidebar();
@@ -2555,9 +2555,9 @@  discard block
 block discarded – undo
2555 2555
 	 * @param  array $items  see above for format of array
2556 2556
 	 * @return string        html string of legend
2557 2557
 	 */
2558
-	protected function _display_legend( $items ) {
2559
-		$this->_template_args['items'] = apply_filters( 'FHEE__EE_Admin_Page___display_legend__items', (array) $items, $this );
2560
-		$legend_template = EE_ADMIN_TEMPLATE . 'admin_details_legend.template.php';
2558
+	protected function _display_legend($items) {
2559
+		$this->_template_args['items'] = apply_filters('FHEE__EE_Admin_Page___display_legend__items', (array) $items, $this);
2560
+		$legend_template = EE_ADMIN_TEMPLATE.'admin_details_legend.template.php';
2561 2561
 		return EEH_Template::display_template($legend_template, $this->_template_args, TRUE);
2562 2562
 	}
2563 2563
 
@@ -2582,33 +2582,33 @@  discard block
 block discarded – undo
2582 2582
 	 *
2583 2583
 	 * @return string json object
2584 2584
 	 */
2585
-	protected function _return_json( $sticky_notices = false ) {
2585
+	protected function _return_json($sticky_notices = false) {
2586 2586
 
2587 2587
 		//make sure any EE_Error notices have been handled.
2588
-		$this->_process_notices( array(), true, $sticky_notices );
2588
+		$this->_process_notices(array(), true, $sticky_notices);
2589 2589
 
2590 2590
 
2591
-		$data = isset( $this->_template_args['data'] ) ? $this->_template_args['data'] : array();
2591
+		$data = isset($this->_template_args['data']) ? $this->_template_args['data'] : array();
2592 2592
 		unset($this->_template_args['data']);
2593 2593
 		$json = array(
2594
-			'error' => isset( $this->_template_args['error'] ) ? $this->_template_args['error'] : false,
2595
-			'success' => isset( $this->_template_args['success'] ) ? $this->_template_args['success'] : false,
2596
-			'errors' => isset( $this->_template_args['errors'] ) ? $this->_template_args['errors'] : false,
2597
-			'attention' => isset( $this->_template_args['attention'] ) ? $this->_template_args['attention'] : false,
2594
+			'error' => isset($this->_template_args['error']) ? $this->_template_args['error'] : false,
2595
+			'success' => isset($this->_template_args['success']) ? $this->_template_args['success'] : false,
2596
+			'errors' => isset($this->_template_args['errors']) ? $this->_template_args['errors'] : false,
2597
+			'attention' => isset($this->_template_args['attention']) ? $this->_template_args['attention'] : false,
2598 2598
 			'notices' => EE_Error::get_notices(),
2599
-			'content' => isset( $this->_template_args['admin_page_content'] ) ? $this->_template_args['admin_page_content'] : '',
2600
-			'data' => array_merge( $data, array('template_args' => $this->_template_args ) ),
2599
+			'content' => isset($this->_template_args['admin_page_content']) ? $this->_template_args['admin_page_content'] : '',
2600
+			'data' => array_merge($data, array('template_args' => $this->_template_args)),
2601 2601
 			'isEEajax' => TRUE //special flag so any ajax.Success methods in js can identify this return package as a EEajax package.
2602 2602
 			);
2603 2603
 
2604 2604
 
2605 2605
 		// make sure there are no php errors or headers_sent.  Then we can set correct json header.
2606
-		if ( NULL === error_get_last() || ! headers_sent() )
2606
+		if (NULL === error_get_last() || ! headers_sent())
2607 2607
 			header('Content-Type: application/json; charset=UTF-8');
2608
-                if( function_exists( 'wp_json_encode' ) ) {
2609
-                    echo wp_json_encode( $json );
2608
+                if (function_exists('wp_json_encode')) {
2609
+                    echo wp_json_encode($json);
2610 2610
                 } else {
2611
-                    echo json_encode( $json );
2611
+                    echo json_encode($json);
2612 2612
                 }
2613 2613
 		exit();
2614 2614
 	}
@@ -2620,11 +2620,11 @@  discard block
 block discarded – undo
2620 2620
 	 * @return json_obj|EE_Error
2621 2621
 	 */
2622 2622
 	public function return_json() {
2623
-		if ( defined('DOING_AJAX') && DOING_AJAX )
2623
+		if (defined('DOING_AJAX') && DOING_AJAX)
2624 2624
 			$this->_return_json();
2625 2625
 
2626 2626
 		else {
2627
-			throw new EE_Error( sprintf( __('The public %s method can only be called when DOING_AJAX = TRUE', 'event_espresso'), __FUNCTION__ ) );
2627
+			throw new EE_Error(sprintf(__('The public %s method can only be called when DOING_AJAX = TRUE', 'event_espresso'), __FUNCTION__));
2628 2628
 		}
2629 2629
 	}
2630 2630
 
@@ -2639,7 +2639,7 @@  discard block
 block discarded – undo
2639 2639
 	 * @access public
2640 2640
 	 * @return void
2641 2641
 	 */
2642
-	public function set_hook_object( EE_Admin_Hooks $hook_obj ) {
2642
+	public function set_hook_object(EE_Admin_Hooks $hook_obj) {
2643 2643
 		$this->_hook_obj = $hook_obj;
2644 2644
 	}
2645 2645
 
@@ -2655,33 +2655,33 @@  discard block
 block discarded – undo
2655 2655
 	*/
2656 2656
 	public function admin_page_wrapper($about = FALSE) {
2657 2657
 
2658
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2658
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2659 2659
 
2660 2660
 		$this->_nav_tabs = $this->_get_main_nav_tabs();
2661 2661
 
2662 2662
 		$this->_template_args['nav_tabs'] = $this->_nav_tabs;
2663 2663
 		$this->_template_args['admin_page_title'] = $this->_admin_page_title;
2664 2664
 
2665
-		$this->_template_args['before_admin_page_content'] = apply_filters( 'FHEE_before_admin_page_content' . $this->_current_page . $this->_current_view, isset( $this->_template_args['before_admin_page_content'] ) ? $this->_template_args['before_admin_page_content'] : '');
2666
-		$this->_template_args['after_admin_page_content'] = apply_filters( 'FHEE_after_admin_page_content' . $this->_current_page . $this->_current_view, isset( $this->_template_args['after_admin_page_content'] ) ? $this->_template_args['after_admin_page_content'] : '');
2665
+		$this->_template_args['before_admin_page_content'] = apply_filters('FHEE_before_admin_page_content'.$this->_current_page.$this->_current_view, isset($this->_template_args['before_admin_page_content']) ? $this->_template_args['before_admin_page_content'] : '');
2666
+		$this->_template_args['after_admin_page_content'] = apply_filters('FHEE_after_admin_page_content'.$this->_current_page.$this->_current_view, isset($this->_template_args['after_admin_page_content']) ? $this->_template_args['after_admin_page_content'] : '');
2667 2667
 
2668 2668
 		$this->_template_args['after_admin_page_content'] .= $this->_set_help_popup_content();
2669 2669
 
2670 2670
 
2671 2671
 
2672 2672
 		// load settings page wrapper template
2673
-		$template_path = !defined( 'DOING_AJAX' ) ? EE_ADMIN_TEMPLATE . 'admin_wrapper.template.php' : EE_ADMIN_TEMPLATE . 'admin_wrapper_ajax.template.php';
2673
+		$template_path = ! defined('DOING_AJAX') ? EE_ADMIN_TEMPLATE.'admin_wrapper.template.php' : EE_ADMIN_TEMPLATE.'admin_wrapper_ajax.template.php';
2674 2674
 
2675 2675
 		//about page?
2676
-		$template_path = $about ? EE_ADMIN_TEMPLATE . 'about_admin_wrapper.template.php' : $template_path;
2676
+		$template_path = $about ? EE_ADMIN_TEMPLATE.'about_admin_wrapper.template.php' : $template_path;
2677 2677
 
2678 2678
 
2679
-		if ( defined( 'DOING_AJAX' ) ) {
2680
-			$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2679
+		if (defined('DOING_AJAX')) {
2680
+			$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
2681 2681
 
2682 2682
 			$this->_return_json();
2683 2683
 		} else {
2684
-			EEH_Template::display_template( $template_path, $this->_template_args );
2684
+			EEH_Template::display_template($template_path, $this->_template_args);
2685 2685
 		}
2686 2686
 
2687 2687
 	}
@@ -2709,7 +2709,7 @@  discard block
 block discarded – undo
2709 2709
 	*		@access public
2710 2710
 	*		@return void
2711 2711
 	*/
2712
-	private function _sort_nav_tabs( $a, $b ) {
2712
+	private function _sort_nav_tabs($a, $b) {
2713 2713
 		if ($a['order'] == $b['order']) {
2714 2714
 	        return 0;
2715 2715
 	    }
@@ -2730,7 +2730,7 @@  discard block
 block discarded – undo
2730 2730
 	 * 	@uses EEH_Form_Fields::get_form_fields (/helper/EEH_Form_Fields.helper.php)
2731 2731
 	 * 	@uses EEH_Form_Fields::get_form_fields_array (/helper/EEH_Form_Fields.helper.php)
2732 2732
 	 */
2733
-	protected function _generate_admin_form_fields( $input_vars = array(), $generator = 'string', $id = FALSE ) {
2733
+	protected function _generate_admin_form_fields($input_vars = array(), $generator = 'string', $id = FALSE) {
2734 2734
 		$content = $generator == 'string' ? EEH_Form_Fields::get_form_fields($input_vars, $id) : EEH_Form_Fields::get_form_fields_array($input_vars);
2735 2735
 		return $content;
2736 2736
 	}
@@ -2752,25 +2752,25 @@  discard block
 block discarded – undo
2752 2752
 	 * @param array $actions if included allows us to set the actions that each button will carry out (i.e. via the "name" value in the button).  We can also use this to just dump default actions by submitting some other value.
2753 2753
 	 * @param bool|string|null $referrer if false then we just do the default action on save and close.  Other wise it will use the $referrer string. IF null, then we don't do ANYTHING on save and close (normal form handling).
2754 2754
 	 */
2755
-	protected function _set_save_buttons($both = TRUE, $text = array(), $actions = array(), $referrer = NULL ) {
2755
+	protected function _set_save_buttons($both = TRUE, $text = array(), $actions = array(), $referrer = NULL) {
2756 2756
 		//make sure $text and $actions are in an array
2757 2757
 		$text = (array) $text;
2758 2758
 		$actions = (array) $actions;
2759 2759
 		$referrer_url = empty($referrer) ? '' : $referrer;
2760
-		$referrer_url = !$referrer ? '<input type="hidden" id="save_and_close_referrer" name="save_and_close_referrer" value="' . $_SERVER['REQUEST_URI'] .'" />' : '<input type="hidden" id="save_and_close_referrer" name="save_and_close_referrer" value="' . $referrer .'" />';
2760
+		$referrer_url = ! $referrer ? '<input type="hidden" id="save_and_close_referrer" name="save_and_close_referrer" value="'.$_SERVER['REQUEST_URI'].'" />' : '<input type="hidden" id="save_and_close_referrer" name="save_and_close_referrer" value="'.$referrer.'" />';
2761 2761
 
2762
-		$button_text = !empty($text) ? $text : array( __('Save', 'event_espresso'), __('Save and Close', 'event_espresso') );
2763
-		$default_names = array( 'save', 'save_and_close' );
2762
+		$button_text = ! empty($text) ? $text : array(__('Save', 'event_espresso'), __('Save and Close', 'event_espresso'));
2763
+		$default_names = array('save', 'save_and_close');
2764 2764
 
2765 2765
 		//add in a hidden index for the current page (so save and close redirects properly)
2766 2766
 		$this->_template_args['save_buttons'] = $referrer_url;
2767 2767
 
2768
-		foreach ( $button_text as $key => $button ) {
2768
+		foreach ($button_text as $key => $button) {
2769 2769
 			$ref = $default_names[$key];
2770
-			$id = $this->_current_view . '_' . $ref;
2771
-			$name = !empty($actions) ? $actions[$key] : $ref;
2772
-			$this->_template_args['save_buttons'] .= '<input type="submit" class="button-primary ' . $ref . '" value="' . $button . '" name="' . $name . '" id="' . $id . '" />';
2773
-			if ( !$both ) break;
2770
+			$id = $this->_current_view.'_'.$ref;
2771
+			$name = ! empty($actions) ? $actions[$key] : $ref;
2772
+			$this->_template_args['save_buttons'] .= '<input type="submit" class="button-primary '.$ref.'" value="'.$button.'" name="'.$name.'" id="'.$id.'" />';
2773
+			if ( ! $both) break;
2774 2774
 		}
2775 2775
 
2776 2776
 	}
@@ -2783,8 +2783,8 @@  discard block
 block discarded – undo
2783 2783
 	 * @since 4.6.0
2784 2784
 	 *
2785 2785
 	 */
2786
-	public function set_add_edit_form_tags( $route = '', $additional_hidden_fields = array() ) {
2787
-		$this->_set_add_edit_form_tags( $route, $additional_hidden_fields );
2786
+	public function set_add_edit_form_tags($route = '', $additional_hidden_fields = array()) {
2787
+		$this->_set_add_edit_form_tags($route, $additional_hidden_fields);
2788 2788
 	}
2789 2789
 
2790 2790
 
@@ -2797,30 +2797,30 @@  discard block
 block discarded – undo
2797 2797
 	 * @param array $additional_hidden_fields any additional hidden fields required in the form header
2798 2798
 	 * @return void
2799 2799
 	 */
2800
-	protected function _set_add_edit_form_tags( $route = '', $additional_hidden_fields = array() ) {
2800
+	protected function _set_add_edit_form_tags($route = '', $additional_hidden_fields = array()) {
2801 2801
 
2802
-		if ( empty( $route )) {
2802
+		if (empty($route)) {
2803 2803
 			$user_msg = __('An error occurred. No action was set for this page\'s form.', 'event_espresso');
2804
-			$dev_msg = $user_msg . "\n" . sprintf( __('The $route argument is required for the %s->%s method.', 'event_espresso'), __FUNCTION__, __CLASS__ );
2805
-			EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ );
2804
+			$dev_msg = $user_msg."\n".sprintf(__('The $route argument is required for the %s->%s method.', 'event_espresso'), __FUNCTION__, __CLASS__);
2805
+			EE_Error::add_error($user_msg.'||'.$dev_msg, __FILE__, __FUNCTION__, __LINE__);
2806 2806
 		}
2807 2807
 		// open form
2808
-		$this->_template_args['before_admin_page_content'] = '<form name="form" method="post" action="' . $this->_admin_base_url . '" id="' . $route . '_event_form" >';
2808
+		$this->_template_args['before_admin_page_content'] = '<form name="form" method="post" action="'.$this->_admin_base_url.'" id="'.$route.'_event_form" >';
2809 2809
 		// add nonce
2810
-		$nonce = wp_nonce_field( $route . '_nonce', $route . '_nonce', FALSE, FALSE );
2810
+		$nonce = wp_nonce_field($route.'_nonce', $route.'_nonce', FALSE, FALSE);
2811 2811
 //		$nonce = wp_nonce_field( $route . '_nonce', '_wpnonce', FALSE, FALSE );
2812
-		$this->_template_args['before_admin_page_content'] .= "\n\t" . $nonce;
2812
+		$this->_template_args['before_admin_page_content'] .= "\n\t".$nonce;
2813 2813
 		// add REQUIRED form action
2814 2814
 		$hidden_fields = array(
2815
-				'action' => array( 'type' => 'hidden', 'value' => $route ),
2815
+				'action' => array('type' => 'hidden', 'value' => $route),
2816 2816
 			);
2817 2817
 		// merge arrays
2818
-		$hidden_fields = is_array( $additional_hidden_fields) ? array_merge( $hidden_fields, $additional_hidden_fields ) : $hidden_fields;
2818
+		$hidden_fields = is_array($additional_hidden_fields) ? array_merge($hidden_fields, $additional_hidden_fields) : $hidden_fields;
2819 2819
 		// generate form fields
2820
-		$form_fields = $this->_generate_admin_form_fields( $hidden_fields, 'array' );
2820
+		$form_fields = $this->_generate_admin_form_fields($hidden_fields, 'array');
2821 2821
 		// add fields to form
2822
-		foreach ( $form_fields as $field_name => $form_field ) {
2823
-			$this->_template_args['before_admin_page_content'] .= "\n\t" . $form_field['field'];
2822
+		foreach ($form_fields as $field_name => $form_field) {
2823
+			$this->_template_args['before_admin_page_content'] .= "\n\t".$form_field['field'];
2824 2824
 		}
2825 2825
 
2826 2826
 		// close form
@@ -2837,8 +2837,8 @@  discard block
 block discarded – undo
2837 2837
 	 * @see EE_Admin_Page::_redirect_after_action() for params.
2838 2838
 	 * @since 4.5.0
2839 2839
 	 */
2840
-	public function redirect_after_action( $success = FALSE, $what = 'item', $action_desc = 'processed', $query_args = array(), $override_overwrite = FALSE ) {
2841
-		$this->_redirect_after_action( $success, $what, $action_desc, $query_args, $override_overwrite );
2840
+	public function redirect_after_action($success = FALSE, $what = 'item', $action_desc = 'processed', $query_args = array(), $override_overwrite = FALSE) {
2841
+		$this->_redirect_after_action($success, $what, $action_desc, $query_args, $override_overwrite);
2842 2842
 	}
2843 2843
 
2844 2844
 
@@ -2854,32 +2854,32 @@  discard block
 block discarded – undo
2854 2854
 	 *	@access protected
2855 2855
 	 *	@return void
2856 2856
 	 */
2857
-	protected function _redirect_after_action( $success = 0, $what = 'item', $action_desc = 'processed', $query_args = array(), $override_overwrite = FALSE ) {
2857
+	protected function _redirect_after_action($success = 0, $what = 'item', $action_desc = 'processed', $query_args = array(), $override_overwrite = FALSE) {
2858 2858
 
2859
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2859
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2860 2860
 
2861 2861
 		//class name for actions/filters.
2862 2862
 		$classname = get_class($this);
2863 2863
 
2864 2864
 		//set redirect url. Note if there is a "page" index in the $query_args then we go with vanilla admin.php route, otherwise we go with whatever is set as the _admin_base_url
2865
-		$redirect_url = isset( $query_args['page'] ) ? admin_url('admin.php') : $this->_admin_base_url;
2866
-		$notices = EE_Error::get_notices( FALSE );
2865
+		$redirect_url = isset($query_args['page']) ? admin_url('admin.php') : $this->_admin_base_url;
2866
+		$notices = EE_Error::get_notices(FALSE);
2867 2867
 
2868 2868
 		// overwrite default success messages //BUT ONLY if overwrite not overridden
2869
-		if ( ! $override_overwrite || ! empty( $notices['errors'] )) {
2869
+		if ( ! $override_overwrite || ! empty($notices['errors'])) {
2870 2870
 			EE_Error::overwrite_success();
2871 2871
 		}
2872 2872
 		// how many records affected ? more than one record ? or just one ?
2873
-		if ( $success > 1 && empty( $notices['errors'] )) {
2873
+		if ($success > 1 && empty($notices['errors'])) {
2874 2874
 			// set plural msg
2875
-			EE_Error::add_success( sprintf( __('The "%s" have been successfully %s.', 'event_espresso'), $what, $action_desc ), __FILE__, __FUNCTION__, __LINE__);
2876
-		} else if ( $success == 1 && empty( $notices['errors'] )) {
2875
+			EE_Error::add_success(sprintf(__('The "%s" have been successfully %s.', 'event_espresso'), $what, $action_desc), __FILE__, __FUNCTION__, __LINE__);
2876
+		} else if ($success == 1 && empty($notices['errors'])) {
2877 2877
 			// set singular msg
2878
-			EE_Error::add_success( sprintf( __('The "%s" has been successfully %s.', 'event_espresso'), $what, $action_desc), __FILE__, __FUNCTION__, __LINE__ );
2878
+			EE_Error::add_success(sprintf(__('The "%s" has been successfully %s.', 'event_espresso'), $what, $action_desc), __FILE__, __FUNCTION__, __LINE__);
2879 2879
 		}
2880 2880
 
2881 2881
 		// check that $query_args isn't something crazy
2882
-		if ( ! is_array( $query_args )) {
2882
+		if ( ! is_array($query_args)) {
2883 2883
 			$query_args = array();
2884 2884
 		}
2885 2885
 
@@ -2892,36 +2892,36 @@  discard block
 block discarded – undo
2892 2892
 		 * @param array $query_args   The original query_args array coming into the
2893 2893
 		 *                          		method.
2894 2894
 		 */
2895
-		do_action( 'AHEE__' . $classname . '___redirect_after_action__before_redirect_modification_' . $this->_req_action, $query_args );
2895
+		do_action('AHEE__'.$classname.'___redirect_after_action__before_redirect_modification_'.$this->_req_action, $query_args);
2896 2896
 
2897 2897
 		//calculate where we're going (if we have a "save and close" button pushed)
2898
-		if ( isset($this->_req_data['save_and_close'] ) && isset($this->_req_data['save_and_close_referrer'] ) ) {
2898
+		if (isset($this->_req_data['save_and_close']) && isset($this->_req_data['save_and_close_referrer'])) {
2899 2899
 			// even though we have the save_and_close referrer, we need to parse the url for the action in order to generate a nonce
2900
-			$parsed_url = parse_url( $this->_req_data['save_and_close_referrer'] );
2900
+			$parsed_url = parse_url($this->_req_data['save_and_close_referrer']);
2901 2901
 			// regenerate query args array from refferer URL
2902
-			parse_str( $parsed_url['query'], $query_args );
2902
+			parse_str($parsed_url['query'], $query_args);
2903 2903
 			// correct page and action will be in the query args now
2904
-			$redirect_url = admin_url( 'admin.php' );
2904
+			$redirect_url = admin_url('admin.php');
2905 2905
 		}
2906 2906
 
2907 2907
 		//merge any default query_args set in _default_route_query_args property
2908
-		if ( ! empty( $this->_default_route_query_args ) && ! $this->_is_UI_request ) {
2908
+		if ( ! empty($this->_default_route_query_args) && ! $this->_is_UI_request) {
2909 2909
 			$args_to_merge = array();
2910
-			foreach ( $this->_default_route_query_args as $query_param => $query_value ) {
2910
+			foreach ($this->_default_route_query_args as $query_param => $query_value) {
2911 2911
 				//is there a wp_referer array in our _default_route_query_args property?
2912
-				if ( $query_param == 'wp_referer'  ) {
2912
+				if ($query_param == 'wp_referer') {
2913 2913
 					$query_value = (array) $query_value;
2914
-					foreach ( $query_value as $reference => $value ) {
2915
-						if ( strpos( $reference, 'nonce' ) !== false ) {
2914
+					foreach ($query_value as $reference => $value) {
2915
+						if (strpos($reference, 'nonce') !== false) {
2916 2916
 							continue;
2917 2917
 						}
2918 2918
 
2919 2919
 						//finally we will override any arguments in the referer with
2920 2920
 						//what might be set on the _default_route_query_args array.
2921
-						if ( isset( $this->_default_route_query_args[$reference] ) ) {
2922
-							$args_to_merge[$reference] = urlencode( $this->_default_route_query_args[$reference] );
2921
+						if (isset($this->_default_route_query_args[$reference])) {
2922
+							$args_to_merge[$reference] = urlencode($this->_default_route_query_args[$reference]);
2923 2923
 						} else {
2924
-							$args_to_merge[$reference] = urlencode( $value );
2924
+							$args_to_merge[$reference] = urlencode($value);
2925 2925
 						}
2926 2926
 					}
2927 2927
 					continue;
@@ -2932,7 +2932,7 @@  discard block
 block discarded – undo
2932 2932
 
2933 2933
 			//now let's merge these arguments but override with what was specifically sent in to the
2934 2934
 			//redirect.
2935
-			$query_args = array_merge( $args_to_merge, $query_args );
2935
+			$query_args = array_merge($args_to_merge, $query_args);
2936 2936
 		}
2937 2937
 
2938 2938
 		$this->_process_notices($query_args);
@@ -2941,19 +2941,19 @@  discard block
 block discarded – undo
2941 2941
 		// generate redirect url
2942 2942
 
2943 2943
 		// if redirecting to anything other than the main page, add a nonce
2944
-		if ( isset( $query_args['action'] )) {
2944
+		if (isset($query_args['action'])) {
2945 2945
 			// manually generate wp_nonce and merge that with the query vars becuz the wp_nonce_url function wrecks havoc on some vars
2946
-			$query_args['_wpnonce'] = wp_create_nonce( $query_args['action'] . '_nonce' );
2946
+			$query_args['_wpnonce'] = wp_create_nonce($query_args['action'].'_nonce');
2947 2947
 		}
2948 2948
 
2949 2949
 		//we're adding some hooks and filters in here for processing any things just before redirects (example: an admin page has done an insert or update and we want to run something after that).
2950
-		do_action( 'AHEE_redirect_' . $classname . $this->_req_action, $query_args );
2950
+		do_action('AHEE_redirect_'.$classname.$this->_req_action, $query_args);
2951 2951
 
2952
-		$redirect_url = apply_filters( 'FHEE_redirect_' . $classname . $this->_req_action, self::add_query_args_and_nonce( $query_args, $redirect_url ), $query_args );
2952
+		$redirect_url = apply_filters('FHEE_redirect_'.$classname.$this->_req_action, self::add_query_args_and_nonce($query_args, $redirect_url), $query_args);
2953 2953
 
2954 2954
 
2955 2955
 		// check if we're doing ajax.  If we are then lets just return the results and js can handle how it wants.
2956
-		if ( defined('DOING_AJAX' ) ) {
2956
+		if (defined('DOING_AJAX')) {
2957 2957
 			$default_data = array(
2958 2958
 				'close' => TRUE,
2959 2959
 				'redirect_url' => $redirect_url,
@@ -2962,11 +2962,11 @@  discard block
 block discarded – undo
2962 2962
 				);
2963 2963
 
2964 2964
 			$this->_template_args['success'] = $success;
2965
-			$this->_template_args['data'] = !empty($this->_template_args['data']) ? array_merge($default_data, $this->_template_args['data'] ): $default_data;
2965
+			$this->_template_args['data'] = ! empty($this->_template_args['data']) ? array_merge($default_data, $this->_template_args['data']) : $default_data;
2966 2966
 			$this->_return_json();
2967 2967
 		}
2968 2968
 
2969
-		wp_safe_redirect( $redirect_url );
2969
+		wp_safe_redirect($redirect_url);
2970 2970
 		exit();
2971 2971
 	}
2972 2972
 
@@ -2982,30 +2982,30 @@  discard block
 block discarded – undo
2982 2982
 	 * @param bool    $sticky_notices      This is used to flag that regardless of whether this is doing_ajax or not, we still save a transient for the notice.
2983 2983
 	 * @return void
2984 2984
 	 */
2985
-	protected function _process_notices( $query_args = array(), $skip_route_verify = FALSE , $sticky_notices = TRUE ) {
2985
+	protected function _process_notices($query_args = array(), $skip_route_verify = FALSE, $sticky_notices = TRUE) {
2986 2986
 
2987 2987
 		//first let's set individual error properties if doing_ajax and the properties aren't already set.
2988
-		if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2989
-			$notices = EE_Error::get_notices( false );
2990
-			if ( empty( $this->_template_args['success'] ) ) {
2991
-				$this->_template_args['success'] = isset( $notices['success'] ) ? $notices['success'] : false;
2988
+		if (defined('DOING_AJAX') && DOING_AJAX) {
2989
+			$notices = EE_Error::get_notices(false);
2990
+			if (empty($this->_template_args['success'])) {
2991
+				$this->_template_args['success'] = isset($notices['success']) ? $notices['success'] : false;
2992 2992
 			}
2993 2993
 
2994
-			if ( empty( $this->_template_args['errors'] ) ) {
2995
-				$this->_template_args['errors'] = isset( $notices['errors'] ) ? $notices['errors'] : false;
2994
+			if (empty($this->_template_args['errors'])) {
2995
+				$this->_template_args['errors'] = isset($notices['errors']) ? $notices['errors'] : false;
2996 2996
 			}
2997 2997
 
2998
-			if ( empty( $this->_template_args['attention'] ) ) {
2999
-				$this->_template_args['attention'] = isset( $notices['attention'] ) ? $notices['attention'] : false;
2998
+			if (empty($this->_template_args['attention'])) {
2999
+				$this->_template_args['attention'] = isset($notices['attention']) ? $notices['attention'] : false;
3000 3000
 			}
3001 3001
 		}
3002 3002
 
3003 3003
 		$this->_template_args['notices'] = EE_Error::get_notices();
3004 3004
 
3005 3005
 		//IF this isn't ajax we need to create a transient for the notices using the route (however, overridden if $sticky_notices == true)
3006
-		if ( ! defined( 'DOING_AJAX' ) || $sticky_notices ) {
3007
-			$route = isset( $query_args['action'] ) ? $query_args['action'] : 'default';
3008
-			$this->_add_transient( $route, $this->_template_args['notices'], TRUE, $skip_route_verify );
3006
+		if ( ! defined('DOING_AJAX') || $sticky_notices) {
3007
+			$route = isset($query_args['action']) ? $query_args['action'] : 'default';
3008
+			$this->_add_transient($route, $this->_template_args['notices'], TRUE, $skip_route_verify);
3009 3009
 		}
3010 3010
 	}
3011 3011
 
@@ -3027,32 +3027,32 @@  discard block
 block discarded – undo
3027 3027
 	 *
3028 3028
 	 * @return string html for button
3029 3029
 	 */
3030
-	public function get_action_link_or_button($action, $type = 'add', $extra_request = array(), $class = 'button-primary', $base_url = FALSE, $exclude_nonce = false ) {
3030
+	public function get_action_link_or_button($action, $type = 'add', $extra_request = array(), $class = 'button-primary', $base_url = FALSE, $exclude_nonce = false) {
3031 3031
 		//first let's validate the action (if $base_url is FALSE otherwise validation will happen further along)
3032
-		if ( !isset($this->_page_routes[$action]) && !$base_url )
3033
-			throw new EE_Error( sprintf( __('There is no page route for given action for the button.  This action was given: %s', 'event_espresso'), $action) );
3032
+		if ( ! isset($this->_page_routes[$action]) && ! $base_url)
3033
+			throw new EE_Error(sprintf(__('There is no page route for given action for the button.  This action was given: %s', 'event_espresso'), $action));
3034 3034
 
3035
-		if ( !isset( $this->_labels['buttons'][$type] ) )
3036
-			throw new EE_Error( sprintf( __('There is no label for the given button type (%s). Labels are set in the <code>_page_config</code> property.', 'event_espresso'), $type) );
3035
+		if ( ! isset($this->_labels['buttons'][$type]))
3036
+			throw new EE_Error(sprintf(__('There is no label for the given button type (%s). Labels are set in the <code>_page_config</code> property.', 'event_espresso'), $type));
3037 3037
 
3038 3038
 		//finally check user access for this button.
3039
-		$has_access = $this->check_user_access( $action, TRUE );
3040
-		if ( ! $has_access ) {
3039
+		$has_access = $this->check_user_access($action, TRUE);
3040
+		if ( ! $has_access) {
3041 3041
 			return '';
3042 3042
 		}
3043 3043
 
3044
-		$_base_url = !$base_url ? $this->_admin_base_url : $base_url;
3044
+		$_base_url = ! $base_url ? $this->_admin_base_url : $base_url;
3045 3045
 
3046 3046
 		$query_args = array(
3047 3047
 			'action' => $action  );
3048 3048
 
3049 3049
 		//merge extra_request args but make sure our original action takes precedence and doesn't get overwritten.
3050
-		if ( !empty($extra_request) )
3051
-			$query_args = array_merge( $extra_request, $query_args );
3050
+		if ( ! empty($extra_request))
3051
+			$query_args = array_merge($extra_request, $query_args);
3052 3052
 
3053
-		$url = self::add_query_args_and_nonce( $query_args, $_base_url, false, $exclude_nonce );
3053
+		$url = self::add_query_args_and_nonce($query_args, $_base_url, false, $exclude_nonce);
3054 3054
 
3055
-		$button = EEH_Template::get_button_or_link( $url, $this->_labels['buttons'][$type], $class );
3055
+		$button = EEH_Template::get_button_or_link($url, $this->_labels['buttons'][$type], $class);
3056 3056
 
3057 3057
 		return $button;
3058 3058
 	}
@@ -3072,11 +3072,11 @@  discard block
 block discarded – undo
3072 3072
 		$args = array(
3073 3073
 			'label' => $this->_admin_page_title,
3074 3074
 			'default' => 10,
3075
-			'option' => $this->_current_page . '_' . $this->_current_view . '_per_page'
3075
+			'option' => $this->_current_page.'_'.$this->_current_view.'_per_page'
3076 3076
 			);
3077 3077
 		//ONLY add the screen option if the user has access to it.
3078
-		if ( $this->check_user_access( $this->_current_view, true ) ) {
3079
-			add_screen_option( $option, $args );
3078
+		if ($this->check_user_access($this->_current_view, true)) {
3079
+			add_screen_option($option, $args);
3080 3080
 		}
3081 3081
 	}
3082 3082
 
@@ -3092,36 +3092,36 @@  discard block
 block discarded – undo
3092 3092
 	 * @return void
3093 3093
 	 */
3094 3094
 	private function _set_per_page_screen_options() {
3095
-		if ( isset($_POST['wp_screen_options']) && is_array($_POST['wp_screen_options']) ) {
3096
-			check_admin_referer( 'screen-options-nonce', 'screenoptionnonce' );
3095
+		if (isset($_POST['wp_screen_options']) && is_array($_POST['wp_screen_options'])) {
3096
+			check_admin_referer('screen-options-nonce', 'screenoptionnonce');
3097 3097
 
3098
-			if ( !$user = wp_get_current_user() )
3098
+			if ( ! $user = wp_get_current_user())
3099 3099
 			return;
3100 3100
 			$option = $_POST['wp_screen_options']['option'];
3101 3101
 			$value = $_POST['wp_screen_options']['value'];
3102 3102
 
3103
-			if ( $option != sanitize_key( $option ) )
3103
+			if ($option != sanitize_key($option))
3104 3104
 				return;
3105 3105
 
3106 3106
 			$map_option = $option;
3107 3107
 
3108 3108
 			$option = str_replace('-', '_', $option);
3109 3109
 
3110
-			switch ( $map_option ) {
3111
-				case $this->_current_page . '_' .  $this->_current_view . '_per_page':
3110
+			switch ($map_option) {
3111
+				case $this->_current_page.'_'.$this->_current_view.'_per_page':
3112 3112
 					$value = (int) $value;
3113
-					if ( $value < 1 || $value > 999 )
3113
+					if ($value < 1 || $value > 999)
3114 3114
 						return;
3115 3115
 					break;
3116 3116
 				default:
3117
-					$value = apply_filters( 'FHEE__EE_Admin_Page___set_per_page_screen_options__value', false, $option, $value );
3118
-					if ( false === $value )
3117
+					$value = apply_filters('FHEE__EE_Admin_Page___set_per_page_screen_options__value', false, $option, $value);
3118
+					if (false === $value)
3119 3119
 						return;
3120 3120
 					break;
3121 3121
 			}
3122 3122
 
3123 3123
 			update_user_meta($user->ID, $option, $value);
3124
-			wp_safe_redirect( remove_query_arg( array('pagenum', 'apage', 'paged'), wp_get_referer() ) );
3124
+			wp_safe_redirect(remove_query_arg(array('pagenum', 'apage', 'paged'), wp_get_referer()));
3125 3125
 			exit;
3126 3126
 		}
3127 3127
 	}
@@ -3132,8 +3132,8 @@  discard block
 block discarded – undo
3132 3132
 	 * This just allows for setting the $_template_args property if it needs to be set outside the object
3133 3133
 	 * @param array $data array that will be assigned to template args.
3134 3134
 	 */
3135
-	public function set_template_args( $data ) {
3136
-		$this->_template_args = array_merge( $this->_template_args, (array) $data );
3135
+	public function set_template_args($data) {
3136
+		$this->_template_args = array_merge($this->_template_args, (array) $data);
3137 3137
 	}
3138 3138
 
3139 3139
 
@@ -3149,26 +3149,26 @@  discard block
 block discarded – undo
3149 3149
 	 * @param bool $skip_route_verify Used to indicate we want to skip route verification.  This is usually ONLY used when we are adding a transient before page_routes have been defined.
3150 3150
 	 * @return void
3151 3151
 	 */
3152
-	protected function _add_transient( $route, $data, $notices = FALSE, $skip_route_verify = FALSE ) {
3152
+	protected function _add_transient($route, $data, $notices = FALSE, $skip_route_verify = FALSE) {
3153 3153
 		$user_id = get_current_user_id();
3154 3154
 
3155
-		if ( !$skip_route_verify )
3155
+		if ( ! $skip_route_verify)
3156 3156
 			$this->_verify_route($route);
3157 3157
 
3158 3158
 
3159 3159
 		//now let's set the string for what kind of transient we're setting
3160
-		$transient = $notices ? 'ee_rte_n_tx_' . $route . '_' . $user_id : 'rte_tx_' . $route . '_' . $user_id;
3161
-		$data = $notices ? array( 'notices' => $data ) : $data;
3160
+		$transient = $notices ? 'ee_rte_n_tx_'.$route.'_'.$user_id : 'rte_tx_'.$route.'_'.$user_id;
3161
+		$data = $notices ? array('notices' => $data) : $data;
3162 3162
 		//is there already a transient for this route?  If there is then let's ADD to that transient
3163
-		$existing = is_multisite() && is_network_admin() ? get_site_transient( $transient ) : get_transient( $transient );
3164
-		if ( $existing ) {
3165
-			$data = array_merge( (array) $data, (array) $existing );
3163
+		$existing = is_multisite() && is_network_admin() ? get_site_transient($transient) : get_transient($transient);
3164
+		if ($existing) {
3165
+			$data = array_merge((array) $data, (array) $existing);
3166 3166
 		}
3167 3167
 
3168
-		if ( is_multisite() && is_network_admin() ) {
3169
-			set_site_transient( $transient, $data, 8 );
3168
+		if (is_multisite() && is_network_admin()) {
3169
+			set_site_transient($transient, $data, 8);
3170 3170
 		} else {
3171
-			set_transient( $transient, $data, 8 );
3171
+			set_transient($transient, $data, 8);
3172 3172
 		}
3173 3173
 	}
3174 3174
 
@@ -3180,18 +3180,18 @@  discard block
 block discarded – undo
3180 3180
 	 * @param bool $notices true we get notices transient. False we just return normal route transient
3181 3181
 	 * @return mixed data
3182 3182
 	 */
3183
-	protected function _get_transient( $notices = FALSE, $route = FALSE ) {
3183
+	protected function _get_transient($notices = FALSE, $route = FALSE) {
3184 3184
 		$user_id = get_current_user_id();
3185
-		$route = !$route ? $this->_req_action : $route;
3186
-		$transient = $notices ? 'ee_rte_n_tx_' . $route . '_' . $user_id : 'rte_tx_' . $route . '_' . $user_id;
3187
-		$data = is_multisite() && is_network_admin() ? get_site_transient( $transient ) : get_transient( $transient );
3185
+		$route = ! $route ? $this->_req_action : $route;
3186
+		$transient = $notices ? 'ee_rte_n_tx_'.$route.'_'.$user_id : 'rte_tx_'.$route.'_'.$user_id;
3187
+		$data = is_multisite() && is_network_admin() ? get_site_transient($transient) : get_transient($transient);
3188 3188
 		//delete transient after retrieval (just in case it hasn't expired);
3189
-		if ( is_multisite() && is_network_admin() ) {
3190
-			delete_site_transient( $transient );
3189
+		if (is_multisite() && is_network_admin()) {
3190
+			delete_site_transient($transient);
3191 3191
 		} else {
3192
-			delete_transient( $transient );
3192
+			delete_transient($transient);
3193 3193
 		}
3194
-		return $notices && isset( $data['notices'] ) ? $data['notices'] : $data;
3194
+		return $notices && isset($data['notices']) ? $data['notices'] : $data;
3195 3195
 	}
3196 3196
 
3197 3197
 
@@ -3208,12 +3208,12 @@  discard block
 block discarded – undo
3208 3208
 
3209 3209
 		//retrieve all existing transients
3210 3210
 		$query = "SELECT option_name FROM $wpdb->options WHERE option_name LIKE '%rte_tx_%' OR option_name LIKE '%rte_n_tx_%'";
3211
-		if ( $results = $wpdb->get_results( $query ) ) {
3212
-			foreach ( $results as $result ) {
3213
-				$transient = str_replace( '_transient_', '', $result->option_name );
3214
-				get_transient( $transient );
3215
-				if ( is_multisite() && is_network_admin() ) {
3216
-					get_site_transient( $transient );
3211
+		if ($results = $wpdb->get_results($query)) {
3212
+			foreach ($results as $result) {
3213
+				$transient = str_replace('_transient_', '', $result->option_name);
3214
+				get_transient($transient);
3215
+				if (is_multisite() && is_network_admin()) {
3216
+					get_site_transient($transient);
3217 3217
 				}
3218 3218
 			}
3219 3219
 		}
@@ -3337,23 +3337,23 @@  discard block
 block discarded – undo
3337 3337
 	 * @param string $line	line no where error occurred
3338 3338
 	 * @return boolean
3339 3339
 	 */
3340
-	protected function _update_espresso_configuration( $tab, $config, $file = '', $func = '', $line = '' ) {
3340
+	protected function _update_espresso_configuration($tab, $config, $file = '', $func = '', $line = '') {
3341 3341
 
3342 3342
 		//remove any options that are NOT going to be saved with the config settings.
3343
-		if ( isset( $config->core->ee_ueip_optin ) ) {
3343
+		if (isset($config->core->ee_ueip_optin)) {
3344 3344
 			$config->core->ee_ueip_has_notified = TRUE;
3345 3345
 			// TODO: remove the following two lines and make sure values are migrated from 3.1
3346
-			update_option( 'ee_ueip_optin', $config->core->ee_ueip_optin);
3347
-			update_option( 'ee_ueip_has_notified', TRUE );
3346
+			update_option('ee_ueip_optin', $config->core->ee_ueip_optin);
3347
+			update_option('ee_ueip_has_notified', TRUE);
3348 3348
 		}
3349 3349
 		// and save it (note we're also doing the network save here)
3350
-		$net_saved = is_main_site() ? EE_Network_Config::instance()->update_config( FALSE, FALSE ) : TRUE;
3351
-		$config_saved = EE_Config::instance()->update_espresso_config( FALSE, FALSE );
3352
-		if ( $config_saved && $net_saved ) {
3353
-			EE_Error::add_success( sprintf( __('"%s" have been successfully updated.', 'event_espresso'), $tab ));
3350
+		$net_saved = is_main_site() ? EE_Network_Config::instance()->update_config(FALSE, FALSE) : TRUE;
3351
+		$config_saved = EE_Config::instance()->update_espresso_config(FALSE, FALSE);
3352
+		if ($config_saved && $net_saved) {
3353
+			EE_Error::add_success(sprintf(__('"%s" have been successfully updated.', 'event_espresso'), $tab));
3354 3354
 			return TRUE;
3355 3355
 		} else {
3356
-			EE_Error::add_error( sprintf( __('The "%s" were not updated.', 'event_espresso'), $tab ), $file, $func, $line  );
3356
+			EE_Error::add_error(sprintf(__('The "%s" were not updated.', 'event_espresso'), $tab), $file, $func, $line);
3357 3357
 			return FALSE;
3358 3358
 		}
3359 3359
 	}
@@ -3366,7 +3366,7 @@  discard block
 block discarded – undo
3366 3366
 	 * Returns an array to be used for EE_FOrm_Fields.helper.php's select_input as the $values argument.
3367 3367
 	 * @return array
3368 3368
 	 */
3369
-	public function get_yes_no_values(){
3369
+	public function get_yes_no_values() {
3370 3370
 		return $this->_yes_no_values;
3371 3371
 	}
3372 3372
 
@@ -3388,8 +3388,8 @@  discard block
 block discarded – undo
3388 3388
 	 *
3389 3389
 	 * @return string
3390 3390
 	 */
3391
-	protected function _next_link( $url, $class = 'dashicons dashicons-arrow-right' ) {
3392
-		return '<a class="' . $class . '" href="' . $url . '"></a>';
3391
+	protected function _next_link($url, $class = 'dashicons dashicons-arrow-right') {
3392
+		return '<a class="'.$class.'" href="'.$url.'"></a>';
3393 3393
 	}
3394 3394
 
3395 3395
 
@@ -3403,8 +3403,8 @@  discard block
 block discarded – undo
3403 3403
 	 *
3404 3404
 	 * @return string
3405 3405
 	 */
3406
-	protected function _previous_link( $url, $class = 'dashicons dashicons-arrow-left' ) {
3407
-		return '<a class="' . $class . '" href="' . $url . '"></a>';
3406
+	protected function _previous_link($url, $class = 'dashicons dashicons-arrow-left') {
3407
+		return '<a class="'.$class.'" href="'.$url.'"></a>';
3408 3408
 	}
3409 3409
 
3410 3410
 
@@ -3423,8 +3423,8 @@  discard block
 block discarded – undo
3423 3423
 	 * @return bool success/fail
3424 3424
 	 */
3425 3425
 	protected function _process_resend_registration() {
3426
-		$this->_template_args['success'] = EED_Messages::process_resend( $this->_req_data );
3427
-		do_action( 'AHEE__EE_Admin_Page___process_resend_registration', $this->_template_args['success'], $this->_req_data );
3426
+		$this->_template_args['success'] = EED_Messages::process_resend($this->_req_data);
3427
+		do_action('AHEE__EE_Admin_Page___process_resend_registration', $this->_template_args['success'], $this->_req_data);
3428 3428
 		return $this->_template_args['success'];
3429 3429
 	}
3430 3430
 
@@ -3437,11 +3437,11 @@  discard block
 block discarded – undo
3437 3437
 	 * @param \EE_Payment $payment
3438 3438
 	 * @return bool success/fail
3439 3439
 	 */
3440
-	protected function _process_payment_notification( EE_Payment $payment ) {
3441
-		add_filter( 'FHEE__EE_Payment_Processor__process_registration_payments__display_notifications', '__return_true' );
3442
-		do_action( 'AHEE__EE_Admin_Page___process_admin_payment_notification', $payment );
3443
-		$this->_template_args['success'] = apply_filters( 'FHEE__EE_Admin_Page___process_admin_payment_notification__success', false, $payment );
3444
-		return $this->_template_args[ 'success' ];
3440
+	protected function _process_payment_notification(EE_Payment $payment) {
3441
+		add_filter('FHEE__EE_Payment_Processor__process_registration_payments__display_notifications', '__return_true');
3442
+		do_action('AHEE__EE_Admin_Page___process_admin_payment_notification', $payment);
3443
+		$this->_template_args['success'] = apply_filters('FHEE__EE_Admin_Page___process_admin_payment_notification__success', false, $payment);
3444
+		return $this->_template_args['success'];
3445 3445
 	}
3446 3446
 
3447 3447
 
Please login to merge, or discard this patch.