Completed
Branch dev (d8d615)
by
unknown
04:34 queued 02:19
created
widgets/upcoming_events/EEW_Upcoming_Events.widget.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             EE_Question_Option::new_instance(['QSO_value' => false, 'QSO_desc' => esc_html__('No', 'event_espresso')]),
110 110
             EE_Question_Option::new_instance(['QSO_value' => true, 'QSO_desc' => esc_html__('Yes', 'event_espresso')]),
111 111
         ];
112
-        $sort_values   = [
112
+        $sort_values = [
113 113
             EE_Question_Option::new_instance(['QSO_value' => 'ASC', 'QSO_desc' => esc_html__('ASC', 'event_espresso')]),
114 114
             EE_Question_Option::new_instance(['QSO_value' => 'DESC', 'QSO_desc' => esc_html__('DESC', 'event_espresso')]),
115 115
         ];
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
                 // Before widget (defined by themes).
327 327
                 echo $before_widget;
328 328
                 // Display the widget title if one was input (before and after defined by themes).
329
-                if (! empty($title)) {
330
-                    echo $before_title . $title . $after_title;
329
+                if ( ! empty($title)) {
330
+                    echo $before_title.$title.$after_title;
331 331
                 }
332 332
                 echo $this->widgetContent($post);
333 333
                 // After widget (defined by themes).
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
      */
347 347
     public function make_the_title_a_link($title)
348 348
     {
349
-        return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>';
349
+        return '<a href="'.EEH_Event_View::event_archive_url().'">'.$title.'</a>';
350 350
     }
351 351
 
352 352
 
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
             foreach ($sizes as $image_size) {
428 428
                 $image_size = trim($image_size);
429 429
                 // no big images plz
430
-                if (! in_array($image_size, ['large', 'post-thumbnail'])) {
430
+                if ( ! in_array($image_size, ['large', 'post-thumbnail'])) {
431 431
                     $image_sizes[] =
432 432
                         EE_Question_Option::new_instance(['QSO_value' => $image_size, 'QSO_desc' => $image_size]);
433 433
                 }
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
     private function parseWidgetSettings(array $instance)
455 455
     {
456 456
         $this->title = isset($instance['title']) && ! empty($instance['title']) ? $instance['title'] : '';
457
-        $this->events_category     = isset($instance['category_name']) && ! empty($instance['category_name'])
457
+        $this->events_category = isset($instance['category_name']) && ! empty($instance['category_name'])
458 458
             ? $instance['category_name']
459 459
             : false;
460 460
         $this->show_expired = isset($instance['show_expired'])
@@ -512,24 +512,24 @@  discard block
 block discarded – undo
512 512
         }
513 513
         $list_items = '';
514 514
         foreach ($events as $event) {
515
-            if ($event instanceof EE_Event && (! is_single() || $post->ID != $event->ID())) {
515
+            if ($event instanceof EE_Event && ( ! is_single() || $post->ID != $event->ID())) {
516 516
                 $event_url = $this->eventUrl($event);
517 517
                 $list_items .= '
518
-                <li id="ee-upcoming-events-widget-li-' . absint($event->ID()) . '" 
518
+                <li id="ee-upcoming-events-widget-li-' . absint($event->ID()).'" 
519 519
                     class="ee-upcoming-events-widget-li"
520 520
                 >
521 521
                     <h5 class="ee-upcoming-events-widget-title-h5">
522
-                        <a class="ee-widget-event-name-a' . $this->linkClass($event) . '" href="' . $event_url . '">
523
-                            ' . esc_html($event->name()) . '
522
+                        <a class="ee-widget-event-name-a' . $this->linkClass($event).'" href="'.$event_url.'">
523
+                            ' . esc_html($event->name()).'
524 524
                         </a>
525 525
                     </h5>
526
-                    ' . $this->eventWidgetContent($event, $event_url) . '
526
+                    ' . $this->eventWidgetContent($event, $event_url).'
527 527
                 </li>';
528 528
             }
529 529
         }
530 530
         return '
531 531
             <ul class="ee-upcoming-events-widget-ul">
532
-                ' . $list_items . '
532
+                ' . $list_items.'
533 533
             </ul>';
534 534
     }
535 535
 
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
         return EEM_Event::instance()->get_all(
562 562
             [
563 563
                 $this->queryWhereParams(),
564
-                'limit'    => '0,' . $this->limit,
564
+                'limit'    => '0,'.$this->limit,
565 565
                 'order_by' => 'Datetime.DTT_EVT_start',
566 566
                 'order'    => $this->order,
567 567
                 'group_by' => 'EVT_ID',
@@ -649,8 +649,8 @@  discard block
 block discarded – undo
649 649
         if (has_post_thumbnail($event->ID()) && $this->image_size != 'none') {
650 650
             $content .= '
651 651
                 <div class="ee-upcoming-events-widget-img-dv">
652
-                    <a class="ee-upcoming-events-widget-img" href="' . $event_url . '">
653
-                        ' . get_the_post_thumbnail($event->ID(), $this->image_size) . '
652
+                    <a class="ee-upcoming-events-widget-img" href="' . $event_url.'">
653
+                        ' . get_the_post_thumbnail($event->ID(), $this->image_size).'
654 654
                     </a>
655 655
                 </div>';
656 656
         }
@@ -661,8 +661,8 @@  discard block
 block discarded – undo
661 661
 
662 662
         if ($this->show_desc) {
663 663
             global $allowedtags;
664
-            $desc    = $event->short_description(25);
665
-            $content .= $desc ? '<p style="margin-top: .5em">' . wp_kses($desc, $allowedtags) . '</p>' : '';
664
+            $desc = $event->short_description(25);
665
+            $content .= $desc ? '<p style="margin-top: .5em">'.wp_kses($desc, $allowedtags).'</p>' : '';
666 666
         }
667 667
 
668 668
         return $content;
@@ -678,11 +678,11 @@  discard block
 block discarded – undo
678 678
      */
679 679
     private function eventDates(EE_Event $event)
680 680
     {
681
-        $date_format        = apply_filters(
681
+        $date_format = apply_filters(
682 682
             'FHEE__espresso_event_date_range__date_format',
683 683
             get_option('date_format')
684 684
         );
685
-        $time_format        = apply_filters(
685
+        $time_format = apply_filters(
686 686
             'FHEE__espresso_event_date_range__time_format',
687 687
             get_option('time_format')
688 688
         );
Please login to merge, or discard this patch.
Indentation   +594 added lines, -594 removed lines patch added patch discarded remove patch
@@ -12,109 +12,109 @@  discard block
 block discarded – undo
12 12
 class EEW_Upcoming_Events extends EspressoWidget
13 13
 {
14 14
 
15
-    /**
16
-     * @var string
17
-     */
18
-    private $title;
19
-    /**
20
-     * @var string
21
-     */
22
-    private $events_category;
23
-
24
-    /**
25
-     * @var bool
26
-     */
27
-    private $show_expired;
28
-
29
-    /**
30
-     * @var string
31
-     */
32
-    private $image_size;
33
-
34
-    /**
35
-     * @var bool
36
-     */
37
-    private $show_desc;
38
-
39
-    /**
40
-     * @var bool
41
-     */
42
-    private $show_dates;
43
-
44
-    /**
45
-     * @var string
46
-     */
47
-    private $date_limit;
48
-
49
-    /**
50
-     * @var string
51
-     */
52
-    private $date_range;
53
-
54
-    /**
55
-     * @var string
56
-     */
57
-    private $limit;
58
-
59
-    /**
60
-     * @var string
61
-     */
62
-    private $order;
63
-
64
-
65
-    /**
66
-     * Register widget with WordPress.
67
-     */
68
-    public function __construct()
69
-    {
70
-        parent::__construct(
71
-            esc_html__('Event Espresso Upcoming Events', 'event_espresso'),
72
-            ['description' => esc_html__('A widget to display your upcoming events.', 'event_espresso')]
73
-        );
74
-    }
75
-
76
-
77
-    /**
78
-     * Back-end widget form.
79
-     *
80
-     * @param array $instance Previously saved values from database.
81
-     * @return void
82
-     * @throws EE_Error
83
-     * @throws ReflectionException
84
-     * @see WP_Widget::form()
85
-     */
86
-    public function form($instance)
87
-    {
88
-
89
-        EE_Registry::instance()->load_class('Question_Option', [], false, false, true);
90
-        // Set up some default widget settings.
91
-        $defaults = [
92
-            'title'           => esc_html__('Upcoming Events', 'event_espresso'),
93
-            'category_name'   => '',
94
-            'show_expired'    => 0,
95
-            'show_desc'       => true,
96
-            'show_dates'      => true,
97
-            'show_everywhere' => false,
98
-            'date_limit'      => 2,
99
-            'limit'           => 10,
100
-            'sort'            => 'ASC',
101
-            'date_range'      => false,
102
-            'image_size'      => 'medium',
103
-        ];
104
-
105
-        $instance = wp_parse_args((array) $instance, $defaults);
106
-        // don't add HTML labels for EE_Form_Fields generated inputs
107
-        add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string');
108
-        $yes_no_values = [
109
-            EE_Question_Option::new_instance(['QSO_value' => false, 'QSO_desc' => esc_html__('No', 'event_espresso')]),
110
-            EE_Question_Option::new_instance(['QSO_value' => true, 'QSO_desc' => esc_html__('Yes', 'event_espresso')]),
111
-        ];
112
-        $sort_values   = [
113
-            EE_Question_Option::new_instance(['QSO_value' => 'ASC', 'QSO_desc' => esc_html__('ASC', 'event_espresso')]),
114
-            EE_Question_Option::new_instance(['QSO_value' => 'DESC', 'QSO_desc' => esc_html__('DESC', 'event_espresso')]),
115
-        ];
116
-
117
-        ?>
15
+	/**
16
+	 * @var string
17
+	 */
18
+	private $title;
19
+	/**
20
+	 * @var string
21
+	 */
22
+	private $events_category;
23
+
24
+	/**
25
+	 * @var bool
26
+	 */
27
+	private $show_expired;
28
+
29
+	/**
30
+	 * @var string
31
+	 */
32
+	private $image_size;
33
+
34
+	/**
35
+	 * @var bool
36
+	 */
37
+	private $show_desc;
38
+
39
+	/**
40
+	 * @var bool
41
+	 */
42
+	private $show_dates;
43
+
44
+	/**
45
+	 * @var string
46
+	 */
47
+	private $date_limit;
48
+
49
+	/**
50
+	 * @var string
51
+	 */
52
+	private $date_range;
53
+
54
+	/**
55
+	 * @var string
56
+	 */
57
+	private $limit;
58
+
59
+	/**
60
+	 * @var string
61
+	 */
62
+	private $order;
63
+
64
+
65
+	/**
66
+	 * Register widget with WordPress.
67
+	 */
68
+	public function __construct()
69
+	{
70
+		parent::__construct(
71
+			esc_html__('Event Espresso Upcoming Events', 'event_espresso'),
72
+			['description' => esc_html__('A widget to display your upcoming events.', 'event_espresso')]
73
+		);
74
+	}
75
+
76
+
77
+	/**
78
+	 * Back-end widget form.
79
+	 *
80
+	 * @param array $instance Previously saved values from database.
81
+	 * @return void
82
+	 * @throws EE_Error
83
+	 * @throws ReflectionException
84
+	 * @see WP_Widget::form()
85
+	 */
86
+	public function form($instance)
87
+	{
88
+
89
+		EE_Registry::instance()->load_class('Question_Option', [], false, false, true);
90
+		// Set up some default widget settings.
91
+		$defaults = [
92
+			'title'           => esc_html__('Upcoming Events', 'event_espresso'),
93
+			'category_name'   => '',
94
+			'show_expired'    => 0,
95
+			'show_desc'       => true,
96
+			'show_dates'      => true,
97
+			'show_everywhere' => false,
98
+			'date_limit'      => 2,
99
+			'limit'           => 10,
100
+			'sort'            => 'ASC',
101
+			'date_range'      => false,
102
+			'image_size'      => 'medium',
103
+		];
104
+
105
+		$instance = wp_parse_args((array) $instance, $defaults);
106
+		// don't add HTML labels for EE_Form_Fields generated inputs
107
+		add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string');
108
+		$yes_no_values = [
109
+			EE_Question_Option::new_instance(['QSO_value' => false, 'QSO_desc' => esc_html__('No', 'event_espresso')]),
110
+			EE_Question_Option::new_instance(['QSO_value' => true, 'QSO_desc' => esc_html__('Yes', 'event_espresso')]),
111
+		];
112
+		$sort_values   = [
113
+			EE_Question_Option::new_instance(['QSO_value' => 'ASC', 'QSO_desc' => esc_html__('ASC', 'event_espresso')]),
114
+			EE_Question_Option::new_instance(['QSO_value' => 'DESC', 'QSO_desc' => esc_html__('DESC', 'event_espresso')]),
115
+		];
116
+
117
+		?>
118 118
 
119 119
         <!-- Widget Title: Text Input -->
120 120
 
@@ -151,32 +151,32 @@  discard block
 block discarded – undo
151 151
                 <?php esc_html_e('Show Expired Events:', 'event_espresso'); ?>
152 152
             </label>
153 153
             <?php
154
-            $show_expired_options   = $yes_no_values;
155
-            $show_expired_options[] = EE_Question_Option::new_instance(
156
-                ['QSO_value' => 2, 'QSO_desc' => esc_html__('Show Only Expired', 'event_espresso')]
157
-            );
158
-            echo EEH_Form_Fields::select(
159
-                esc_html__('Show Expired Events:', 'event_espresso'),
160
-                $instance['show_expired'],
161
-                $show_expired_options,
162
-                $this->fieldName('show_expired'),
163
-                $this->fieldID('show_expired')
164
-            );
165
-            ?>
154
+			$show_expired_options   = $yes_no_values;
155
+			$show_expired_options[] = EE_Question_Option::new_instance(
156
+				['QSO_value' => 2, 'QSO_desc' => esc_html__('Show Only Expired', 'event_espresso')]
157
+			);
158
+			echo EEH_Form_Fields::select(
159
+				esc_html__('Show Expired Events:', 'event_espresso'),
160
+				$instance['show_expired'],
161
+				$show_expired_options,
162
+				$this->fieldName('show_expired'),
163
+				$this->fieldID('show_expired')
164
+			);
165
+			?>
166 166
         </p>
167 167
         <p>
168 168
             <label for="<?php echo esc_attr($this->fieldID('sort')); ?>">
169 169
                 <?php esc_html_e('Sort Events:', 'event_espresso'); ?>
170 170
             </label>
171 171
             <?php
172
-            echo EEH_Form_Fields::select(
173
-                esc_html__('Sort Events:', 'event_espresso'),
174
-                $instance['sort'],
175
-                $sort_values,
176
-                $this->fieldName('sort'),
177
-                $this->fieldID('sort')
178
-            );
179
-            ?>
172
+			echo EEH_Form_Fields::select(
173
+				esc_html__('Sort Events:', 'event_espresso'),
174
+				$instance['sort'],
175
+				$sort_values,
176
+				$this->fieldName('sort'),
177
+				$this->fieldID('sort')
178
+			);
179
+			?>
180 180
         </p>
181 181
         <p>
182 182
             <label for="<?php echo esc_attr($this->fieldID('image_size')); ?>">
@@ -190,42 +190,42 @@  discard block
 block discarded – undo
190 190
                 <?php esc_html_e('Show Description:', 'event_espresso'); ?>
191 191
             </label>
192 192
             <?php
193
-            echo EEH_Form_Fields::select(
194
-                esc_html__('Show Description:', 'event_espresso'),
195
-                $instance['show_desc'],
196
-                $yes_no_values,
197
-                $this->fieldName('show_desc'),
198
-                $this->fieldID('show_desc')
199
-            );
200
-            ?>
193
+			echo EEH_Form_Fields::select(
194
+				esc_html__('Show Description:', 'event_espresso'),
195
+				$instance['show_desc'],
196
+				$yes_no_values,
197
+				$this->fieldName('show_desc'),
198
+				$this->fieldID('show_desc')
199
+			);
200
+			?>
201 201
         </p>
202 202
         <p>
203 203
             <label for="<?php echo esc_attr($this->fieldID('show_dates')); ?>">
204 204
                 <?php esc_html_e('Show Dates:', 'event_espresso'); ?>
205 205
             </label>
206 206
             <?php
207
-            echo EEH_Form_Fields::select(
208
-                esc_html__('Show Dates:', 'event_espresso'),
209
-                $instance['show_dates'],
210
-                $yes_no_values,
211
-                $this->fieldName('show_dates'),
212
-                $this->fieldID('show_dates')
213
-            );
214
-            ?>
207
+			echo EEH_Form_Fields::select(
208
+				esc_html__('Show Dates:', 'event_espresso'),
209
+				$instance['show_dates'],
210
+				$yes_no_values,
211
+				$this->fieldName('show_dates'),
212
+				$this->fieldID('show_dates')
213
+			);
214
+			?>
215 215
         </p>
216 216
         <p>
217 217
             <label for="<?php echo esc_attr($this->fieldID('show_everywhere')); ?>">
218 218
                 <?php esc_html_e('Show on all Pages:', 'event_espresso'); ?>
219 219
             </label>
220 220
             <?php
221
-            echo EEH_Form_Fields::select(
222
-                esc_html__('Show on all Pages:', 'event_espresso'),
223
-                $instance['show_everywhere'],
224
-                $yes_no_values,
225
-                $this->fieldName('show_everywhere'),
226
-                $this->fieldID('show_everywhere')
227
-            );
228
-            ?>
221
+			echo EEH_Form_Fields::select(
222
+				esc_html__('Show on all Pages:', 'event_espresso'),
223
+				$instance['show_everywhere'],
224
+				$yes_no_values,
225
+				$this->fieldName('show_everywhere'),
226
+				$this->fieldID('show_everywhere')
227
+			);
228
+			?>
229 229
         </p>
230 230
         <p>
231 231
             <label for="<?php echo esc_attr($this->fieldID('date_limit')); ?>">
@@ -243,278 +243,278 @@  discard block
 block discarded – undo
243 243
                 <?php esc_html_e('Show Date Range:', 'event_espresso'); ?>
244 244
             </label>
245 245
             <?php
246
-            echo EEH_Form_Fields::select(
247
-                esc_html__('Show Date Range:', 'event_espresso'),
248
-                $instance['date_range'],
249
-                $yes_no_values,
250
-                $this->fieldName('date_range'),
251
-                $this->fieldID('date_range')
252
-            );
253
-            ?>
246
+			echo EEH_Form_Fields::select(
247
+				esc_html__('Show Date Range:', 'event_espresso'),
248
+				$instance['date_range'],
249
+				$yes_no_values,
250
+				$this->fieldName('date_range'),
251
+				$this->fieldID('date_range')
252
+			);
253
+			?>
254 254
             <span class="description">
255 255
                 <br />
256 256
                 <?php esc_html_e(
257
-                    'This setting will replace the list of dates in the widget.',
258
-                    'event_espresso'
259
-                ); ?>
257
+					'This setting will replace the list of dates in the widget.',
258
+					'event_espresso'
259
+				); ?>
260 260
             </span>
261 261
         </p>
262 262
 
263 263
         <?php
264
-    }
265
-
266
-
267
-    /**
268
-     * Sanitize widget form values as they are saved.
269
-     *
270
-     * @param array $new_instance Values just sent to be saved.
271
-     * @param array $old_instance Previously saved values from database.
272
-     *
273
-     * @return array Updated safe values to be saved.
274
-     * @see WP_Widget::update()
275
-     *
276
-     */
277
-    public function update($new_instance, $old_instance)
278
-    {
279
-        $instance                    = $old_instance;
280
-        $instance['title']           = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
281
-        $instance['category_name']   = $new_instance['category_name'];
282
-        $instance['show_expired']    = $new_instance['show_expired'];
283
-        $instance['limit']           = $new_instance['limit'];
284
-        $instance['sort']            = $new_instance['sort'];
285
-        $instance['image_size']      = $new_instance['image_size'];
286
-        $instance['show_desc']       = $new_instance['show_desc'];
287
-        $instance['show_dates']      = $new_instance['show_dates'];
288
-        $instance['show_everywhere'] = $new_instance['show_everywhere'];
289
-        $instance['date_limit']      = $new_instance['date_limit'];
290
-        $instance['date_range']      = $new_instance['date_range'];
291
-        return $instance;
292
-    }
293
-
294
-
295
-    /**
296
-     * Front-end display of widget.
297
-     *
298
-     * @param array $args     Widget arguments.
299
-     * @param array $instance Saved values from database.
300
-     * @throws EE_Error
301
-     * @throws ReflectionException
302
-     * @see WP_Widget::widget()
303
-     *
304
-     */
305
-    public function widget($args, $instance)
306
-    {
307
-
308
-        global $post;
309
-        // make sure there is some kinda post object
310
-        if ($post instanceof WP_Post) {
311
-            $before_widget = '';
312
-            $before_title  = '';
313
-            $after_title   = '';
314
-            $after_widget  = '';
315
-            // but NOT an events archives page, cuz that would be like two event lists on the same page
316
-            $show_everywhere = ! isset($instance['show_everywhere']) || absint($instance['show_everywhere']);
317
-            if ($show_everywhere || ! ($post->post_type == 'espresso_events' && is_archive())) {
318
-                // let's use some of the event helper functions'
319
-                // make separate vars out of attributes
320
-                extract($args);
321
-
322
-                // grab widget settings
323
-                $this->parseWidgetSettings($instance);
324
-                $title = $this->widgetTitle();
325
-
326
-                // Before widget (defined by themes).
327
-                echo $before_widget;
328
-                // Display the widget title if one was input (before and after defined by themes).
329
-                if (! empty($title)) {
330
-                    echo $before_title . $title . $after_title;
331
-                }
332
-                echo $this->widgetContent($post);
333
-                // After widget (defined by themes).
334
-                echo $after_widget;
335
-            }
336
-        }
337
-    }
338
-
339
-
340
-    /**
341
-     * make_the_title_a_link
342
-     * callback for widget_title filter
343
-     *
344
-     * @param $title
345
-     * @return string
346
-     */
347
-    public function make_the_title_a_link($title)
348
-    {
349
-        return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>';
350
-    }
351
-
352
-
353
-    /**
354
-     * @param string $field_name
355
-     * @return string
356
-     * @since   4.10.14.p
357
-     */
358
-    public function fieldID($field_name)
359
-    {
360
-        return parent::get_field_id($field_name);
361
-    }
362
-
363
-
364
-    /**
365
-     * @param string $field_name
366
-     * @return string
367
-     * @since   4.10.14.p
368
-     */
369
-    public function fieldName($field_name)
370
-    {
371
-        return parent::get_field_name($field_name);
372
-    }
373
-
374
-
375
-    /**
376
-     * @param array $instance
377
-     * @throws EE_Error
378
-     * @throws ReflectionException
379
-     * @since   4.10.14.p
380
-     */
381
-    private function eventCategoriesSelector(array $instance)
382
-    {
383
-        $event_categories = [];
384
-        $categories       = EEM_Term::instance()->get_all_ee_categories(true);
385
-        if ($categories) {
386
-            foreach ($categories as $category) {
387
-                if ($category instanceof EE_Term) {
388
-                    $event_categories[] =
389
-                        EE_Question_Option::new_instance(
390
-                            [
391
-                                'QSO_value' => $category->get('slug'),
392
-                                'QSO_desc'  => $category->get('name'),
393
-                            ]
394
-                        );
395
-                }
396
-            }
397
-        }
398
-        array_unshift(
399
-            $event_categories,
400
-            EE_Question_Option::new_instance(
401
-                [
402
-                    'QSO_value' => '',
403
-                    'QSO_desc'  => esc_html__(' - display all - ', 'event_espresso'),
404
-                ]
405
-            )
406
-        );
407
-        echo EEH_Form_Fields::select(
408
-            esc_html__('Event Category:', 'event_espresso'),
409
-            $instance['category_name'],
410
-            $event_categories,
411
-            $this->fieldName('category_name'),
412
-            $this->fieldID('category_name')
413
-        );
414
-    }
415
-
416
-
417
-    /**
418
-     * @param array $instance
419
-     * @since   4.10.14.p
420
-     */
421
-    private function imageSizeSelector(array $instance)
422
-    {
423
-        $image_sizes = [];
424
-        $sizes       = get_intermediate_image_sizes();
425
-        if ($sizes) {
426
-            // loop thru images and create option objects out of them
427
-            foreach ($sizes as $image_size) {
428
-                $image_size = trim($image_size);
429
-                // no big images plz
430
-                if (! in_array($image_size, ['large', 'post-thumbnail'])) {
431
-                    $image_sizes[] =
432
-                        EE_Question_Option::new_instance(['QSO_value' => $image_size, 'QSO_desc' => $image_size]);
433
-                }
434
-            }
435
-            $image_sizes[] =
436
-                EE_Question_Option::new_instance(
437
-                    ['QSO_value' => 'none', 'QSO_desc' => esc_html__('don\'t show images', 'event_espresso')]
438
-                );
439
-        }
440
-        echo EEH_Form_Fields::select(
441
-            esc_html__('Image Size:', 'event_espresso'),
442
-            $instance['image_size'],
443
-            $image_sizes,
444
-            $this->fieldName('image_size'),
445
-            $this->fieldID('image_size')
446
-        );
447
-    }
448
-
449
-
450
-    /**
451
-     * @param array $instance
452
-     * @since   4.10.14.p
453
-     */
454
-    private function parseWidgetSettings(array $instance)
455
-    {
456
-        $this->title = isset($instance['title']) && ! empty($instance['title']) ? $instance['title'] : '';
457
-        $this->events_category     = isset($instance['category_name']) && ! empty($instance['category_name'])
458
-            ? $instance['category_name']
459
-            : false;
460
-        $this->show_expired = isset($instance['show_expired'])
461
-            ? filter_var($instance['show_expired'], FILTER_VALIDATE_BOOLEAN)
462
-            : 0;
463
-        $this->image_size   = isset($instance['image_size']) && ! empty($instance['image_size'])
464
-            ? $instance['image_size']
465
-            : 'medium';
466
-        $this->show_desc    = ! isset($instance['show_desc'])
467
-                              || filter_var($instance['show_desc'], FILTER_VALIDATE_BOOLEAN);
468
-        $this->show_dates   = ! isset($instance['show_dates'])
469
-                              || filter_var($instance['show_dates'], FILTER_VALIDATE_BOOLEAN);
470
-        $this->date_limit   = isset($instance['date_limit']) && ! empty($instance['date_limit'])
471
-            ? $instance['date_limit']
472
-            : null;
473
-        $this->date_range   = isset($instance['date_range']) && ! empty($instance['date_range'])
474
-            ? $instance['date_range']
475
-            : false;
476
-        $this->limit        = isset($instance['limit']) ? absint($instance['limit']) : 10;
477
-        $this->order        = isset($instance['sort']) && $instance['sort'] === 'DESC'
478
-            ? 'DESC'
479
-            : 'ASC';
480
-    }
481
-
482
-
483
-    /**
484
-     * @return mixed|void
485
-     * @since   4.10.14.p
486
-     */
487
-    private function widgetTitle()
488
-    {
489
-        // add function to make the title a link
490
-        add_filter('widget_title', [$this, 'make_the_title_a_link'], 15);
491
-        // filter the title
492
-        $title = apply_filters('widget_title', $this->title);
493
-        // remove the function from the filter, so it does not affect other widgets
494
-        remove_filter('widget_title', [$this, 'make_the_title_a_link'], 15);
495
-        return $title;
496
-    }
497
-
498
-
499
-    /**
500
-     * @param WP_Post $post
501
-     * @return string
502
-     * @throws EE_Error
503
-     * @throws ReflectionException
504
-     * @since   4.10.14.p
505
-     */
506
-    private function widgetContent(WP_Post $post)
507
-    {
508
-        // run the query
509
-        $events = $this->getUpcomingEvents();
510
-        if (empty($events)) {
511
-            return '';
512
-        }
513
-        $list_items = '';
514
-        foreach ($events as $event) {
515
-            if ($event instanceof EE_Event && (! is_single() || $post->ID != $event->ID())) {
516
-                $event_url = $this->eventUrl($event);
517
-                $list_items .= '
264
+	}
265
+
266
+
267
+	/**
268
+	 * Sanitize widget form values as they are saved.
269
+	 *
270
+	 * @param array $new_instance Values just sent to be saved.
271
+	 * @param array $old_instance Previously saved values from database.
272
+	 *
273
+	 * @return array Updated safe values to be saved.
274
+	 * @see WP_Widget::update()
275
+	 *
276
+	 */
277
+	public function update($new_instance, $old_instance)
278
+	{
279
+		$instance                    = $old_instance;
280
+		$instance['title']           = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
281
+		$instance['category_name']   = $new_instance['category_name'];
282
+		$instance['show_expired']    = $new_instance['show_expired'];
283
+		$instance['limit']           = $new_instance['limit'];
284
+		$instance['sort']            = $new_instance['sort'];
285
+		$instance['image_size']      = $new_instance['image_size'];
286
+		$instance['show_desc']       = $new_instance['show_desc'];
287
+		$instance['show_dates']      = $new_instance['show_dates'];
288
+		$instance['show_everywhere'] = $new_instance['show_everywhere'];
289
+		$instance['date_limit']      = $new_instance['date_limit'];
290
+		$instance['date_range']      = $new_instance['date_range'];
291
+		return $instance;
292
+	}
293
+
294
+
295
+	/**
296
+	 * Front-end display of widget.
297
+	 *
298
+	 * @param array $args     Widget arguments.
299
+	 * @param array $instance Saved values from database.
300
+	 * @throws EE_Error
301
+	 * @throws ReflectionException
302
+	 * @see WP_Widget::widget()
303
+	 *
304
+	 */
305
+	public function widget($args, $instance)
306
+	{
307
+
308
+		global $post;
309
+		// make sure there is some kinda post object
310
+		if ($post instanceof WP_Post) {
311
+			$before_widget = '';
312
+			$before_title  = '';
313
+			$after_title   = '';
314
+			$after_widget  = '';
315
+			// but NOT an events archives page, cuz that would be like two event lists on the same page
316
+			$show_everywhere = ! isset($instance['show_everywhere']) || absint($instance['show_everywhere']);
317
+			if ($show_everywhere || ! ($post->post_type == 'espresso_events' && is_archive())) {
318
+				// let's use some of the event helper functions'
319
+				// make separate vars out of attributes
320
+				extract($args);
321
+
322
+				// grab widget settings
323
+				$this->parseWidgetSettings($instance);
324
+				$title = $this->widgetTitle();
325
+
326
+				// Before widget (defined by themes).
327
+				echo $before_widget;
328
+				// Display the widget title if one was input (before and after defined by themes).
329
+				if (! empty($title)) {
330
+					echo $before_title . $title . $after_title;
331
+				}
332
+				echo $this->widgetContent($post);
333
+				// After widget (defined by themes).
334
+				echo $after_widget;
335
+			}
336
+		}
337
+	}
338
+
339
+
340
+	/**
341
+	 * make_the_title_a_link
342
+	 * callback for widget_title filter
343
+	 *
344
+	 * @param $title
345
+	 * @return string
346
+	 */
347
+	public function make_the_title_a_link($title)
348
+	{
349
+		return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>';
350
+	}
351
+
352
+
353
+	/**
354
+	 * @param string $field_name
355
+	 * @return string
356
+	 * @since   4.10.14.p
357
+	 */
358
+	public function fieldID($field_name)
359
+	{
360
+		return parent::get_field_id($field_name);
361
+	}
362
+
363
+
364
+	/**
365
+	 * @param string $field_name
366
+	 * @return string
367
+	 * @since   4.10.14.p
368
+	 */
369
+	public function fieldName($field_name)
370
+	{
371
+		return parent::get_field_name($field_name);
372
+	}
373
+
374
+
375
+	/**
376
+	 * @param array $instance
377
+	 * @throws EE_Error
378
+	 * @throws ReflectionException
379
+	 * @since   4.10.14.p
380
+	 */
381
+	private function eventCategoriesSelector(array $instance)
382
+	{
383
+		$event_categories = [];
384
+		$categories       = EEM_Term::instance()->get_all_ee_categories(true);
385
+		if ($categories) {
386
+			foreach ($categories as $category) {
387
+				if ($category instanceof EE_Term) {
388
+					$event_categories[] =
389
+						EE_Question_Option::new_instance(
390
+							[
391
+								'QSO_value' => $category->get('slug'),
392
+								'QSO_desc'  => $category->get('name'),
393
+							]
394
+						);
395
+				}
396
+			}
397
+		}
398
+		array_unshift(
399
+			$event_categories,
400
+			EE_Question_Option::new_instance(
401
+				[
402
+					'QSO_value' => '',
403
+					'QSO_desc'  => esc_html__(' - display all - ', 'event_espresso'),
404
+				]
405
+			)
406
+		);
407
+		echo EEH_Form_Fields::select(
408
+			esc_html__('Event Category:', 'event_espresso'),
409
+			$instance['category_name'],
410
+			$event_categories,
411
+			$this->fieldName('category_name'),
412
+			$this->fieldID('category_name')
413
+		);
414
+	}
415
+
416
+
417
+	/**
418
+	 * @param array $instance
419
+	 * @since   4.10.14.p
420
+	 */
421
+	private function imageSizeSelector(array $instance)
422
+	{
423
+		$image_sizes = [];
424
+		$sizes       = get_intermediate_image_sizes();
425
+		if ($sizes) {
426
+			// loop thru images and create option objects out of them
427
+			foreach ($sizes as $image_size) {
428
+				$image_size = trim($image_size);
429
+				// no big images plz
430
+				if (! in_array($image_size, ['large', 'post-thumbnail'])) {
431
+					$image_sizes[] =
432
+						EE_Question_Option::new_instance(['QSO_value' => $image_size, 'QSO_desc' => $image_size]);
433
+				}
434
+			}
435
+			$image_sizes[] =
436
+				EE_Question_Option::new_instance(
437
+					['QSO_value' => 'none', 'QSO_desc' => esc_html__('don\'t show images', 'event_espresso')]
438
+				);
439
+		}
440
+		echo EEH_Form_Fields::select(
441
+			esc_html__('Image Size:', 'event_espresso'),
442
+			$instance['image_size'],
443
+			$image_sizes,
444
+			$this->fieldName('image_size'),
445
+			$this->fieldID('image_size')
446
+		);
447
+	}
448
+
449
+
450
+	/**
451
+	 * @param array $instance
452
+	 * @since   4.10.14.p
453
+	 */
454
+	private function parseWidgetSettings(array $instance)
455
+	{
456
+		$this->title = isset($instance['title']) && ! empty($instance['title']) ? $instance['title'] : '';
457
+		$this->events_category     = isset($instance['category_name']) && ! empty($instance['category_name'])
458
+			? $instance['category_name']
459
+			: false;
460
+		$this->show_expired = isset($instance['show_expired'])
461
+			? filter_var($instance['show_expired'], FILTER_VALIDATE_BOOLEAN)
462
+			: 0;
463
+		$this->image_size   = isset($instance['image_size']) && ! empty($instance['image_size'])
464
+			? $instance['image_size']
465
+			: 'medium';
466
+		$this->show_desc    = ! isset($instance['show_desc'])
467
+							  || filter_var($instance['show_desc'], FILTER_VALIDATE_BOOLEAN);
468
+		$this->show_dates   = ! isset($instance['show_dates'])
469
+							  || filter_var($instance['show_dates'], FILTER_VALIDATE_BOOLEAN);
470
+		$this->date_limit   = isset($instance['date_limit']) && ! empty($instance['date_limit'])
471
+			? $instance['date_limit']
472
+			: null;
473
+		$this->date_range   = isset($instance['date_range']) && ! empty($instance['date_range'])
474
+			? $instance['date_range']
475
+			: false;
476
+		$this->limit        = isset($instance['limit']) ? absint($instance['limit']) : 10;
477
+		$this->order        = isset($instance['sort']) && $instance['sort'] === 'DESC'
478
+			? 'DESC'
479
+			: 'ASC';
480
+	}
481
+
482
+
483
+	/**
484
+	 * @return mixed|void
485
+	 * @since   4.10.14.p
486
+	 */
487
+	private function widgetTitle()
488
+	{
489
+		// add function to make the title a link
490
+		add_filter('widget_title', [$this, 'make_the_title_a_link'], 15);
491
+		// filter the title
492
+		$title = apply_filters('widget_title', $this->title);
493
+		// remove the function from the filter, so it does not affect other widgets
494
+		remove_filter('widget_title', [$this, 'make_the_title_a_link'], 15);
495
+		return $title;
496
+	}
497
+
498
+
499
+	/**
500
+	 * @param WP_Post $post
501
+	 * @return string
502
+	 * @throws EE_Error
503
+	 * @throws ReflectionException
504
+	 * @since   4.10.14.p
505
+	 */
506
+	private function widgetContent(WP_Post $post)
507
+	{
508
+		// run the query
509
+		$events = $this->getUpcomingEvents();
510
+		if (empty($events)) {
511
+			return '';
512
+		}
513
+		$list_items = '';
514
+		foreach ($events as $event) {
515
+			if ($event instanceof EE_Event && (! is_single() || $post->ID != $event->ID())) {
516
+				$event_url = $this->eventUrl($event);
517
+				$list_items .= '
518 518
                 <li id="ee-upcoming-events-widget-li-' . absint($event->ID()) . '" 
519 519
                     class="ee-upcoming-events-widget-li"
520 520
                 >
@@ -525,194 +525,194 @@  discard block
 block discarded – undo
525 525
                     </h5>
526 526
                     ' . $this->eventWidgetContent($event, $event_url) . '
527 527
                 </li>';
528
-            }
529
-        }
530
-        return '
528
+			}
529
+		}
530
+		return '
531 531
             <ul class="ee-upcoming-events-widget-ul">
532 532
                 ' . $list_items . '
533 533
             </ul>';
534
-    }
535
-
536
-
537
-    /**
538
-     * @param EE_Event $event
539
-     * @return string|null
540
-     * @throws EE_Error
541
-     * @since   4.10.14.p
542
-     */
543
-    private function eventUrl(EE_Event $event)
544
-    {
545
-        return esc_url_raw(
546
-            apply_filters(
547
-                'FHEE_EEW_Upcoming_Events__widget__event_url',
548
-                $event->get_permalink(),
549
-                $event
550
-            )
551
-        );
552
-    }
553
-
554
-
555
-    /**
556
-     * @return EE_Base_Class[]
557
-     * @throws EE_Error
558
-     */
559
-    private function getUpcomingEvents()
560
-    {
561
-        return EEM_Event::instance()->get_all(
562
-            [
563
-                $this->queryWhereParams(),
564
-                'limit'    => '0,' . $this->limit,
565
-                'order_by' => 'Datetime.DTT_EVT_start',
566
-                'order'    => $this->order,
567
-                'group_by' => 'EVT_ID',
568
-            ]
569
-        );
570
-    }
571
-
572
-
573
-    /**
574
-     * @return mixed|void
575
-     * @throws EE_Error
576
-     * @since   4.10.14.p
577
-     */
578
-    private function queryWhereParams()
579
-    {
580
-        // start to build our where clause
581
-        $where = [
582
-            'status' => ['IN', ['publish', 'sold_out']],
583
-        ];
584
-        // add category
585
-        if ($this->events_category) {
586
-            $where['Term_Taxonomy.taxonomy']  = 'espresso_event_categories';
587
-            $where['Term_Taxonomy.Term.slug'] = $this->events_category;
588
-        }
589
-        // if NOT expired then we want events that start today or in the future
590
-        // if NOT show expired then we want events that start today or in the future
591
-        if ($this->show_expired == 0) {
592
-            $where['Datetime.DTT_EVT_end'] = [
593
-                '>=',
594
-                EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end'),
595
-            ];
596
-        }
597
-        // if show ONLY expired we want events that ended prior to today
598
-        if ($this->show_expired == 2) {
599
-            $where['Datetime.DTT_EVT_end'] = [
600
-                '<=',
601
-                EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start'),
602
-            ];
603
-        }
604
-        // allow $where to be filtered
605
-        return apply_filters('FHEE__EEW_Upcoming_Events__widget__where', $where, $this->events_category, $this->show_expired);
606
-    }
607
-
608
-
609
-    /**
610
-     * @param EE_Event $event
611
-     * @return string
612
-     * @throws EE_Error
613
-     * @throws ReflectionException
614
-     * @since   4.10.14.p
615
-     */
616
-    private function linkClass(EE_Event $event)
617
-    {
618
-        // how big is the event name ?
619
-        $name_length = strlen($event->name());
620
-        switch ($name_length) {
621
-            case $name_length > 70:
622
-                return ' three-line';
623
-            case $name_length > 35:
624
-                return ' two-line';
625
-        }
626
-        return ' one-line';
627
-    }
628
-
629
-
630
-    /**
631
-     * @param EE_Event $event
632
-     * @param string   $event_url
633
-     * @return mixed|string|void
634
-     * @throws EE_Error
635
-     * @throws ReflectionException
636
-     * @since   4.10.14.p
637
-     */
638
-    private function eventWidgetContent(EE_Event $event, $event_url = '')
639
-    {
640
-        if (post_password_required($event->ID())) {
641
-            return apply_filters(
642
-                'FHEE_EEW_Upcoming_Events__widget__password_form',
643
-                get_the_password_form($event->ID()),
644
-                $event
645
-            );
646
-        }
647
-
648
-        $content = '';
649
-        if (has_post_thumbnail($event->ID()) && $this->image_size != 'none') {
650
-            $content .= '
534
+	}
535
+
536
+
537
+	/**
538
+	 * @param EE_Event $event
539
+	 * @return string|null
540
+	 * @throws EE_Error
541
+	 * @since   4.10.14.p
542
+	 */
543
+	private function eventUrl(EE_Event $event)
544
+	{
545
+		return esc_url_raw(
546
+			apply_filters(
547
+				'FHEE_EEW_Upcoming_Events__widget__event_url',
548
+				$event->get_permalink(),
549
+				$event
550
+			)
551
+		);
552
+	}
553
+
554
+
555
+	/**
556
+	 * @return EE_Base_Class[]
557
+	 * @throws EE_Error
558
+	 */
559
+	private function getUpcomingEvents()
560
+	{
561
+		return EEM_Event::instance()->get_all(
562
+			[
563
+				$this->queryWhereParams(),
564
+				'limit'    => '0,' . $this->limit,
565
+				'order_by' => 'Datetime.DTT_EVT_start',
566
+				'order'    => $this->order,
567
+				'group_by' => 'EVT_ID',
568
+			]
569
+		);
570
+	}
571
+
572
+
573
+	/**
574
+	 * @return mixed|void
575
+	 * @throws EE_Error
576
+	 * @since   4.10.14.p
577
+	 */
578
+	private function queryWhereParams()
579
+	{
580
+		// start to build our where clause
581
+		$where = [
582
+			'status' => ['IN', ['publish', 'sold_out']],
583
+		];
584
+		// add category
585
+		if ($this->events_category) {
586
+			$where['Term_Taxonomy.taxonomy']  = 'espresso_event_categories';
587
+			$where['Term_Taxonomy.Term.slug'] = $this->events_category;
588
+		}
589
+		// if NOT expired then we want events that start today or in the future
590
+		// if NOT show expired then we want events that start today or in the future
591
+		if ($this->show_expired == 0) {
592
+			$where['Datetime.DTT_EVT_end'] = [
593
+				'>=',
594
+				EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end'),
595
+			];
596
+		}
597
+		// if show ONLY expired we want events that ended prior to today
598
+		if ($this->show_expired == 2) {
599
+			$where['Datetime.DTT_EVT_end'] = [
600
+				'<=',
601
+				EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start'),
602
+			];
603
+		}
604
+		// allow $where to be filtered
605
+		return apply_filters('FHEE__EEW_Upcoming_Events__widget__where', $where, $this->events_category, $this->show_expired);
606
+	}
607
+
608
+
609
+	/**
610
+	 * @param EE_Event $event
611
+	 * @return string
612
+	 * @throws EE_Error
613
+	 * @throws ReflectionException
614
+	 * @since   4.10.14.p
615
+	 */
616
+	private function linkClass(EE_Event $event)
617
+	{
618
+		// how big is the event name ?
619
+		$name_length = strlen($event->name());
620
+		switch ($name_length) {
621
+			case $name_length > 70:
622
+				return ' three-line';
623
+			case $name_length > 35:
624
+				return ' two-line';
625
+		}
626
+		return ' one-line';
627
+	}
628
+
629
+
630
+	/**
631
+	 * @param EE_Event $event
632
+	 * @param string   $event_url
633
+	 * @return mixed|string|void
634
+	 * @throws EE_Error
635
+	 * @throws ReflectionException
636
+	 * @since   4.10.14.p
637
+	 */
638
+	private function eventWidgetContent(EE_Event $event, $event_url = '')
639
+	{
640
+		if (post_password_required($event->ID())) {
641
+			return apply_filters(
642
+				'FHEE_EEW_Upcoming_Events__widget__password_form',
643
+				get_the_password_form($event->ID()),
644
+				$event
645
+			);
646
+		}
647
+
648
+		$content = '';
649
+		if (has_post_thumbnail($event->ID()) && $this->image_size != 'none') {
650
+			$content .= '
651 651
                 <div class="ee-upcoming-events-widget-img-dv">
652 652
                     <a class="ee-upcoming-events-widget-img" href="' . $event_url . '">
653 653
                         ' . get_the_post_thumbnail($event->ID(), $this->image_size) . '
654 654
                     </a>
655 655
                 </div>';
656
-        }
657
-
658
-        if ($this->show_dates) {
659
-            $content .= $this->eventDates($event);
660
-        }
661
-
662
-        if ($this->show_desc) {
663
-            global $allowedtags;
664
-            $desc    = $event->short_description(25);
665
-            $content .= $desc ? '<p style="margin-top: .5em">' . wp_kses($desc, $allowedtags) . '</p>' : '';
666
-        }
667
-
668
-        return $content;
669
-    }
670
-
671
-
672
-    /**
673
-     * @param EE_Event $event
674
-     * @return string
675
-     * @throws EE_Error
676
-     * @throws ReflectionException
677
-     * @since   4.10.14.p
678
-     */
679
-    private function eventDates(EE_Event $event)
680
-    {
681
-        $date_format        = apply_filters(
682
-            'FHEE__espresso_event_date_range__date_format',
683
-            get_option('date_format')
684
-        );
685
-        $time_format        = apply_filters(
686
-            'FHEE__espresso_event_date_range__time_format',
687
-            get_option('time_format')
688
-        );
689
-        $single_date_format = apply_filters(
690
-            'FHEE__espresso_event_date_range__single_date_format',
691
-            get_option('date_format')
692
-        );
693
-        $single_time_format = apply_filters(
694
-            'FHEE__espresso_event_date_range__single_time_format',
695
-            get_option('time_format')
696
-        );
697
-        if ($this->date_range == true) {
698
-            return espresso_event_date_range(
699
-                $date_format,
700
-                $time_format,
701
-                $single_date_format,
702
-                $single_time_format,
703
-                $event->ID(),
704
-                false
705
-            );
706
-        }
707
-        return espresso_list_of_event_dates(
708
-            $event->ID(),
709
-            $date_format,
710
-            $time_format,
711
-            false,
712
-            null,
713
-            true,
714
-            true,
715
-            $this->date_limit
716
-        );
717
-    }
656
+		}
657
+
658
+		if ($this->show_dates) {
659
+			$content .= $this->eventDates($event);
660
+		}
661
+
662
+		if ($this->show_desc) {
663
+			global $allowedtags;
664
+			$desc    = $event->short_description(25);
665
+			$content .= $desc ? '<p style="margin-top: .5em">' . wp_kses($desc, $allowedtags) . '</p>' : '';
666
+		}
667
+
668
+		return $content;
669
+	}
670
+
671
+
672
+	/**
673
+	 * @param EE_Event $event
674
+	 * @return string
675
+	 * @throws EE_Error
676
+	 * @throws ReflectionException
677
+	 * @since   4.10.14.p
678
+	 */
679
+	private function eventDates(EE_Event $event)
680
+	{
681
+		$date_format        = apply_filters(
682
+			'FHEE__espresso_event_date_range__date_format',
683
+			get_option('date_format')
684
+		);
685
+		$time_format        = apply_filters(
686
+			'FHEE__espresso_event_date_range__time_format',
687
+			get_option('time_format')
688
+		);
689
+		$single_date_format = apply_filters(
690
+			'FHEE__espresso_event_date_range__single_date_format',
691
+			get_option('date_format')
692
+		);
693
+		$single_time_format = apply_filters(
694
+			'FHEE__espresso_event_date_range__single_time_format',
695
+			get_option('time_format')
696
+		);
697
+		if ($this->date_range == true) {
698
+			return espresso_event_date_range(
699
+				$date_format,
700
+				$time_format,
701
+				$single_date_format,
702
+				$single_time_format,
703
+				$event->ID(),
704
+				false
705
+			);
706
+		}
707
+		return espresso_list_of_event_dates(
708
+			$event->ID(),
709
+			$date_format,
710
+			$time_format,
711
+			false,
712
+			null,
713
+			true,
714
+			true,
715
+			$this->date_limit
716
+		);
717
+	}
718 718
 }
Please login to merge, or discard this patch.
pricing/templates/event_tickets_datetime_attached_tickets_row.template.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
                           placeholder="Datetime Description (optional)"><?php echo esc_textarea($DTT_description); ?></textarea>
24 24
             </div>
25 25
             <?php do_action(
26
-                'AHEE__event_tickets_datetime_attached_tickets_row_template__advanced_details_after_dtt_description',
27
-                $dtt_row,
28
-                $DTT_ID
29
-            ); ?>
26
+				'AHEE__event_tickets_datetime_attached_tickets_row_template__advanced_details_after_dtt_description',
27
+				$dtt_row,
28
+				$DTT_ID
29
+			); ?>
30 30
             <h4 class="datetime-tickets-heading"><?php esc_html_e('Assigned Tickets', 'event_espresso'); ?></h4>
31 31
 
32 32
             <ul class="datetime-tickets-list">
@@ -36,28 +36,28 @@  discard block
 block discarded – undo
36 36
 
37 37
             <div class="add-datetime-ticket-container">
38 38
                 <h4 class="datetime-tickets-heading"><?php
39
-                    esc_html_e(
40
-                        'Add New Ticket',
41
-                        'event_espresso'
42
-                    ); ?></h4><?php echo $add_new_datetime_ticket_help_link; ?><br>
39
+					esc_html_e(
40
+						'Add New Ticket',
41
+						'event_espresso'
42
+					); ?></h4><?php echo $add_new_datetime_ticket_help_link; ?><br>
43 43
                 <table class="add-new-ticket-table">
44 44
                     <thead>
45 45
                     <tr valign="top">
46 46
                         <td><span class="ANT_TKT_name_label"><?php
47
-                                esc_html_e(
48
-                                    'Ticket Name',
49
-                                    'event_espresso'
50
-                                ); ?></span></td>
47
+								esc_html_e(
48
+									'Ticket Name',
49
+									'event_espresso'
50
+								); ?></span></td>
51 51
                         <td><span class="ANT_TKT_goes_on_sale_label"><?php
52
-                                esc_html_e(
53
-                                    'Sale Starts',
54
-                                    'event_espresso'
55
-                                ); ?></span></td>
52
+								esc_html_e(
53
+									'Sale Starts',
54
+									'event_espresso'
55
+								); ?></span></td>
56 56
                         <td><span class="ANT_TKT_sell_until_label"><?php
57
-                                esc_html_e(
58
-                                    'Sell Until',
59
-                                    'event_espresso'
60
-                                ); ?></span></td>
57
+								esc_html_e(
58
+									'Sell Until',
59
+									'event_espresso'
60
+								); ?></span></td>
61 61
                         <td><span class="ANT_TKT_price_label"><?php esc_html_e('Price', 'event_espresso'); ?></span>
62 62
                         </td>
63 63
                         <td><span class="ANT_TKT_qty_label"><?php esc_html_e('Qty', 'event_espresso'); ?></span></td>
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
                 <div class="ee-editor-footer-container">
108 108
                     <div class="ee-editor-id-container">
109 109
                         <span class="ee-item-id"><?php
110
-                            echo $DTT_ID
111
-                                ? sprintf(
112
-                                    esc_html__('Datetime ID: %d', 'event_espresso'),
113
-                                    $DTT_ID
114
-                                )
115
-                                : ''; ?></span>
110
+							echo $DTT_ID
111
+								? sprintf(
112
+									esc_html__('Datetime ID: %d', 'event_espresso'),
113
+									$DTT_ID
114
+								)
115
+								: ''; ?></span>
116 116
                     </div>
117 117
                     <div class="save-cancel-button-container">
118 118
                         <button data-context="short-ticket" data-datetime-row="<?php echo absint($dtt_row); ?>"
Please login to merge, or discard this patch.
new/pricing/templates/event_tickets_datetime_ticket_price_row.template.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,9 +61,12 @@  discard block
 block discarded – undo
61 61
             <input type="text" size="1" class="edit-price-PRC_amount ee-numeric"
62 62
                    name="prices_archive[<?php echo absint($tkt_row); ?>][<?php echo absint($PRC_order); ?>][PRC_amount]"
63 63
                    value="<?php echo esc_attr($PRC_amount); ?>" disabled>
64
-        <?php else : ?>
64
+        <?php else {
65
+	: ?>
65 66
             <input type="text" size="1" class="edit-price-PRC_amount ee-numeric"
66
-                   name="<?php echo esc_attr($edit_prices_name); ?>[<?php echo absint($tkt_row); ?>][<?php echo absint($PRC_order); ?>][PRC_amount]"
67
+                   name="<?php echo esc_attr($edit_prices_name);
68
+}
69
+?>[<?php echo absint($tkt_row); ?>][<?php echo absint($PRC_order); ?>][PRC_amount]"
67 70
                    value="<?php echo esc_attr($PRC_amount); ?>">
68 71
         <?php endif; ?>
69 72
     </td>
@@ -74,8 +77,11 @@  discard block
 block discarded – undo
74 77
     <td>
75 78
         <?php if ($disabled) : ?>
76 79
             <span class="ee-lock-icon"></span>
77
-        <?php else : ?>
78
-            <!-- <span class="gear-icon dashicons dashicons-admin-generic clickable" data-ticket-row="<?php echo absint($tkt_row); ?>" data-context="price" data-price-row="<?php echo absint($PRC_order); ?>"></span> -->
80
+        <?php else {
81
+	: ?>
82
+            <!-- <span class="gear-icon dashicons dashicons-admin-generic clickable" data-ticket-row="<?php echo absint($tkt_row);
83
+}
84
+?>" data-context="price" data-price-row="<?php echo absint($PRC_order); ?>"></span> -->
79 85
             <span class="trash-icon dashicons dashicons-post-trash clickable" data-ticket-row="<?php echo absint($tkt_row); ?>"
80 86
                   data-context="price" data-price-row="<?php echo absint($PRC_order); ?>"<?php echo $show_trash_icon; ?>></span>
81 87
             <button data-ticket-row="<?php echo absint($tkt_row); ?>" data-price-row="<?php echo absint($PRC_order); ?>"
Please login to merge, or discard this patch.
new/pricing/templates/event_tickets_datetime_dtt_tickets_list.template.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 
15 15
 <li data-datetime-row="<?php echo absint($dtt_row); ?>" data-context="datetime-ticket" data-ticket-row="<?php echo absint($tkt_row); ?>"
16 16
     class="datetime-ticket clickable<?php echo $ticket_selected;
17
-    echo $tkt_status_class; ?>">
17
+	echo $tkt_status_class; ?>">
18 18
     <input type="checkbox" name="datetime_ticket[<?php echo absint($dtt_row); ?>][<?php echo absint($tkt_row); ?>]"
19 19
            class="datetime-ticket-checkbox" value="1"<?php echo $datetime_ticket_checked; ?>>
20 20
     <span class="ee-icon ee-icon-tickets ticket-list-ticket-name"><?php echo $TKT_name; ?></span>
Please login to merge, or discard this patch.
admin/new/pricing/templates/event_tickets_datetime_ticket_row.template.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
             <!--<div class="total-price-container"><?php printf(
170 170
                 esc_html__('Total Final Price: %s', 'event_espresso'),
171
-                '<span class="ticket-price-amount">' . $TKT_price . '</span>'
171
+                '<span class="ticket-price-amount">'.$TKT_price.'</span>'
172 172
             ); ?> </div>-->
173 173
             <textarea name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_description]"
174 174
                       class="edit-ticket-TKT_description ee-full-textarea-inp"
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                         ); ?></label>
268 268
                 </div>
269 269
                 <div class="ticket-is-taxable-container">
270
-                    <?php if (! empty($tax_rows)) { ?>
270
+                    <?php if ( ! empty($tax_rows)) { ?>
271 271
                         <?php if ($disabled) : ?>
272 272
                             <?php
273 273
                             $tax_value = ! empty($TKT_taxable) ? 1 : 0;
Please login to merge, or discard this patch.
Braces   +40 added lines, -16 removed lines patch added patch discarded remove patch
@@ -79,8 +79,11 @@  discard block
 block discarded – undo
79 79
                    class="edit-ticket-TKT_start_date ee-text-inp" value="<?php echo esc_attr($TKT_start_date); ?>">
80 80
             <input type="text" name="archived_ticket[TKT_start_date]" class="edit-ticket-TKT_start_date ee-text-inp"
81 81
                    value="<?php echo esc_attr($TKT_start_date); ?>" disabled>
82
-        <?php else : ?>
83
-            <input id="edit-ticket-TKT_start_date-<?php echo absint($tkt_row); ?>" type="text"
82
+        <?php else {
83
+	: ?>
84
+            <input id="edit-ticket-TKT_start_date-<?php echo absint($tkt_row);
85
+}
86
+?>" type="text"
84 87
                    name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_start_date]"
85 88
                    class="edit-ticket-TKT_start_date ee-text-inp ee-datepicker" value="<?php echo esc_attr($TKT_start_date); ?>"
86 89
                    data-context="start-ticket" data-date-field-context="#display-ticketrow-<?php echo absint($tkt_row); ?>"
@@ -94,8 +97,11 @@  discard block
 block discarded – undo
94 97
                    class="edit-ticket-TKT_end_date ee-text-inp" value="<?php echo esc_attr($TKT_end_date); ?>">
95 98
             <input type="text" name="archived_ticket[TKT_end_date]" class="edit-ticket-TKT_end_date ee-text-inp"
96 99
                    value="<?php echo esc_attr($TKT_end_date); ?>" disabled>
97
-        <?php else : ?>
98
-            <input id="edit-ticket-TKT_end_date-<?php echo absint($tkt_row); ?>" type="text"
100
+        <?php else {
101
+	: ?>
102
+            <input id="edit-ticket-TKT_end_date-<?php echo absint($tkt_row);
103
+}
104
+?>" type="text"
99 105
                    name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_end_date]"
100 106
                    class="edit-ticket-TKT_end_date ee-text-inp ee-datepicker" value="<?php echo esc_attr($TKT_end_date); ?>"
101 107
                    data-context="end-ticket" data-date-field-context="#display-ticketrow-<?php echo absint($tkt_row); ?>"
@@ -111,8 +117,11 @@  discard block
 block discarded – undo
111 117
             <input type="text" name="archived_ticket[<?php echo absint($tkt_row); ?>][TKT_base_price]"
112 118
                    class="edit-ticket-TKT_base_price ee-small-text-inp edit-price-PRC_amount ee-numeric"
113 119
                    value="<?php echo esc_attr($TKT_base_price); ?>" disabled>
114
-        <?php else : ?>
115
-            <input id="edit-ticket-TKT_base_price-<?php echo absint($tkt_row); ?>" type="text"
120
+        <?php else {
121
+	: ?>
122
+            <input id="edit-ticket-TKT_base_price-<?php echo absint($tkt_row);
123
+}
124
+?>" type="text"
116 125
                    name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_base_price]"
117 126
                    class="edit-ticket-TKT_base_price ee-small-text-inp edit-price-PRC_amount ee-numeric"
118 127
                    value="<?php echo esc_attr($TKT_base_price); ?>">
@@ -129,8 +138,11 @@  discard block
 block discarded – undo
129 138
             <input type="text" class="edit-ticket-TKT_qty ee-small-text-inp ee-numeric"
130 139
                    name="archived_ticket[<?php echo absint($tkt_row); ?>][TKT_qty]" value="<?php echo esc_attr($TKT_qty_for_input); ?>"
131 140
                    disabled>
132
-        <?php else : ?>
133
-            <input type="text" id="edit-ticket-TKT_qty-<?php echo absint($tkt_row); ?>"
141
+        <?php else {
142
+	: ?>
143
+            <input type="text" id="edit-ticket-TKT_qty-<?php echo absint($tkt_row);
144
+}
145
+?>"
134 146
                    class="edit-ticket-TKT_qty ee-small-text-inp ee-numeric"
135 147
                    name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_qty]"
136 148
                    value="<?php echo esc_attr($TKT_qty_for_input); ?>">
@@ -209,9 +221,12 @@  discard block
 block discarded – undo
209 221
                                 <input type="text" class="edit-ticket-TKT_uses ee-small-text-inp ee-numeric"
210 222
                                        name="archived_ticket[<?php echo absint($tkt_row); ?>][TKT_uses]"
211 223
                                        value="<?php echo esc_attr($TKT_uses); ?>" disabled>
212
-                            <?php else : ?>
224
+                            <?php else {
225
+	: ?>
213 226
                                 <input type="text" class="edit-ticket-TKT_uses ee-small-text-inp ee-numeric"
214
-                                       name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_uses]"
227
+                                       name="<?php echo esc_attr($edit_tickets_name);
228
+}
229
+?>[<?php echo absint($tkt_row); ?>][TKT_uses]"
215 230
                                        value="<?php echo esc_attr($TKT_uses); ?>">
216 231
                             <?php endif; ?>
217 232
                         </td>
@@ -223,9 +238,12 @@  discard block
 block discarded – undo
223 238
                                 <input type="text" class="edit-ticket-TKT_min ee-small-text-inp ee-numeric"
224 239
                                        name="archived_ticket[<?php echo absint($tkt_row); ?>][TKT_min]"
225 240
                                        value="<?php echo esc_attr($TKT_min); ?>" disabled>
226
-                            <?php else : ?>
241
+                            <?php else {
242
+	: ?>
227 243
                                 <input type="text" class="edit-ticket-TKT_min ee-small-text-inp ee-numeric"
228
-                                       name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_min]"
244
+                                       name="<?php echo esc_attr($edit_tickets_name);
245
+}
246
+?>[<?php echo absint($tkt_row); ?>][TKT_min]"
229 247
                                        value="<?php echo esc_attr($TKT_min); ?>">
230 248
                             <?php endif; ?>
231 249
                         </td>
@@ -237,9 +255,12 @@  discard block
 block discarded – undo
237 255
                                 <input type="text" class="edit-ticket-TKT_max ee-small-text-inp ee-numeric"
238 256
                                        name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_max]"
