Completed
Branch models-cleanup/main (0d2dda)
by
unknown
09:34
created
modules/events_archive_filters/EED_Events_Archive_Filters.module.php 3 patches
Doc Comments   +14 added lines, -13 removed lines patch added patch discarded remove patch
@@ -247,6 +247,7 @@  discard block
 block discarded – undo
247 247
      * @access    public
248 248
      * @param    mixed boolean|string    $join_terms pass TRUE or term string, doesn't really matter since this value
249 249
      *                                   doesn't really get used for anything yet
250
+     * @param string $join_terms
250 251
      * @return    string
251 252
      */
252 253
     public static function posts_join_sql_for_terms($join_terms = null)
@@ -422,7 +423,7 @@  discard block
 block discarded – undo
422 423
      *    or else some of the table references below will result in MySQL errors
423 424
      *
424 425
      * @access    public
425
-     * @param    boolean $orderby_params
426
+     * @param    string[] $orderby_params
426 427
      * @return    string
427 428
      */
428 429
     public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC')
@@ -535,7 +536,7 @@  discard block
 block discarded – undo
535 536
      *
536 537
      * @access    public
537 538
      * @param        string $content
538
-     * @return        void
539
+     * @return        string
539 540
      */
540 541
     public function event_details($content)
541 542
     {
@@ -552,7 +553,7 @@  discard block
 block discarded – undo
552 553
      *
553 554
      * @access    public
554 555
      * @param        string $content
555
-     * @return        void
556
+     * @return        string
556 557
      */
557 558
     public function event_tickets($content)
558 559
     {
@@ -569,7 +570,7 @@  discard block
 block discarded – undo
569 570
      *
570 571
      * @access    public
571 572
      * @param        string $content
572
-     * @return        void
573
+     * @return        string
573 574
      */
574 575
     public function event_datetimes($content)
575 576
     {
@@ -586,7 +587,7 @@  discard block
 block discarded – undo
586 587
      *
587 588
      * @access    public
588 589
      * @param        string $content
589
-     * @return        void
590
+     * @return        string
590 591
      */
591 592
     public function event_venues($content)
592 593
     {
@@ -635,7 +636,7 @@  discard block
 block discarded – undo
635 636
      *    excerpt_length
636 637
      *
637 638
      * @access    public
638
-     * @return    void
639
+     * @return    integer|null
639 640
      */
640 641
     public function excerpt_length($length)
641 642
     {
@@ -665,7 +666,7 @@  discard block
 block discarded – undo
665 666
      *    excerpt_more
666 667
      *
667 668
      * @access    public
668
-     * @return    void
669
+     * @return    string
669 670
      */
670 671
     public function excerpt_more($more)
671 672
     {
@@ -866,7 +867,7 @@  discard block
 block discarded – undo
866 867
      *    get_template_part
867 868
      *
868 869
      * @access    public
869
-     * @return    void
870
+     * @return    string|null
870 871
      */
871 872
     public static function get_template_part()
872 873
     {
@@ -910,7 +911,7 @@  discard block
 block discarded – undo
910 911
      *    event_list_css
911 912
      *
912 913
      * @access    public
913
-     * @return    void
914
+     * @return    string
914 915
      */
915 916
     public static function event_list_css($extra_class = '')
916 917
     {
@@ -946,7 +947,7 @@  discard block
 block discarded – undo
946 947
      *    display_description
947 948
      *
948 949
      * @access    public
949
-     * @return    void
950
+     * @return    boolean
950 951
      */
951 952
     public static function display_description($value)
952 953
     {
@@ -961,7 +962,7 @@  discard block
 block discarded – undo
961 962
      *    display_venue_details
962 963
      *
963 964
      * @access    public
964
-     * @return    void
965
+     * @return    boolean
965 966
      */
966 967
     public static function display_venue_details()
967 968
     {
@@ -977,7 +978,7 @@  discard block
 block discarded – undo
977 978
      *    display_address
978 979
      *
979 980
      * @access    public
980
-     * @return    void
981
+     * @return    boolean
981 982
      */
982 983
     public static function display_address()
983 984
     {
@@ -993,7 +994,7 @@  discard block
 block discarded – undo
993 994
      *    pagination
994 995
      *
995 996
      * @access    public
996
-     * @return    void
997
+     * @return    string
997 998
      */
998 999
     public static function pagination()
999 1000
     {
Please login to merge, or discard this patch.
Indentation   +1026 added lines, -1026 removed lines patch added patch discarded remove patch
@@ -13,1030 +13,1030 @@
 block discarded – undo
13 13
 {
14 14
 
15 15
 
16
-    /**
17
-     * @return EED_Events_Archive_Filters
18
-     */
19
-    public static function instance()
20
-    {
21
-        return parent::get_instance(__CLASS__);
22
-    }
23
-
24
-
25
-    /**
26
-     *    Start Date
27
-     *
28
-     * @var    $_elf_month
29
-     * @access    protected
30
-     */
31
-    protected $_elf_month = null;
32
-
33
-
34
-    /**
35
-     *    Category
36
-     *
37
-     * @var    $_elf_category
38
-     * @access    protected
39
-     */
40
-    protected $_elf_category = null;
41
-
42
-
43
-    /**
44
-     *    whether to display expired events in the event list
45
-     *
46
-     * @var    $_show_expired
47
-     * @access    protected
48
-     */
49
-    protected $_show_expired = null;
50
-
51
-
52
-    /**
53
-     *    whether to display the event list as a grid or list
54
-     *
55
-     * @var    $_type
56
-     * @access    protected
57
-     */
58
-    protected static $_type = null;
59
-
60
-
61
-    /**
62
-     *    array of existing event list views
63
-     *
64
-     * @var    $_types
65
-     * @access    protected
66
-     */
67
-    protected static $_types = array('grid', 'text', 'dates');
68
-
69
-
70
-
71
-    /**
72
-     *    set_hooks - for hooking into EE Core, other modules, etc
73
-     *
74
-     * @access    public
75
-     * @return    void
76
-     */
77
-    public static function set_hooks()
78
-    {
79
-    }
80
-
81
-    /**
82
-     *    set_hooks_admin - for hooking into EE Admin Core, other modules, etc
83
-     *
84
-     * @access    public
85
-     * @return    void
86
-     */
87
-    public static function set_hooks_admin()
88
-    {
89
-    }
90
-
91
-
92
-    /**
93
-     *    set_definitions
94
-     *
95
-     * @access    public
96
-     * @return    void
97
-     */
98
-    public static function set_definitions()
99
-    {
100
-    }
101
-
102
-
103
-    /**
104
-     *    run - initial module setup
105
-     *
106
-     * @access    public
107
-     * @return    void
108
-     */
109
-    public function run($WP)
110
-    {
111
-    }
112
-
113
-
114
-    /**
115
-     *    event_list
116
-     *
117
-     * @access    public
118
-     * @return    void
119
-     */
120
-    public function event_list()
121
-    {
122
-        // load other required components
123
-        $this->_load_assests();
124
-    }
125
-
126
-
127
-    /**
128
-     *    _filter_query_parts
129
-     *
130
-     * @access    public
131
-     * @return    void
132
-     */
133
-    private function _filter_query_parts()
134
-    {
135
-        // build event list query
136
-        add_filter('posts_join', array($this, 'posts_join'), 1, 2);
137
-        add_filter('posts_where', array($this, 'posts_where'), 1, 2);
138
-        add_filter('posts_orderby', array($this, 'posts_orderby'), 1, 2);
139
-    }
140
-
141
-    /**
142
-     *    _type - the type of event list : grid, text, dates
143
-     *
144
-     * @access    public
145
-     * @return    string
146
-     */
147
-    public static function set_type()
148
-    {
149
-        do_action('AHEE__EED_Events_Archive_Filters__before_set_type');
150
-        EED_Events_Archive_Filters::$_types = apply_filters(
151
-            'EED_Events_Archive_Filters__set_type__types',
152
-            EED_Events_Archive_Filters::$_types
153
-        );
154
-        $view = isset(EE_Registry::instance()->CFG->EED_Events_Archive_Filters['default_type']) ? EE_Registry::instance(
155
-        )->CFG->EED_Events_Archive_Filters['default_type'] : 'grid';
156
-        $elf_type = EE_Registry::instance()->REQ->is_set('elf_type') ? sanitize_text_field(
157
-            EE_Registry::instance()->REQ->get('elf_type')
158
-        ) : '';
159
-        $view = ! empty($elf_type) ? $elf_type : $view;
160
-        $view = apply_filters('EED_Events_Archive_Filters__set_type__type', $view);
161
-        if (! empty($view) && in_array($view, EED_Events_Archive_Filters::$_types)) {
162
-            self::$_type = $view;
163
-        }
164
-    }
165
-
166
-    /**
167
-     *    _show_expired
168
-     *
169
-     * @access    private
170
-     * @param    boolean $req_only if TRUE, then ignore defaults and only return $_POST value
171
-     * @return    boolean
172
-     */
173
-    private static function _show_expired($req_only = false)
174
-    {
175
-        // get default value for "display_expired_events" as set in the EE General Settings > Templates > Event Listings
176
-        $show_expired = ! $req_only && isset(
177
-            EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events']
178
-        ) ? EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events'] : false;
179
-        // override default expired option if set via filter
180
-        $show_expired = EE_Registry::instance()->REQ->is_set('elf_expired_chk') ? absint(
181
-            EE_Registry::instance()->REQ->get('elf_expired_chk')
182
-        ) : $show_expired;
183
-        return $show_expired ? true : false;
184
-    }
185
-
186
-    /**
187
-     *    _event_category_slug
188
-     *
189
-     * @access    private
190
-     * @return    string
191
-     */
192
-    private static function _event_category_slug()
193
-    {
194
-        return EE_Registry::instance()->REQ->is_set('elf_category_dd') ? sanitize_text_field(
195
-            EE_Registry::instance()->REQ->get('elf_category_dd')
196
-        ) : '';
197
-    }
198
-
199
-    /**
200
-     *    _display_month - what month should the event list display events for?
201
-     *
202
-     * @access    private
203
-     * @return    string
204
-     */
205
-    private static function _display_month()
206
-    {
207
-        return EE_Registry::instance()->REQ->is_set('elf_month_dd') ? sanitize_text_field(
208
-            EE_Registry::instance()->REQ->get('elf_month_dd')
209
-        ) : '';
210
-    }
211
-
212
-
213
-    /**
214
-     *    get_post_data
215
-     *
216
-     * @access    public
217
-     * @return    void
218
-     */
219
-    public function get_post_data()
220
-    {
221
-        $this->_elf_month = EED_Events_Archive_Filters::_display_month();
222
-        $this->_elf_category = EED_Events_Archive_Filters::_event_category_slug();
223
-        $this->_show_expired = EED_Events_Archive_Filters::_show_expired(true);
224
-    }
225
-
226
-
227
-    /**
228
-     *    posts_join
229
-     *
230
-     * @access    public
231
-     * @return    void
232
-     */
233
-    public function posts_join($SQL, WP_Query $wp_query)
234
-    {
235
-        if (isset($wp_query->query) && isset($wp_query->query['post_type']) && $wp_query->query['post_type'] == 'espresso_events') {
236
-            // Category
237
-            $SQL .= EED_Events_Archive_Filters::posts_join_sql_for_terms(
238
-                EED_Events_Archive_Filters::_event_category_slug()
239
-            );
240
-        }
241
-        return $SQL;
242
-    }
243
-
244
-
245
-    /**
246
-     *    posts_join_sql_for_terms
247
-     *
248
-     * @access    public
249
-     * @param    mixed boolean|string    $join_terms pass TRUE or term string, doesn't really matter since this value
250
-     *                                   doesn't really get used for anything yet
251
-     * @return    string
252
-     */
253
-    public static function posts_join_sql_for_terms($join_terms = null)
254
-    {
255
-        $SQL = '';
256
-        if (! empty($join_terms)) {
257
-            global $wpdb;
258
-            $SQL .= " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)";
259
-            $SQL .= " LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)";
260
-            $SQL .= " LEFT JOIN $wpdb->terms ON ($wpdb->terms.term_id = $wpdb->term_taxonomy.term_id) ";
261
-        }
262
-        return $SQL;
263
-    }
264
-
265
-
266
-    /**
267
-     *    posts_join_for_orderby
268
-     *    usage:  $SQL .= EED_Events_Archive_Filters::posts_join_for_orderby( $orderby_params );
269
-     *
270
-     * @access    public
271
-     * @param    array $orderby_params
272
-     * @return    string
273
-     */
274
-    public static function posts_join_for_orderby($orderby_params = array())
275
-    {
276
-        global $wpdb;
277
-        $SQL = '';
278
-        $orderby_params = is_array($orderby_params) ? $orderby_params : array($orderby_params);
279
-        foreach ($orderby_params as $orderby) {
280
-            switch ($orderby) {
281
-                case 'ticket_start':
282
-                case 'ticket_end':
283
-                    $SQL .= ' LEFT JOIN ' . EEM_Datetime_Ticket::instance()->table() . ' ON ('
284
-                            . EEM_Datetime::instance()->table() . '.DTT_ID = '
285
-                            . EEM_Datetime_Ticket::instance()->table() . '.DTT_ID )';
286
-                    $SQL .= ' LEFT JOIN ' . EEM_Ticket::instance()->table() . ' ON ('
287
-                            . EEM_Datetime_Ticket::instance()->table() . '.TKT_ID = '
288
-                            . EEM_Ticket::instance()->table() . '.TKT_ID )';
289
-                    break;
290
-
291
-                case 'venue_title':
292
-                case 'city':
293
-                    $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = '
294
-                            . EEM_Event_Venue::instance()->table() . '.EVT_ID )';
295
-                    $SQL .= ' LEFT JOIN ' . EEM_Venue::instance()->table() . ' ON ('
296
-                            . EEM_Event_Venue::instance()->table() . '.VNU_ID = '
297
-                            . EEM_Venue::instance()->table() . '.VNU_ID )';
298
-                    break;
299
-
300
-                case 'state':
301
-                    $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = '
302
-                            . EEM_Event_Venue::instance()->table() . '.EVT_ID )';
303
-                    $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->second_table() . ' ON ('
304
-                            . EEM_Event_Venue::instance()->table() . '.VNU_ID = '
305
-                            . EEM_Event_Venue::instance()->second_table() . '.VNU_ID )';
306
-                    break;
307
-            }
308
-        }
309
-        return $SQL;
310
-    }
311
-
312
-
313
-    /**
314
-     *    posts_where
315
-     *
316
-     * @access    public
317
-     * @return    void
318
-     */
319
-    public function posts_where($SQL, WP_Query $wp_query)
320
-    {
321
-        if (isset($wp_query->query_vars) && isset($wp_query->query_vars['post_type']) && $wp_query->query_vars['post_type'] == 'espresso_events') {
322
-            // Show Expired ?
323
-            $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_show_expired(
324
-                EED_Events_Archive_Filters::_show_expired()
325
-            );
326
-            // Category
327
-            // $elf_category = EED_Events_Archive_Filters::_event_category_slug();
328
-            $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_category_slug(
329
-                EED_Events_Archive_Filters::_event_category_slug()
330
-            );
331
-            // Start Date
332
-            // $elf_month = EED_Events_Archive_Filters::_display_month();
333
-            $SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_list_month(
334
-                EED_Events_Archive_Filters::_display_month()
335
-            );
336
-        }
337
-        return $SQL;
338
-    }
339
-
340
-
341
-    /**
342
-     *    posts_where_sql_for_show_expired
343
-     *
344
-     * @access    public
345
-     * @param    boolean $show_expired if TRUE, then displayed past events
346
-     * @return    string
347
-     */
348
-    public static function posts_where_sql_for_show_expired($show_expired = false)
349
-    {
350
-        return ! $show_expired
351
-            ? ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > "' . date('Y-m-d H:s:i') . '" '
352
-            : '';
353
-    }
354
-
355
-
356
-    /**
357
-     *    posts_where_sql_for_event_category_slug
358
-     *
359
-     * @access    public
360
-     * @param    boolean $event_category_slug
361
-     * @return    string
362
-     */
363
-    public static function posts_where_sql_for_event_category_slug($event_category_slug = null)
364
-    {
365
-        global $wpdb;
366
-        return ! empty($event_category_slug) ? ' AND ' . $wpdb->terms . '.slug = "' . $event_category_slug . '" ' : '';
367
-    }
368
-
369
-    /**
370
-     *    posts_where_sql_for_event_list_month
371
-     *
372
-     * @access    public
373
-     * @param    boolean $month
374
-     * @return    string
375
-     */
376
-    public static function posts_where_sql_for_event_list_month($month = null)
377
-    {
378
-        $SQL = '';
379
-        if (! empty($month)) {
380
-            // event start date is LESS than the end of the month ( so nothing that doesn't start until next month )
381
-            $SQL = ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start';
382
-            $SQL .= ' <= "' . date('Y-m-t 23:59:59', \EEH_DTT_Helper::first_of_month_timestamp($month)) . '"';
383
-            // event end date is GREATER than the start of the month ( so nothing that ended before this month )
384
-            $SQL .= ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end';
385
-            $SQL .= ' >= "' . date('Y-m-d 0:0:00', \EEH_DTT_Helper::first_of_month_timestamp($month)) . '" ';
386
-        }
387
-        return $SQL;
388
-    }
389
-
390
-
391
-    /**
392
-     *    posts_orderby
393
-     *
394
-     * @access    public
395
-     * @return    void
396
-     */
397
-    public function posts_orderby($SQL, WP_Query $wp_query)
398
-    {
399
-        if (isset($wp_query->query) && isset($wp_query->query['post_type']) && $wp_query->query['post_type'] == 'espresso_events') {
400
-            $SQL = EED_Events_Archive_Filters::posts_orderby_sql(array('start_date'));
401
-        }
402
-        return $SQL;
403
-    }
404
-
405
-
406
-    /**
407
-     *    posts_orderby_sql
408
-     *
409
-     *    possible parameters:
410
-     *    ID
411
-     *    start_date
412
-     *    end_date
413
-     *    event_name
414
-     *    category_slug
415
-     *    ticket_start
416
-     *    ticket_end
417
-     *    venue_title
418
-     *    city
419
-     *    state
420
-     *
421
-     *    **IMPORTANT**
422
-     *    make sure to also send the $orderby_params array to the posts_join_for_orderby() method
423
-     *    or else some of the table references below will result in MySQL errors
424
-     *
425
-     * @access    public
426
-     * @param    boolean $orderby_params
427
-     * @return    string
428
-     */
429
-    public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC')
430
-    {
431
-        global $wpdb;
432
-        $SQL = '';
433
-        $cntr = 1;
434
-        $orderby_params = is_array($orderby_params) ? $orderby_params : array($orderby_params);
435
-        foreach ($orderby_params as $orderby) {
436
-            $glue = $cntr == 1 || $cntr == count($orderby_params) ? ' ' : ', ';
437
-            switch ($orderby) {
438
-                case 'id':
439
-                case 'ID':
440
-                    $SQL .= $glue . $wpdb->posts . '.ID ' . $sort;
441
-                    break;
442
-
443
-                case 'start_date':
444
-                    $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_start ' . $sort;
445
-                    break;
446
-
447
-                case 'end_date':
448
-                    $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_end ' . $sort;
449
-                    break;
450
-
451
-                case 'event_name':
452
-                    $SQL .= $glue . $wpdb->posts . '.post_title ' . $sort;
453
-                    break;
454
-
455
-                case 'category_slug':
456
-                    $SQL .= $glue . $wpdb->terms . '.slug ' . $sort;
457
-                    break;
458
-
459
-                case 'ticket_start':
460
-                    $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_start_date ' . $sort;
461
-                    break;
462
-
463
-                case 'ticket_end':
464
-                    $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_end_date ' . $sort;
465
-                    break;
466
-
467
-                case 'venue_title':
468
-                    $SQL .= $glue . 'venue_title ' . $sort;
469
-                    break;
470
-
471
-                case 'city':
472
-                    $SQL .= $glue . EEM_Venue::instance()->second_table() . '.VNU_city ' . $sort;
473
-                    break;
474
-
475
-                case 'state':
476
-                    $SQL .= $glue . EEM_State::instance()->table() . '.STA_name ' . $sort;
477
-                    break;
478
-            }
479
-            $cntr++;
480
-        }
481
-        // echo '<h4>$SQL : ' . $SQL . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
482
-        return $SQL;
483
-    }
484
-
485
-
486
-    /**
487
-     *    template_redirect
488
-     *
489
-     * @access    public
490
-     * @return    void
491
-     */
492
-    public function template_redirect()
493
-    {
494
-        // add event list filters
495
-        add_action('loop_start', array($this, 'event_list_template_filters'));
496
-        // and pagination
497
-        add_action('loop_start', array($this, 'event_list_pagination'));
498
-        add_action('loop_end', array($this, 'event_list_pagination'));
499
-        // if NOT a custom template
500
-        if (
501
-            EE_Registry::instance()
502
-                       ->load_core('Front_Controller', array(), false, true)
503
-                       ->get_selected_template() != 'archive-espresso_events.php'
504
-        ) {
505
-            // don't know if theme uses the_excerpt
506
-            add_filter('the_excerpt', array($this, 'event_details'), 100);
507
-            add_filter('the_excerpt', array($this, 'event_tickets'), 110);
508
-            add_filter('the_excerpt', array($this, 'event_datetimes'), 120);
509
-            add_filter('the_excerpt', array($this, 'event_venues'), 130);
510
-            // or the_content
511
-            add_filter('the_content', array($this, 'event_details'), 100);
512
-            add_filter('the_content', array($this, 'event_tickets'), 110);
513
-            add_filter('the_content', array($this, 'event_datetimes'), 120);
514
-            add_filter('the_content', array($this, 'event_venues'), 130);
515
-        } else {
516
-            remove_all_filters('excerpt_length');
517
-            add_filter('excerpt_length', array($this, 'excerpt_length'), 10);
518
-            add_filter('excerpt_more', array($this, 'excerpt_more'), 10);
519
-        }
520
-    }
521
-
522
-
523
-    /**
524
-     *    event_list_pagination
525
-     *
526
-     * @access    public
527
-     * @return        void
528
-     */
529
-    public function event_list_pagination()
530
-    {
531
-        echo '<div class="ee-pagination-dv ee-clear-float">' . espresso_event_list_pagination() . '</div>';
532
-    }
533
-
534
-
535
-    /**
536
-     *    event_details
537
-     *
538
-     * @access    public
539
-     * @param        string $content
540
-     * @return        void
541
-     */
542
-    public function event_details($content)
543
-    {
544
-        return EEH_Template::display_template(
545
-            EE_TEMPLATES . EE_Config::get_current_theme() . '/content-espresso_events-details.php',
546
-            array('the_content' => $content),
547
-            true
548
-        );
549
-    }
550
-
551
-
552
-    /**
553
-     *    event_tickets
554
-     *
555
-     * @access    public
556
-     * @param        string $content
557
-     * @return        void
558
-     */
559
-    public function event_tickets($content)
560
-    {
561
-        return $content
562
-               . EEH_Template::display_template(
563
-                   EE_TEMPLATES . EE_Config::get_current_theme() . '/content-espresso_events-tickets.php',
564
-                   array(),
565
-                   true
566
-               );
567
-    }
568
-
569
-    /**
570
-     *    event_datetimes
571
-     *
572
-     * @access    public
573
-     * @param        string $content
574
-     * @return        void
575
-     */
576
-    public function event_datetimes($content)
577
-    {
578
-        return $content
579
-               . EEH_Template::display_template(
580
-                   EE_TEMPLATES . EE_Config::get_current_theme() . '/content-espresso_events-datetimes.php',
581
-                   array(),
582
-                   true
583
-               );
584
-    }
585
-
586
-    /**
587
-     *    event_venues
588
-     *
589
-     * @access    public
590
-     * @param        string $content
591
-     * @return        void
592
-     */
593
-    public function event_venues($content)
594
-    {
595
-        return $content
596
-               . EEH_Template::display_template(
597
-                   EE_TEMPLATES . EE_Config::get_current_theme() . '/content-espresso_events-venues.php',
598
-                   array(),
599
-                   true
600
-               );
601
-    }
602
-
603
-
604
-    /**
605
-     *    _initial_setup
606
-     *
607
-     * @access    public
608
-     * @return    void
609
-     */
610
-    private function _load_assests()
611
-    {
612
-        do_action('AHEE__EED_Events_Archive_Filters__before_load_assests');
613
-        wp_enqueue_style('espresso_default');
614
-        wp_enqueue_style('espresso_custom_css');
615
-        add_filter('FHEE_load_EE_Session', '__return_true');
616
-        add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
617
-        if (EE_Registry::instance()->CFG->map_settings->use_google_maps) {
618
-            add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11);
619
-        }
620
-        // add_filter( 'the_excerpt', array( $this, 'the_excerpt' ), 999 );
621
-    }
622
-
623
-
624
-    /**
625
-     *    _get_template
626
-     *
627
-     * @access    private
628
-     * @return    string
629
-     */
630
-    private function _get_template($which = 'part')
631
-    {
632
-        return EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events.php';
633
-    }
634
-
635
-
636
-    /**
637
-     *    excerpt_length
638
-     *
639
-     * @access    public
640
-     * @return    void
641
-     */
642
-    public function excerpt_length($length)
643
-    {
644
-
645
-        if (self::$_type == 'grid') {
646
-            return 36;
647
-        }
648
-
649
-        switch (EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size) {
650
-            case 'tiny':
651
-                return 12;
652
-                break;
653
-            case 'small':
654
-                return 24;
655
-                break;
656
-            case 'large':
657
-                return 48;
658
-                break;
659
-            case 'medium':
660
-            default:
661
-                return 36;
662
-        }
663
-    }
664
-
665
-
666
-    /**
667
-     *    excerpt_more
668
-     *
669
-     * @access    public
670
-     * @return    void
671
-     */
672
-    public function excerpt_more($more)
673
-    {
674
-        return '&hellip;';
675
-    }
676
-
677
-
678
-
679
-
680
-    /**
681
-     *    wp_enqueue_scripts
682
-     *
683
-     * @access    public
684
-     * @return    void
685
-     */
686
-    public function wp_enqueue_scripts()
687
-    {
688
-        // get some style
689
-        if (apply_filters('FHEE_enable_default_espresso_css', false)) {
690
-            // first check uploads folder
691
-            if (
692
-                is_readable(
693
-                    get_stylesheet_directory() . EE_Config::get_current_theme() . '/archive-espresso_events.css'
694
-                )
695
-            ) {
696
-                wp_register_style(
697
-                    'archive-espresso_events',
698
-                    get_stylesheet_directory_uri() . EE_Config::get_current_theme(
699
-                    ) . '/archive-espresso_events.css',
700
-                    array('dashicons', 'espresso_default')
701
-                );
702
-            } else {
703
-                wp_register_style(
704
-                    'archive-espresso_events',
705
-                    EE_TEMPLATES_URL . EE_Config::get_current_theme() . '/archive-espresso_events.css',
706
-                    array('dashicons', 'espresso_default')
707
-                );
708
-            }
709
-            if (
710
-                is_readable(
711
-                    get_stylesheet_directory() . EE_Config::get_current_theme() . '/archive-espresso_events.js'
712
-                )
713
-            ) {
714
-                wp_register_script(
715
-                    'archive-espresso_events',
716
-                    get_stylesheet_directory_uri() . EE_Config::get_current_theme() . '/archive-espresso_events.js',
717
-                    array('jquery-masonry'),
718
-                    '1.0',
719
-                    true
720
-                );
721
-            } else {
722
-                wp_register_script(
723
-                    'archive-espresso_events',
724
-                    EVENTS_ARCHIVE_ASSETS_URL . 'archive-espresso_events.js',
725
-                    array('jquery-masonry'),
726
-                    '1.0',
727
-                    true
728
-                );
729
-            }
730
-            wp_enqueue_style('archive-espresso_events');
731
-            wp_enqueue_script('jquery-masonry');
732
-            wp_enqueue_script('archive-espresso_events');
733
-            add_action('wp_footer', array('EED_Events_Archive_Filters', 'localize_grid_event_lists'), 1);
734
-        }
735
-    }
736
-
737
-
738
-    /**
739
-     *    template_settings_form
740
-     *
741
-     * @access    public
742
-     * @static
743
-     * @return    void
744
-     */
745
-    public static function localize_grid_event_lists()
746
-    {
747
-        wp_localize_script(
748
-            'archive-espresso_events',
749
-            'espresso_grid_event_lists',
750
-            EED_Events_Archive_Filters::$espresso_grid_event_lists
751
-        );
752
-    }
753
-
754
-
755
-    /**
756
-     *    template_settings_form
757
-     *
758
-     * @access    public
759
-     * @static
760
-     * @return    void
761
-     */
762
-    public static function template_settings_form()
763
-    {
764
-        $EE = EE_Registry::instance();
765
-        $EE->CFG->template_settings->EED_Events_Archive_Filters = isset($EE->CFG->template_settings->EED_Events_Archive_Filters)
766
-            ? $EE->CFG->template_settings->EED_Events_Archive_Filters : new EE_Events_Archive_Config();
767
-        $EE->CFG->template_settings->EED_Events_Archive_Filters = apply_filters(
768
-            'FHEE__Event_List__template_settings_form__event_list_config',
769
-            $EE->CFG->template_settings->EED_Events_Archive_Filters
770
-        );
771
-        EEH_Template::display_template(
772
-            EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php',
773
-            $EE->CFG->template_settings->EED_Events_Archive_Filters
774
-        );
775
-    }
776
-
777
-
778
-    /**
779
-     *    set_default_settings
780
-     *
781
-     * @access    public
782
-     * @static
783
-     * @return    void
784
-     */
785
-    public static function set_default_settings($CFG)
786
-    {
787
-        // EEH_Debug_Tools::printr( $CFG, '$CFG  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
788
-        $CFG->display_description = isset($CFG->display_description) && ! empty($CFG->display_description)
789
-            ? $CFG->display_description : 1;
790
-        $CFG->display_address = isset($CFG->display_address) && ! empty($CFG->display_address) ? $CFG->display_address
791
-            : true;
792
-        $CFG->display_venue_details = isset($CFG->display_venue_details) && ! empty($CFG->display_venue_details)
793
-            ? $CFG->display_venue_details : true;
794
-        $CFG->display_expired_events = isset($CFG->display_expired_events) && ! empty($CFG->display_expired_events)
795
-            ? $CFG->display_expired_events : false;
796
-        $CFG->default_type = isset($CFG->default_type) && ! empty($CFG->default_type) ? $CFG->default_type : 'grid';
797
-        $CFG->event_list_grid_size = isset($CFG->event_list_grid_size) && ! empty($CFG->event_list_grid_size)
798
-            ? $CFG->event_list_grid_size : 'medium';
799
-        $CFG->templates['full'] = isset($CFG->templates['full']) && ! empty($CFG->templates['full'])
800
-            ? $CFG->templates['full']
801
-            : EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events.php';
802
-        $CFG->templates['part'] = isset($CFG->templates['part']) && ! empty($CFG->templates['part'])
803
-            ? $CFG->templates['part']
804
-            : EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events-grid-view.php';
805
-        return $CFG;
806
-    }
807
-
808
-
809
-    /**
810
-     *    filter_config
811
-     *
812
-     * @access    public
813
-     * @return    void
814
-     */
815
-    public function filter_config($CFG)
816
-    {
817
-        return $CFG;
818
-    }
819
-
820
-
821
-    /**
822
-     *    filter_config
823
-     *
824
-     * @access    public
825
-     * @return    void
826
-     */
827
-    public static function update_template_settings($CFG, $REQ)
828
-    {
829
-        // $CFG->template_settings->EED_Events_Archive_Filters = new stdClass();
830
-        $CFG->EED_Events_Archive_Filters->display_description = isset($REQ['display_description_in_event_list'])
831
-            ? absint($REQ['display_description_in_event_list']) : 1;
832
-        $CFG->EED_Events_Archive_Filters->display_address = isset($REQ['display_address_in_event_list']) ? absint(
833
-            $REQ['display_address_in_event_list']
834
-        ) : true;
835
-        $CFG->EED_Events_Archive_Filters->display_venue_details = isset($REQ['display_venue_details_in_event_list'])
836
-            ? absint($REQ['display_venue_details_in_event_list']) : true;
837
-        $CFG->EED_Events_Archive_Filters->display_expired_events = isset($REQ['display_expired_events']) ? absint(
838
-            $REQ['display_expired_events']
839
-        ) : false;
840
-        $CFG->EED_Events_Archive_Filters->default_type = isset($REQ['default_type']) ? sanitize_text_field(
841
-            $REQ['default_type']
842
-        ) : 'grid';
843
-        $CFG->EED_Events_Archive_Filters->event_list_grid_size = isset($REQ['event_list_grid_size'])
844
-            ? sanitize_text_field($REQ['event_list_grid_size']) : 'medium';
845
-        $CFG->EED_Events_Archive_Filters->templates = array(
846
-            'full' => EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events.php',
847
-        );
848
-
849
-        switch ($CFG->EED_Events_Archive_Filters->default_type) {
850
-            case 'dates':
851
-                $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme()
852
-                                                                      . '/archive-espresso_events-dates-view.php';
853
-                break;
854
-            case 'text':
855
-                $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme()
856
-                                                                      . '/archive-espresso_events-text-view.php';
857
-                break;
858
-            default:
859
-                $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme()
860
-                                                                      . '/archive-espresso_events-grid-view.php';
861
-        }
862
-
863
-        $CFG->EED_Events_Archive_Filters = isset($REQ['reset_event_list_settings'])
864
-                                           && absint($REQ['reset_event_list_settings']) == 1
865
-            ? new EE_Events_Archive_Config()
866
-            : $CFG->EED_Events_Archive_Filters;
867
-        return $CFG;
868
-    }
869
-
870
-
871
-    /**
872
-     *    get_template_part
873
-     *
874
-     * @access    public
875
-     * @return    void
876
-     */
877
-    public static function get_template_part()
878
-    {
879
-        switch (self::$_type) {
880
-            case 'dates':
881
-                return 'archive-espresso_events-dates-view.php';
882
-                break;
883
-            case 'text':
884
-                return 'archive-espresso_events-text-view.php';
885
-                break;
886
-            default:
887
-                return 'archive-espresso_events-grid-view.php';
888
-        }
889
-    }
890
-
891
-
892
-    /**
893
-     *    event_list_template_filters
894
-     *
895
-     * @access    public
896
-     * @return    void
897
-     */
898
-    public function event_list_template_filters()
899
-    {
900
-        $args = array(
901
-            'form_url'         => get_post_type_archive_link('espresso_events'),
902
-            // add_query_arg( array( 'post_type' => 'espresso_events' ), home_url() ),
903
-            'elf_month'        => EED_Events_Archive_Filters::_display_month(),
904
-            'elf_category'     => EED_Events_Archive_Filters::_event_category_slug(),
905
-            'elf_show_expired' => EED_Events_Archive_Filters::_show_expired(),
906
-            'elf_type'         => self::$_type,
907
-        );
908
-        EEH_Template::display_template(
909
-            EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events-filters.php',
910
-            $args
911
-        );
912
-    }
913
-
914
-
915
-    /**
916
-     *    event_list_css
917
-     *
918
-     * @access    public
919
-     * @return    void
920
-     */
921
-    public static function event_list_css($extra_class = '')
922
-    {
923
-        $EE = EE_Registry::instance();
924
-        $event_list_css = ! empty($extra_class) ? array($extra_class) : array();
925
-        $event_list_css[] = 'espresso-event-list-event';
926
-        if (self::$_type == 'grid') {
927
-            $event_list_grid_size = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size)
928
-                ? $EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size : 'medium';
929
-            $event_list_css[] = $event_list_grid_size . '-event-list-grid';
930
-        }
931
-        $event_list_css = apply_filters(
932
-            'EED_Events_Archive_Filters__event_list_css__event_list_css_array',
933
-            $event_list_css
934
-        );
935
-        return implode(' ', $event_list_css);
936
-    }
937
-
938
-
939
-    /**
940
-     *    event_categories
941
-     *
942
-     * @access    public
943
-     * @return    void
944
-     */
945
-    public static function event_categories()
946
-    {
947
-        return EE_Registry::instance()->load_model('Term')->get_all_ee_categories();
948
-    }
949
-
950
-
951
-    /**
952
-     *    display_description
953
-     *
954
-     * @access    public
955
-     * @return    void
956
-     */
957
-    public static function display_description($value)
958
-    {
959
-        $EE = EE_Registry::instance();
960
-        $display_description = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_description)
961
-            ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_description : 1;
962
-        return $display_description === $value ? true : false;
963
-    }
964
-
965
-
966
-    /**
967
-     *    display_venue_details
968
-     *
969
-     * @access    public
970
-     * @return    void
971
-     */
972
-    public static function display_venue_details()
973
-    {
974
-        $EE = EE_Registry::instance();
975
-        $display_venue_details = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details)
976
-            ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details : true;
977
-        $venue_name = EEH_Venue_View::venue_name();
978
-        return $display_venue_details && ! empty($venue_name) ? true : false;
979
-    }
980
-
981
-
982
-    /**
983
-     *    display_address
984
-     *
985
-     * @access    public
986
-     * @return    void
987
-     */
988
-    public static function display_address()
989
-    {
990
-        $EE = EE_Registry::instance();
991
-        $display_address = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_address)
992
-            ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_address : false;
993
-        $venue_name = EEH_Venue_View::venue_name();
994
-        return $display_address && ! empty($venue_name) ? true : false;
995
-    }
996
-
997
-
998
-    /**
999
-     *    pagination
1000
-     *
1001
-     * @access    public
1002
-     * @return    void
1003
-     */
1004
-    public static function pagination()
1005
-    {
1006
-        global $wp_query;
1007
-        $big = 999999999; // need an unlikely integer
1008
-        $pagination = paginate_links(
1009
-            array(
1010
-                'base'         => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
1011
-                'format'       => '?paged=%#%',
1012
-                'current'      => max(1, get_query_var('paged')),
1013
-                'total'        => $wp_query->max_num_pages,
1014
-                'show_all'     => true,
1015
-                'end_size'     => 10,
1016
-                'mid_size'     => 6,
1017
-                'prev_next'    => true,
1018
-                'prev_text'    => __('&lsaquo; PREV', 'event_espresso'),
1019
-                'next_text'    => __('NEXT &rsaquo;', 'event_espresso'),
1020
-                'type'         => 'plain',
1021
-                'add_args'     => false,
1022
-                'add_fragment' => '',
1023
-            )
1024
-        );
1025
-        return ! empty($pagination) ? '<div class="ee-pagination-dv clear">' . $pagination . '</div>' : '';
1026
-    }
1027
-
1028
-
1029
-    /**
1030
-     *    event_list_title
1031
-     *
1032
-     * @access    public
1033
-     * @return    void
1034
-     */
1035
-    public static function event_list_title()
1036
-    {
1037
-        return apply_filters(
1038
-            'EED_Events_Archive_Filters__event_list_title__event_list_title',
1039
-            __('Upcoming Events', 'event_espresso')
1040
-        );
1041
-    }
16
+	/**
17
+	 * @return EED_Events_Archive_Filters
18
+	 */
19
+	public static function instance()
20
+	{
21
+		return parent::get_instance(__CLASS__);
22
+	}
23
+
24
+
25
+	/**
26
+	 *    Start Date
27
+	 *
28
+	 * @var    $_elf_month
29
+	 * @access    protected
30
+	 */
31
+	protected $_elf_month = null;
32
+
33
+
34
+	/**
35
+	 *    Category
36
+	 *
37
+	 * @var    $_elf_category
38
+	 * @access    protected
39
+	 */
40
+	protected $_elf_category = null;
41
+
42
+
43
+	/**
44
+	 *    whether to display expired events in the event list
45
+	 *
46
+	 * @var    $_show_expired
47
+	 * @access    protected
48
+	 */
49
+	protected $_show_expired = null;
50
+
51
+
52
+	/**
53
+	 *    whether to display the event list as a grid or list
54
+	 *
55
+	 * @var    $_type
56
+	 * @access    protected
57
+	 */
58
+	protected static $_type = null;
59
+
60
+
61
+	/**
62
+	 *    array of existing event list views
63
+	 *
64
+	 * @var    $_types
65
+	 * @access    protected
66
+	 */
67
+	protected static $_types = array('grid', 'text', 'dates');
68
+
69
+
70
+
71
+	/**
72
+	 *    set_hooks - for hooking into EE Core, other modules, etc
73
+	 *
74
+	 * @access    public
75
+	 * @return    void
76
+	 */
77
+	public static function set_hooks()
78
+	{
79
+	}
80
+
81
+	/**
82
+	 *    set_hooks_admin - for hooking into EE Admin Core, other modules, etc
83
+	 *
84
+	 * @access    public
85
+	 * @return    void
86
+	 */
87
+	public static function set_hooks_admin()
88
+	{
89
+	}
90
+
91
+
92
+	/**
93
+	 *    set_definitions
94
+	 *
95
+	 * @access    public
96
+	 * @return    void
97
+	 */
98
+	public static function set_definitions()
99
+	{
100
+	}
101
+
102
+
103
+	/**
104
+	 *    run - initial module setup
105
+	 *
106
+	 * @access    public
107
+	 * @return    void
108
+	 */
109
+	public function run($WP)
110
+	{
111
+	}
112
+
113
+
114
+	/**
115
+	 *    event_list
116
+	 *
117
+	 * @access    public
118
+	 * @return    void
119
+	 */
120
+	public function event_list()
121
+	{
122
+		// load other required components
123
+		$this->_load_assests();
124
+	}
125
+
126
+
127
+	/**
128
+	 *    _filter_query_parts
129
+	 *
130
+	 * @access    public
131
+	 * @return    void
132
+	 */
133
+	private function _filter_query_parts()
134
+	{
135
+		// build event list query
136
+		add_filter('posts_join', array($this, 'posts_join'), 1, 2);
137
+		add_filter('posts_where', array($this, 'posts_where'), 1, 2);
138
+		add_filter('posts_orderby', array($this, 'posts_orderby'), 1, 2);
139
+	}
140
+
141
+	/**
142
+	 *    _type - the type of event list : grid, text, dates
143
+	 *
144
+	 * @access    public
145
+	 * @return    string
146
+	 */
147
+	public static function set_type()
148
+	{
149
+		do_action('AHEE__EED_Events_Archive_Filters__before_set_type');
150
+		EED_Events_Archive_Filters::$_types = apply_filters(
151
+			'EED_Events_Archive_Filters__set_type__types',
152
+			EED_Events_Archive_Filters::$_types
153
+		);
154
+		$view = isset(EE_Registry::instance()->CFG->EED_Events_Archive_Filters['default_type']) ? EE_Registry::instance(
155
+		)->CFG->EED_Events_Archive_Filters['default_type'] : 'grid';
156
+		$elf_type = EE_Registry::instance()->REQ->is_set('elf_type') ? sanitize_text_field(
157
+			EE_Registry::instance()->REQ->get('elf_type')
158
+		) : '';
159
+		$view = ! empty($elf_type) ? $elf_type : $view;
160
+		$view = apply_filters('EED_Events_Archive_Filters__set_type__type', $view);
161
+		if (! empty($view) && in_array($view, EED_Events_Archive_Filters::$_types)) {
162
+			self::$_type = $view;
163
+		}
164
+	}
165
+
166
+	/**
167
+	 *    _show_expired
168
+	 *
169
+	 * @access    private
170
+	 * @param    boolean $req_only if TRUE, then ignore defaults and only return $_POST value
171
+	 * @return    boolean
172
+	 */
173
+	private static function _show_expired($req_only = false)
174
+	{
175
+		// get default value for "display_expired_events" as set in the EE General Settings > Templates > Event Listings
176
+		$show_expired = ! $req_only && isset(
177
+			EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events']
178
+		) ? EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events'] : false;
179
+		// override default expired option if set via filter
180
+		$show_expired = EE_Registry::instance()->REQ->is_set('elf_expired_chk') ? absint(
181
+			EE_Registry::instance()->REQ->get('elf_expired_chk')
182
+		) : $show_expired;
183
+		return $show_expired ? true : false;
184
+	}
185
+
186
+	/**
187
+	 *    _event_category_slug
188
+	 *
189
+	 * @access    private
190
+	 * @return    string
191
+	 */
192
+	private static function _event_category_slug()
193
+	{
194
+		return EE_Registry::instance()->REQ->is_set('elf_category_dd') ? sanitize_text_field(
195
+			EE_Registry::instance()->REQ->get('elf_category_dd')
196
+		) : '';
197
+	}
198
+
199
+	/**
200
+	 *    _display_month - what month should the event list display events for?
201
+	 *
202
+	 * @access    private
203
+	 * @return    string
204
+	 */
205
+	private static function _display_month()
206
+	{
207
+		return EE_Registry::instance()->REQ->is_set('elf_month_dd') ? sanitize_text_field(
208
+			EE_Registry::instance()->REQ->get('elf_month_dd')
209
+		) : '';
210
+	}
211
+
212
+
213
+	/**
214
+	 *    get_post_data
215
+	 *
216
+	 * @access    public
217
+	 * @return    void
218
+	 */
219
+	public function get_post_data()
220
+	{
221
+		$this->_elf_month = EED_Events_Archive_Filters::_display_month();
222
+		$this->_elf_category = EED_Events_Archive_Filters::_event_category_slug();
223
+		$this->_show_expired = EED_Events_Archive_Filters::_show_expired(true);
224
+	}
225
+
226
+
227
+	/**
228
+	 *    posts_join
229
+	 *
230
+	 * @access    public
231
+	 * @return    void
232
+	 */
233
+	public function posts_join($SQL, WP_Query $wp_query)
234
+	{
235
+		if (isset($wp_query->query) && isset($wp_query->query['post_type']) && $wp_query->query['post_type'] == 'espresso_events') {
236
+			// Category
237
+			$SQL .= EED_Events_Archive_Filters::posts_join_sql_for_terms(
238
+				EED_Events_Archive_Filters::_event_category_slug()
239
+			);
240
+		}
241
+		return $SQL;
242
+	}
243
+
244
+
245
+	/**
246
+	 *    posts_join_sql_for_terms
247
+	 *
248
+	 * @access    public
249
+	 * @param    mixed boolean|string    $join_terms pass TRUE or term string, doesn't really matter since this value
250
+	 *                                   doesn't really get used for anything yet
251
+	 * @return    string
252
+	 */
253
+	public static function posts_join_sql_for_terms($join_terms = null)
254
+	{
255
+		$SQL = '';
256
+		if (! empty($join_terms)) {
257
+			global $wpdb;
258
+			$SQL .= " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)";
259
+			$SQL .= " LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)";
260
+			$SQL .= " LEFT JOIN $wpdb->terms ON ($wpdb->terms.term_id = $wpdb->term_taxonomy.term_id) ";
261
+		}
262
+		return $SQL;
263
+	}
264
+
265
+
266
+	/**
267
+	 *    posts_join_for_orderby
268
+	 *    usage:  $SQL .= EED_Events_Archive_Filters::posts_join_for_orderby( $orderby_params );
269
+	 *
270
+	 * @access    public
271
+	 * @param    array $orderby_params
272
+	 * @return    string
273
+	 */
274
+	public static function posts_join_for_orderby($orderby_params = array())
275
+	{
276
+		global $wpdb;
277
+		$SQL = '';
278
+		$orderby_params = is_array($orderby_params) ? $orderby_params : array($orderby_params);
279
+		foreach ($orderby_params as $orderby) {
280
+			switch ($orderby) {
281
+				case 'ticket_start':
282
+				case 'ticket_end':
283
+					$SQL .= ' LEFT JOIN ' . EEM_Datetime_Ticket::instance()->table() . ' ON ('
284
+							. EEM_Datetime::instance()->table() . '.DTT_ID = '
285
+							. EEM_Datetime_Ticket::instance()->table() . '.DTT_ID )';
286
+					$SQL .= ' LEFT JOIN ' . EEM_Ticket::instance()->table() . ' ON ('
287
+							. EEM_Datetime_Ticket::instance()->table() . '.TKT_ID = '
288
+							. EEM_Ticket::instance()->table() . '.TKT_ID )';
289
+					break;
290
+
291
+				case 'venue_title':
292
+				case 'city':
293
+					$SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = '
294
+							. EEM_Event_Venue::instance()->table() . '.EVT_ID )';
295
+					$SQL .= ' LEFT JOIN ' . EEM_Venue::instance()->table() . ' ON ('
296
+							. EEM_Event_Venue::instance()->table() . '.VNU_ID = '
297
+							. EEM_Venue::instance()->table() . '.VNU_ID )';
298
+					break;
299
+
300
+				case 'state':
301
+					$SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = '
302
+							. EEM_Event_Venue::instance()->table() . '.EVT_ID )';
303
+					$SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->second_table() . ' ON ('
304
+							. EEM_Event_Venue::instance()->table() . '.VNU_ID = '
305
+							. EEM_Event_Venue::instance()->second_table() . '.VNU_ID )';
306
+					break;
307
+			}
308
+		}
309
+		return $SQL;
310
+	}
311
+
312
+
313
+	/**
314
+	 *    posts_where
315
+	 *
316
+	 * @access    public
317
+	 * @return    void
318
+	 */
319
+	public function posts_where($SQL, WP_Query $wp_query)
320
+	{
321
+		if (isset($wp_query->query_vars) && isset($wp_query->query_vars['post_type']) && $wp_query->query_vars['post_type'] == 'espresso_events') {
322
+			// Show Expired ?
323
+			$SQL .= EED_Events_Archive_Filters::posts_where_sql_for_show_expired(
324
+				EED_Events_Archive_Filters::_show_expired()
325
+			);
326
+			// Category
327
+			// $elf_category = EED_Events_Archive_Filters::_event_category_slug();
328
+			$SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_category_slug(
329
+				EED_Events_Archive_Filters::_event_category_slug()
330
+			);
331
+			// Start Date
332
+			// $elf_month = EED_Events_Archive_Filters::_display_month();
333
+			$SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_list_month(
334
+				EED_Events_Archive_Filters::_display_month()
335
+			);
336
+		}
337
+		return $SQL;
338
+	}
339
+
340
+
341
+	/**
342
+	 *    posts_where_sql_for_show_expired
343
+	 *
344
+	 * @access    public
345
+	 * @param    boolean $show_expired if TRUE, then displayed past events
346
+	 * @return    string
347
+	 */
348
+	public static function posts_where_sql_for_show_expired($show_expired = false)
349
+	{
350
+		return ! $show_expired
351
+			? ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > "' . date('Y-m-d H:s:i') . '" '
352
+			: '';
353
+	}
354
+
355
+
356
+	/**
357
+	 *    posts_where_sql_for_event_category_slug
358
+	 *
359
+	 * @access    public
360
+	 * @param    boolean $event_category_slug
361
+	 * @return    string
362
+	 */
363
+	public static function posts_where_sql_for_event_category_slug($event_category_slug = null)
364
+	{
365
+		global $wpdb;
366
+		return ! empty($event_category_slug) ? ' AND ' . $wpdb->terms . '.slug = "' . $event_category_slug . '" ' : '';
367
+	}
368
+
369
+	/**
370
+	 *    posts_where_sql_for_event_list_month
371
+	 *
372
+	 * @access    public
373
+	 * @param    boolean $month
374
+	 * @return    string
375
+	 */
376
+	public static function posts_where_sql_for_event_list_month($month = null)
377
+	{
378
+		$SQL = '';
379
+		if (! empty($month)) {
380
+			// event start date is LESS than the end of the month ( so nothing that doesn't start until next month )
381
+			$SQL = ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start';
382
+			$SQL .= ' <= "' . date('Y-m-t 23:59:59', \EEH_DTT_Helper::first_of_month_timestamp($month)) . '"';
383
+			// event end date is GREATER than the start of the month ( so nothing that ended before this month )
384
+			$SQL .= ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end';
385
+			$SQL .= ' >= "' . date('Y-m-d 0:0:00', \EEH_DTT_Helper::first_of_month_timestamp($month)) . '" ';
386
+		}
387
+		return $SQL;
388
+	}
389
+
390
+
391
+	/**
392
+	 *    posts_orderby
393
+	 *
394
+	 * @access    public
395
+	 * @return    void
396
+	 */
397
+	public function posts_orderby($SQL, WP_Query $wp_query)
398
+	{
399
+		if (isset($wp_query->query) && isset($wp_query->query['post_type']) && $wp_query->query['post_type'] == 'espresso_events') {
400
+			$SQL = EED_Events_Archive_Filters::posts_orderby_sql(array('start_date'));
401
+		}
402
+		return $SQL;
403
+	}
404
+
405
+
406
+	/**
407
+	 *    posts_orderby_sql
408
+	 *
409
+	 *    possible parameters:
410
+	 *    ID
411
+	 *    start_date
412
+	 *    end_date
413
+	 *    event_name
414
+	 *    category_slug
415
+	 *    ticket_start
416
+	 *    ticket_end
417
+	 *    venue_title
418
+	 *    city
419
+	 *    state
420
+	 *
421
+	 *    **IMPORTANT**
422
+	 *    make sure to also send the $orderby_params array to the posts_join_for_orderby() method
423
+	 *    or else some of the table references below will result in MySQL errors
424
+	 *
425
+	 * @access    public
426
+	 * @param    boolean $orderby_params
427
+	 * @return    string
428
+	 */
429
+	public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC')
430
+	{
431
+		global $wpdb;
432
+		$SQL = '';
433
+		$cntr = 1;
434
+		$orderby_params = is_array($orderby_params) ? $orderby_params : array($orderby_params);
435
+		foreach ($orderby_params as $orderby) {
436
+			$glue = $cntr == 1 || $cntr == count($orderby_params) ? ' ' : ', ';
437
+			switch ($orderby) {
438
+				case 'id':
439
+				case 'ID':
440
+					$SQL .= $glue . $wpdb->posts . '.ID ' . $sort;
441
+					break;
442
+
443
+				case 'start_date':
444
+					$SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_start ' . $sort;
445
+					break;
446
+
447
+				case 'end_date':
448
+					$SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_end ' . $sort;
449
+					break;
450
+
451
+				case 'event_name':
452
+					$SQL .= $glue . $wpdb->posts . '.post_title ' . $sort;
453
+					break;
454
+
455
+				case 'category_slug':
456
+					$SQL .= $glue . $wpdb->terms . '.slug ' . $sort;
457
+					break;
458
+
459
+				case 'ticket_start':
460
+					$SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_start_date ' . $sort;
461
+					break;
462
+
463
+				case 'ticket_end':
464
+					$SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_end_date ' . $sort;
465
+					break;
466
+
467
+				case 'venue_title':
468
+					$SQL .= $glue . 'venue_title ' . $sort;
469
+					break;
470
+
471
+				case 'city':
472
+					$SQL .= $glue . EEM_Venue::instance()->second_table() . '.VNU_city ' . $sort;
473
+					break;
474
+
475
+				case 'state':
476
+					$SQL .= $glue . EEM_State::instance()->table() . '.STA_name ' . $sort;
477
+					break;
478
+			}
479
+			$cntr++;
480
+		}
481
+		// echo '<h4>$SQL : ' . $SQL . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
482
+		return $SQL;
483
+	}
484
+
485
+
486
+	/**
487
+	 *    template_redirect
488
+	 *
489
+	 * @access    public
490
+	 * @return    void
491
+	 */
492
+	public function template_redirect()
493
+	{
494
+		// add event list filters
495
+		add_action('loop_start', array($this, 'event_list_template_filters'));
496
+		// and pagination
497
+		add_action('loop_start', array($this, 'event_list_pagination'));
498
+		add_action('loop_end', array($this, 'event_list_pagination'));
499
+		// if NOT a custom template
500
+		if (
501
+			EE_Registry::instance()
502
+					   ->load_core('Front_Controller', array(), false, true)
503
+					   ->get_selected_template() != 'archive-espresso_events.php'
504
+		) {
505
+			// don't know if theme uses the_excerpt
506
+			add_filter('the_excerpt', array($this, 'event_details'), 100);
507
+			add_filter('the_excerpt', array($this, 'event_tickets'), 110);
508
+			add_filter('the_excerpt', array($this, 'event_datetimes'), 120);
509
+			add_filter('the_excerpt', array($this, 'event_venues'), 130);
510
+			// or the_content
511
+			add_filter('the_content', array($this, 'event_details'), 100);
512
+			add_filter('the_content', array($this, 'event_tickets'), 110);
513
+			add_filter('the_content', array($this, 'event_datetimes'), 120);
514
+			add_filter('the_content', array($this, 'event_venues'), 130);
515
+		} else {
516
+			remove_all_filters('excerpt_length');
517
+			add_filter('excerpt_length', array($this, 'excerpt_length'), 10);
518
+			add_filter('excerpt_more', array($this, 'excerpt_more'), 10);
519
+		}
520
+	}
521
+
522
+
523
+	/**
524
+	 *    event_list_pagination
525
+	 *
526
+	 * @access    public
527
+	 * @return        void
528
+	 */
529
+	public function event_list_pagination()
530
+	{
531
+		echo '<div class="ee-pagination-dv ee-clear-float">' . espresso_event_list_pagination() . '</div>';
532
+	}
533
+
534
+
535
+	/**
536
+	 *    event_details
537
+	 *
538
+	 * @access    public
539
+	 * @param        string $content
540
+	 * @return        void
541
+	 */
542
+	public function event_details($content)
543
+	{
544
+		return EEH_Template::display_template(
545
+			EE_TEMPLATES . EE_Config::get_current_theme() . '/content-espresso_events-details.php',
546
+			array('the_content' => $content),
547
+			true
548
+		);
549
+	}
550
+
551
+
552
+	/**
553
+	 *    event_tickets
554
+	 *
555
+	 * @access    public
556
+	 * @param        string $content
557
+	 * @return        void
558
+	 */
559
+	public function event_tickets($content)
560
+	{
561
+		return $content
562
+			   . EEH_Template::display_template(
563
+				   EE_TEMPLATES . EE_Config::get_current_theme() . '/content-espresso_events-tickets.php',
564
+				   array(),
565
+				   true
566
+			   );
567
+	}
568
+
569
+	/**
570
+	 *    event_datetimes
571
+	 *
572
+	 * @access    public
573
+	 * @param        string $content
574
+	 * @return        void
575
+	 */
576
+	public function event_datetimes($content)
577
+	{
578
+		return $content
579
+			   . EEH_Template::display_template(
580
+				   EE_TEMPLATES . EE_Config::get_current_theme() . '/content-espresso_events-datetimes.php',
581
+				   array(),
582
+				   true
583
+			   );
584
+	}
585
+
586
+	/**
587
+	 *    event_venues
588
+	 *
589
+	 * @access    public
590
+	 * @param        string $content
591
+	 * @return        void
592
+	 */
593
+	public function event_venues($content)
594
+	{
595
+		return $content
596
+			   . EEH_Template::display_template(
597
+				   EE_TEMPLATES . EE_Config::get_current_theme() . '/content-espresso_events-venues.php',
598
+				   array(),
599
+				   true
600
+			   );
601
+	}
602
+
603
+
604
+	/**
605
+	 *    _initial_setup
606
+	 *
607
+	 * @access    public
608
+	 * @return    void
609
+	 */
610
+	private function _load_assests()
611
+	{
612
+		do_action('AHEE__EED_Events_Archive_Filters__before_load_assests');
613
+		wp_enqueue_style('espresso_default');
614
+		wp_enqueue_style('espresso_custom_css');
615
+		add_filter('FHEE_load_EE_Session', '__return_true');
616
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
617
+		if (EE_Registry::instance()->CFG->map_settings->use_google_maps) {
618
+			add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11);
619
+		}
620
+		// add_filter( 'the_excerpt', array( $this, 'the_excerpt' ), 999 );
621
+	}
622
+
623
+
624
+	/**
625
+	 *    _get_template
626
+	 *
627
+	 * @access    private
628
+	 * @return    string
629
+	 */
630
+	private function _get_template($which = 'part')
631
+	{
632
+		return EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events.php';
633
+	}
634
+
635
+
636
+	/**
637
+	 *    excerpt_length
638
+	 *
639
+	 * @access    public
640
+	 * @return    void
641
+	 */
642
+	public function excerpt_length($length)
643
+	{
644
+
645
+		if (self::$_type == 'grid') {
646
+			return 36;
647
+		}
648
+
649
+		switch (EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size) {
650
+			case 'tiny':
651
+				return 12;
652
+				break;
653
+			case 'small':
654
+				return 24;
655
+				break;
656
+			case 'large':
657
+				return 48;
658
+				break;
659
+			case 'medium':
660
+			default:
661
+				return 36;
662
+		}
663
+	}
664
+
665
+
666
+	/**
667
+	 *    excerpt_more
668
+	 *
669
+	 * @access    public
670
+	 * @return    void
671
+	 */
672
+	public function excerpt_more($more)
673
+	{
674
+		return '&hellip;';
675
+	}
676
+
677
+
678
+
679
+
680
+	/**
681
+	 *    wp_enqueue_scripts
682
+	 *
683
+	 * @access    public
684
+	 * @return    void
685
+	 */
686
+	public function wp_enqueue_scripts()
687
+	{
688
+		// get some style
689
+		if (apply_filters('FHEE_enable_default_espresso_css', false)) {
690
+			// first check uploads folder
691
+			if (
692
+				is_readable(
693
+					get_stylesheet_directory() . EE_Config::get_current_theme() . '/archive-espresso_events.css'
694
+				)
695
+			) {
696
+				wp_register_style(
697
+					'archive-espresso_events',
698
+					get_stylesheet_directory_uri() . EE_Config::get_current_theme(
699
+					) . '/archive-espresso_events.css',
700
+					array('dashicons', 'espresso_default')
701
+				);
702
+			} else {
703
+				wp_register_style(
704
+					'archive-espresso_events',
705
+					EE_TEMPLATES_URL . EE_Config::get_current_theme() . '/archive-espresso_events.css',
706
+					array('dashicons', 'espresso_default')
707
+				);
708
+			}
709
+			if (
710
+				is_readable(
711
+					get_stylesheet_directory() . EE_Config::get_current_theme() . '/archive-espresso_events.js'
712
+				)
713
+			) {
714
+				wp_register_script(
715
+					'archive-espresso_events',
716
+					get_stylesheet_directory_uri() . EE_Config::get_current_theme() . '/archive-espresso_events.js',
717
+					array('jquery-masonry'),
718
+					'1.0',
719
+					true
720
+				);
721
+			} else {
722
+				wp_register_script(
723
+					'archive-espresso_events',
724
+					EVENTS_ARCHIVE_ASSETS_URL . 'archive-espresso_events.js',
725
+					array('jquery-masonry'),
726
+					'1.0',
727
+					true
728
+				);
729
+			}
730
+			wp_enqueue_style('archive-espresso_events');
731
+			wp_enqueue_script('jquery-masonry');
732
+			wp_enqueue_script('archive-espresso_events');
733
+			add_action('wp_footer', array('EED_Events_Archive_Filters', 'localize_grid_event_lists'), 1);
734
+		}
735
+	}
736
+
737
+
738
+	/**
739
+	 *    template_settings_form
740
+	 *
741
+	 * @access    public
742
+	 * @static
743
+	 * @return    void
744
+	 */
745
+	public static function localize_grid_event_lists()
746
+	{
747
+		wp_localize_script(
748
+			'archive-espresso_events',
749
+			'espresso_grid_event_lists',
750
+			EED_Events_Archive_Filters::$espresso_grid_event_lists
751
+		);
752
+	}
753
+
754
+
755
+	/**
756
+	 *    template_settings_form
757
+	 *
758
+	 * @access    public
759
+	 * @static
760
+	 * @return    void
761
+	 */
762
+	public static function template_settings_form()
763
+	{
764
+		$EE = EE_Registry::instance();
765
+		$EE->CFG->template_settings->EED_Events_Archive_Filters = isset($EE->CFG->template_settings->EED_Events_Archive_Filters)
766
+			? $EE->CFG->template_settings->EED_Events_Archive_Filters : new EE_Events_Archive_Config();
767
+		$EE->CFG->template_settings->EED_Events_Archive_Filters = apply_filters(
768
+			'FHEE__Event_List__template_settings_form__event_list_config',
769
+			$EE->CFG->template_settings->EED_Events_Archive_Filters
770
+		);
771
+		EEH_Template::display_template(
772
+			EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php',
773
+			$EE->CFG->template_settings->EED_Events_Archive_Filters
774
+		);
775
+	}
776
+
777
+
778
+	/**
779
+	 *    set_default_settings
780
+	 *
781
+	 * @access    public
782
+	 * @static
783
+	 * @return    void
784
+	 */
785
+	public static function set_default_settings($CFG)
786
+	{
787
+		// EEH_Debug_Tools::printr( $CFG, '$CFG  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
788
+		$CFG->display_description = isset($CFG->display_description) && ! empty($CFG->display_description)
789
+			? $CFG->display_description : 1;
790
+		$CFG->display_address = isset($CFG->display_address) && ! empty($CFG->display_address) ? $CFG->display_address
791
+			: true;
792
+		$CFG->display_venue_details = isset($CFG->display_venue_details) && ! empty($CFG->display_venue_details)
793
+			? $CFG->display_venue_details : true;
794
+		$CFG->display_expired_events = isset($CFG->display_expired_events) && ! empty($CFG->display_expired_events)
795
+			? $CFG->display_expired_events : false;
796
+		$CFG->default_type = isset($CFG->default_type) && ! empty($CFG->default_type) ? $CFG->default_type : 'grid';
797
+		$CFG->event_list_grid_size = isset($CFG->event_list_grid_size) && ! empty($CFG->event_list_grid_size)
798
+			? $CFG->event_list_grid_size : 'medium';
799
+		$CFG->templates['full'] = isset($CFG->templates['full']) && ! empty($CFG->templates['full'])
800
+			? $CFG->templates['full']
801
+			: EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events.php';
802
+		$CFG->templates['part'] = isset($CFG->templates['part']) && ! empty($CFG->templates['part'])
803
+			? $CFG->templates['part']
804
+			: EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events-grid-view.php';
805
+		return $CFG;
806
+	}
807
+
808
+
809
+	/**
810
+	 *    filter_config
811
+	 *
812
+	 * @access    public
813
+	 * @return    void
814
+	 */
815
+	public function filter_config($CFG)
816
+	{
817
+		return $CFG;
818
+	}
819
+
820
+
821
+	/**
822
+	 *    filter_config
823
+	 *
824
+	 * @access    public
825
+	 * @return    void
826
+	 */
827
+	public static function update_template_settings($CFG, $REQ)
828
+	{
829
+		// $CFG->template_settings->EED_Events_Archive_Filters = new stdClass();
830
+		$CFG->EED_Events_Archive_Filters->display_description = isset($REQ['display_description_in_event_list'])
831
+			? absint($REQ['display_description_in_event_list']) : 1;
832
+		$CFG->EED_Events_Archive_Filters->display_address = isset($REQ['display_address_in_event_list']) ? absint(
833
+			$REQ['display_address_in_event_list']
834
+		) : true;
835
+		$CFG->EED_Events_Archive_Filters->display_venue_details = isset($REQ['display_venue_details_in_event_list'])
836
+			? absint($REQ['display_venue_details_in_event_list']) : true;
837
+		$CFG->EED_Events_Archive_Filters->display_expired_events = isset($REQ['display_expired_events']) ? absint(
838
+			$REQ['display_expired_events']
839
+		) : false;
840
+		$CFG->EED_Events_Archive_Filters->default_type = isset($REQ['default_type']) ? sanitize_text_field(
841
+			$REQ['default_type']
842
+		) : 'grid';
843
+		$CFG->EED_Events_Archive_Filters->event_list_grid_size = isset($REQ['event_list_grid_size'])
844
+			? sanitize_text_field($REQ['event_list_grid_size']) : 'medium';
845
+		$CFG->EED_Events_Archive_Filters->templates = array(
846
+			'full' => EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events.php',
847
+		);
848
+
849
+		switch ($CFG->EED_Events_Archive_Filters->default_type) {
850
+			case 'dates':
851
+				$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme()
852
+																	  . '/archive-espresso_events-dates-view.php';
853
+				break;
854
+			case 'text':
855
+				$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme()
856
+																	  . '/archive-espresso_events-text-view.php';
857
+				break;
858
+			default:
859
+				$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme()
860
+																	  . '/archive-espresso_events-grid-view.php';
861
+		}
862
+
863
+		$CFG->EED_Events_Archive_Filters = isset($REQ['reset_event_list_settings'])
864
+										   && absint($REQ['reset_event_list_settings']) == 1
865
+			? new EE_Events_Archive_Config()
866
+			: $CFG->EED_Events_Archive_Filters;
867
+		return $CFG;
868
+	}
869
+
870
+
871
+	/**
872
+	 *    get_template_part
873
+	 *
874
+	 * @access    public
875
+	 * @return    void
876
+	 */
877
+	public static function get_template_part()
878
+	{
879
+		switch (self::$_type) {
880
+			case 'dates':
881
+				return 'archive-espresso_events-dates-view.php';
882
+				break;
883
+			case 'text':
884
+				return 'archive-espresso_events-text-view.php';
885
+				break;
886
+			default:
887
+				return 'archive-espresso_events-grid-view.php';
888
+		}
889
+	}
890
+
891
+
892
+	/**
893
+	 *    event_list_template_filters
894
+	 *
895
+	 * @access    public
896
+	 * @return    void
897
+	 */
898
+	public function event_list_template_filters()
899
+	{
900
+		$args = array(
901
+			'form_url'         => get_post_type_archive_link('espresso_events'),
902
+			// add_query_arg( array( 'post_type' => 'espresso_events' ), home_url() ),
903
+			'elf_month'        => EED_Events_Archive_Filters::_display_month(),
904
+			'elf_category'     => EED_Events_Archive_Filters::_event_category_slug(),
905
+			'elf_show_expired' => EED_Events_Archive_Filters::_show_expired(),
906
+			'elf_type'         => self::$_type,
907
+		);
908
+		EEH_Template::display_template(
909
+			EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events-filters.php',
910
+			$args
911
+		);
912
+	}
913
+
914
+
915
+	/**
916
+	 *    event_list_css
917
+	 *
918
+	 * @access    public
919
+	 * @return    void
920
+	 */
921
+	public static function event_list_css($extra_class = '')
922
+	{
923
+		$EE = EE_Registry::instance();
924
+		$event_list_css = ! empty($extra_class) ? array($extra_class) : array();
925
+		$event_list_css[] = 'espresso-event-list-event';
926
+		if (self::$_type == 'grid') {
927
+			$event_list_grid_size = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size)
928
+				? $EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size : 'medium';
929
+			$event_list_css[] = $event_list_grid_size . '-event-list-grid';
930
+		}
931
+		$event_list_css = apply_filters(
932
+			'EED_Events_Archive_Filters__event_list_css__event_list_css_array',
933
+			$event_list_css
934
+		);
935
+		return implode(' ', $event_list_css);
936
+	}
937
+
938
+
939
+	/**
940
+	 *    event_categories
941
+	 *
942
+	 * @access    public
943
+	 * @return    void
944
+	 */
945
+	public static function event_categories()
946
+	{
947
+		return EE_Registry::instance()->load_model('Term')->get_all_ee_categories();
948
+	}
949
+
950
+
951
+	/**
952
+	 *    display_description
953
+	 *
954
+	 * @access    public
955
+	 * @return    void
956
+	 */
957
+	public static function display_description($value)
958
+	{
959
+		$EE = EE_Registry::instance();
960
+		$display_description = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_description)
961
+			? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_description : 1;
962
+		return $display_description === $value ? true : false;
963
+	}
964
+
965
+
966
+	/**
967
+	 *    display_venue_details
968
+	 *
969
+	 * @access    public
970
+	 * @return    void
971
+	 */
972
+	public static function display_venue_details()
973
+	{
974
+		$EE = EE_Registry::instance();
975
+		$display_venue_details = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details)
976
+			? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details : true;
977
+		$venue_name = EEH_Venue_View::venue_name();
978
+		return $display_venue_details && ! empty($venue_name) ? true : false;
979
+	}
980
+
981
+
982
+	/**
983
+	 *    display_address
984
+	 *
985
+	 * @access    public
986
+	 * @return    void
987
+	 */
988
+	public static function display_address()
989
+	{
990
+		$EE = EE_Registry::instance();
991
+		$display_address = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_address)
992
+			? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_address : false;
993
+		$venue_name = EEH_Venue_View::venue_name();
994
+		return $display_address && ! empty($venue_name) ? true : false;
995
+	}
996
+
997
+
998
+	/**
999
+	 *    pagination
1000
+	 *
1001
+	 * @access    public
1002
+	 * @return    void
1003
+	 */
1004
+	public static function pagination()
1005
+	{
1006
+		global $wp_query;
1007
+		$big = 999999999; // need an unlikely integer
1008
+		$pagination = paginate_links(
1009
+			array(
1010
+				'base'         => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
1011
+				'format'       => '?paged=%#%',
1012
+				'current'      => max(1, get_query_var('paged')),
1013
+				'total'        => $wp_query->max_num_pages,
1014
+				'show_all'     => true,
1015
+				'end_size'     => 10,
1016
+				'mid_size'     => 6,
1017
+				'prev_next'    => true,
1018
+				'prev_text'    => __('&lsaquo; PREV', 'event_espresso'),
1019
+				'next_text'    => __('NEXT &rsaquo;', 'event_espresso'),
1020
+				'type'         => 'plain',
1021
+				'add_args'     => false,
1022
+				'add_fragment' => '',
1023
+			)
1024
+		);
1025
+		return ! empty($pagination) ? '<div class="ee-pagination-dv clear">' . $pagination . '</div>' : '';
1026
+	}
1027
+
1028
+
1029
+	/**
1030
+	 *    event_list_title
1031
+	 *
1032
+	 * @access    public
1033
+	 * @return    void
1034
+	 */
1035
+	public static function event_list_title()
1036
+	{
1037
+		return apply_filters(
1038
+			'EED_Events_Archive_Filters__event_list_title__event_list_title',
1039
+			__('Upcoming Events', 'event_espresso')
1040
+		);
1041
+	}
1042 1042
 }
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         ) : '';
159 159
         $view = ! empty($elf_type) ? $elf_type : $view;
160 160
         $view = apply_filters('EED_Events_Archive_Filters__set_type__type', $view);
161
-        if (! empty($view) && in_array($view, EED_Events_Archive_Filters::$_types)) {
161
+        if ( ! empty($view) && in_array($view, EED_Events_Archive_Filters::$_types)) {
162 162
             self::$_type = $view;
163 163
         }
164 164
     }
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     public static function posts_join_sql_for_terms($join_terms = null)
254 254
     {
255 255
         $SQL = '';
256
-        if (! empty($join_terms)) {
256
+        if ( ! empty($join_terms)) {
257 257
             global $wpdb;
258 258
             $SQL .= " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)";
259 259
             $SQL .= " LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)";
@@ -280,29 +280,29 @@  discard block
 block discarded – undo
280 280
             switch ($orderby) {
281 281
                 case 'ticket_start':
282 282
                 case 'ticket_end':
283
-                    $SQL .= ' LEFT JOIN ' . EEM_Datetime_Ticket::instance()->table() . ' ON ('
284
-                            . EEM_Datetime::instance()->table() . '.DTT_ID = '
285
-                            . EEM_Datetime_Ticket::instance()->table() . '.DTT_ID )';
286
-                    $SQL .= ' LEFT JOIN ' . EEM_Ticket::instance()->table() . ' ON ('
287
-                            . EEM_Datetime_Ticket::instance()->table() . '.TKT_ID = '
288
-                            . EEM_Ticket::instance()->table() . '.TKT_ID )';
283
+                    $SQL .= ' LEFT JOIN '.EEM_Datetime_Ticket::instance()->table().' ON ('
284
+                            . EEM_Datetime::instance()->table().'.DTT_ID = '
285
+                            . EEM_Datetime_Ticket::instance()->table().'.DTT_ID )';
286
+                    $SQL .= ' LEFT JOIN '.EEM_Ticket::instance()->table().' ON ('
287
+                            . EEM_Datetime_Ticket::instance()->table().'.TKT_ID = '
288
+                            . EEM_Ticket::instance()->table().'.TKT_ID )';
289 289
                     break;
290 290
 
291 291
                 case 'venue_title':
292 292
                 case 'city':
293
-                    $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = '
294
-                            . EEM_Event_Venue::instance()->table() . '.EVT_ID )';
295
-                    $SQL .= ' LEFT JOIN ' . EEM_Venue::instance()->table() . ' ON ('
296
-                            . EEM_Event_Venue::instance()->table() . '.VNU_ID = '
297
-                            . EEM_Venue::instance()->table() . '.VNU_ID )';
293
+                    $SQL .= ' LEFT JOIN '.EEM_Event_Venue::instance()->table().' ON ('.$wpdb->posts.'.ID = '
294
+                            . EEM_Event_Venue::instance()->table().'.EVT_ID )';
295
+                    $SQL .= ' LEFT JOIN '.EEM_Venue::instance()->table().' ON ('
296
+                            . EEM_Event_Venue::instance()->table().'.VNU_ID = '
297
+                            . EEM_Venue::instance()->table().'.VNU_ID )';
298 298
                     break;
299 299
 
300 300
                 case 'state':
301
-                    $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = '
302
-                            . EEM_Event_Venue::instance()->table() . '.EVT_ID )';
303
-                    $SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->second_table() . ' ON ('
304
-                            . EEM_Event_Venue::instance()->table() . '.VNU_ID = '
305
-                            . EEM_Event_Venue::instance()->second_table() . '.VNU_ID )';
301
+                    $SQL .= ' LEFT JOIN '.EEM_Event_Venue::instance()->table().' ON ('.$wpdb->posts.'.ID = '
302
+                            . EEM_Event_Venue::instance()->table().'.EVT_ID )';
303
+                    $SQL .= ' LEFT JOIN '.EEM_Event_Venue::instance()->second_table().' ON ('
304
+                            . EEM_Event_Venue::instance()->table().'.VNU_ID = '
305
+                            . EEM_Event_Venue::instance()->second_table().'.VNU_ID )';
306 306
                     break;
307 307
             }
308 308
         }
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
     public static function posts_where_sql_for_show_expired($show_expired = false)
349 349
     {
350 350
         return ! $show_expired
351
-            ? ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > "' . date('Y-m-d H:s:i') . '" '
351
+            ? ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_end > "'.date('Y-m-d H:s:i').'" '
352 352
             : '';
353 353
     }
354 354
 
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
     public static function posts_where_sql_for_event_category_slug($event_category_slug = null)
364 364
     {
365 365
         global $wpdb;
366
-        return ! empty($event_category_slug) ? ' AND ' . $wpdb->terms . '.slug = "' . $event_category_slug . '" ' : '';
366
+        return ! empty($event_category_slug) ? ' AND '.$wpdb->terms.'.slug = "'.$event_category_slug.'" ' : '';
367 367
     }
368 368
 
369 369
     /**
@@ -376,13 +376,13 @@  discard block
 block discarded – undo
376 376
     public static function posts_where_sql_for_event_list_month($month = null)
377 377
     {
378 378
         $SQL = '';
379
-        if (! empty($month)) {
379
+        if ( ! empty($month)) {
380 380
             // event start date is LESS than the end of the month ( so nothing that doesn't start until next month )
381
-            $SQL = ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start';
382
-            $SQL .= ' <= "' . date('Y-m-t 23:59:59', \EEH_DTT_Helper::first_of_month_timestamp($month)) . '"';
381
+            $SQL = ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_start';
382
+            $SQL .= ' <= "'.date('Y-m-t 23:59:59', \EEH_DTT_Helper::first_of_month_timestamp($month)).'"';
383 383
             // event end date is GREATER than the start of the month ( so nothing that ended before this month )
384
-            $SQL .= ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end';
385
-            $SQL .= ' >= "' . date('Y-m-d 0:0:00', \EEH_DTT_Helper::first_of_month_timestamp($month)) . '" ';
384
+            $SQL .= ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_end';
385
+            $SQL .= ' >= "'.date('Y-m-d 0:0:00', \EEH_DTT_Helper::first_of_month_timestamp($month)).'" ';
386 386
         }
387 387
         return $SQL;
388 388
     }
@@ -437,43 +437,43 @@  discard block
 block discarded – undo
437 437
             switch ($orderby) {
438 438
                 case 'id':
439 439
                 case 'ID':
440
-                    $SQL .= $glue . $wpdb->posts . '.ID ' . $sort;
440
+                    $SQL .= $glue.$wpdb->posts.'.ID '.$sort;
441 441
                     break;
442 442
 
443 443
                 case 'start_date':
444
-                    $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_start ' . $sort;
444
+                    $SQL .= $glue.EEM_Datetime::instance()->table().'.DTT_EVT_start '.$sort;
445 445
                     break;
446 446
 
447 447
                 case 'end_date':
448
-                    $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_end ' . $sort;
448
+                    $SQL .= $glue.EEM_Datetime::instance()->table().'.DTT_EVT_end '.$sort;
449 449
                     break;
450 450
 
451 451
                 case 'event_name':
452
-                    $SQL .= $glue . $wpdb->posts . '.post_title ' . $sort;
452
+                    $SQL .= $glue.$wpdb->posts.'.post_title '.$sort;
453 453
                     break;
454 454
 
455 455
                 case 'category_slug':
456
-                    $SQL .= $glue . $wpdb->terms . '.slug ' . $sort;
456
+                    $SQL .= $glue.$wpdb->terms.'.slug '.$sort;
457 457
                     break;
458 458
 
459 459
                 case 'ticket_start':
460
-                    $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_start_date ' . $sort;
460
+                    $SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_start_date '.$sort;
461 461
                     break;
462 462
 
463 463
                 case 'ticket_end':
464
-                    $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_end_date ' . $sort;
464
+                    $SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_end_date '.$sort;
465 465
                     break;
466 466
 
467 467
                 case 'venue_title':
468
-                    $SQL .= $glue . 'venue_title ' . $sort;
468
+                    $SQL .= $glue.'venue_title '.$sort;
469 469
                     break;
470 470
 
471 471
                 case 'city':
472
-                    $SQL .= $glue . EEM_Venue::instance()->second_table() . '.VNU_city ' . $sort;
472
+                    $SQL .= $glue.EEM_Venue::instance()->second_table().'.VNU_city '.$sort;
473 473
                     break;
474 474
 
475 475
                 case 'state':
476
-                    $SQL .= $glue . EEM_State::instance()->table() . '.STA_name ' . $sort;
476
+                    $SQL .= $glue.EEM_State::instance()->table().'.STA_name '.$sort;
477 477
                     break;
478 478
             }
479 479
             $cntr++;
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
      */
529 529
     public function event_list_pagination()
530 530
     {
531
-        echo '<div class="ee-pagination-dv ee-clear-float">' . espresso_event_list_pagination() . '</div>';
531
+        echo '<div class="ee-pagination-dv ee-clear-float">'.espresso_event_list_pagination().'</div>';
532 532
     }
533 533
 
534 534
 
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
     public function event_details($content)
543 543
     {
544 544
         return EEH_Template::display_template(
545
-            EE_TEMPLATES . EE_Config::get_current_theme() . '/content-espresso_events-details.php',
545
+            EE_TEMPLATES.EE_Config::get_current_theme().'/content-espresso_events-details.php',
546 546
             array('the_content' => $content),
547 547
             true
548 548
         );
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
     {
561 561
         return $content
562 562
                . EEH_Template::display_template(
563
-                   EE_TEMPLATES . EE_Config::get_current_theme() . '/content-espresso_events-tickets.php',
563
+                   EE_TEMPLATES.EE_Config::get_current_theme().'/content-espresso_events-tickets.php',
564 564
                    array(),
565 565
                    true
566 566
                );
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
     {
578 578
         return $content
579 579
                . EEH_Template::display_template(
580
-                   EE_TEMPLATES . EE_Config::get_current_theme() . '/content-espresso_events-datetimes.php',
580
+                   EE_TEMPLATES.EE_Config::get_current_theme().'/content-espresso_events-datetimes.php',
581 581
                    array(),
582 582
                    true
583 583
                );
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
     {
595 595
         return $content
596 596
                . EEH_Template::display_template(
597
-                   EE_TEMPLATES . EE_Config::get_current_theme() . '/content-espresso_events-venues.php',
597
+                   EE_TEMPLATES.EE_Config::get_current_theme().'/content-espresso_events-venues.php',
598 598
                    array(),
599 599
                    true
600 600
                );
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
      */
630 630
     private function _get_template($which = 'part')
631 631
     {
632
-        return EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events.php';
632
+        return EE_TEMPLATES.EE_Config::get_current_theme().'/archive-espresso_events.php';
633 633
     }
634 634
 
635 635
 
@@ -690,30 +690,30 @@  discard block
 block discarded – undo
690 690
             // first check uploads folder
691 691
             if (
692 692
                 is_readable(
693
-                    get_stylesheet_directory() . EE_Config::get_current_theme() . '/archive-espresso_events.css'
693
+                    get_stylesheet_directory().EE_Config::get_current_theme().'/archive-espresso_events.css'
694 694
                 )
695 695
             ) {
696 696
                 wp_register_style(
697 697
                     'archive-espresso_events',
698
-                    get_stylesheet_directory_uri() . EE_Config::get_current_theme(
699
-                    ) . '/archive-espresso_events.css',
698
+                    get_stylesheet_directory_uri().EE_Config::get_current_theme(
699
+                    ).'/archive-espresso_events.css',
700 700
                     array('dashicons', 'espresso_default')
701 701
                 );
702 702
             } else {
703 703
                 wp_register_style(
704 704
                     'archive-espresso_events',
705
-                    EE_TEMPLATES_URL . EE_Config::get_current_theme() . '/archive-espresso_events.css',
705
+                    EE_TEMPLATES_URL.EE_Config::get_current_theme().'/archive-espresso_events.css',
706 706
                     array('dashicons', 'espresso_default')
707 707
                 );
708 708
             }
709 709
             if (
710 710
                 is_readable(
711
-                    get_stylesheet_directory() . EE_Config::get_current_theme() . '/archive-espresso_events.js'
711
+                    get_stylesheet_directory().EE_Config::get_current_theme().'/archive-espresso_events.js'
712 712
                 )
713 713
             ) {
714 714
                 wp_register_script(
715 715
                     'archive-espresso_events',
716
-                    get_stylesheet_directory_uri() . EE_Config::get_current_theme() . '/archive-espresso_events.js',
716
+                    get_stylesheet_directory_uri().EE_Config::get_current_theme().'/archive-espresso_events.js',
717 717
                     array('jquery-masonry'),
718 718
                     '1.0',
719 719
                     true
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
             } else {
722 722
                 wp_register_script(
723 723
                     'archive-espresso_events',
724
-                    EVENTS_ARCHIVE_ASSETS_URL . 'archive-espresso_events.js',
724
+                    EVENTS_ARCHIVE_ASSETS_URL.'archive-espresso_events.js',
725 725
                     array('jquery-masonry'),
726 726
                     '1.0',
727 727
                     true
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
             $EE->CFG->template_settings->EED_Events_Archive_Filters
770 770
         );
771 771
         EEH_Template::display_template(
772
-            EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php',
772
+            EVENTS_ARCHIVE_TEMPLATES_PATH.'admin-event-list-settings.template.php',
773 773
             $EE->CFG->template_settings->EED_Events_Archive_Filters
774 774
         );
775 775
     }
@@ -798,10 +798,10 @@  discard block
 block discarded – undo
798 798
             ? $CFG->event_list_grid_size : 'medium';
799 799
         $CFG->templates['full'] = isset($CFG->templates['full']) && ! empty($CFG->templates['full'])
800 800
             ? $CFG->templates['full']
801
-            : EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events.php';
801
+            : EE_TEMPLATES.EE_Config::get_current_theme().'/archive-espresso_events.php';
802 802
         $CFG->templates['part'] = isset($CFG->templates['part']) && ! empty($CFG->templates['part'])
803 803
             ? $CFG->templates['part']
804
-            : EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events-grid-view.php';
804
+            : EE_TEMPLATES.EE_Config::get_current_theme().'/archive-espresso_events-grid-view.php';
805 805
         return $CFG;
806 806
     }
807 807
 
@@ -843,20 +843,20 @@  discard block
 block discarded – undo
843 843
         $CFG->EED_Events_Archive_Filters->event_list_grid_size = isset($REQ['event_list_grid_size'])
844 844
             ? sanitize_text_field($REQ['event_list_grid_size']) : 'medium';
845 845
         $CFG->EED_Events_Archive_Filters->templates = array(
846
-            'full' => EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events.php',
846
+            'full' => EE_TEMPLATES.EE_Config::get_current_theme().'/archive-espresso_events.php',
847 847
         );
848 848
 
849 849
         switch ($CFG->EED_Events_Archive_Filters->default_type) {
850 850
             case 'dates':
851
-                $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme()
851
+                $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme()
852 852
                                                                       . '/archive-espresso_events-dates-view.php';
853 853
                 break;
854 854
             case 'text':
855
-                $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme()
855
+                $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme()
856 856
                                                                       . '/archive-espresso_events-text-view.php';
857 857
                 break;
858 858
             default:
859
-                $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme()
859
+                $CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme()
860 860
                                                                       . '/archive-espresso_events-grid-view.php';
861 861
         }
862 862
 
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
             'elf_type'         => self::$_type,
907 907
         );
908 908
         EEH_Template::display_template(
909
-            EE_TEMPLATES . EE_Config::get_current_theme() . '/archive-espresso_events-filters.php',
909
+            EE_TEMPLATES.EE_Config::get_current_theme().'/archive-espresso_events-filters.php',
910 910
             $args
911 911
         );
912 912
     }
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
         if (self::$_type == 'grid') {
927 927
             $event_list_grid_size = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size)
928 928
                 ? $EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size : 'medium';
929
-            $event_list_css[] = $event_list_grid_size . '-event-list-grid';
929
+            $event_list_css[] = $event_list_grid_size.'-event-list-grid';
930 930
         }
931 931
         $event_list_css = apply_filters(
932 932
             'EED_Events_Archive_Filters__event_list_css__event_list_css_array',
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
                 'add_fragment' => '',
1023 1023
             )
1024 1024
         );
1025
-        return ! empty($pagination) ? '<div class="ee-pagination-dv clear">' . $pagination . '</div>' : '';
1025
+        return ! empty($pagination) ? '<div class="ee-pagination-dv clear">'.$pagination.'</div>' : '';
1026 1026
     }
1027 1027
 
1028 1028
 
Please login to merge, or discard this patch.
modules/feeds/EED_Feeds.module.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      *
113 113
      * @access    public
114 114
      * @param    string $SQL the JOIN clause for the comment feed query
115
-     * @return    void
115
+     * @return    string
116 116
      */
117 117
     public static function comment_feed_join($SQL)
118 118
     {
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      *
134 134
      * @access    public
135 135
      * @param    string $SQL the WHERE clause for the comment feed query
136
-     * @return    void
136
+     * @return    string
137 137
      */
138 138
     public static function comment_feed_where($SQL)
139 139
     {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      *
151 151
      * @access    public
152 152
      * @param    string $content
153
-     * @return    void
153
+     * @return    string
154 154
      */
155 155
     public static function the_event_feed($content)
156 156
     {
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      *
192 192
      * @access    public
193 193
      * @param    string $content
194
-     * @return    void
194
+     * @return    string
195 195
      */
196 196
     public static function the_venue_feed($content)
197 197
     {
Please login to merge, or discard this patch.
Indentation   +213 added lines, -213 removed lines patch added patch discarded remove patch
@@ -12,217 +12,217 @@
 block discarded – undo
12 12
 {
13 13
 
14 14
 
15
-    /**
16
-     * @return EED_Feeds
17
-     */
18
-    public static function instance()
19
-    {
20
-        return parent::get_instance(__CLASS__);
21
-    }
22
-
23
-
24
-    /**
25
-     *    set_hooks - for hooking into EE Core, other modules, etc
26
-     *
27
-     * @access    public
28
-     * @return    void
29
-     */
30
-    public static function set_hooks()
31
-    {
32
-        add_action('parse_request', array('EED_Feeds', 'parse_request'), 10);
33
-        add_filter('default_feed', array('EED_Feeds', 'default_feed'), 10, 1);
34
-        add_filter('comment_feed_join', array('EED_Feeds', 'comment_feed_join'), 10, 2);
35
-        add_filter('comment_feed_where', array('EED_Feeds', 'comment_feed_where'), 10, 2);
36
-    }
37
-
38
-    /**
39
-     *    set_hooks_admin - for hooking into EE Admin Core, other modules, etc
40
-     *
41
-     * @access    public
42
-     * @return    void
43
-     */
44
-    public static function set_hooks_admin()
45
-    {
46
-    }
47
-
48
-
49
-    /**
50
-     *    run - initial module setup
51
-     *
52
-     * @access    public
53
-     * @return    void
54
-     */
55
-    public function run($WP)
56
-    {
57
-    }
58
-
59
-
60
-    /**
61
-     *    default_feed
62
-     *
63
-     * @access    public
64
-     * @param    type    rss2, atom, rss, rdf, rssjs
65
-     * @return    string
66
-     */
67
-    public static function default_feed($type = 'rss2')
68
-    {
69
-        // rss2, atom, rss, rdf, rssjs
70
-        $type = 'rss2';
71
-        return $type;
72
-    }
73
-
74
-
75
-    /**
76
-     *    parse_request
77
-     *
78
-     * @access    public
79
-     * @return    void
80
-     */
81
-    public static function parse_request()
82
-    {
83
-        if (EE_Registry::instance()->REQ->is_set('post_type')) {
84
-            // define path to templates
85
-            define('RSS_FEEDS_TEMPLATES_PATH', str_replace('\\', '/', plugin_dir_path(__FILE__)) . 'templates/');
86
-            // what kinda post_type are we dealing with ?
87
-            switch (EE_Registry::instance()->REQ->get('post_type')) {
88
-                case 'espresso_events':
89
-                    // for rss2, atom, rss, rdf
90
-                    add_filter('the_excerpt_rss', array('EED_Feeds', 'the_event_feed'), 10, 1);
91
-                    add_filter('the_content_feed', array('EED_Feeds', 'the_event_feed'), 10, 1);
92
-                    // for json ( also uses the above filter )
93
-                    add_filter('rssjs_feed_item', array('EED_Feeds', 'the_event_rssjs_feed'), 10, 1);
94
-                    break;
95
-                case 'espresso_venues':
96
-                    // for rss2, atom, rss, rdf
97
-                    add_filter('the_excerpt_rss', array('EED_Feeds', 'the_venue_feed'), 10, 1);
98
-                    add_filter('the_content_feed', array('EED_Feeds', 'the_venue_feed'), 10, 1);
99
-                    // for json ( also uses the above filter )
100
-                    add_filter('rssjs_feed_item', array('EED_Feeds', 'the_venue_rssjs_feed'), 10, 1);
101
-                    break;
102
-            }
103
-        }
104
-    }
105
-
106
-
107
-    /**
108
-     *    comment_feed_join - EVEN THOUGH... our espresso_attendees custom post type is set to NOT PUBLIC
109
-     *    WordPress thought it would be a good idea to display the comments for them in the RSS feeds... we think NOT
110
-     *    so this little snippet of SQL taps into the comment feed query and removes comments for the
111
-     *    espresso_attendees post_type
112
-     *
113
-     * @access    public
114
-     * @param    string $SQL the JOIN clause for the comment feed query
115
-     * @return    void
116
-     */
117
-    public static function comment_feed_join($SQL)
118
-    {
119
-        global $wpdb;
120
-        // check for wp_posts table in JOIN clause
121
-        if (strpos($SQL, $wpdb->posts) !== false) {
122
-            add_filter('EED_Feeds__comment_feed_where__espresso_attendees', '__return_true');
123
-        }
124
-        return $SQL;
125
-    }
126
-
127
-
128
-    /**
129
-     *    comment_feed_where - EVEN THOUGH... our espresso_attendees custom post type is set to NOT PUBLIC
130
-     *    WordPress thought it would be a good idea to display the comments for them in the RSS feeds... we think NOT
131
-     *    so this little snippet of SQL taps into the comment feed query and removes comments for the
132
-     *    espresso_attendees post_type
133
-     *
134
-     * @access    public
135
-     * @param    string $SQL the WHERE clause for the comment feed query
136
-     * @return    void
137
-     */
138
-    public static function comment_feed_where($SQL)
139
-    {
140
-        global $wp_query, $wpdb;
141
-        if ($wp_query->is_comment_feed && apply_filters('EED_Feeds__comment_feed_where__espresso_attendees', false)) {
142
-            $SQL .= " AND $wpdb->posts.post_type != 'espresso_attendees'";
143
-        }
144
-        return $SQL;
145
-    }
146
-
147
-
148
-    /**
149
-     *    the_event_feed
150
-     *
151
-     * @access    public
152
-     * @param    string $content
153
-     * @return    void
154
-     */
155
-    public static function the_event_feed($content)
156
-    {
157
-        if (is_feed() && is_readable(RSS_FEEDS_TEMPLATES_PATH . 'espresso_events_feed.template.php')) {
158
-            global $post;
159
-            $template_args = array(
160
-                'EVT_ID'            => $post->ID,
161
-                'event_description' => get_option('rss_use_excerpt') ? $post->post_excerpt : $post->post_content,
162
-            );
163
-            $content = EEH_Template::display_template(
164
-                RSS_FEEDS_TEMPLATES_PATH . 'espresso_events_feed.template.php',
165
-                $template_args,
166
-                true
167
-            );
168
-        }
169
-        return $content;
170
-    }
171
-
172
-
173
-    /**
174
-     *    the_event_rssjs_feed
175
-     *
176
-     * @access    public
177
-     * @param    object $item
178
-     * @return    void
179
-     */
180
-    public static function the_event_rssjs_feed($item)
181
-    {
182
-        if (is_feed() && isset($item->description)) {
183
-            $item->description = EED_Feeds::the_event_feed($item->description);
184
-        }
185
-        return $item;
186
-    }
187
-
188
-
189
-    /**
190
-     *    the_venue_feed
191
-     *
192
-     * @access    public
193
-     * @param    string $content
194
-     * @return    void
195
-     */
196
-    public static function the_venue_feed($content)
197
-    {
198
-        if (is_feed() && is_readable(RSS_FEEDS_TEMPLATES_PATH . 'espresso_venues_feed.template.php')) {
199
-            global $post;
200
-            $template_args = array(
201
-                'VNU_ID'            => $post->ID,
202
-                'venue_description' => get_option('rss_use_excerpt') ? $post->post_excerpt : $post->post_content,
203
-            );
204
-            $content = EEH_Template::display_template(
205
-                RSS_FEEDS_TEMPLATES_PATH . 'espresso_venues_feed.template.php',
206
-                $template_args,
207
-                true
208
-            );
209
-        }
210
-        return $content;
211
-    }
212
-
213
-
214
-    /**
215
-     *    the_venue_rssjs_feed
216
-     *
217
-     * @access    public
218
-     * @param    object $item
219
-     * @return    void
220
-     */
221
-    public static function the_venue_rssjs_feed($item)
222
-    {
223
-        if (is_feed() && isset($item->description)) {
224
-            $item->description = EED_Feeds::the_venue_feed($item->description);
225
-        }
226
-        return $item;
227
-    }
15
+	/**
16
+	 * @return EED_Feeds
17
+	 */
18
+	public static function instance()
19
+	{
20
+		return parent::get_instance(__CLASS__);
21
+	}
22
+
23
+
24
+	/**
25
+	 *    set_hooks - for hooking into EE Core, other modules, etc
26
+	 *
27
+	 * @access    public
28
+	 * @return    void
29
+	 */
30
+	public static function set_hooks()
31
+	{
32
+		add_action('parse_request', array('EED_Feeds', 'parse_request'), 10);
33
+		add_filter('default_feed', array('EED_Feeds', 'default_feed'), 10, 1);
34
+		add_filter('comment_feed_join', array('EED_Feeds', 'comment_feed_join'), 10, 2);
35
+		add_filter('comment_feed_where', array('EED_Feeds', 'comment_feed_where'), 10, 2);
36
+	}
37
+
38
+	/**
39
+	 *    set_hooks_admin - for hooking into EE Admin Core, other modules, etc
40
+	 *
41
+	 * @access    public
42
+	 * @return    void
43
+	 */
44
+	public static function set_hooks_admin()
45
+	{
46
+	}
47
+
48
+
49
+	/**
50
+	 *    run - initial module setup
51
+	 *
52
+	 * @access    public
53
+	 * @return    void
54
+	 */
55
+	public function run($WP)
56
+	{
57
+	}
58
+
59
+
60
+	/**
61
+	 *    default_feed
62
+	 *
63
+	 * @access    public
64
+	 * @param    type    rss2, atom, rss, rdf, rssjs
65
+	 * @return    string
66
+	 */
67
+	public static function default_feed($type = 'rss2')
68
+	{
69
+		// rss2, atom, rss, rdf, rssjs
70
+		$type = 'rss2';
71
+		return $type;
72
+	}
73
+
74
+
75
+	/**
76
+	 *    parse_request
77
+	 *
78
+	 * @access    public
79
+	 * @return    void
80
+	 */
81
+	public static function parse_request()
82
+	{
83
+		if (EE_Registry::instance()->REQ->is_set('post_type')) {
84
+			// define path to templates
85
+			define('RSS_FEEDS_TEMPLATES_PATH', str_replace('\\', '/', plugin_dir_path(__FILE__)) . 'templates/');
86
+			// what kinda post_type are we dealing with ?
87
+			switch (EE_Registry::instance()->REQ->get('post_type')) {
88
+				case 'espresso_events':
89
+					// for rss2, atom, rss, rdf
90
+					add_filter('the_excerpt_rss', array('EED_Feeds', 'the_event_feed'), 10, 1);
91
+					add_filter('the_content_feed', array('EED_Feeds', 'the_event_feed'), 10, 1);
92
+					// for json ( also uses the above filter )
93
+					add_filter('rssjs_feed_item', array('EED_Feeds', 'the_event_rssjs_feed'), 10, 1);
94
+					break;
95
+				case 'espresso_venues':
96
+					// for rss2, atom, rss, rdf
97
+					add_filter('the_excerpt_rss', array('EED_Feeds', 'the_venue_feed'), 10, 1);
98
+					add_filter('the_content_feed', array('EED_Feeds', 'the_venue_feed'), 10, 1);
99
+					// for json ( also uses the above filter )
100
+					add_filter('rssjs_feed_item', array('EED_Feeds', 'the_venue_rssjs_feed'), 10, 1);
101
+					break;
102
+			}
103
+		}
104
+	}
105
+
106
+
107
+	/**
108
+	 *    comment_feed_join - EVEN THOUGH... our espresso_attendees custom post type is set to NOT PUBLIC
109
+	 *    WordPress thought it would be a good idea to display the comments for them in the RSS feeds... we think NOT
110
+	 *    so this little snippet of SQL taps into the comment feed query and removes comments for the
111
+	 *    espresso_attendees post_type
112
+	 *
113
+	 * @access    public
114
+	 * @param    string $SQL the JOIN clause for the comment feed query
115
+	 * @return    void
116
+	 */
117
+	public static function comment_feed_join($SQL)
118
+	{
119
+		global $wpdb;
120
+		// check for wp_posts table in JOIN clause
121
+		if (strpos($SQL, $wpdb->posts) !== false) {
122
+			add_filter('EED_Feeds__comment_feed_where__espresso_attendees', '__return_true');
123
+		}
124
+		return $SQL;
125
+	}
126
+
127
+
128
+	/**
129
+	 *    comment_feed_where - EVEN THOUGH... our espresso_attendees custom post type is set to NOT PUBLIC
130
+	 *    WordPress thought it would be a good idea to display the comments for them in the RSS feeds... we think NOT
131
+	 *    so this little snippet of SQL taps into the comment feed query and removes comments for the
132
+	 *    espresso_attendees post_type
133
+	 *
134
+	 * @access    public
135
+	 * @param    string $SQL the WHERE clause for the comment feed query
136
+	 * @return    void
137
+	 */
138
+	public static function comment_feed_where($SQL)
139
+	{
140
+		global $wp_query, $wpdb;
141
+		if ($wp_query->is_comment_feed && apply_filters('EED_Feeds__comment_feed_where__espresso_attendees', false)) {
142
+			$SQL .= " AND $wpdb->posts.post_type != 'espresso_attendees'";
143
+		}
144
+		return $SQL;
145
+	}
146
+
147
+
148
+	/**
149
+	 *    the_event_feed
150
+	 *
151
+	 * @access    public
152
+	 * @param    string $content
153
+	 * @return    void
154
+	 */
155
+	public static function the_event_feed($content)
156
+	{
157
+		if (is_feed() && is_readable(RSS_FEEDS_TEMPLATES_PATH . 'espresso_events_feed.template.php')) {
158
+			global $post;
159
+			$template_args = array(
160
+				'EVT_ID'            => $post->ID,
161
+				'event_description' => get_option('rss_use_excerpt') ? $post->post_excerpt : $post->post_content,
162
+			);
163
+			$content = EEH_Template::display_template(
164
+				RSS_FEEDS_TEMPLATES_PATH . 'espresso_events_feed.template.php',
165
+				$template_args,
166
+				true
167
+			);
168
+		}
169
+		return $content;
170
+	}
171
+
172
+
173
+	/**
174
+	 *    the_event_rssjs_feed
175
+	 *
176
+	 * @access    public
177
+	 * @param    object $item
178
+	 * @return    void
179
+	 */
180
+	public static function the_event_rssjs_feed($item)
181
+	{
182
+		if (is_feed() && isset($item->description)) {
183
+			$item->description = EED_Feeds::the_event_feed($item->description);
184
+		}
185
+		return $item;
186
+	}
187
+
188
+
189
+	/**
190
+	 *    the_venue_feed
191
+	 *
192
+	 * @access    public
193
+	 * @param    string $content
194
+	 * @return    void
195
+	 */
196
+	public static function the_venue_feed($content)
197
+	{
198
+		if (is_feed() && is_readable(RSS_FEEDS_TEMPLATES_PATH . 'espresso_venues_feed.template.php')) {
199
+			global $post;
200
+			$template_args = array(
201
+				'VNU_ID'            => $post->ID,
202
+				'venue_description' => get_option('rss_use_excerpt') ? $post->post_excerpt : $post->post_content,
203
+			);
204
+			$content = EEH_Template::display_template(
205
+				RSS_FEEDS_TEMPLATES_PATH . 'espresso_venues_feed.template.php',
206
+				$template_args,
207
+				true
208
+			);
209
+		}
210
+		return $content;
211
+	}
212
+
213
+
214
+	/**
215
+	 *    the_venue_rssjs_feed
216
+	 *
217
+	 * @access    public
218
+	 * @param    object $item
219
+	 * @return    void
220
+	 */
221
+	public static function the_venue_rssjs_feed($item)
222
+	{
223
+		if (is_feed() && isset($item->description)) {
224
+			$item->description = EED_Feeds::the_venue_feed($item->description);
225
+		}
226
+		return $item;
227
+	}
228 228
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     {
83 83
         if (EE_Registry::instance()->REQ->is_set('post_type')) {
84 84
             // define path to templates
85
-            define('RSS_FEEDS_TEMPLATES_PATH', str_replace('\\', '/', plugin_dir_path(__FILE__)) . 'templates/');
85
+            define('RSS_FEEDS_TEMPLATES_PATH', str_replace('\\', '/', plugin_dir_path(__FILE__)).'templates/');
86 86
             // what kinda post_type are we dealing with ?
87 87
             switch (EE_Registry::instance()->REQ->get('post_type')) {
88 88
                 case 'espresso_events':
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public static function the_event_feed($content)
156 156
     {
157
-        if (is_feed() && is_readable(RSS_FEEDS_TEMPLATES_PATH . 'espresso_events_feed.template.php')) {
157
+        if (is_feed() && is_readable(RSS_FEEDS_TEMPLATES_PATH.'espresso_events_feed.template.php')) {
158 158
             global $post;
159 159
             $template_args = array(
160 160
                 'EVT_ID'            => $post->ID,
161 161
                 'event_description' => get_option('rss_use_excerpt') ? $post->post_excerpt : $post->post_content,
162 162
             );
163 163
             $content = EEH_Template::display_template(
164
-                RSS_FEEDS_TEMPLATES_PATH . 'espresso_events_feed.template.php',
164
+                RSS_FEEDS_TEMPLATES_PATH.'espresso_events_feed.template.php',
165 165
                 $template_args,
166 166
                 true
167 167
             );
@@ -195,14 +195,14 @@  discard block
 block discarded – undo
195 195
      */
196 196
     public static function the_venue_feed($content)
197 197
     {
198
-        if (is_feed() && is_readable(RSS_FEEDS_TEMPLATES_PATH . 'espresso_venues_feed.template.php')) {
198
+        if (is_feed() && is_readable(RSS_FEEDS_TEMPLATES_PATH.'espresso_venues_feed.template.php')) {
199 199
             global $post;
200 200
             $template_args = array(
201 201
                 'VNU_ID'            => $post->ID,
202 202
                 'venue_description' => get_option('rss_use_excerpt') ? $post->post_excerpt : $post->post_content,
203 203
             );
204 204
             $content = EEH_Template::display_template(
205
-                RSS_FEEDS_TEMPLATES_PATH . 'espresso_venues_feed.template.php',
205
+                RSS_FEEDS_TEMPLATES_PATH.'espresso_venues_feed.template.php',
206 206
                 $template_args,
207 207
                 true
208 208
             );
Please login to merge, or discard this patch.
admin_pages/support/Support_Admin_Page_Init.core.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -16,36 +16,36 @@
 block discarded – undo
16 16
 {
17 17
 
18 18
 
19
-    public function __construct()
20
-    {
21
-        // define some help/support page related constants
22
-        define('EE_SUPPORT_PG_SLUG', 'espresso_support');
23
-        define('EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page=' . EE_SUPPORT_PG_SLUG));
24
-        define('EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES . 'support/templates/');
25
-        define('EE_SUPPORT_ADMIN', EE_ADMIN_PAGES . 'support/');
26
-        define('EE_SUPPORT_ASSETS_URL', EE_ADMIN_PAGES_URL . 'support/assets/');
27
-        parent::__construct();
28
-    }
19
+	public function __construct()
20
+	{
21
+		// define some help/support page related constants
22
+		define('EE_SUPPORT_PG_SLUG', 'espresso_support');
23
+		define('EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page=' . EE_SUPPORT_PG_SLUG));
24
+		define('EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES . 'support/templates/');
25
+		define('EE_SUPPORT_ADMIN', EE_ADMIN_PAGES . 'support/');
26
+		define('EE_SUPPORT_ASSETS_URL', EE_ADMIN_PAGES_URL . 'support/assets/');
27
+		parent::__construct();
28
+	}
29 29
 
30
-    protected function _set_init_properties()
31
-    {
32
-        $this->label = __('Help & Support', 'event_espresso');
33
-    }
30
+	protected function _set_init_properties()
31
+	{
32
+		$this->label = __('Help & Support', 'event_espresso');
33
+	}
34 34
 
35
-    protected function _set_menu_map()
36
-    {
37
-        $this->_menu_map = new EE_Admin_Page_Sub_Menu(
38
-            array(
39
-                'menu_group'              => 'extras',
40
-                'menu_order'              => 30,
41
-                'show_on_menu'            => EE_Admin_Page_Menu_Map::BLOG_AND_NETWORK_ADMIN,
42
-                'parent_slug'             => 'espresso_events',
43
-                'menu_slug'               => EE_SUPPORT_PG_SLUG,
44
-                'menu_label'              => __('Help & Support', 'event_espresso'),
45
-                'capability'              => 'ee_read_ee',
46
-                'maintenance_mode_parent' => 'espresso_maintenance_settings',
47
-                'admin_init_page'         => $this,
48
-            )
49
-        );
50
-    }
35
+	protected function _set_menu_map()
36
+	{
37
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(
38
+			array(
39
+				'menu_group'              => 'extras',
40
+				'menu_order'              => 30,
41
+				'show_on_menu'            => EE_Admin_Page_Menu_Map::BLOG_AND_NETWORK_ADMIN,
42
+				'parent_slug'             => 'espresso_events',
43
+				'menu_slug'               => EE_SUPPORT_PG_SLUG,
44
+				'menu_label'              => __('Help & Support', 'event_espresso'),
45
+				'capability'              => 'ee_read_ee',
46
+				'maintenance_mode_parent' => 'espresso_maintenance_settings',
47
+				'admin_init_page'         => $this,
48
+			)
49
+		);
50
+	}
51 51
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@
 block discarded – undo
20 20
     {
21 21
         // define some help/support page related constants
22 22
         define('EE_SUPPORT_PG_SLUG', 'espresso_support');
23
-        define('EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page=' . EE_SUPPORT_PG_SLUG));
24
-        define('EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES . 'support/templates/');
25
-        define('EE_SUPPORT_ADMIN', EE_ADMIN_PAGES . 'support/');
26
-        define('EE_SUPPORT_ASSETS_URL', EE_ADMIN_PAGES_URL . 'support/assets/');
23
+        define('EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page='.EE_SUPPORT_PG_SLUG));
24
+        define('EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES.'support/templates/');
25
+        define('EE_SUPPORT_ADMIN', EE_ADMIN_PAGES.'support/');
26
+        define('EE_SUPPORT_ASSETS_URL', EE_ADMIN_PAGES_URL.'support/assets/');
27 27
         parent::__construct();
28 28
     }
29 29
 
Please login to merge, or discard this patch.
admin_pages/support/Support_Admin_Page.core.php 2 patches
Indentation   +238 added lines, -238 removed lines patch added patch discarded remove patch
@@ -13,242 +13,242 @@
 block discarded – undo
13 13
 {
14 14
 
15 15
 
16
-    protected function _init_page_props()
17
-    {
18
-        $this->page_slug = EE_SUPPORT_PG_SLUG;
19
-        $this->page_label = esc_html__('Help & Support', 'event_espresso');
20
-        $this->_admin_base_url = EE_SUPPORT_ADMIN_URL;
21
-        $this->_admin_base_path = EE_SUPPORT_ADMIN;
22
-    }
23
-
24
-
25
-    protected function _ajax_hooks()
26
-    {
27
-    }
28
-
29
-
30
-    protected function _define_page_props()
31
-    {
32
-        $this->_labels = array();
33
-        $this->_admin_page_title = $this->page_label;
34
-    }
35
-
36
-
37
-    protected function _set_page_routes()
38
-    {
39
-        $this->_page_routes = array(
40
-            'default'    => array(
41
-                'func'       => '_contact_support',
42
-                'capability' => 'ee_read_ee',
43
-            ),
44
-            'developers' => array(
45
-                'func'       => '_developers',
46
-                'capability' => 'ee_read_ee',
47
-            ),
48
-            'shortcodes' => array(
49
-                'func'       => '_shortcodes',
50
-                'capability' => 'ee_read_ee',
51
-            ),
52
-        );
53
-    }
54
-
55
-
56
-    protected function _set_page_config()
57
-    {
58
-        $this->_page_config = array(
59
-            'default'    => array(
60
-                'nav'           => array(
61
-                    'label' => esc_html__('Support', 'event_espresso'),
62
-                    'order' => 30,
63
-                ),
64
-                'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_support_boxes')),
65
-                'require_nonce' => false,
66
-            ),
67
-            'developers' => array(
68
-                'nav'           => array(
69
-                    'label' => esc_html__('Developers', 'event_espresso'),
70
-                    'order' => 50,
71
-                ),
72
-                'metaboxes'     => $this->_default_espresso_metaboxes,
73
-                'require_nonce' => false,
74
-            ),
75
-            'shortcodes' => array(
76
-                'nav'           => array(
77
-                    'label' => esc_html__('Shortcodes', 'event_espresso'),
78
-                    'order' => 60,
79
-                ),
80
-                'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_shortcodes_boxes')),
81
-                'require_nonce' => false,
82
-            ),
83
-        );
84
-    }
85
-
86
-
87
-    // none of the below group are currently used for Support pages
88
-    protected function _add_screen_options()
89
-    {
90
-    }
91
-
92
-
93
-    protected function _add_feature_pointers()
94
-    {
95
-    }
96
-
97
-
98
-    public function admin_init()
99
-    {
100
-    }
101
-
102
-
103
-    public function admin_notices()
104
-    {
105
-    }
106
-
107
-
108
-    public function admin_footer_scripts()
109
-    {
110
-    }
111
-
112
-
113
-    public function load_scripts_styles()
114
-    {
115
-    }
116
-
117
-
118
-    protected function _installation()
119
-    {
120
-        $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php';
121
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template(
122
-            $template_path,
123
-            '',
124
-            true
125
-        );
126
-        $this->display_admin_page_with_sidebar();
127
-    }
128
-
129
-
130
-    protected function _resources()
131
-    {
132
-        $this->display_admin_page_with_sidebar();
133
-    }
134
-
135
-
136
-    protected function _add_settings_metabox($box, $label, array $args)
137
-    {
138
-        add_meta_box(
139
-            "espresso_{$box}_settings",
140
-            $label,
141
-            function ($post, $metabox) {
142
-                echo EEH_Template::display_template(
143
-                    $metabox['args']['template_path'],
144
-                    $metabox['args']['template_args'],
145
-                    true
146
-                );
147
-            },
148
-            $this->_current_screen->id,
149
-            'normal',
150
-            'high',
151
-            apply_filters(
152
-                "FHEE__Support_Admin_Page___add_settings_metabox__{$box}_args_array",
153
-                $args
154
-            )
155
-        );
156
-    }
157
-
158
-
159
-    protected function _resources_boxes()
160
-    {
161
-        $boxes = apply_filters(
162
-            'FHEE__Support_Admin_Page___resources_boxes__boxes_array',
163
-            array(
164
-                'favorite_theme_developers' => esc_html__('Favorite Theme Developers', 'event_espresso'),
165
-                'highly_recommended_themes' => esc_html__('Highly Recommended Themes', 'event_espresso'),
166
-                'hire_developer'            => esc_html__('Hire a Developer', 'event_espresso'),
167
-                'partners'                  => esc_html__('Partners', 'event_espresso'),
168
-                'recommended_plugins'       => esc_html__('Recommended Plugins', 'event_espresso'),
169
-                'other_resources'           => esc_html__('Other Resources', 'event_espresso'),
170
-            )
171
-        );
172
-        foreach ($boxes as $box => $label) {
173
-            $this->_add_settings_metabox(
174
-                $box,
175
-                $label,
176
-                array(
177
-                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
178
-                    'template_args' => $this->_template_args,
179
-                )
180
-            );
181
-        }
182
-    }
183
-
184
-
185
-    protected function _shortcodes()
186
-    {
187
-        $this->display_admin_page_with_sidebar();
188
-    }
189
-
190
-
191
-    protected function _shortcodes_boxes()
192
-    {
193
-        $boxes = apply_filters(
194
-            'FHEE__Support_Admin_Page___shortcodes_boxes__boxes_array',
195
-            array(
196
-                'shortcodes_event_listings'  => esc_html__('Event Listings', 'event_espresso'),
197
-                'shortcodes_ticket_selector' => esc_html__('Event Ticket Selector', 'event_espresso'),
198
-                'shortcodes_category'        => esc_html__('Event Categories', 'event_espresso'),
199
-                'shortcodes_attendee'        => esc_html__('Event Attendees', 'event_espresso')
200
-                /*'shortcodes_single_events' => esc_html__('Single Events', 'event_espresso'),*/
201
-                /*'shortcodes_attendee_listings' => esc_html__('Attendee Listings', 'event_espresso'),*/
202
-            )
203
-        );
204
-        foreach ($boxes as $box => $label) {
205
-            $this->_add_settings_metabox(
206
-                $box,
207
-                $label,
208
-                array(
209
-                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
210
-                    'template_args' => $this->_template_args,
211
-                )
212
-            );
213
-        }
214
-    }
215
-
216
-
217
-    protected function _contact_support()
218
-    {
219
-        $this->display_admin_page_with_sidebar();
220
-    }
221
-
222
-
223
-    protected function _support_boxes()
224
-    {
225
-        $boxes = apply_filters(
226
-            'FHEE__Support_Admin_Page___support_boxes__boxes_array',
227
-            array(
228
-                'contact_support'       => esc_html__('Contact Support', 'event_espresso'),
229
-                'important_information' => esc_html__('Important Information', 'event_espresso'),
230
-            )
231
-        );
232
-        foreach ($boxes as $box => $label) {
233
-            $this->_add_settings_metabox(
234
-                $box,
235
-                $label,
236
-                array(
237
-                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
238
-                    'template_args' => $this->_template_args,
239
-                )
240
-            );
241
-        }
242
-    }
243
-
244
-
245
-    protected function _developers()
246
-    {
247
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template(
248
-            EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php',
249
-            array(),
250
-            true
251
-        );
252
-        $this->display_admin_page_with_sidebar();
253
-    }
16
+	protected function _init_page_props()
17
+	{
18
+		$this->page_slug = EE_SUPPORT_PG_SLUG;
19
+		$this->page_label = esc_html__('Help & Support', 'event_espresso');
20
+		$this->_admin_base_url = EE_SUPPORT_ADMIN_URL;
21
+		$this->_admin_base_path = EE_SUPPORT_ADMIN;
22
+	}
23
+
24
+
25
+	protected function _ajax_hooks()
26
+	{
27
+	}
28
+
29
+
30
+	protected function _define_page_props()
31
+	{
32
+		$this->_labels = array();
33
+		$this->_admin_page_title = $this->page_label;
34
+	}
35
+
36
+
37
+	protected function _set_page_routes()
38
+	{
39
+		$this->_page_routes = array(
40
+			'default'    => array(
41
+				'func'       => '_contact_support',
42
+				'capability' => 'ee_read_ee',
43
+			),
44
+			'developers' => array(
45
+				'func'       => '_developers',
46
+				'capability' => 'ee_read_ee',
47
+			),
48
+			'shortcodes' => array(
49
+				'func'       => '_shortcodes',
50
+				'capability' => 'ee_read_ee',
51
+			),
52
+		);
53
+	}
54
+
55
+
56
+	protected function _set_page_config()
57
+	{
58
+		$this->_page_config = array(
59
+			'default'    => array(
60
+				'nav'           => array(
61
+					'label' => esc_html__('Support', 'event_espresso'),
62
+					'order' => 30,
63
+				),
64
+				'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_support_boxes')),
65
+				'require_nonce' => false,
66
+			),
67
+			'developers' => array(
68
+				'nav'           => array(
69
+					'label' => esc_html__('Developers', 'event_espresso'),
70
+					'order' => 50,
71
+				),
72
+				'metaboxes'     => $this->_default_espresso_metaboxes,
73
+				'require_nonce' => false,
74
+			),
75
+			'shortcodes' => array(
76
+				'nav'           => array(
77
+					'label' => esc_html__('Shortcodes', 'event_espresso'),
78
+					'order' => 60,
79
+				),
80
+				'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_shortcodes_boxes')),
81
+				'require_nonce' => false,
82
+			),
83
+		);
84
+	}
85
+
86
+
87
+	// none of the below group are currently used for Support pages
88
+	protected function _add_screen_options()
89
+	{
90
+	}
91
+
92
+
93
+	protected function _add_feature_pointers()
94
+	{
95
+	}
96
+
97
+
98
+	public function admin_init()
99
+	{
100
+	}
101
+
102
+
103
+	public function admin_notices()
104
+	{
105
+	}
106
+
107
+
108
+	public function admin_footer_scripts()
109
+	{
110
+	}
111
+
112
+
113
+	public function load_scripts_styles()
114
+	{
115
+	}
116
+
117
+
118
+	protected function _installation()
119
+	{
120
+		$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php';
121
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
122
+			$template_path,
123
+			'',
124
+			true
125
+		);
126
+		$this->display_admin_page_with_sidebar();
127
+	}
128
+
129
+
130
+	protected function _resources()
131
+	{
132
+		$this->display_admin_page_with_sidebar();
133
+	}
134
+
135
+
136
+	protected function _add_settings_metabox($box, $label, array $args)
137
+	{
138
+		add_meta_box(
139
+			"espresso_{$box}_settings",
140
+			$label,
141
+			function ($post, $metabox) {
142
+				echo EEH_Template::display_template(
143
+					$metabox['args']['template_path'],
144
+					$metabox['args']['template_args'],
145
+					true
146
+				);
147
+			},
148
+			$this->_current_screen->id,
149
+			'normal',
150
+			'high',
151
+			apply_filters(
152
+				"FHEE__Support_Admin_Page___add_settings_metabox__{$box}_args_array",
153
+				$args
154
+			)
155
+		);
156
+	}
157
+
158
+
159
+	protected function _resources_boxes()
160
+	{
161
+		$boxes = apply_filters(
162
+			'FHEE__Support_Admin_Page___resources_boxes__boxes_array',
163
+			array(
164
+				'favorite_theme_developers' => esc_html__('Favorite Theme Developers', 'event_espresso'),
165
+				'highly_recommended_themes' => esc_html__('Highly Recommended Themes', 'event_espresso'),
166
+				'hire_developer'            => esc_html__('Hire a Developer', 'event_espresso'),
167
+				'partners'                  => esc_html__('Partners', 'event_espresso'),
168
+				'recommended_plugins'       => esc_html__('Recommended Plugins', 'event_espresso'),
169
+				'other_resources'           => esc_html__('Other Resources', 'event_espresso'),
170
+			)
171
+		);
172
+		foreach ($boxes as $box => $label) {
173
+			$this->_add_settings_metabox(
174
+				$box,
175
+				$label,
176
+				array(
177
+					'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
178
+					'template_args' => $this->_template_args,
179
+				)
180
+			);
181
+		}
182
+	}
183
+
184
+
185
+	protected function _shortcodes()
186
+	{
187
+		$this->display_admin_page_with_sidebar();
188
+	}
189
+
190
+
191
+	protected function _shortcodes_boxes()
192
+	{
193
+		$boxes = apply_filters(
194
+			'FHEE__Support_Admin_Page___shortcodes_boxes__boxes_array',
195
+			array(
196
+				'shortcodes_event_listings'  => esc_html__('Event Listings', 'event_espresso'),
197
+				'shortcodes_ticket_selector' => esc_html__('Event Ticket Selector', 'event_espresso'),
198
+				'shortcodes_category'        => esc_html__('Event Categories', 'event_espresso'),
199
+				'shortcodes_attendee'        => esc_html__('Event Attendees', 'event_espresso')
200
+				/*'shortcodes_single_events' => esc_html__('Single Events', 'event_espresso'),*/
201
+				/*'shortcodes_attendee_listings' => esc_html__('Attendee Listings', 'event_espresso'),*/
202
+			)
203
+		);
204
+		foreach ($boxes as $box => $label) {
205
+			$this->_add_settings_metabox(
206
+				$box,
207
+				$label,
208
+				array(
209
+					'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
210
+					'template_args' => $this->_template_args,
211
+				)
212
+			);
213
+		}
214
+	}
215
+
216
+
217
+	protected function _contact_support()
218
+	{
219
+		$this->display_admin_page_with_sidebar();
220
+	}
221
+
222
+
223
+	protected function _support_boxes()
224
+	{
225
+		$boxes = apply_filters(
226
+			'FHEE__Support_Admin_Page___support_boxes__boxes_array',
227
+			array(
228
+				'contact_support'       => esc_html__('Contact Support', 'event_espresso'),
229
+				'important_information' => esc_html__('Important Information', 'event_espresso'),
230
+			)
231
+		);
232
+		foreach ($boxes as $box => $label) {
233
+			$this->_add_settings_metabox(
234
+				$box,
235
+				$label,
236
+				array(
237
+					'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
238
+					'template_args' => $this->_template_args,
239
+				)
240
+			);
241
+		}
242
+	}
243
+
244
+
245
+	protected function _developers()
246
+	{
247
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
248
+			EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php',
249
+			array(),
250
+			true
251
+		);
252
+		$this->display_admin_page_with_sidebar();
253
+	}
254 254
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
     protected function _installation()
119 119
     {
120
-        $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php';
120
+        $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_installation.template.php';
121 121
         $this->_template_args['admin_page_content'] = EEH_Template::display_template(
122 122
             $template_path,
123 123
             '',
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         add_meta_box(
139 139
             "espresso_{$box}_settings",
140 140
             $label,
141
-            function ($post, $metabox) {
141
+            function($post, $metabox) {
142 142
                 echo EEH_Template::display_template(
143 143
                     $metabox['args']['template_path'],
144 144
                     $metabox['args']['template_args'],
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                 $box,
175 175
                 $label,
176 176
                 array(
177
-                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
177
+                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH."support_admin_details_{$box}.template.php",
178 178
                     'template_args' => $this->_template_args,
179 179
                 )
180 180
             );
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                 $box,
207 207
                 $label,
208 208
                 array(
209
-                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
209
+                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH."support_admin_details_{$box}.template.php",
210 210
                     'template_args' => $this->_template_args,
211 211
                 )
212 212
             );
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
                 $box,
235 235
                 $label,
236 236
                 array(
237
-                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php",
237
+                    'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH."support_admin_details_{$box}.template.php",
238 238
                     'template_args' => $this->_template_args,
239 239
                 )
240 240
             );
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     protected function _developers()
246 246
     {
247 247
         $this->_template_args['admin_page_content'] = EEH_Template::display_template(
248
-            EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php',
248
+            EE_SUPPORT_ADMIN_TEMPLATE_PATH.'developers_admin_details.template.php',
249 249
             array(),
250 250
             true
251 251
         );
Please login to merge, or discard this patch.
support/templates/support_admin_details_shortcodes_attendee.template.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
             <strong>[ESPRESSO_EVENT_ATTENDEES]</strong><br>
10 10
             <p class="description">
11 11
                 <?php _e(
12
-                    'With no parameters, this shows the attendees for the earliest active event, or if no active event, the earliest upcoming event.  If it is used in Event Description, then it will show the attendees for that event.',
13
-                    'event_espresso'
14
-                ); ?>
12
+					'With no parameters, this shows the attendees for the earliest active event, or if no active event, the earliest upcoming event.  If it is used in Event Description, then it will show the attendees for that event.',
13
+					'event_espresso'
14
+				); ?>
15 15
             </p>
16 16
             <br>
17 17
         </li>
@@ -40,18 +40,18 @@  discard block
 block discarded – undo
40 40
             <strong>[ESPRESSO_EVENT_ATTENDEES status=RAP]</strong><br>
41 41
             <p class="description">
42 42
                 <?php _e(
43
-                    'You can list attendees that have a specific registration status (use status code) or use "all" to return all attendees regardless of status.  Default when you don\'t have this parameter set is to only return attendees attached to approved contacts.',
44
-                    'event_espresso'
45
-                ); ?>
43
+					'You can list attendees that have a specific registration status (use status code) or use "all" to return all attendees regardless of status.  Default when you don\'t have this parameter set is to only return attendees attached to approved contacts.',
44
+					'event_espresso'
45
+				); ?>
46 46
             </p>
47 47
             <p>
48 48
                 <?php _e('The statuses you can use are:', 'event_espresso'); ?>
49 49
                 <br>
50 50
                 <?php
51
-                foreach (EEM_Registration::reg_status_array(array(), true) as $status_code => $status_label) {
52
-                    echo '<strong>' . $status_code . ':</strong>' . ' ' . $status_label . '<br>';
53
-                }
54
-                ?>
51
+				foreach (EEM_Registration::reg_status_array(array(), true) as $status_code => $status_label) {
52
+					echo '<strong>' . $status_code . ':</strong>' . ' ' . $status_label . '<br>';
53
+				}
54
+				?>
55 55
 
56 56
             </p>
57 57
             <br>
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
             <strong>[ESPRESSO_EVENT_ATTENDEES display_on_archives=true]</strong><br>
61 61
             <p class="description">
62 62
                 <?php _e(
63
-                    'Will display the attendees list when events are viewed on archive pages.',
64
-                    'event_espresso'
65
-                ); ?>
63
+					'Will display the attendees list when events are viewed on archive pages.',
64
+					'event_espresso'
65
+				); ?>
66 66
             </p>
67 67
             <br>
68 68
         </li>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
                 <br>
50 50
                 <?php
51 51
                 foreach (EEM_Registration::reg_status_array(array(), true) as $status_code => $status_label) {
52
-                    echo '<strong>' . $status_code . ':</strong>' . ' ' . $status_label . '<br>';
52
+                    echo '<strong>'.$status_code.':</strong>'.' '.$status_label.'<br>';
53 53
                 }
54 54
                 ?>
55 55
 
Please login to merge, or discard this patch.
support/templates/support_admin_details_installation.template.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <div class="padding">
2 2
     <!-- <p><?php _e(
3
-        'Download the <a href="https://eventespresso.com/wp-content/plugins/download-monitor/download.php?id=2">Installation Guide</a> as a PDF',
4
-        'event_espresso'
5
-    ); ?></p> -->
3
+		'Download the <a href="https://eventespresso.com/wp-content/plugins/download-monitor/download.php?id=2">Installation Guide</a> as a PDF',
4
+		'event_espresso'
5
+	); ?></p> -->
6 6
     <p>
7 7
         <?php _e('For the latest installation instructions please visit:', 'event_espresso'); ?>
8 8
         <a href="https://eventespresso.com/wiki/installing-event-espresso/" target="_blank">https://eventespresso.com/wiki/installing-event-espresso/</a>
Please login to merge, or discard this patch.
support/templates/support_admin_details_important_information.template.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -1,50 +1,50 @@  discard block
 block discarded – undo
1 1
 <div class="padding">
2 2
     <?php
3
-    global $wpdb, $wp_version;
4
-    $wp_req_version = '3.1';
5
-    $php_req_version = '5.2';
6
-    $mysql_req_version = '5.0';
7
-    $is_php_valid = version_compare(phpversion(), $php_req_version, '>');
8
-    $is_mysql_valid = version_compare($wpdb->db_version(), $mysql_req_version, '>');
3
+	global $wpdb, $wp_version;
4
+	$wp_req_version = '3.1';
5
+	$php_req_version = '5.2';
6
+	$mysql_req_version = '5.0';
7
+	$is_php_valid = version_compare(phpversion(), $php_req_version, '>');
8
+	$is_mysql_valid = version_compare($wpdb->db_version(), $mysql_req_version, '>');
9 9
 
10
-    if (! version_compare($wp_version, $wp_req_version, '>=')) {
11
-        echo '<p class="red_alert">'
12
-             . __(
13
-                 'This version of Event Espresso requires WordPress version',
14
-                 'event_espresso'
15
-             ) . ' ' . $wp_req_version . '+. '
16
-             . __(
17
-                 'Please upgrade to the latest version of WordPress.',
18
-                 'event_espresso'
19
-             ) . '</p>';
20
-    }
21
-    if (! $is_php_valid) {
22
-        echo '<p class="red_alert">'
23
-             . __(
24
-                 'Your version of PHP is out of date, please update to the latest version of PHP. <br>Required version of PHP:',
25
-                 'event_espresso'
26
-             ) . ' ' . $php_req_version . '</p>';
27
-    }
28
-    if (! $is_mysql_valid) {
29
-        echo '<p class="red_alert">'
30
-             . __(
31
-                 'Your version of MySQL is out of date, please update to the latest version of MySQL. <br>Required version of MySQL:',
32
-                 'event_espresso'
33
-             ) . ' ' . $mysql_req_version . '</p>';
34
-    }
10
+	if (! version_compare($wp_version, $wp_req_version, '>=')) {
11
+		echo '<p class="red_alert">'
12
+			 . __(
13
+				 'This version of Event Espresso requires WordPress version',
14
+				 'event_espresso'
15
+			 ) . ' ' . $wp_req_version . '+. '
16
+			 . __(
17
+				 'Please upgrade to the latest version of WordPress.',
18
+				 'event_espresso'
19
+			 ) . '</p>';
20
+	}
21
+	if (! $is_php_valid) {
22
+		echo '<p class="red_alert">'
23
+			 . __(
24
+				 'Your version of PHP is out of date, please update to the latest version of PHP. <br>Required version of PHP:',
25
+				 'event_espresso'
26
+			 ) . ' ' . $php_req_version . '</p>';
27
+	}
28
+	if (! $is_mysql_valid) {
29
+		echo '<p class="red_alert">'
30
+			 . __(
31
+				 'Your version of MySQL is out of date, please update to the latest version of MySQL. <br>Required version of MySQL:',
32
+				 'event_espresso'
33
+			 ) . ' ' . $mysql_req_version . '</p>';
34
+	}
35 35
 
36
-    $query_args = array(
37
-        'page'   => 'espresso_maintenance_settings',
38
-        'action' => 'system_status',
39
-    );
40
-    $system_status_link = EE_Admin_Page::add_query_args_and_nonce($query_args, admin_url('admin.php'));
36
+	$query_args = array(
37
+		'page'   => 'espresso_maintenance_settings',
38
+		'action' => 'system_status',
39
+	);
40
+	$system_status_link = EE_Admin_Page::add_query_args_and_nonce($query_args, admin_url('admin.php'));
41 41
 
42
-    ?>
42
+	?>
43 43
     <a href="<?php echo $system_status_link; ?>" class="button-secondary right">
44 44
         <?php _e(
45
-            'System Information',
46
-            'event_espresso'
47
-        ); ?></a>
45
+			'System Information',
46
+			'event_espresso'
47
+		); ?></a>
48 48
     <div class="localhost-information">
49 49
         <p><strong><?php esc_html_e('WordPress Version:', 'event_espresso'); ?></strong>&nbsp;<?php echo $wp_version; ?>
50 50
         </p>
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
         <p><strong><?php esc_html_e('MySQL Version:', 'event_espresso'); ?></strong>&nbsp;<?php echo $wpdb->db_version(); ?></p>
53 53
         <p><strong>
54 54
                 <?php esc_html_e(
55
-                    'Event Espresso Version:',
56
-                    'event_espresso'
57
-                ); ?></strong>&nbsp;<?php echo EVENT_ESPRESSO_VERSION ?></p>
55
+					'Event Espresso Version:',
56
+					'event_espresso'
57
+				); ?></strong>&nbsp;<?php echo EVENT_ESPRESSO_VERSION ?></p>
58 58
         <p><strong><?php esc_html_e('WordPress Address (URL):', 'event_espresso'); ?></strong>&nbsp;<?php echo site_url(); ?></p>
59 59
         <p><strong><?php esc_html_e('Site address (URL):', 'event_espresso'); ?></strong>&nbsp;<?php echo home_url(); ?>
60 60
     </div>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,30 +7,30 @@
 block discarded – undo
7 7
     $is_php_valid = version_compare(phpversion(), $php_req_version, '>');
8 8
     $is_mysql_valid = version_compare($wpdb->db_version(), $mysql_req_version, '>');
9 9
 
10
-    if (! version_compare($wp_version, $wp_req_version, '>=')) {
10
+    if ( ! version_compare($wp_version, $wp_req_version, '>=')) {
11 11
         echo '<p class="red_alert">'
12 12
              . __(
13 13
                  'This version of Event Espresso requires WordPress version',
14 14
                  'event_espresso'
15
-             ) . ' ' . $wp_req_version . '+. '
15
+             ).' '.$wp_req_version.'+. '
16 16
              . __(
17 17
                  'Please upgrade to the latest version of WordPress.',
18 18
                  'event_espresso'
19
-             ) . '</p>';
19
+             ).'</p>';
20 20
     }
21
-    if (! $is_php_valid) {
21
+    if ( ! $is_php_valid) {
22 22
         echo '<p class="red_alert">'
23 23
              . __(
24 24
                  'Your version of PHP is out of date, please update to the latest version of PHP. <br>Required version of PHP:',
25 25
                  'event_espresso'
26
-             ) . ' ' . $php_req_version . '</p>';
26
+             ).' '.$php_req_version.'</p>';
27 27
     }
28
-    if (! $is_mysql_valid) {
28
+    if ( ! $is_mysql_valid) {
29 29
         echo '<p class="red_alert">'
30 30
              . __(
31 31
                  'Your version of MySQL is out of date, please update to the latest version of MySQL. <br>Required version of MySQL:',
32 32
                  'event_espresso'
33
-             ) . ' ' . $mysql_req_version . '</p>';
33
+             ).' '.$mysql_req_version.'</p>';
34 34
     }
35 35
 
36 36
     $query_args = array(
Please login to merge, or discard this patch.
admin_pages/about/About_Admin_Page.core.php 2 patches
Indentation   +274 added lines, -274 removed lines patch added patch discarded remove patch
@@ -17,128 +17,128 @@  discard block
 block discarded – undo
17 17
 {
18 18
 
19 19
 
20
-    protected function _init_page_props()
21
-    {
22
-        $this->page_slug = EE_ABOUT_PG_SLUG;
23
-        $this->page_label = esc_html__('About Event Espresso', 'event_espresso');
24
-        $this->_admin_base_url = EE_ABOUT_ADMIN_URL;
25
-        $this->_admin_base_path = EE_ABOUT_ADMIN;
26
-    }
27
-
28
-
29
-    protected function _ajax_hooks()
30
-    {
31
-        // todo: all hooks for ajax goes here.
32
-    }
33
-
34
-
35
-    protected function _define_page_props()
36
-    {
37
-        $this->_labels = array();
38
-        $this->_admin_page_title = $this->page_label;
39
-    }
40
-
41
-
42
-    protected function _set_page_routes()
43
-    {
44
-        $this->_page_routes = array(
45
-            'default' => array(
46
-                'func'       => '_overview',
47
-                'capability' => 'manage_options',
48
-            ),
49
-            // 'overview' => '_overview',
50
-            // 'func' => '_overview',
51
-            // 'capability' => 'ee_read_ee'
52
-            // ),
53
-            'credits' => array(
54
-                'func'       => '_credits',
55
-                'capability' => 'manage_options',
56
-            ),
57
-
58
-            'decafvpro' => array(
59
-                'func'       => '_decafvpro',
60
-                'capability' => 'manage_options',
61
-            ),
62
-            'reviews'   => array(
63
-                'func'       => '_reviews',
64
-                'capability' => 'manage_options',
65
-            ),
66
-        );
67
-    }
68
-
69
-
70
-    protected function _set_page_config()
71
-    {
72
-        $this->_page_config = array(
73
-            /*'default' => array(
20
+	protected function _init_page_props()
21
+	{
22
+		$this->page_slug = EE_ABOUT_PG_SLUG;
23
+		$this->page_label = esc_html__('About Event Espresso', 'event_espresso');
24
+		$this->_admin_base_url = EE_ABOUT_ADMIN_URL;
25
+		$this->_admin_base_path = EE_ABOUT_ADMIN;
26
+	}
27
+
28
+
29
+	protected function _ajax_hooks()
30
+	{
31
+		// todo: all hooks for ajax goes here.
32
+	}
33
+
34
+
35
+	protected function _define_page_props()
36
+	{
37
+		$this->_labels = array();
38
+		$this->_admin_page_title = $this->page_label;
39
+	}
40
+
41
+
42
+	protected function _set_page_routes()
43
+	{
44
+		$this->_page_routes = array(
45
+			'default' => array(
46
+				'func'       => '_overview',
47
+				'capability' => 'manage_options',
48
+			),
49
+			// 'overview' => '_overview',
50
+			// 'func' => '_overview',
51
+			// 'capability' => 'ee_read_ee'
52
+			// ),
53
+			'credits' => array(
54
+				'func'       => '_credits',
55
+				'capability' => 'manage_options',
56
+			),
57
+
58
+			'decafvpro' => array(
59
+				'func'       => '_decafvpro',
60
+				'capability' => 'manage_options',
61
+			),
62
+			'reviews'   => array(
63
+				'func'       => '_reviews',
64
+				'capability' => 'manage_options',
65
+			),
66
+		);
67
+	}
68
+
69
+
70
+	protected function _set_page_config()
71
+	{
72
+		$this->_page_config = array(
73
+			/*'default' => array(
74 74
                 'nav' => array(
75 75
                     'label' => __('What\'s New', 'event_espresso'),
76 76
                     'order' => 10),
77 77
                 'require_nonce' => FALSE
78 78
                 ),*/
79
-            // 'overview' => array(
80
-            'default' => array(
81
-                'nav'           => array(
82
-                    'label' => esc_html__('About', 'event_espresso'),
83
-                    'order' => 20,
84
-                ),
85
-                'require_nonce' => false,
86
-            ),
87
-            'credits' => array(
88
-                'nav'           => array(
89
-                    'label' => esc_html__('Credits', 'event_espresso'),
90
-                    'order' => 30,
91
-                ),
92
-                'require_nonce' => false,
93
-            ),
94
-
95
-            'decafvpro' => array(
96
-                'nav'           => array(
97
-                    'label' => esc_html__('Decaf vs Regular', 'event_espresso'),
98
-                    'order' => 40,
99
-                ),
100
-                'require_nonce' => false,
101
-            ),
102
-            'reviews'   => array(
103
-                'nav'           => array(
104
-                    'label' => esc_html__('Reviews', 'event_espresso'),
105
-                    'order' => 50,
106
-                ),
107
-                'require_nonce' => false,
108
-            ),
109
-        );
110
-    }
111
-
112
-
113
-    // none of the below group are currently used for Support pages
114
-    protected function _add_screen_options()
115
-    {
116
-    }
117
-
118
-    protected function _add_feature_pointers()
119
-    {
120
-    }
121
-
122
-    public function admin_init()
123
-    {
124
-    }
125
-
126
-    public function admin_notices()
127
-    {
128
-    }
129
-
130
-    public function admin_footer_scripts()
131
-    {
132
-    }
133
-
134
-    public function load_scripts_styles()
135
-    {
136
-    }
137
-
138
-
139
-    protected function _whats_new()
140
-    {
141
-        /*$steps = EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ? $this->_get_started_steps() : FALSE;
79
+			// 'overview' => array(
80
+			'default' => array(
81
+				'nav'           => array(
82
+					'label' => esc_html__('About', 'event_espresso'),
83
+					'order' => 20,
84
+				),
85
+				'require_nonce' => false,
86
+			),
87
+			'credits' => array(
88
+				'nav'           => array(
89
+					'label' => esc_html__('Credits', 'event_espresso'),
90
+					'order' => 30,
91
+				),
92
+				'require_nonce' => false,
93
+			),
94
+
95
+			'decafvpro' => array(
96
+				'nav'           => array(
97
+					'label' => esc_html__('Decaf vs Regular', 'event_espresso'),
98
+					'order' => 40,
99
+				),
100
+				'require_nonce' => false,
101
+			),
102
+			'reviews'   => array(
103
+				'nav'           => array(
104
+					'label' => esc_html__('Reviews', 'event_espresso'),
105
+					'order' => 50,
106
+				),
107
+				'require_nonce' => false,
108
+			),
109
+		);
110
+	}
111
+
112
+
113
+	// none of the below group are currently used for Support pages
114
+	protected function _add_screen_options()
115
+	{
116
+	}
117
+
118
+	protected function _add_feature_pointers()
119
+	{
120
+	}
121
+
122
+	public function admin_init()
123
+	{
124
+	}
125
+
126
+	public function admin_notices()
127
+	{
128
+	}
129
+
130
+	public function admin_footer_scripts()
131
+	{
132
+	}
133
+
134
+	public function load_scripts_styles()
135
+	{
136
+	}
137
+
138
+
139
+	protected function _whats_new()
140
+	{
141
+		/*$steps = EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ? $this->_get_started_steps() : FALSE;
142 142
         $steps = $steps !== FALSE ? $steps : '';
143 143
         $this->_admin_page_title = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION );
144 144
         $settings_message = $steps;
@@ -146,168 +146,168 @@  discard block
 block discarded – undo
146 146
         $template = EE_ABOUT_TEMPLATE_PATH . 'whats_new.template.php';
147 147
         $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE );
148 148
         $this->display_about_admin_page();*/
149
-    }
149
+	}
150 150
 
151 151
 
152
-    protected function _overview()
153
-    {
154
-        /*$this->_template_args['admin_page_title'] = __('About Event Espresso', 'event_espresso');
152
+	protected function _overview()
153
+	{
154
+		/*$this->_template_args['admin_page_title'] = __('About Event Espresso', 'event_espresso');
155 155
         $this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso Decaf, the most powerful, and free, Event Management plugin for WordPress.', 'event_espresso');
156 156
         $template = EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php';
157 157
         $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE );
158 158
         $this->display_about_admin_page();*/
159 159
 
160
-        // Copied from _whats_new()
161
-        $steps = EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance
162
-            ? $this->_get_started_steps() : false;
163
-        $steps = $steps !== false ? $steps : '';
164
-        $this->_admin_page_title = sprintf(
165
-            esc_html__('Welcome to Event Espresso %s', 'event_espresso'),
166
-            EVENT_ESPRESSO_VERSION
167
-        );
168
-        $settings_message = $steps;
169
-        $this->_template_args['admin_page_subtitle'] = esc_html__(
170
-            'Thank you for choosing Event Espresso, the most powerful, and free, Event Management plugin for WordPress.',
171
-            'event_espresso'
172
-        ) . $settings_message;
173
-        $template = EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php';
174
-        $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
175
-            $template,
176
-            $this->_template_args,
177
-            true
178
-        );
179
-        $this->display_about_admin_page();
180
-    }
181
-
182
-
183
-    protected function _get_started_steps()
184
-    {
185
-        $steps = '<h2>' . esc_html__('Getting Started', 'event_espresso') . '</h2>';
186
-        $step_one = '<p>'
187
-                    . sprintf(
188
-                        esc_html__(
189
-                            '%sStep 1%s: Visit your %sOrganization Settings%s and add/update your details.',
190
-                            'event_espresso'
191
-                        ),
192
-                        '<strong>',
193
-                        '</strong>',
194
-                        '<a href="admin.php?page=espresso_general_settings">',
195
-                        '</a>'
196
-                    ) . '</strong></p>';
197
-        $step_two = '<p>'
198
-                    . sprintf(
199
-                        esc_html__('%sStep 2%s: Setup your %sPayment Methods%s.', 'event_espresso'),
200
-                        '<strong>',
201
-                        '</strong>',
202
-                        '<a href="admin.php?page=espresso_payment_settings">',
203
-                        '</a>'
204
-                    ) . '</strong></p>';
205
-        $step_three = '<p>'
206
-                      . sprintf(
207
-                          esc_html__('%sStep 3%s: Create your %sFirst Event%s.', 'event_espresso'),
208
-                          '<strong>',
209
-                          '</strong>',
210
-                          '<a href="admin.php?page=espresso_events&action=create_new">',
211
-                          '</a>'
212
-                      ) . '</strong></p>';
213
-
214
-        // done?
215
-        $done_step_one = EE_Registry::instance()->CFG->organization->address_1 == '123 Onna Road' ? false : true;
216
-        $active_invoice_pm = EEM_Payment_Method::instance()->get_one_active(
217
-            EEM_Payment_Method::scope_cart,
218
-            array(array('PMD_type' => 'Invoice'))
219
-        );
220
-        $active_pms_count = EEM_Payment_Method::instance()->count_active(EEM_Payment_Method::scope_cart);
221
-        // done step two if a non-invoice paymetn method is active; or there is more than one PM active, or
222
-        // if only the invoice is active but it's clearly been updated
223
-        $done_step_two = $active_pms_count > 1 ||
224
-                         ($active_pms_count === 1 && ! $active_invoice_pm) ||
225
-                         ($active_invoice_pm instanceof EE_Payment_Method && (
226
-                                 $active_invoice_pm->get_extra_meta('pdf_payee_name', true, '') ||
227
-                                 $active_invoice_pm->get_extra_meta('pdf_payee_email', true, '') ||
228
-                                 $active_invoice_pm->get_extra_meta('pdf_payee_tax_number', true, '') ||
229
-                                 $active_invoice_pm->get_extra_meta('pdf_payee_address', true, '') ||
230
-                                 $active_invoice_pm->get_extra_meta('page_extra_info', true, '')
231
-                             )
232
-                         );
233
-        $done_step_three = EE_Registry::instance()->load_model('Event')->count() > 0 ? true : false;
234
-
235
-        // if ALL steps are done, let's just return FALSE so we don't display anything
236
-        if ($done_step_one && $done_step_two && $done_step_three) {
237
-            return false;
238
-        }
239
-
240
-        // now let's put it together
241
-        $steps .= sprintf('%s' . $step_one . '%s', $done_step_one ? '<strike>' : '', $done_step_one ? '</strike>' : '');
242
-        $steps .= sprintf('%s' . $step_two . '%s', $done_step_two ? '<strike>' : '', $done_step_two ? '</strike>' : '');
243
-        $steps .= sprintf(
244
-            '%s' . $step_three . '%s',
245
-            $done_step_three ? '<strike>' : '',
246
-            $done_step_three ? '</strike>' : ''
247
-        );
248
-
249
-        return $steps;
250
-    }
251
-
252
-
253
-    protected function _credits()
254
-    {
255
-        $this->_template_args['admin_page_title'] = sprintf(
256
-            __('Welcome to Event Espresso %s', 'event_espresso'),
257
-            EVENT_ESPRESSO_VERSION
258
-        );
259
-        $this->_template_args['admin_page_subtitle'] = __(
260
-            'Thank you for choosing Event Espresso Decaf, the most powerful, and free, Event Management plugin for WordPress.',
261
-            'event_espresso'
262
-        );
263
-        $template = EE_ABOUT_TEMPLATE_PATH . 'credits.template.php';
264
-        $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
265
-            $template,
266
-            $this->_template_args,
267
-            true
268
-        );
269
-        $this->display_about_admin_page();
270
-    }
271
-
272
-
273
-    protected function _decafvpro()
274
-    {
275
-        $this->_template_args['admin_page_title'] = sprintf(
276
-            __('Welcome to Event Espresso %s', 'event_espresso'),
277
-            EVENT_ESPRESSO_VERSION
278
-        );
279
-        $this->_template_args['admin_page_subtitle'] = sprintf(
280
-            __(
281
-                'Event Espresso lets you focus on doing %swhat you love%s — %sorganizing your events%s',
282
-                'event_espresso'
283
-            ),
284
-            '<em>',
285
-            '</em>',
286
-            '<strong>',
287
-            '</strong>'
288
-        );
289
-        $template = EE_ABOUT_TEMPLATE_PATH . 'decafvpro.template.php';
290
-        $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
291
-            $template,
292
-            $this->_template_args,
293
-            true
294
-        );
295
-        $this->display_about_admin_page();
296
-    }
297
-
298
-    protected function _reviews()
299
-    {
300
-        $this->_template_args['admin_page_title'] = __('Rave Reviews About Event Espresso 4', 'event_espresso');
301
-        $this->_template_args['admin_page_subtitle'] = __(
302
-            'At Event Espresso, customer satisfaction is our ultimate goal.',
303
-            'event_espresso'
304
-        );
305
-        $template = EE_ABOUT_TEMPLATE_PATH . 'reviews.template.php';
306
-        $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
307
-            $template,
308
-            $this->_template_args,
309
-            true
310
-        );
311
-        $this->display_about_admin_page();
312
-    }
160
+		// Copied from _whats_new()
161
+		$steps = EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance
162
+			? $this->_get_started_steps() : false;
163
+		$steps = $steps !== false ? $steps : '';
164
+		$this->_admin_page_title = sprintf(
165
+			esc_html__('Welcome to Event Espresso %s', 'event_espresso'),
166
+			EVENT_ESPRESSO_VERSION
167
+		);
168
+		$settings_message = $steps;
169
+		$this->_template_args['admin_page_subtitle'] = esc_html__(
170
+			'Thank you for choosing Event Espresso, the most powerful, and free, Event Management plugin for WordPress.',
171
+			'event_espresso'
172
+		) . $settings_message;
173
+		$template = EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php';
174
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
175
+			$template,
176
+			$this->_template_args,
177
+			true
178
+		);
179
+		$this->display_about_admin_page();
180
+	}
181
+
182
+
183
+	protected function _get_started_steps()
184
+	{
185
+		$steps = '<h2>' . esc_html__('Getting Started', 'event_espresso') . '</h2>';
186
+		$step_one = '<p>'
187
+					. sprintf(
188
+						esc_html__(
189
+							'%sStep 1%s: Visit your %sOrganization Settings%s and add/update your details.',
190
+							'event_espresso'
191
+						),
192
+						'<strong>',
193
+						'</strong>',
194
+						'<a href="admin.php?page=espresso_general_settings">',
195
+						'</a>'
196
+					) . '</strong></p>';
197
+		$step_two = '<p>'
198
+					. sprintf(
199
+						esc_html__('%sStep 2%s: Setup your %sPayment Methods%s.', 'event_espresso'),
200
+						'<strong>',
201
+						'</strong>',
202
+						'<a href="admin.php?page=espresso_payment_settings">',
203
+						'</a>'
204
+					) . '</strong></p>';
205
+		$step_three = '<p>'
206
+					  . sprintf(
207
+						  esc_html__('%sStep 3%s: Create your %sFirst Event%s.', 'event_espresso'),
208
+						  '<strong>',
209
+						  '</strong>',
210
+						  '<a href="admin.php?page=espresso_events&action=create_new">',
211
+						  '</a>'
212
+					  ) . '</strong></p>';
213
+
214
+		// done?
215
+		$done_step_one = EE_Registry::instance()->CFG->organization->address_1 == '123 Onna Road' ? false : true;
216
+		$active_invoice_pm = EEM_Payment_Method::instance()->get_one_active(
217
+			EEM_Payment_Method::scope_cart,
218
+			array(array('PMD_type' => 'Invoice'))
219
+		);
220
+		$active_pms_count = EEM_Payment_Method::instance()->count_active(EEM_Payment_Method::scope_cart);
221
+		// done step two if a non-invoice paymetn method is active; or there is more than one PM active, or
222
+		// if only the invoice is active but it's clearly been updated
223
+		$done_step_two = $active_pms_count > 1 ||
224
+						 ($active_pms_count === 1 && ! $active_invoice_pm) ||
225
+						 ($active_invoice_pm instanceof EE_Payment_Method && (
226
+								 $active_invoice_pm->get_extra_meta('pdf_payee_name', true, '') ||
227
+								 $active_invoice_pm->get_extra_meta('pdf_payee_email', true, '') ||
228
+								 $active_invoice_pm->get_extra_meta('pdf_payee_tax_number', true, '') ||
229
+								 $active_invoice_pm->get_extra_meta('pdf_payee_address', true, '') ||
230
+								 $active_invoice_pm->get_extra_meta('page_extra_info', true, '')
231
+							 )
232
+						 );
233
+		$done_step_three = EE_Registry::instance()->load_model('Event')->count() > 0 ? true : false;
234
+
235
+		// if ALL steps are done, let's just return FALSE so we don't display anything
236
+		if ($done_step_one && $done_step_two && $done_step_three) {
237
+			return false;
238
+		}
239
+
240
+		// now let's put it together
241
+		$steps .= sprintf('%s' . $step_one . '%s', $done_step_one ? '<strike>' : '', $done_step_one ? '</strike>' : '');
242
+		$steps .= sprintf('%s' . $step_two . '%s', $done_step_two ? '<strike>' : '', $done_step_two ? '</strike>' : '');
243
+		$steps .= sprintf(
244
+			'%s' . $step_three . '%s',
245
+			$done_step_three ? '<strike>' : '',
246
+			$done_step_three ? '</strike>' : ''
247
+		);
248
+
249
+		return $steps;
250
+	}
251
+
252
+
253
+	protected function _credits()
254
+	{
255
+		$this->_template_args['admin_page_title'] = sprintf(
256
+			__('Welcome to Event Espresso %s', 'event_espresso'),
257
+			EVENT_ESPRESSO_VERSION
258
+		);
259
+		$this->_template_args['admin_page_subtitle'] = __(
260
+			'Thank you for choosing Event Espresso Decaf, the most powerful, and free, Event Management plugin for WordPress.',
261
+			'event_espresso'
262
+		);
263
+		$template = EE_ABOUT_TEMPLATE_PATH . 'credits.template.php';
264
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
265
+			$template,
266
+			$this->_template_args,
267
+			true
268
+		);
269
+		$this->display_about_admin_page();
270
+	}
271
+
272
+
273
+	protected function _decafvpro()
274
+	{
275
+		$this->_template_args['admin_page_title'] = sprintf(
276
+			__('Welcome to Event Espresso %s', 'event_espresso'),
277
+			EVENT_ESPRESSO_VERSION
278
+		);
279
+		$this->_template_args['admin_page_subtitle'] = sprintf(
280
+			__(
281
+				'Event Espresso lets you focus on doing %swhat you love%s — %sorganizing your events%s',
282
+				'event_espresso'
283
+			),
284
+			'<em>',
285
+			'</em>',
286
+			'<strong>',
287
+			'</strong>'
288
+		);
289
+		$template = EE_ABOUT_TEMPLATE_PATH . 'decafvpro.template.php';
290
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
291
+			$template,
292
+			$this->_template_args,
293
+			true
294
+		);
295
+		$this->display_about_admin_page();
296
+	}
297
+
298
+	protected function _reviews()
299
+	{
300
+		$this->_template_args['admin_page_title'] = __('Rave Reviews About Event Espresso 4', 'event_espresso');
301
+		$this->_template_args['admin_page_subtitle'] = __(
302
+			'At Event Espresso, customer satisfaction is our ultimate goal.',
303
+			'event_espresso'
304
+		);
305
+		$template = EE_ABOUT_TEMPLATE_PATH . 'reviews.template.php';
306
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
307
+			$template,
308
+			$this->_template_args,
309
+			true
310
+		);
311
+		$this->display_about_admin_page();
312
+	}
313 313
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
         $this->_template_args['admin_page_subtitle'] = esc_html__(
170 170
             'Thank you for choosing Event Espresso, the most powerful, and free, Event Management plugin for WordPress.',
171 171
             'event_espresso'
172
-        ) . $settings_message;
173
-        $template = EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php';
172
+        ).$settings_message;
173
+        $template = EE_ABOUT_TEMPLATE_PATH.'ee4-overview.template.php';
174 174
         $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