239 257
                                        value="<?php echo esc_attr($TKT_max); ?>" disabled>
240
-                            <?php else : ?>
258
+                            <?php else {
259
+	: ?>
241 260
                                 <input type="text" class="edit-ticket-TKT_max ee-small-text-inp ee-numeric"
242
-                                       name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_max]"
261
+                                       name="<?php echo esc_attr($edit_tickets_name);
262
+}
263
+?>[<?php echo absint($tkt_row); ?>][TKT_max]"
243 264
                                        value="<?php echo esc_attr($TKT_max); ?>">
244 265
                             <?php endif; ?>
245 266
                         </td>
@@ -278,8 +299,11 @@  discard block
 block discarded – undo
278 299
                         <input class="TKT-taxable-checkbox" id="edit-ticket-TKT_taxable-<?php echo absint($tkt_row); ?>"
279 300
                                type="checkbox" name="archived_ticket[<?php echo absint($tkt_row); ?>][TKT_taxable]"
280 301
                                value="1"<?php echo $TKT_taxable; ?> disabled>
281
-                        <?php else : ?>
282
-                        <input class="TKT-taxable-checkbox" id="edit-ticket-TKT_taxable-<?php echo absint($tkt_row); ?>"
302
+                        <?php else {
303
+	: ?>
304
+                        <input class="TKT-taxable-checkbox" id="edit-ticket-TKT_taxable-<?php echo absint($tkt_row);
305
+}
306
+?>"
283 307
                                type="checkbox"
284 308
                                name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_taxable]"
285 309
                                value="1"<?php echo $TKT_taxable; ?>>
Please login to merge, or discard this patch.
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 ?>
59 59
 <tr valign="top" class="ee-ticket-sortable ticket-row <?php echo sanitize_html_class($ticket_archive_class);
60 60
 if (WP_DEBUG) {
61
-    echo ' ee-wp-debug';
61
+	echo ' ee-wp-debug';
62 62
 } ?>" id="display-ticketrow-<?php echo absint($tkt_row); ?>">
63 63
     <!--<td class="ee-tkt-order-field"><span class="dashicons dashicons-sort <?php echo sanitize_html_class($tkt_status_class); ?>">
64 64
     <input type="hidden" name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_order]" class="edit-ticket-TKT_order" value ="<?php echo absint($TKT_order); ?>" ></span></td>-->
@@ -167,9 +167,9 @@  discard block
 block discarded – undo
167 167
                    class="edit-ticket-TKT_row" value="<?php echo absint($tkt_row); ?>">
168 168
 
169 169
             <!--<div class="total-price-container"><?php printf(
170
-                esc_html__('Total Final Price: %s', 'event_espresso'),
171
-                '<span class="ticket-price-amount">' . $TKT_price . '</span>'
172
-            ); ?> </div>-->
170
+				esc_html__('Total Final Price: %s', 'event_espresso'),
171
+				'<span class="ticket-price-amount">' . $TKT_price . '</span>'
172
+			); ?> </div>-->
173 173
             <textarea name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_description]"