175 175
             $template,
176 176
             $this->_template_args,
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
     protected function _get_started_steps()
184 184
     {
185
-        $steps = '<h2>' . esc_html__('Getting Started', 'event_espresso') . '</h2>';
185
+        $steps = '<h2>'.esc_html__('Getting Started', 'event_espresso').'</h2>';
186 186
         $step_one = '<p>'
187 187
                     . sprintf(
188 188
                         esc_html__(
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                         '</strong>',
194 194
                         '<a href="admin.php?page=espresso_general_settings">',
195 195
                         '</a>'
196
-                    ) . '</strong></p>';
196
+                    ).'</strong></p>';
197 197
         $step_two = '<p>'
198 198
                     . sprintf(
199 199
                         esc_html__('%sStep 2%s: Setup your %sPayment Methods%s.', 'event_espresso'),
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
                         '</strong>',
202 202
                         '<a href="admin.php?page=espresso_payment_settings">',
203 203
                         '</a>'
204
-                    ) . '</strong></p>';
204
+                    ).'</strong></p>';
205 205
         $step_three = '<p>'
206 206
                       . sprintf(
207 207
                           esc_html__('%sStep 3%s: Create your %sFirst Event%s.', 'event_espresso'),
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
                           '</strong>',
210 210
                           '<a href="admin.php?page=espresso_events&action=create_new">',
211 211
                           '</a>'
212
-                      ) . '</strong></p>';
212
+                      ).'</strong></p>';
213 213
 