174 174
                       class="edit-ticket-TKT_description ee-full-textarea-inp"
175 175
                       placeholder="Ticket Description"><?php echo esc_textarea($TKT_description); ?></textarea>
@@ -183,20 +183,20 @@  discard block
 block discarded – undo
183 183
                     <thead>
184 184
                     <tr valign="bottom">
185 185
                         <td><span class="TD_TKT_number_datetimes_label"><?php
186
-                                esc_html_e(
187
-                                    '# Datetimes',
188
-                                    'event_espresso'
189
-                                ); ?></span></td>
186
+								esc_html_e(
187
+									'# Datetimes',
188
+									'event_espresso'
189
+								); ?></span></td>
190 190
                         <td><span class="TD_TKT_min_qty_label"><?php
191
-                                esc_html_e(
192
-                                    'Minimum Quantity',
193
-                                    'event_espresso'
194
-                                ); ?></span></td>
191
+								esc_html_e(
192
+									'Minimum Quantity',
193
+									'event_espresso'
194
+								); ?></span></td>
195 195
                         <td><span class="TD_TKT_max_qty_label"><?php
196
-                                esc_html_e(
197
-                                    'Maximum Quantity',
198
-                                    'event_espresso'
199
-                                ); ?></span></td>
196
+								esc_html_e(
197
+									'Maximum Quantity',
198
+									'event_espresso'
199
+								); ?></span></td>
200 200
                     </tr>
201 201
                     </thead>
202 202
                     <tbody>
@@ -254,24 +254,24 @@  discard block
 block discarded – undo
254 254
                     <input type="checkbox"
255 255
                            name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_required]"
256 256
                            class="edit-ticket-TKT_required" value="1"<?php
257
-                            echo $TKT_required
258
-                                ? ' checked="checked"'
259
-                                : '';
260
-                            echo $disabled
261
-                                ? ' disabled'
262
-                                : ''; ?>>
257
+							echo $TKT_required
258
+								? ' checked="checked"'
259
+								: '';
260
+							echo $disabled
261
+								? ' disabled'
262
+								: ''; ?>>
263 263
                     <label for="edit-ticket-TKT_required"><?php
264
-                        esc_html_e(
265
-                            'This ticket is required (will appear first in frontend ticket lists).',
266
-                            'event_espresso'
267
-                        ); ?></label>
264
+						esc_html_e(
265
+							'This ticket is required (will appear first in frontend ticket lists).',
266
+							'event_espresso'
267
+						); ?></label>
268 268
                 </div>
269 269
                 <div class="ticket-is-taxable-container">
270 270
                     <?php if (! empty($tax_rows)) { ?>
271 271
                         <?php if ($disabled) : ?>
272 272
                             <?php
273
-                            $tax_value = ! empty($TKT_taxable) ? 1 : 0;
274
-                            ?>
273
+							$tax_value = ! empty($TKT_taxable) ? 1 : 0;
274
+							?>
275 275
                         <input class="TKT-taxable-checkbox" type="hidden"
276 276
                                name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_taxable]"
277 277
                                value="<?php echo esc_attr($tax_value); ?>">
@@ -285,16 +285,16 @@  discard block
 block discarded – undo
285 285
                                value="1"<?php echo $TKT_taxable; ?>>
286 286
                         <?php endif; ?>
287 287
                     <label for="edit-ticket-TKT_taxable-<?php echo absint($tkt_row); ?>"> <?php
288
-                        esc_html_e('This ticket is taxable.', 'event_espresso'); ?>
288
+						esc_html_e('This ticket is taxable.', 'event_espresso'); ?>
289 289
                     <?php } //end tax_rows check ?>
290 290
                 </div>
291 291
             </div>
292 292
             <div class="price-table-container">
293 293
                 <h4 class="tickets-heading price-table-info"<?php echo $show_price_modifier; ?>><?php
294
-                    esc_html_e(
295
-                        'Price Modifiers',
296
-                        'event_espresso'
297
-                    ); ?></h4>
294
+					esc_html_e(
295
+						'Price Modifiers',
296
+						'event_espresso'
297
+					); ?></h4>
298 298
                 <table class="price-table">
299 299
                     <thead class="price-table-info"<?php echo $show_price_modifier; ?>>
300 300
                     <tr>
@@ -314,10 +314,10 @@  discard block
 block discarded – undo
314 314
                     <tr class="price-subtotal-row TKT-taxes-display"<?php echo $display_subtotal; ?>>
315 315
                         <td colspan="4" class="ee-numeric">
316 316
                             <span class="TKT-taxable-subtotal-label"><strong><?php
317
-                                    esc_html_e(
318
-                                        'Subtotal',
319
-                                        'event_espresso'
320
-                                    ); ?></strong></span>
317
+									esc_html_e(
318
+										'Subtotal',
319
+										'event_espresso'
320
+									); ?></strong></span>
321 321
                         </td>
322 322
                         <td class="ee-numeric">
323 323
                             <span
@@ -350,51 +350,51 @@  discard block
 block discarded – undo
350 350
             <div style="clear:both"></div>
351 351
             <h4 class="tickets-heading"><?php esc_html_e('Event Datetimes', 'event_espresso'); ?></h4>
352 352
             <p><?php
353
-                esc_html_e(
354
-                    'This ticket will be usable (allow entrance) for the following selected event datetimes (click to select).  The "# Datetimes" amount (above) indicates how many of the assigned datetimes the ticket holder can gain access to:',
355
-                    'event_espresso'
356
-                ); ?></p>
353
+				esc_html_e(
354
+					'This ticket will be usable (allow entrance) for the following selected event datetimes (click to select).  The "# Datetimes" amount (above) indicates how many of the assigned datetimes the ticket holder can gain access to:',
355
+					'event_espresso'
356
+				); ?></p>
357 357
             <ul class="datetime-tickets-list">