214 214
         // done?
215 215
         $done_step_one = EE_Registry::instance()->CFG->organization->address_1 == '123 Onna Road' ? false : true;
@@ -238,10 +238,10 @@  discard block
 block discarded – undo
238 238
         }
239 239
 
240 240
         // now let's put it together
241
-        $steps .= sprintf('%s' . $step_one . '%s', $done_step_one ? '<strike>' : '', $done_step_one ? '</strike>' : '');
242
-        $steps .= sprintf('%s' . $step_two . '%s', $done_step_two ? '<strike>' : '', $done_step_two ? '</strike>' : '');
241
+        $steps .= sprintf('%s'.$step_one.'%s', $done_step_one ? '<strike>' : '', $done_step_one ? '</strike>' : '');
242
+        $steps .= sprintf('%s'.$step_two.'%s', $done_step_two ? '<strike>' : '', $done_step_two ? '</strike>' : '');
243 243
         $steps .= sprintf(
244
-            '%s' . $step_three . '%s',
244
+            '%s'.$step_three.'%s',
245 245
             $done_step_three ? '<strike>' : '',
246 246
             $done_step_three ? '</strike>' : ''
247 247
         );
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
             'Thank you for choosing Event Espresso Decaf, the most powerful, and free, Event Management plugin for WordPress.',