358 358
                 <?php echo $ticket_datetimes_list; ?>
359 359
             </ul>
360 360
 
361 361
             <?php do_action(
362
-                'AHEE__event_tickets_datetime_ticket_row_template__advanced_details_end',
363
-                $tkt_row,
364
-                $TKT_ID
365
-            ); ?>
362
+				'AHEE__event_tickets_datetime_ticket_row_template__advanced_details_end',
363
+				$tkt_row,
364
+				$TKT_ID
365
+			); ?>
366 366
             <div class="ee-editor-footer-container">
367 367
                 <div class="ee-editor-id-container">
368 368
                     <span class="ee-item-id"><?php echo
369
-                        $TKT_ID
370
-                            ? sprintf(
371
-                                esc_html__('Ticket ID: %d', 'event_espresso'),
372
-                                $TKT_ID
373
-                            )
374
-                                             : ''; ?></span>
369
+						$TKT_ID
370
+							? sprintf(
371
+								esc_html__('Ticket ID: %d', 'event_espresso'),
372
+								$TKT_ID
373
+							)
374
+											 : ''; ?></span>
375 375
                 </div>
376 376
                 <div class="save-cancel-button-container">
377 377
                     <label for="edit-ticket-TKT_is_default_selector"><?php
378
-                        esc_html_e(
379
-                            'use this new ticket as a default ticket for any new events',
380
-                            'event_espresso'
381
-                        ); ?></label>
378
+						esc_html_e(
379
+							'use this new ticket as a default ticket for any new events',
380
+							'event_espresso'
381
+						); ?></label>
382 382
                     <input type="checkbox"
383 383
                            name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_is_default_selector]"
384 384
                            class="edit-ticket-TKT_is_default_selector" value="1"<?php
385
-                            echo $disabled
386
-                                ? ' disabled'
387
-                                : ''; ?>>
385
+							echo $disabled
386
+								? ' disabled'
387
+								: ''; ?>>
388 388
                     <input type="hidden"
389 389
                            name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo absint($tkt_row); ?>][TKT_is_default]"
390 390
                            class="edit-ticket-TKT_is_default" value="<?php echo esc_attr($TKT_is_default); ?>">
391 391
                     <!--<button class="button-primary ee-save-button" data-context="ticket" data-ticket-row="<?php echo absint($tkt_row); ?>"><?php esc_html_e(
392
-                        'Update Ticket',
393
-                        'event_espresso'
394
-                    ); ?></button>-->
392
+						'Update Ticket',
393
+						'event_espresso'
394
+					); ?></button>-->
395 395
                     <button class="button-secondary ee-cancel-button" data-context="ticket"
396 396
                             data-ticket-row="<?php echo absint($tkt_row); ?>"><?php
397
-                                    esc_html_e('Close', 'event_espresso'); ?></button>
397
+									esc_html_e('Close', 'event_espresso'); ?></button>
398 398
                 </div>
399 399
             </div>
400 400
             <!-- these hidden inputs are for tracking changes in dtts attached to tickets during a js session -->
Please login to merge, or discard this patch.
admin_pages/maintenance/templates/ee_system_stati_page.template.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -18,38 +18,38 @@  discard block
 block discarded – undo
18 18
  */
19 19
 function ee_recurse_into_array_for_display($data, $depth = 0, $td = true)
20 20
 {
21
-    if (is_object($data) || $data instanceof __PHP_Incomplete_Class) {
22
-        // is_object($incomplete_class) actually returns false, hence why we check for it
23
-        $data = json_decode(json_encode($data), true);
24
-    }
25
-    if (empty($data)) {
26
-        return;
27
-    }
28
-    if (is_array($data)) {
29
-        $depth++;
30
-        ksort($data, SORT_NATURAL | SORT_FLAG_CASE);
31
-        if (EEH_Array::is_associative_array($data)) { ?>
21
+	if (is_object($data) || $data instanceof __PHP_Incomplete_Class) {
22
+		// is_object($incomplete_class) actually returns false, hence why we check for it
23
+		$data = json_decode(json_encode($data), true);
24
+	}
25
+	if (empty($data)) {
26
+		return;
27
+	}
28
+	if (is_array($data)) {
29
+		$depth++;
30
+		ksort($data, SORT_NATURAL | SORT_FLAG_CASE);
31
+		if (EEH_Array::is_associative_array($data)) { ?>
32 32
             <table class='ee-system-stati ee-system-stati-<?php echo absint($depth); ?>'>
33 33
                 <tbody>
34 34
                     <?php foreach ($data as $data_key => $data_value) {
35
-                        // if the value is a single element array with no key,
36
-                        // and the value is a primitive (not an array, object, etc.)
37
-                        if (
38
-                            is_array($data_value)
39
-                            && count($data_value) === 1
40
-                            && empty(key($data_value))
41
-                            && is_scalar(reset($data_value))
42
-                        ) {
43
-                            ?>
35
+						// if the value is a single element array with no key,
36
+						// and the value is a primitive (not an array, object, etc.)
37
+						if (
38
+							is_array($data_value)
39
+							&& count($data_value) === 1
40
+							&& empty(key($data_value))
41
+							&& is_scalar(reset($data_value))
42
+						) {
43
+							?>
44 44
                             <tr>
45 45
                                 <td class="ee-system-stati-value" colspan="2">
46 46
                                     <?php echo esc_html(reset($data_value)); ?>
47 47
                                 </td>
48 48
                             </tr>
49 49
                             <?php
50
-                            continue;
51
-                        }
52
-                        ?>
50
+							continue;
51
+						}
52
+						?>
53 53
                         <tr>
54 54
                             <td class='ee-system-stati-key'>
55 55
                                 <span class="ee-system-stati-label">
@@ -64,31 +64,31 @@  discard block
 block discarded – undo
64 64
                             <?php if (is_scalar($data_value)) { ?>
65 65
                                 <?php ee_recurse_into_array_for_display($data_value, $depth); ?>
66 66
                             <?php } else {
67
-                                if (is_array($data_value) && count($data_value) === 1) {
68
-                                    // verify that values have been set
69
-                                    $keys_only = empty(
70
-                                        array_filter(
71
-                                            array_values($data_value),
72
-                                            function ($v) {
73
-                                                return $v !== null && (is_array($v) || trim($v) !== '');
74
-                                            }
75
-                                        )
76
-                                    );
77
-                                    // if the array only consists of keys (no values)
78
-                                    if ($keys_only) {
79
-                                        // then use keys for values
80
-                                        $data_value = array_keys($data_value);
81
-                                        // but if there is only one value now
82
-                                        if (count($data_value) === 1) {
83
-                                            // then pass that single value back into this function
84
-                                            // this prevents extra empty layers of nothing being added to the output
85
-                                            ee_recurse_into_array_for_display(reset($data_value), $depth);
86
-                                            // need to finish the row off though
87
-                                            echo '</tr>';
88
-                                            continue;
89
-                                        }
90
-                                    }
91
-                                } ?>
67
+								if (is_array($data_value) && count($data_value) === 1) {
68
+									// verify that values have been set
69
+									$keys_only = empty(
70
+										array_filter(
71
+											array_values($data_value),
72
+											function ($v) {
73
+												return $v !== null && (is_array($v) || trim($v) !== '');
74
+											}
75
+										)
76
+									);
77
+									// if the array only consists of keys (no values)
78
+									if ($keys_only) {
79
+										// then use keys for values
80
+										$data_value = array_keys($data_value);
81
+										// but if there is only one value now
82
+										if (count($data_value) === 1) {
83
+											// then pass that single value back into this function
84
+											// this prevents extra empty layers of nothing being added to the output
85
+											ee_recurse_into_array_for_display(reset($data_value), $depth);
86
+											// need to finish the row off though
87
+											echo '</tr>';
88
+											continue;
89
+										}
90
+									}
91
+								} ?>
92 92
                                 <td class="ee-system-stati-sub-values">
93 93
                                     <?php ee_recurse_into_array_for_display($data_value, $depth); ?>
94 94
                                 </td>
@@ -106,19 +106,19 @@  discard block
 block discarded – undo
106 106
                 <?php } ?>
107 107
             </ul>
108 108
         <?php } else {
109
-            // there's no key (label) and there's only one value,
110
-            // so let's just pass that value back into this function,
111
-            // but reset the depth back to where it was.
112
-            // this prevents extra empty layers of nothing being added to the output
113
-            $depth--;
114
-            ee_recurse_into_array_for_display(reset($data), $depth, false);
115
-        }
116
-    } else {
117
-        echo $td ? '<td class="ee-system-stati-value">' : '';
118
-        // simple value
119
-        echo $data;
120
-        echo $td ? '</td>' : '';
121
-    }
109
+			// there's no key (label) and there's only one value,
110
+			// so let's just pass that value back into this function,
111
+			// but reset the depth back to where it was.
112
+			// this prevents extra empty layers of nothing being added to the output
113
+			$depth--;
114
+			ee_recurse_into_array_for_display(reset($data), $depth, false);
115
+		}
116
+	} else {
117
+		echo $td ? '<td class="ee-system-stati-value">' : '';
118
+		// simple value
119
+		echo $data;
120
+		echo $td ? '</td>' : '';
121
+	}
122 122
 }
123 123
 
124 124
 ?>
Please login to merge, or discard this patch.
venues/templates/event_venues_metabox_content_from_manager.template.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -14,20 +14,20 @@
 block discarded – undo
14 14
                 <?php esc_html_e('Select from Venue Manager List', 'event_espresso'); ?>
15 15
             </label>
16 16
             <?php
17
-            echo $venue_selector; // already escaped
18
-            echo $new_venue_link; // already escaped
19
-            foreach ($venues as $venue) :
20
-                if (! $venue instanceof EE_Venue) {
21
-                    continue;
22
-                }
23
-                $selected     = $evt_venue_id === $venue->ID() ? 'ee-venue-selected' : 'ee-venue-not-selected';
24
-                $edit_url     = EE_Admin_Page::add_query_args_and_nonce(
25
-                    ['action' => 'edit', 'post' => $venue->ID()],
26
-                    EE_VENUES_ADMIN_URL
27
-                );
28
-                $state_name   = is_object($venue->state_obj()) ? $venue->state_obj()->name() : null;
29
-                $country_name = is_object($venue->country_obj()) ? $venue->country_obj()->name() : null;
30
-                ?>
17
+			echo $venue_selector; // already escaped
18
+			echo $new_venue_link; // already escaped
19
+			foreach ($venues as $venue) :
20
+				if (! $venue instanceof EE_Venue) {
21
+					continue;
22
+				}
23
+				$selected     = $evt_venue_id === $venue->ID() ? 'ee-venue-selected' : 'ee-venue-not-selected';
24
+				$edit_url     = EE_Admin_Page::add_query_args_and_nonce(
25
+					['action' => 'edit', 'post' => $venue->ID()],
26
+					EE_VENUES_ADMIN_URL
27
+				);
28
+				$state_name   = is_object($venue->state_obj()) ? $venue->state_obj()->name() : null;
29
+				$country_name = is_object($venue->country_obj()) ? $venue->country_obj()->name() : null;
30
+				?>
31 31
                 <div class='eebox <?php echo sanitize_html_class($selected); ?>' id="eebox_<?php echo absint($venue->ID()); ?>">
32 32
                     <p class='address-view'>
33 33
                         <span><?php esc_html_e('Address:', 'event_espresso'); ?>&nbsp;</span>
Please login to merge, or discard this patch.
templates/txn_admin_details_main_meta_box_txn_details.template.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
                     <?php if ($payments) : ?>
126 126
                         <?php $payment_total = 0; ?>
127 127
                         <?php foreach ($payments as $PAY_ID => $payment) :
128
-                            if (! $payment instanceof EE_Payment) {
128
+                            if ( ! $payment instanceof EE_Payment) {
129 129
                                 continue;
130 130
                             }
131 131
                             $PAY_ID = absint($PAY_ID);
132
-                            $existing_reg_payment_json = isset($existing_reg_payments[ $PAY_ID ])
133
-                                ? wp_json_encode($existing_reg_payments[ $PAY_ID ])
132
+                            $existing_reg_payment_json = isset($existing_reg_payments[$PAY_ID])
133
+                                ? wp_json_encode($existing_reg_payments[$PAY_ID])
134 134
                                 : '{}';
135 135
                             ?>
136 136
                             <tr id="txn-admin-payment-tr-<?php echo absint($PAY_ID); ?>">
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
                                 <td class=" jst-rght">
222 222
                                     <?php
223 223
                                     $payment_class = $payment->amount() > 0
224
-                                        ? 'txn-admin-payment-status-' . $payment->STS_ID()
224
+                                        ? 'txn-admin-payment-status-'.$payment->STS_ID()
225 225
                                         : 'txn-admin-payment-status-PDC';
226 226
                                     ?>
227 227
                                     <span class="<?php echo esc_attr($payment_class); ?>">
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                             $overpaid
263 263
                             . sprintf(
264 264
                                 __('Payments Total %s', 'event_espresso'),
265
-                                '(' . EE_Registry::instance()->CFG->currency->code . ')'
265
+                                '('.EE_Registry::instance()->CFG->currency->code.')'
266 266
                             )
267 267
                         ); ?>
268 268
                         </span>
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
             >
399 399
                 <div class="ee-icon ee-icon-cash-add float-left"></div>
400 400
                 <?php
401
-                echo esc_html__('Apply a Payment to Transaction #', 'event_espresso') . esc_html($txn_nmbr['value']); ?>
401
+                echo esc_html__('Apply a Payment to Transaction #', 'event_espresso').esc_html($txn_nmbr['value']); ?>
402 402
             </h2>
403 403
 
404 404
             <h2 id="admin-modal-dialog-edit-payment-h2" class="admin-modal-dialog-h2 hdr-has-icon"
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
 
911 911
     <?php if (WP_DEBUG) {
912 912
         $delivered_messages = get_option('EED_Messages__payment', []);
913
-        if (isset($delivered_messages[ $TXN_ID ])) { ?>
913
+        if (isset($delivered_messages[$TXN_ID])) { ?>
914 914
             <h4 class="admin-primary-mbox-h4 hdr-has-icon">
915 915
                 <span class="dashicons dashicons-email-alt"></span>
916 916
                 <?php esc_html_e('Messages Sent to Primary Registrant', 'event_espresso'); ?>
@@ -930,13 +930,13 @@  discard block
 block discarded – undo
930 930
                     </thead>
931 931
                     <tbody>
932 932
                         <?php
933
-                        foreach ($delivered_messages[ $TXN_ID ] as $timestamp => $delivered_message) :
933
+                        foreach ($delivered_messages[$TXN_ID] as $timestamp => $delivered_message) :
934 934
                             ?>
935 935
                             <tr>
936 936
                                 <td class="jst-left">
937 937
                                     <?php echo esc_html(
938 938
                                         date(
939
-                                            get_option('date_format') . ' ' . get_option('time_format'),
939
+                                            get_option('date_format').' '.get_option('time_format'),
940 940
                                             ($timestamp + (get_option('gmt_offset') * HOUR_IN_SECONDS))
941 941
                                         )
942 942
                                     ); ?>
Please login to merge, or discard this patch.
Indentation   +172 added lines, -172 removed lines patch added patch discarded remove patch
@@ -80,25 +80,25 @@  discard block
 block discarded – undo
80 80
     </div>
81 81
     <br class="clear" />
82 82
     <?php
83
-    $no_payments = $grand_raw_total > 0
84
-                   || $TXN_status !== EEM_Transaction::complete_status_code
85
-                   || ! empty($payments);
86
-    ?>
83
+	$no_payments = $grand_raw_total > 0
84
+				   || $TXN_status !== EEM_Transaction::complete_status_code
85
+				   || ! empty($payments);
86
+	?>
87 87
     <?php if ($attendee instanceof EE_Attendee && $no_payments) : ?>
88 88
         <?php $no_payment_text = $can_edit_payments
89
-            ? esc_html__(
90
-                'No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.',
91
-                'event_espresso'
92
-            )
93
-            : esc_html__(
94
-                'No payments have been applied to this transaction yet.',
95
-                'event_espresso'
96
-            );
97
-        ?>
89
+			? esc_html__(
90
+				'No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.',
91
+				'event_espresso'
92
+			)
93
+			: esc_html__(
94
+				'No payments have been applied to this transaction yet.',
95
+				'event_espresso'
96
+			);
97
+		?>
98 98
 
99 99
         <h3 class="admin-primary-mbox-h4 hdr-has-icon">
100 100
             <span class="ee-icon ee-icon-cash"></span><?php
101
-            esc_html_e('Payment Details', 'event_espresso'); ?>
101
+			esc_html_e('Payment Details', 'event_espresso'); ?>
102 102
         </h3>
103 103
 
104 104
         <div class="admin-primary-mbox-tbl-wrap">
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
                         <th class="jst-left"><?php esc_html_e('TXN&nbsp;ID / CHQ&nbsp;#', 'event_espresso'); ?></th>
115 115
                         <th class="jst-left"><?php esc_html_e('P.O. / S.O.&nbsp;#', 'event_espresso'); ?></th>
116 116
                         <th class="jst-left"><?php esc_html_e(
117
-                            'Notes / Extra&nbsp;Accounting',
118
-                            'event_espresso'
119
-                        ); ?></th>
117
+							'Notes / Extra&nbsp;Accounting',
118
+							'event_espresso'
119
+						); ?></th>
120 120
                         <!--<th class="jst-left"><?php esc_html_e('Details', 'event_espresso'); ?></th>-->
121 121
                         <th class="jst-cntr"><?php esc_html_e('Amount', 'event_espresso'); ?></th>
122 122
                     </tr>
@@ -125,14 +125,14 @@  discard block
 block discarded – undo
125 125
                     <?php if ($payments) : ?>
126 126
                         <?php $payment_total = 0; ?>
127 127
                         <?php foreach ($payments as $PAY_ID => $payment) :
128
-                            if (! $payment instanceof EE_Payment) {
129
-                                continue;
130
-                            }
131
-                            $PAY_ID = absint($PAY_ID);
132
-                            $existing_reg_payment_json = isset($existing_reg_payments[ $PAY_ID ])
133
-                                ? wp_json_encode($existing_reg_payments[ $PAY_ID ])
134
-                                : '{}';
135
-                            ?>
128
+							if (! $payment instanceof EE_Payment) {
129
+								continue;
130
+							}
131
+							$PAY_ID = absint($PAY_ID);
132
+							$existing_reg_payment_json = isset($existing_reg_payments[ $PAY_ID ])
133
+								? wp_json_encode($existing_reg_payments[ $PAY_ID ])
134
+								: '{}';
135
+							?>
136 136
                             <tr id="txn-admin-payment-tr-<?php echo absint($PAY_ID); ?>">
137 137
                                 <td>
138 138
                 <span id="payment-status-<?php echo absint($PAY_ID); ?>"
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
                                 <td class=" jst-rght">
174 174
                                     <div id="payment-id-<?php echo absint($PAY_ID); ?>">
175 175
                                         <?php echo $PAY_ID; // sanitized
176
-                                        ?>
176
+										?>
177 177
                                     </div>
178 178
                                 </td>
179 179
                                 <td class=" jst-left">
@@ -187,15 +187,15 @@  discard block
 block discarded – undo
187 187
                                     </div>
188 188
                                     <div id="payment-gateway-<?php echo absint($PAY_ID); ?>">
189 189
                                         <?php echo $payment->payment_method() instanceof EE_Payment_Method
190
-                                            ? esc_html($payment->payment_method()->admin_name())
191
-                                            : esc_html__("Unknown", 'event_espresso'); ?>
190
+											? esc_html($payment->payment_method()->admin_name())
191
+											: esc_html__("Unknown", 'event_espresso'); ?>
192 192
                                     </div>
193 193
                                     <div id="payment-gateway-id-<?php echo absint($PAY_ID); ?>"
194 194
                                          class="hidden"
195 195
                                     >
196 196
                                         <?php echo $payment->payment_method() instanceof EE_Payment_Method
197
-                                            ? esc_html($payment->payment_method()->ID())
198
-                                            : 0; ?>
197
+											? esc_html($payment->payment_method()->ID())
198
+											: 0; ?>
199 199
                                     </div>
200 200
                                 </td>
201 201
                                 <td class=" jst-left">
@@ -220,18 +220,18 @@  discard block
 block discarded – undo
220 220
                                 </td>
221 221
                                 <td class=" jst-rght">
222 222
                                     <?php
223
-                                    $payment_class = $payment->amount() > 0
224
-                                        ? 'txn-admin-payment-status-' . $payment->STS_ID()
225
-                                        : 'txn-admin-payment-status-PDC';
226
-                                    ?>
223
+									$payment_class = $payment->amount() > 0
224
+										? 'txn-admin-payment-status-' . $payment->STS_ID()
225
+										: 'txn-admin-payment-status-PDC';
226
+									?>
227 227
                                     <span class="<?php echo esc_attr($payment_class); ?>">
228 228
                                         <span id="payment-amount-<?php echo absint($PAY_ID); ?>" style="display:inline;">
229 229
                                         <?php echo EEH_Template::format_currency(
230
-                                            $payment->amount(),
231
-                                            false,
232
-                                            false
233
-                                        ); // already escaped
234
-                                        ?>
230
+											$payment->amount(),
231
+											false,
232
+											false
233
+										); // already escaped
234
+										?>
235 235
                                         </span>
236 236
                                     </span>
237 237
                                 </td>
@@ -239,9 +239,9 @@  discard block
 block discarded – undo
239 239
                             <?php $payment_total += $payment->STS_ID() == 'PAP' ? $payment->amount() : 0; ?>
240 240
                         <?php endforeach; ?>
241 241
                         <?php $pay_totals_class = $payment_total > $grand_raw_total
242
-                            ? ' important-notice'
243
-                            : '';
244
-                        ?>
242
+							? ' important-notice'
243
+							: '';
244
+						?>
245 245
                         <tr id="txn-admin-no-payments-tr" class="admin-primary-mbox-total-tr hidden">
246 246
                             <td class=" jst-rght" colspan="10">
247 247
                                 <span class="important-notice"><?php echo $no_payment_text; // already escaped ?></span>
@@ -253,28 +253,28 @@  discard block
 block discarded – undo
253 253
                             <th class=" jst-rght" colspan="9">
254 254
                         <span id="payments-total-spn">
255 255
                         <?php
256
-                        $overpaid = $payment_total > $grand_raw_total
257
-                            ? '<span id="overpaid">'
258
-                              . __('This transaction has been overpaid ! ', 'event_espresso')
259
-                              . '</span>'
260
-                            : '';
261
-                        echo esc_html(
262
-                            $overpaid
263
-                            . sprintf(
264
-                                __('Payments Total %s', 'event_espresso'),
265
-                                '(' . EE_Registry::instance()->CFG->currency->code . ')'
266
-                            )
267
-                        ); ?>
256
+						$overpaid = $payment_total > $grand_raw_total
257
+							? '<span id="overpaid">'
258
+							  . __('This transaction has been overpaid ! ', 'event_espresso')
259
+							  . '</span>'
260
+							: '';
261
+						echo esc_html(
262
+							$overpaid
263
+							. sprintf(
264
+								__('Payments Total %s', 'event_espresso'),
265
+								'(' . EE_Registry::instance()->CFG->currency->code . ')'
266
+							)
267
+						); ?>
268 268
                         </span>
269 269
                             </th>
270 270
                             <th class=" jst-rght">
271 271
                         <span id="txn-admin-payment-total">
272 272
                         <?php
273
-                        echo EEH_Template::format_currency(
274
-                            $payment_total,
275
-                            false,
276
-                            false
277
-                        ); // already escaped ?>
273
+						echo EEH_Template::format_currency(
274
+							$payment_total,
275
+							false,
276
+							false
277
+						); // already escaped ?>
278 278
                         </span>
279 279
                             </th>
280 280
                         </tr>
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 
358 358
         <ul id="txn-admin-payment-options-ul">
359 359
             <?php if ($can_edit_payments) :
360
-                ?>
360
+				?>
361 361
                 <li>
362 362
                     <a id="display-txn-admin-apply-payment"
363 363
                        class="button-primary no-icon no-hide"
@@ -382,12 +382,12 @@  discard block
 block discarded – undo
382 382
                 </li>
383 383
             <?php endif; ?>
384 384
             <?php
385
-            // Allows extend the fields at actions area.
386
-            do_action(
387
-                'AHEE__txn_admin_details_main_meta_box_txn_details__after_actions_buttons',
388
-                $can_edit_payments
389
-            );
390
-            ?>
385
+			// Allows extend the fields at actions area.
386
+			do_action(
387
+				'AHEE__txn_admin_details_main_meta_box_txn_details__after_actions_buttons',
388
+				$can_edit_payments
389
+			);
390
+			?>
391 391
         </ul>
392 392
         <br class="clear" />
393 393
 
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
             >
399 399
                 <div class="ee-icon ee-icon-cash-add float-left"></div>
400 400
                 <?php
401
-                echo esc_html__('Apply a Payment to Transaction #', 'event_espresso') . esc_html($txn_nmbr['value']); ?>
401
+				echo esc_html__('Apply a Payment to Transaction #', 'event_espresso') . esc_html($txn_nmbr['value']); ?>
402 402
             </h2>
403 403
 
404 404
             <h2 id="admin-modal-dialog-edit-payment-h2" class="admin-modal-dialog-h2 hdr-has-icon"
@@ -406,23 +406,23 @@  discard block
 block discarded – undo
406 406
             >
407 407
                 <div class="ee-icon ee-icon-cash-edit float-left"></div>
408 408
                 <?php
409
-                printf(
410
-                    esc_html__('Edit Payment #%s for Transaction #%s', 'event_espresso'),
411
-                    '<span></span>',
412
-                    $txn_nmbr['value']
413
-                );
414
-                ?>
409
+				printf(
410
+					esc_html__('Edit Payment #%s for Transaction #%s', 'event_espresso'),
411
+					'<span></span>',
412
+					$txn_nmbr['value']
413
+				);
414
+				?>
415 415
             </h2>
416 416
 
417 417
             <h2 id="admin-modal-dialog-edit-refund-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;">
418 418
                 <div class="ee-icon ee-icon-cash-edit float-left"></div>
419 419
                 <?php
420
-                printf(
421
-                    esc_html__('Edit Refund #%s for Transaction #%s', 'event_espresso'),
422
-                    '<span></span>',
423
-                    $txn_nmbr['value']
424
-                );
425
-                ?>
420
+				printf(
421
+					esc_html__('Edit Refund #%s for Transaction #%s', 'event_espresso'),
422
+					'<span></span>',
423
+					$txn_nmbr['value']
424
+				);
425
+				?>
426 426
             </h2>
427 427
 
428 428
             <h2 id="admin-modal-dialog-apply-refund-h2" class="admin-modal-dialog-h2 hdr-has-icon"
@@ -430,9 +430,9 @@  discard block
 block discarded – undo
430 430
             >
431 431
                 <div class="ee-icon ee-icon-cash-remove float-left"></div>
432 432
                 <?php
433
-                echo esc_html__('Apply a Refund to Transaction #', 'event_espresso');
434
-                echo esc_html($txn_nmbr['value']);
435
-                ?>
433
+				echo esc_html__('Apply a Refund to Transaction #', 'event_espresso');
434
+				echo esc_html($txn_nmbr['value']);
435
+				?>
436 436
             </h2>
437 437
 
438 438
             <form name="txn-admin-apply-payment-frm"
@@ -531,29 +531,29 @@  discard block
 block discarded – undo
531 531
                             >
532 532
                                 <?php foreach ($payment_methods as $method) : ?>
533 533
                                     <?php
534
-                                    $selected = $method->slug() == 'cash'
535
-                                        ? ' selected'
536
-                                        : '';
537
-                                    ?>
534
+									$selected = $method->slug() == 'cash'
535
+										? ' selected'
536
+										: '';
537
+									?>
538 538
                                     <option id="payment-method-opt-<?php echo esc_attr($method->slug()); ?>"
539 539
                                             value="<?php echo esc_attr($method->ID()); ?>"
540 540
                                         <?php echo esc_attr($selected); ?>
541 541
                                     >
542 542
                                         <?php
543
-                                        echo esc_html(
544
-                                            sanitize_key($method->admin_desc())
545
-                                                ? substr($method->admin_desc(), 0, 128)
546
-                                                : $method->admin_name()
547
-                                        );
548
-                                        ?>&nbsp;&nbsp;
543
+										echo esc_html(
544
+											sanitize_key($method->admin_desc())
545
+												? substr($method->admin_desc(), 0, 128)
546
+												: $method->admin_name()
547
+										);
548
+										?>&nbsp;&nbsp;
549 549
                                     </option>
550 550
                                 <?php endforeach; ?>
551 551
                             </select>
552 552
                             <p class="description">
553 553
                                 <?php esc_html_e(
554
-                                    'Whether the payment was made via PayPal, Credit Card, Cheque, or Cash',
555
-                                    'event_espresso'
556
-                                ); ?>
554
+									'Whether the payment was made via PayPal, Credit Card, Cheque, or Cash',
555
+									'event_espresso'
556
+								); ?>
557 557
                             </p>
558 558
                         </div>
559 559
 
@@ -561,9 +561,9 @@  discard block
 block discarded – undo
561 561
                             <div class="txn-admin-apply-payment-gw-txn-id-dv admin-modal-dialog-row">
562 562
                                 <label for="txn-admin-payment-txn-id-chq-nmbr-inp" class="">
563 563
                                     <?php esc_html_e(
564
-                                        'TXN ID / CHQ #',
565
-                                        'event_espresso'
566
-                                    ); ?>
564
+										'TXN ID / CHQ #',
565
+										'event_espresso'
566
+									); ?>
567 567
                                 </label>