261 261
             'event_espresso'
262 262
         );
263
-        $template = EE_ABOUT_TEMPLATE_PATH . 'credits.template.php';
263
+        $template = EE_ABOUT_TEMPLATE_PATH.'credits.template.php';
264 264
         $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
265 265
             $template,
266 266
             $this->_template_args,
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             '<strong>',
287 287
             '</strong>'
288 288
         );
289
-        $template = EE_ABOUT_TEMPLATE_PATH . 'decafvpro.template.php';
289
+        $template = EE_ABOUT_TEMPLATE_PATH.'decafvpro.template.php';
290 290
         $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
291 291
             $template,
292 292
             $this->_template_args,
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
             'At Event Espresso, customer satisfaction is our ultimate goal.',
303 303
             'event_espresso'
304 304
         );
305
-        $template = EE_ABOUT_TEMPLATE_PATH . 'reviews.template.php';
305
+        $template = EE_ABOUT_TEMPLATE_PATH.'reviews.template.php';
306 306
         $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
307 307
             $template,
308 308
             $this->_template_args,
Please login to merge, or discard this patch.
admin_pages/about/templates/reviews.template.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
     </div>
138 138
     <?php
139
-    if (! defined('EE_CAF_URL')) {
139
+    if ( ! defined('EE_CAF_URL')) {
140 140
         ?>
141 141
         <div align="right"><a
142 142
                 href="https://eventespresso.com/pricing/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=reviews+tab"
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
     </div>
258 258
     <?php
259
-    if (! defined('EE_CAF_URL')) {
259
+    if ( ! defined('EE_CAF_URL')) {
260 260
         ?>
261 261
         <div align="right"><a
262 262
                 href="https://eventespresso.com/pricing/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=reviews+tab"
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         </div>
368 368
     </div>
369 369
     <?php
370
-    if (! defined('EE_CAF_URL')) {
370
+    if ( ! defined('EE_CAF_URL')) {
371 371
         ?>
372 372
         <div align="right"><a
373 373
                 href="https://eventespresso.com/pricing/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=reviews+tab"
Please login to merge, or discard this patch.
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@  discard block
 block discarded – undo
1 1
 <h2 style="text-align: left;"><?php esc_html_e('Who uses Event Espresso?', 'event_espresso'); ?></h2>
2 2
 <p><?php
3
-    echo sprintf(
4
-        esc_html__(
5
-            'Event Espresso is used by over 40,000 event organizers across the world. They host %sconferences%s, %sart classes%s, training courses, concerts, fundraisers, workshops, %sfilm festivals%s, %spaint and wine%s, and more.',
6
-            'event_espresso'
7
-        ),
8
-        '<a href="https://eventespresso.com/use-cases/conferences/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=Decaf+vs+Regular">',
9
-        '</a>',
10
-        '<a href="https://eventespresso.com/use-cases/art-classes/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=Decaf+vs+Regular">',
11
-        '</a>',
12
-        '<a href="https://eventespresso.com/use-cases/film-festival-ticketing-software/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=Decaf+vs+Regular">',
13
-        '</a>',
14
-        '<a href="https://eventespresso.com/use-cases/paint-wine-party-ticketing-software/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=Decaf+vs+Regular">',
15
-        '</a>'
16
-    ); ?></p>
3
+	echo sprintf(
4
+		esc_html__(
5
+			'Event Espresso is used by over 40,000 event organizers across the world. They host %sconferences%s, %sart classes%s, training courses, concerts, fundraisers, workshops, %sfilm festivals%s, %spaint and wine%s, and more.',
6
+			'event_espresso'
7
+		),
8
+		'<a href="https://eventespresso.com/use-cases/conferences/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=Decaf+vs+Regular">',
9
+		'</a>',
10
+		'<a href="https://eventespresso.com/use-cases/art-classes/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=Decaf+vs+Regular">',
11
+		'</a>',
12
+		'<a href="https://eventespresso.com/use-cases/film-festival-ticketing-software/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=Decaf+vs+Regular">',
13
+		'</a>',
14
+		'<a href="https://eventespresso.com/use-cases/paint-wine-party-ticketing-software/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=Decaf+vs+Regular">',
15
+		'</a>'
16
+	); ?></p>
17 17
 
18 18
     <h2 class="about-headline-callout"><?php esc_html_e('Rave Reviews About Event Espresso 4', 'event_espresso'); ?></h2>
19 19
     <p>See what people have to say about the Event Espresso software and support services on <a
@@ -135,16 +135,16 @@  discard block
 block discarded – undo
135 135
 
136 136
     </div>
137 137
     <?php
138
-    if (! defined('EE_CAF_URL')) {
139
-        ?>
138
+	if (! defined('EE_CAF_URL')) {
139
+		?>
140 140
         <div align="right"><a
141 141
                 href="https://eventespresso.com/pricing/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=reviews+tab"
142 142
                 target="_blank" class="button button-primary button-hero"><span
143 143
                     class="dashicons dashicons-cart"></span><?php esc_html_e('Upgrade Now!', 'event_espresso') ?></a>
144 144
         </div>
145 145
         <?php
146
-    }
147
-    ?>
146
+	}
147
+	?>
148 148
     &nbsp;
149 149
     <hr/>
150 150
     <div class="feature-section has-3-columns is-fullwidth three-col">
@@ -255,16 +255,16 @@  discard block
 block discarded – undo
255 255
 
256 256
     </div>
257 257
     <?php
258
-    if (! defined('EE_CAF_URL')) {
259
-        ?>
258
+	if (! defined('EE_CAF_URL')) {
259
+		?>
260 260
         <div align="right"><a
261 261
                 href="https://eventespresso.com/pricing/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=reviews+tab"
262 262
                 target="_blank" class="button button-primary button-hero"><span
263 263
                     class="dashicons dashicons-cart"></span><?php esc_html_e('Upgrade Now!', 'event_espresso') ?></a>
264 264
         </div>
265 265
         <?php
266
-    }
267
-    ?>
266
+	}
267
+	?>
268 268
     &nbsp;
269 269
     <hr/>
270 270
     <div class="feature-section has-3-columns is-fullwidth three-col">
@@ -366,13 +366,13 @@  discard block
 block discarded – undo
366 366
         </div>
367 367
     </div>
368 368
     <?php
369
-    if (! defined('EE_CAF_URL')) {
370
-        ?>
369
+	if (! defined('EE_CAF_URL')) {
370
+		?>
371 371
         <div align="right"><a
372 372
                 href="https://eventespresso.com/pricing/?utm_source=wordpress_org&amp;utm_medium=link&amp;utm_campaign=decaf_about_page&amp;utm_content=reviews+tab"
373 373
                 target="_blank" class="button button-primary button-hero"><span
374 374
                     class="dashicons dashicons-cart"></span><?php esc_html_e('Upgrade Now!', 'event_espresso') ?></a>
375 375
         </div>
376 376
         <?php
377
-    }
378
-    ?>
379 377
\ No newline at end of file
378
+	}
379
+	?>
380 380
\ No newline at end of file
Please login to merge, or discard this patch.