568 568
                                 <input name="txn_admin_payment[txn_id_chq_nmbr]"
569 569
                                        id="txn-admin-payment-txn-id-chq-nmbr-inp"
@@ -572,9 +572,9 @@  discard block
 block discarded – undo
572 572
                                 />
573 573
                                 <p class="description">
574 574
                                     <?php esc_html_e(
575
-                                        'The Transaction ID sent back from the payment gateway, or the Cheque #',
576
-                                        'event_espresso'
577
-                                    ); ?>
575
+										'The Transaction ID sent back from the payment gateway, or the Cheque #',
576
+										'event_espresso'
577
+									); ?>
578 578
                                 </p>
579 579
                             </div>
580 580
                         </div>
@@ -591,9 +591,9 @@  discard block
 block discarded – undo
591 591
                                 />
592 592
                                 <p class="description">
593 593
                                     <?php esc_html_e(
594
-                                        'The gateway response string (optional)',
595
-                                        'event_espresso'
596
-                                    ); ?>
594
+										'The gateway response string (optional)',
595
+										'event_espresso'
596
+									); ?>
597 597
                                 </p>
598 598
                             </div>
599 599
                         </div>
@@ -602,9 +602,9 @@  discard block
 block discarded – undo
602 602
                             <div class="txn-admin-apply-payment-status-dv admin-modal-dialog-row">
603 603
                                 <label for="txn-admin-payment-status-slct" class="">
604 604
                                     <?php esc_html_e(
605
-                                        'Payment Status',
606
-                                        'event_espresso'
607
-                                    ); ?>
605
+										'Payment Status',
606
+										'event_espresso'
607
+									); ?>
608 608
                                 </label>
609 609
                                 <select name="txn_admin_payment[status]"
610 610
                                         id="txn-admin-payment-status-slct"
@@ -613,10 +613,10 @@  discard block
 block discarded – undo
613 613
                                 >
614 614
                                     <?php foreach ($payment_status as $STS_ID => $STS_code) : ?>
615 615
                                         <?php
616
-                                        $selected = $STS_ID == 'PAP'
617
-                                            ? 'selected'
618
-                                            : '';
619
-                                        ?>
616
+										$selected = $STS_ID == 'PAP'
617
+											? 'selected'
618
+											: '';
619
+										?>
620 620
                                         <option id="payment-status-opt-<?php echo esc_attr($STS_ID); ?>"
621 621
                                                 value="<?php echo esc_attr($STS_ID); ?>"
622 622
                                             <?php echo esc_attr($selected); ?>
@@ -627,10 +627,10 @@  discard block
 block discarded – undo
627 627
                                 </select>
628 628
                                 <p class="description">
629 629
                                     <?php
630
-                                    esc_html_e(
631
-                                        'Whether the payment was approved, cancelled, declined or failed after submission to the gateway',
632
-                                        'event_espresso'
633
-                                    ); ?>
630
+									esc_html_e(
631
+										'Whether the payment was approved, cancelled, declined or failed after submission to the gateway',
632
+										'event_espresso'
633
+									); ?>
634 634
                                 </p>
635 635
                             </div>
636 636
                         </div>
@@ -647,9 +647,9 @@  discard block
 block discarded – undo
647 647
                             />
648 648
                             <p class="description">
649 649
                                 <?php esc_html_e(
650
-                                    'The Purchase or Sales Order Number if any (optional)',
651
-                                    'event_espresso'
652
-                                ); ?>
650
+									'The Purchase or Sales Order Number if any (optional)',
651
+									'event_espresso'
652
+								); ?>
653 653
                             </p>
654 654
                         </div>
655 655
 
@@ -670,9 +670,9 @@  discard block
 block discarded – undo
670 670
                             />
671 671
                             <p class="description">
672 672
                                 <?php esc_html_e(
673
-                                    'An extra field you may use for accounting purposes or simple notes. Defaults to the primary registrant\'s registration code.',
674
-                                    'event_espresso'
675
-                                ); ?>
673
+									'An extra field you may use for accounting purposes or simple notes. Defaults to the primary registrant\'s registration code.',
674
+									'event_espresso'
675
+								); ?>
676 676
                             </p>
677 677
                         </div>
678 678
 
@@ -705,12 +705,12 @@  discard block
 block discarded – undo
705 705
                                 <?php esc_html_e('Change Registration Status?', 'event_espresso'); ?>
706 706
                             </label>
707 707
                             <?php
708
-                            echo $status_change_select; // already escaped ?>
708
+							echo $status_change_select; // already escaped ?>
709 709
                             <p class="description">
710 710
                                 <?php esc_html_e(
711
-                                    'If you wish to change the status for the registrations selected above, then select which status from this dropdown.',
712
-                                    'event_espresso'
713
-                                ); ?>
711
+									'If you wish to change the status for the registrations selected above, then select which status from this dropdown.',
712
+									'event_espresso'
713
+								); ?>
714 714
                             </p>
715 715
                             <br />
716 716
                         </div>
@@ -741,14 +741,14 @@  discard block
 block discarded – undo
741 741
                             <br class="clear-float" />
742 742
                             <p class="description">
743 743
                                 <?php printf(
744
-                                    esc_html__(
745
-                                        'By default %1$sa payment message is sent to the primary registrant%2$s after submitting this form.%3$sHowever, if you check the "Registration Messages" box, the system will also send any related messages matching the status of the registrations to %1$seach registration for this transaction%2$s.',
746
-                                        'event_espresso'
747
-                                    ),
748
-                                    '<strong>',
749
-                                    '</strong>',
750
-                                    '<br />'
751
-                                ); ?>
744
+									esc_html__(
745
+										'By default %1$sa payment message is sent to the primary registrant%2$s after submitting this form.%3$sHowever, if you check the "Registration Messages" box, the system will also send any related messages matching the status of the registrations to %1$seach registration for this transaction%2$s.',
746
+										'event_espresso'
747
+									),
748
+									'<strong>',
749
+									'</strong>',
750
+									'<br />'
751
+								); ?>
752 752
                             </p>
753 753
                         </div>
754 754
                         <div class="clear"></div>
@@ -813,10 +813,10 @@  discard block
 block discarded – undo
813 813
             >
814 814
                 <span class="ee-icon ee-icon-cash-add"></span>
815 815
                 <?php printf(
816
-                    esc_html__('Delete Payment/Refund for Transaction #', 'event_espresso'),
817
-                    $txn_nmbr['value']
818
-                );
819
-                ?>
816
+					esc_html__('Delete Payment/Refund for Transaction #', 'event_espresso'),
817
+					$txn_nmbr['value']
818
+				);
819
+				?>
820 820
             </h2>
821 821
 
822 822
             <form name="txn-admin-delete-payment-frm"
@@ -852,13 +852,13 @@  discard block
 block discarded – undo
852 852
                             <?php echo $delete_status_change_select; // already escaped ?>
853 853
                             <p class="description">
854 854
                                 <?php printf(
855
-                                    esc_html__(
856
-                                        'If you wish to change the status of all the registrations associated with this transaction after deleting this payment/refund, then select which status from this dropdown. %sNote: ALL registrations associated with this transaction will be updated to this new status.%s',
857
-                                        'event_espresso'
858
-                                    ),
859
-                                    '<strong>',
860
-                                    '</strong>'
861
-                                ); ?>
855
+									esc_html__(
856
+										'If you wish to change the status of all the registrations associated with this transaction after deleting this payment/refund, then select which status from this dropdown. %sNote: ALL registrations associated with this transaction will be updated to this new status.%s',
857
+										'event_espresso'
858
+									),
859
+									'<strong>',
860
+									'</strong>'
861
+								); ?>
862 862
                             </p>
863 863
                         </div>
864 864
 
@@ -873,10 +873,10 @@  discard block
 block discarded – undo
873 873
                             />
874 874
                             <p class="description">
875 875
                                 <?php
876
-                                esc_html_e(
877
-                                    'If you check this box, the system will send any related registration messages matching the status of the registrations to each registration for this transaction. No Payment notifications are sent when deleting a payment.',
878
-                                    'event_espresso'
879
-                                ); ?>
876
+								esc_html_e(
877
+									'If you check this box, the system will send any related registration messages matching the status of the registrations to each registration for this transaction. No Payment notifications are sent when deleting a payment.',
878
+									'event_espresso'
879
+								); ?>
880 880
                             </p>
881 881
                         </div>
882 882
                         <div class="clear"></div>
@@ -909,8 +909,8 @@  discard block
 block discarded – undo
909 909
     <?php endif; // $grand_raw_total > 0?>
910 910
 
911 911
     <?php if (WP_DEBUG) {
912
-        $delivered_messages = get_option('EED_Messages__payment', []);
913
-        if (isset($delivered_messages[ $TXN_ID ])) { ?>
912
+		$delivered_messages = get_option('EED_Messages__payment', []);
913
+		if (isset($delivered_messages[ $TXN_ID ])) { ?>
914 914
             <h4 class="admin-primary-mbox-h4 hdr-has-icon">
915 915
                 <span class="dashicons dashicons-email-alt"></span>
916 916
                 <?php esc_html_e('Messages Sent to Primary Registrant', 'event_espresso'); ?>
@@ -922,39 +922,39 @@  discard block
 block discarded – undo
922 922
                             <th class="jst-left"><?php esc_html_e('Date & Time', 'event_espresso'); ?></th>
923 923
                             <th class="jst-left"><?php esc_html_e('Message Type', 'event_espresso'); ?></th>
924 924
                             <th class="jst-left"><?php esc_html_e(
925
-                                'Payment Status Upon Sending',
926
-                                'event_espresso'
927
-                            ); ?></th>
925
+								'Payment Status Upon Sending',
926
+								'event_espresso'
927
+							); ?></th>
928 928
                             <th class="jst-left"><?php esc_html_e('TXN Status Upon Sending', 'event_espresso'); ?></th>
929 929
                         </tr>
930 930
                     </thead>
931 931
                     <tbody>
932 932
                         <?php
933
-                        foreach ($delivered_messages[ $TXN_ID ] as $timestamp => $delivered_message) :
934
-                            ?>
933
+						foreach ($delivered_messages[ $TXN_ID ] as $timestamp => $delivered_message) :
934
+							?>
935 935
                             <tr>
936 936
                                 <td class="jst-left">
937 937
                                     <?php echo esc_html(
938
-                                        date(
939
-                                            get_option('date_format') . ' ' . get_option('time_format'),
940
-                                            ($timestamp + (get_option('gmt_offset') * HOUR_IN_SECONDS))
941
-                                        )
942
-                                    ); ?>
938
+										date(
939
+											get_option('date_format') . ' ' . get_option('time_format'),
940
+											($timestamp + (get_option('gmt_offset') * HOUR_IN_SECONDS))
941
+										)
942
+									); ?>
943 943
                                 </td>
944 944
                                 <td class="jst-left"><?php
945
-                                    echo isset($delivered_message['message_type'])
946
-                                        ? esc_html($delivered_message['message_type'])
947
-                                        : ''; ?>
945
+									echo isset($delivered_message['message_type'])
946
+										? esc_html($delivered_message['message_type'])
947
+										: ''; ?>
948 948
                                 </td>
949 949
                                 <td class="jst-left"><?php
950
-                                    echo isset($delivered_message['pay_status'])
951
-                                        ? esc_html($delivered_message['pay_status'])
952
-                                        : ''; ?>
950
+									echo isset($delivered_message['pay_status'])
951
+										? esc_html($delivered_message['pay_status'])
952
+										: ''; ?>
953 953
                                 </td>
954 954
                                 <td class="jst-left"><?php
955
-                                    echo isset($delivered_message['txn_status'])
956
-                                        ? esc_html($delivered_message['txn_status'])
957
-                                        : ''; ?>
955
+									echo isset($delivered_message['txn_status'])
956
+										? esc_html($delivered_message['txn_status'])
957
+										: ''; ?>
958 958
                                 </td>
959 959
                             </tr>
960 960
                         <?php endforeach; // $delivered_messages?>
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
                 </table>
963 963
             </div>
964 964
             <?php
965
-        }
966
-    }
967
-    ?>
965
+		}
966
+	}
967
+	?>
968 968
 </div>
Please login to merge, or discard this patch.
extend/registration_form/templates/questions_in_group_meta_box.template.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@
 block discarded – undo
3 3
 assert($question_group instanceof EE_Question_Group);
4 4
 assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions)));// list of unused questions
5 5
 foreach ($all_questions as $question_option) {
6
-    assert($question_option);
7
-    assert($question_option instanceof EE_Question);
6
+	assert($question_option);
7
+	assert($question_option instanceof EE_Question);
8 8
 }
9 9
 ?>
10 10
 <h4><?php esc_html_e('Check off all questions that you wish to appear in this group.', 'event_espresso'); ?></h4>
11 11
 <ul>
12 12
     <?php
13
-    foreach ($all_questions as $question_ID => $question) {
14
-        /*@var $question EE_Question*/
15
-        $checked = array_key_exists($question_ID, $question_group->questions()) ? 'checked' : '';
16
-        ?>
13
+	foreach ($all_questions as $question_ID => $question) {
14
+		/*@var $question EE_Question*/
15
+		$checked = array_key_exists($question_ID, $question_group->questions()) ? 'checked' : '';
16
+		?>
17 17
         <li>
18 18
             <label for="question-<?php echo absint($question_ID); ?>">
19 19
                 <input type="checkbox" name="questions[<?php echo absint($question_ID); ?>]"
Please login to merge, or discard this patch.