Completed
Branch decaf-fixes/main (0c91cf)
by
unknown
07:32 queued 02:36
created
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
@@ -33,9 +33,12 @@  discard block
 block discarded – undo
33 33
             <input type="text" size="1" class="edit-price-PRC_amount ee-numeric"
34 34
                    name="prices_archive[<?php echo $tkt_row; ?>][<?php echo $PRC_order; ?>][PRC_amount]"
35 35
                    value="<?php echo $PRC_amount; ?>" disabled>
36
-        <?php else : ?>
36
+        <?php else {
37
+	: ?>
37 38
             <input type="text" size="1" class="edit-price-PRC_amount ee-numeric"
38
-                   name="<?php echo $edit_prices_name; ?>[<?php echo $tkt_row; ?>][<?php echo $PRC_order; ?>][PRC_amount]"
39
+                   name="<?php echo $edit_prices_name;
40
+}
41
+?>[<?php echo $tkt_row; ?>][<?php echo $PRC_order; ?>][PRC_amount]"
39 42
                    value="<?php echo $PRC_amount; ?>">
40 43
         <?php endif; ?>
41 44
     </td>
@@ -46,8 +49,11 @@  discard block
 block discarded – undo
46 49
     <td>
47 50
         <?php if ($disabled) : ?>
48 51
             <span class="ee-lock-icon"></span>
49
-        <?php else : ?>
50
-            <!-- <span class="gear-icon dashicons dashicons-admin-generic clickable" data-ticket-row="<?php echo $tkt_row; ?>" data-context="price" data-price-row="<?php echo $PRC_order; ?>"></span> -->
52
+        <?php else {
53
+	: ?>
54
+            <!-- <span class="gear-icon dashicons dashicons-admin-generic clickable" data-ticket-row="<?php echo $tkt_row;
55
+}
56
+?>" data-context="price" data-price-row="<?php echo $PRC_order; ?>"></span> -->
51 57
             <span class="trash-icon dashicons dashicons-post-trash clickable" data-ticket-row="<?php echo $tkt_row; ?>"
52 58
                   data-context="price" data-price-row="<?php echo $PRC_order; ?>"<?php echo $show_trash_icon; ?>></span>
53 59
             <button data-ticket-row="<?php echo $tkt_row; ?>" data-price-row="<?php echo $PRC_order; ?>"
Please login to merge, or discard this patch.
admin/new/pricing/templates/pricing_type_details_main_meta_box.template.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
             <td>
11 11
                 <?php echo $base_type_select; ?><br/>
12 12
                 <p class="description"><?php
13
-                    _e(
14
-                        'Choosing a basic type allows us to quickly configure a bunch of other options for you.<br/>All events need to have at least one Base Price type option.<br/>Discounts reduce the price of an event, Surcharges increase the price.<br/>Taxes are applied to the final total.',
15
-                        'event_espresso'
16
-                    ); ?></p>
13
+					_e(
14
+						'Choosing a basic type allows us to quickly configure a bunch of other options for you.<br/>All events need to have at least one Base Price type option.<br/>Discounts reduce the price of an event, Surcharges increase the price.<br/>Taxes are applied to the final total.',
15
+						'event_espresso'
16
+					); ?></p>
17 17
             </td>
18 18
         </tr>
19 19
 
@@ -44,20 +44,20 @@  discard block
 block discarded – undo
44 44
                     <?php _e('Fixed', 'event_espresso'); ?>
45 45
                 </label>
46 46
                 <p class="description"><?php
47
-                    _e(
48
-                        'Whether this Price Type will be applied as a percentage or applied as a set fixed amount.',
49
-                        'event_espresso'
50
-                    ); ?></p>
47
+					_e(
48
+						'Whether this Price Type will be applied as a percentage or applied as a set fixed amount.',
49
+						'event_espresso'
50
+					); ?></p>
51 51
                 <?php if ($price_type->base_type() == EEM_Price_Type::base_type_tax) :
52
-                    // base type is tax so let's just let the user know that taxes are always percentage.
53
-                    ?>
52
+					// base type is tax so let's just let the user know that taxes are always percentage.
53
+					?>
54 54
                     <p class="description" style="color:#E44064">
55 55
                         <?php
56
-                            _e(
57
-                                'The selected base type for this price type is "Tax".  Taxes are always assumed to be a percentage.  If you want to use a fixed value for a tax then please change the base type to a surcharge.',
58
-                                'event_espresso'
59
-                            );
60
-                        ?></p>
56
+							_e(
57
+								'The selected base type for this price type is "Tax".  Taxes are always assumed to be a percentage.  If you want to use a fixed value for a tax then please change the base type to a surcharge.',
58
+								'event_espresso'
59
+							);
60
+						?></p>
61 61
                 <?php endif; ?>
62 62
             </td>
63 63
         </tr>
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
                 <p class="description">
72 72
                     <?php _e('The order that Price Types are applied.', 'event_espresso'); ?></p>
73 73
                 <p class="description"><?php
74
-                    _e(
75
-                        'Price types are applied sequentially according to their Order, where higher ordered Price Types will affect lower ordered Price Types.<br/>Price types with equal Orders will be applied in parallel to whatever total precedes them and will not affect each other. Actual Prices will be set to "0" so that they are processed first. Taxes will be always be applied last but their order will still determine if they are applied in parallel or as compound taxes (one tax on top of the other).',
76
-                        'event_espresso'
77
-                    ); ?></p>
74
+					_e(
75
+						'Price types are applied sequentially according to their Order, where higher ordered Price Types will affect lower ordered Price Types.<br/>Price types with equal Orders will be applied in parallel to whatever total precedes them and will not affect each other. Actual Prices will be set to "0" so that they are processed first. Taxes will be always be applied last but their order will still determine if they are applied in parallel or as compound taxes (one tax on top of the other).',
76
+						'event_espresso'
77
+					); ?></p>
78 78
             </td>
79 79
         </tr>
80 80
 
Please login to merge, or discard this patch.
admin/new/pricing/templates/pricing_details_main_meta_box.template.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,11 @@
 block discarded – undo
20 20
                         );
21 21
                         ?>
22 22
                     </p>
23
-                <?php else : ?>
24
-                    <?php echo EEH_Form_Fields::select_input('PRT_ID', $price_types, $price->type(), 'id="PRT_ID"'); ?>
23
+                <?php else {
24
+	: ?>
25
+                    <?php echo EEH_Form_Fields::select_input('PRT_ID', $price_types, $price->type(), 'id="PRT_ID"');
26
+}
27
+?>
25 28
                     <p class="description">
26 29
                         <?php
27 30
                             _e(
Please login to merge, or discard this patch.
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -4,40 +4,40 @@  discard block
 block discarded – undo
4 4
         <tbody>
5 5
         <tr valign="top">
6 6
             <th><label for="PRT_ID"><?php
7
-                    _e(
8
-                        'Type',
9
-                        'event_espresso'
10
-                    ); ?></label> <?php echo EEH_Template::get_help_tab_link('type_field_info'); ?></th>
7
+					_e(
8
+						'Type',
9
+						'event_espresso'
10
+					); ?></label> <?php echo EEH_Template::get_help_tab_link('type_field_info'); ?></th>
11 11
             <td>
12 12
                 <?php if ($price->type_obj() && $price->type_obj()->base_type() === 1) : ?>
13 13
                     <input type="hidden" name="PRT_ID" id="PRT_ID" value="<?php echo $price->type(); ?>"/>
14 14
                     <p><strong><?php _e('Price', 'event_espresso'); ?></strong></p>
15 15
                     <p class="description">
16 16
                         <?php
17
-                        _e(
18
-                            'This is the default base price. Every new ticket created will start off with this base price.',
19
-                            'event_espresso'
20
-                        );
21
-                        ?>
17
+						_e(
18
+							'This is the default base price. Every new ticket created will start off with this base price.',
19
+							'event_espresso'
20
+						);
21
+						?>
22 22
                     </p>
23 23
                 <?php else : ?>
24 24
                     <?php echo EEH_Form_Fields::select_input('PRT_ID', $price_types, $price->type(), 'id="PRT_ID"'); ?>
25 25
                     <p class="description">
26 26
                         <?php
27
-                            _e(
28
-                                'Price Modifier. Default items will apply to ALL new events you create.',
29
-                                'event_espresso'
30
-                            );
31
-                        ?></p>
27
+							_e(
28
+								'Price Modifier. Default items will apply to ALL new events you create.',
29
+								'event_espresso'
30
+							);
31
+						?></p>
32 32
                 <?php endif; ?>
33 33
             </td>
34 34
         </tr>
35 35
         <tr valign="top">
36 36
             <th><label for="PRC_name"><?php
37
-                    _e(
38
-                        'Name',
39
-                        'event_espresso'
40
-                    ); ?></label> <?php echo EEH_Template::get_help_tab_link('name_field_info'); ?></th>
37
+					_e(
38
+						'Name',
39
+						'event_espresso'
40
+					); ?></label> <?php echo EEH_Template::get_help_tab_link('name_field_info'); ?></th>
41 41
             <td>
42 42
                 <input class="regular-text" type="text" id="PRC_name" name="PRC_name"
43 43
                        value="<?php $price->f('PRC_name'); ?>"/>
@@ -45,22 +45,22 @@  discard block
 block discarded – undo
45 45
         </tr>
46 46
         <tr valign="top">
47 47
             <th><label for="PRC_desc"><?php
48
-                    _e(
49
-                        'Description',
50
-                        'event_espresso'
51
-                    ); ?></label> <?php echo EEH_Template::get_help_tab_link('description_field_info'); ?></th>
48
+					_e(
49
+						'Description',
50
+						'event_espresso'
51
+					); ?></label> <?php echo EEH_Template::get_help_tab_link('description_field_info'); ?></th>
52 52
             <td>
53 53
                     <textarea class="regular-text" id="PRC_desc" name="PRC_desc" rows="5"><?php
54
-                        $price->f('PRC_desc');
55
-                    ?></textarea><br/>
54
+						$price->f('PRC_desc');
55
+					?></textarea><br/>
56 56
             </td>
57 57
         </tr>
58 58
         <tr valign="top">
59 59
             <th><label for="PRC_amount"><?php
60
-                    _e(
61
-                        'Amount',
62
-                        'event_espresso'
63
-                    ); ?><?php echo EEH_Template::get_help_tab_link('amount_field_info'); ?></label></th>
60
+					_e(
61
+						'Amount',
62
+						'event_espresso'
63
+					); ?><?php echo EEH_Template::get_help_tab_link('amount_field_info'); ?></label></th>
64 64
             <td>
65 65
                 <input class="small-text ee-numeric" type="text" id="PRC_amount" name="PRC_amount"
66 66
                        value="<?php echo $price->amount(); ?>"/>
Please login to merge, or discard this patch.
caffeinated/admin/new/tickets/Tickets_Admin_Page.core.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         $limit = array($offset, $per_page);
217 217
 
218 218
         if (isset($this->_req_data['s'])) {
219
-            $sstr = '%' . $this->_req_data['s'] . '%';
219
+            $sstr = '%'.$this->_req_data['s'].'%';
220 220
             $_where['OR'] = array(
221 221
                 'TKT_name'        => array('LIKE', $sstr),
222 222
                 'TKT_description' => array('LIKE', $sstr),
@@ -245,18 +245,18 @@  discard block
 block discarded – undo
245 245
         $TKT = EEM_Ticket::instance();
246 246
 
247 247
         // checkboxes?
248
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
248
+        if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
249 249
             // if array has more than one element then success message should be plural
250 250
             $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
251 251
 
252 252
             // cycle thru the boxes
253 253
             while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
254 254
                 if ($trash) {
255
-                    if (! $TKT->delete_by_ID($TKT_ID)) {
255
+                    if ( ! $TKT->delete_by_ID($TKT_ID)) {
256 256
                         $success = 0;
257 257
                     }
258 258
                 } else {
259
-                    if (! $TKT->restore_by_ID($TKT_ID)) {
259
+                    if ( ! $TKT->restore_by_ID($TKT_ID)) {
260 260
                         $success = 0;
261 261
                     }
262 262
                 }
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
             $TKT_ID = absint($this->_req_data['TKT_ID']);
267 267
 
268 268
             if ($trash) {
269
-                if (! $TKT->delete_by_ID($TKT_ID)) {
269
+                if ( ! $TKT->delete_by_ID($TKT_ID)) {
270 270
                     $success = 0;
271 271
                 }
272 272
             } else {
273
-                if (! $TKT->restore_by_ID($TKT_ID)) {
273
+                if ( ! $TKT->restore_by_ID($TKT_ID)) {
274 274
                     $success = 0;
275 275
                 }
276 276
             }
@@ -288,21 +288,21 @@  discard block
 block discarded – undo
288 288
         $TKT = EEM_Ticket::instance();
289 289
 
290 290
         // checkboxes?
291
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
291
+        if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
292 292
             // if array has more than one element then success message should be plural
293 293
             $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
294 294
 
295 295
             // cycle thru the boxes
296 296
             while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
297 297
                 // delete
298
-                if (! $this->_delete_the_ticket($TKT_ID)) {
298
+                if ( ! $this->_delete_the_ticket($TKT_ID)) {
299 299
                     $success = 0;
300 300
                 }
301 301
             }
302 302
         } else {
303 303
             // grab single id and trash
304 304
             $TKT_ID = absint($this->_req_data['TKT_ID']);
305
-            if (! $this->_delete_the_ticket($TKT_ID)) {
305
+            if ( ! $this->_delete_the_ticket($TKT_ID)) {
306 306
                 $success = 0;
307 307
             }
308 308
         }
Please login to merge, or discard this patch.
Indentation   +308 added lines, -308 removed lines patch added patch discarded remove patch
@@ -13,312 +13,312 @@
 block discarded – undo
13 13
 {
14 14
 
15 15
 
16
-    protected function _init_page_props()
17
-    {
18
-        $this->page_slug = TICKETS_PG_SLUG;
19
-        $this->page_label = TICKETS_LABEL;
20
-        $this->_admin_base_url = TICKETS_ADMIN_URL;
21
-        $this->_admin_base_path = TICKETS_ADMIN;
22
-    }
23
-
24
-
25
-    protected function _ajax_hooks()
26
-    {
27
-    }
28
-
29
-
30
-    protected function _define_page_props()
31
-    {
32
-        $this->_admin_page_title = TICKETS_LABEL;
33
-        $this->_labels = array(
34
-            'buttons' => array(
35
-                'add'    => esc_html__('Add New Default Ticket', 'event_espresso'),
36
-                'edit'   => esc_html__('Edit Default Ticket', 'event_espresso'),
37
-                'delete' => esc_html__('Delete Default Ticket', 'event_espresso'),
38
-            ),
39
-        );
40
-    }
41
-
42
-
43
-    protected function _set_page_routes()
44
-    {
45
-
46
-        $tkt_id = ! empty($this->_req_data['TKT_ID']) && ! is_array($this->_req_data['TKT_ID'])
47
-            ? $this->_req_data['TKT_ID'] : 0;
48
-
49
-        $this->_page_routes = array(
50
-            'default'         => array(
51
-                'func'       => '_tickets_overview_list_table',
52
-                'capability' => 'ee_read_default_tickets',
53
-            ),
54
-            'trash_ticket'    => array(
55
-                'func'       => '_trash_or_restore_ticket',
56
-                'noheader'   => true,
57
-                'args'       => array('trash' => true),
58
-                'capability' => 'ee_delete_default_ticket',
59
-                'obj_id'     => $tkt_id,
60
-            ),
61
-            'trash_tickets'   => array(
62
-                'func'       => '_trash_or_restore_ticket',
63
-                'noheader'   => true,
64
-                'args'       => array('trash' => true),
65
-                'capability' => 'ee_delete_default_tickets',
66
-            ),
67
-            'restore_ticket'  => array(
68
-                'func'       => '_trash_or_restore_ticket',
69
-                'noheader'   => true,
70
-                'capability' => 'ee_delete_default_ticket',
71
-                'obj_id'     => $tkt_id,
72
-            ),
73
-            'restore_tickets' => array(
74
-                'func'       => '_trash_or_restore_ticket',
75
-                'noheader'   => true,
76
-                'capability' => 'ee_delete_default_tickets',
77
-            ),
78
-            'delete_ticket'   => array(
79
-                'func'       => '_delete_ticket',
80
-                'noheader'   => true,
81
-                'capability' => 'ee_delete_default_ticket',
82
-                'obj_id'     => $tkt_id,
83
-            ),
84
-            'delete_tickets'  => array(
85
-                'func'       => '_delete_ticket',
86
-                'noheader'   => true,
87
-                'capability' => 'ee_delete_default_tickets',
88
-            ),
89
-        );
90
-    }
91
-
92
-
93
-    protected function _set_page_config()
94
-    {
95
-        $this->_page_config = array(
96
-            'default' => array(
97
-                'nav'           => array(
98
-                    'label' => esc_html__('Default Tickets', 'event_espresso'),
99
-                    'order' => 10,
100
-                ),
101
-                'list_table'    => 'Tickets_List_Table',
102
-                'require_nonce' => false,
103
-            ),
104
-        );
105
-    }
106
-
107
-
108
-    protected function _add_screen_options()
109
-    {
110
-    }
111
-
112
-    protected function _add_screen_options_default()
113
-    {
114
-        $this->_per_page_screen_option();
115
-    }
116
-
117
-
118
-    protected function _add_feature_pointers()
119
-    {
120
-    }
121
-
122
-    public function load_scripts_styles()
123
-    {
124
-    }
125
-
126
-    public function load_scripts_styles_default()
127
-    {
128
-    }
129
-
130
-    public function admin_footer_scripts()
131
-    {
132
-    }
133
-
134
-    public function admin_init()
135
-    {
136
-    }
137
-
138
-    public function admin_notices()
139
-    {
140
-    }
141
-
142
-
143
-    public function _set_list_table_views_default()
144
-    {
145
-        $this->_views = array(
146
-            'all'     => array(
147
-                'slug'        => 'all',
148
-                'label'       => esc_html__('All', 'event_espresso'),
149
-                'count'       => 0,
150
-                'bulk_action' => array(
151
-                    'trash_tickets' => esc_html__('Move to Trash', 'event_espresso'),
152
-                ),
153
-            ),
154
-            'trashed' => array(
155
-                'slug'        => 'trashed',
156
-                'label'       => esc_html__('Trash', 'event_espresso'),
157
-                'count'       => 0,
158
-                'bulk_action' => array(
159
-                    'restore_tickets' => esc_html__('Restore from Trash', 'event_espresso'),
160
-                    'delete_tickets'  => esc_html__('Delete Permanently', 'event_espresso'),
161
-                ),
162
-            ),
163
-        );
164
-    }
165
-
166
-
167
-    public function _tickets_overview_list_table()
168
-    {
169
-        $this->_search_btn_label = esc_html__('Tickets', 'event_espresso');
170
-        $this->display_admin_list_table_page_with_no_sidebar();
171
-    }
172
-
173
-
174
-    public function get_default_tickets($per_page = 10, $count = false, $trashed = false)
175
-    {
176
-
177
-        $orderby = empty($this->_req_data['orderby']) ? 'TKT_name' : $this->_req_data['orderby'];
178
-        $order = empty($this->_req_data['order']) ? 'ASC' : $order;
179
-
180
-        switch ($orderby) {
181
-            case 'TKT_name':
182
-                $orderby = array('TKT_name' => $order);
183
-                break;
184
-
185
-            case 'TKT_price':
186
-                $orderby = array('TKT_price' => $order);
187
-                break;
188
-
189
-            case 'TKT_uses':
190
-                $orderby = array('TKT_uses' => $order);
191
-                break;
192
-
193
-            case 'TKT_min':
194
-                $orderby = array('TKT_min' => $order);
195
-                break;
196
-
197
-            case 'TKT_max':
198
-                $orderby = array('TKT_max' => $order);
199
-                break;
200
-
201
-            case 'TKT_qty':
202
-                $orderby = array('TKT_qty' => $order);
203
-                break;
204
-        }
205
-
206
-        $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged'])
207
-            ? $this->_req_data['paged'] : 1;
208
-        $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage'])
209
-            ? $this->_req_data['perpage'] : $per_page;
210
-
211
-        $_where = array(
212
-            'TKT_is_default' => 1,
213
-            'TKT_deleted'    => $trashed,
214
-        );
215
-
216
-        $offset = ($current_page - 1) * $per_page;
217
-        $limit = array($offset, $per_page);
218
-
219
-        if (isset($this->_req_data['s'])) {
220
-            $sstr = '%' . $this->_req_data['s'] . '%';
221
-            $_where['OR'] = array(
222
-                'TKT_name'        => array('LIKE', $sstr),
223
-                'TKT_description' => array('LIKE', $sstr),
224
-            );
225
-        }
226
-
227
-        $query_params = array(
228
-            $_where,
229
-            'order_by' => $orderby,
230
-            'limit'    => $limit,
231
-            'group_by' => 'TKT_ID',
232
-        );
233
-
234
-        if ($count) {
235
-            return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
236
-        } else {
237
-            return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
238
-        }
239
-    }
240
-
241
-
242
-    protected function _trash_or_restore_ticket($trash = false)
243
-    {
244
-        $success = 1;
245
-
246
-        $TKT = EEM_Ticket::instance();
247
-
248
-        // checkboxes?
249
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
250
-            // if array has more than one element then success message should be plural
251
-            $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
252
-
253
-            // cycle thru the boxes
254
-            while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
255
-                if ($trash) {
256
-                    if (! $TKT->delete_by_ID($TKT_ID)) {
257
-                        $success = 0;
258
-                    }
259
-                } else {
260
-                    if (! $TKT->restore_by_ID($TKT_ID)) {
261
-                        $success = 0;
262
-                    }
263
-                }
264
-            }
265
-        } else {
266
-            // grab single id and trash
267
-            $TKT_ID = absint($this->_req_data['TKT_ID']);
268
-
269
-            if ($trash) {
270
-                if (! $TKT->delete_by_ID($TKT_ID)) {
271
-                    $success = 0;
272
-                }
273
-            } else {
274
-                if (! $TKT->restore_by_ID($TKT_ID)) {
275
-                    $success = 0;
276
-                }
277
-            }
278
-        }
279
-
280
-        $action_desc = $trash ? 'moved to the trash' : 'restored';
281
-        $this->_redirect_after_action($success, 'Tickets', $action_desc, array());
282
-    }
283
-
284
-
285
-    protected function _delete_ticket()
286
-    {
287
-        $success = 1;
288
-
289
-        $TKT = EEM_Ticket::instance();
290
-
291
-        // checkboxes?
292
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
293
-            // if array has more than one element then success message should be plural
294
-            $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
295
-
296
-            // cycle thru the boxes
297
-            while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
298
-                // delete
299
-                if (! $this->_delete_the_ticket($TKT_ID)) {
300
-                    $success = 0;
301
-                }
302
-            }
303
-        } else {
304
-            // grab single id and trash
305
-            $TKT_ID = absint($this->_req_data['TKT_ID']);
306
-            if (! $this->_delete_the_ticket($TKT_ID)) {
307
-                $success = 0;
308
-            }
309
-        }
310
-
311
-        $action_desc = 'deleted';
312
-        $this->_redirect_after_action($success, 'Tickets', $action_desc, array());
313
-    }
314
-
315
-
316
-    protected function _delete_the_ticket($TKT_ID)
317
-    {
318
-        $tkt = EEM_Ticket::instance()->get_one_by_ID($TKT_ID);
319
-
320
-        // delete all related prices first
321
-        $tkt->delete_related_permanently('Price');
322
-        return $tkt->delete_permanently();
323
-    }
16
+	protected function _init_page_props()
17
+	{
18
+		$this->page_slug = TICKETS_PG_SLUG;
19
+		$this->page_label = TICKETS_LABEL;
20
+		$this->_admin_base_url = TICKETS_ADMIN_URL;
21
+		$this->_admin_base_path = TICKETS_ADMIN;
22
+	}
23
+
24
+
25
+	protected function _ajax_hooks()
26
+	{
27
+	}
28
+
29
+
30
+	protected function _define_page_props()
31
+	{
32
+		$this->_admin_page_title = TICKETS_LABEL;
33
+		$this->_labels = array(
34
+			'buttons' => array(
35
+				'add'    => esc_html__('Add New Default Ticket', 'event_espresso'),
36
+				'edit'   => esc_html__('Edit Default Ticket', 'event_espresso'),
37
+				'delete' => esc_html__('Delete Default Ticket', 'event_espresso'),
38
+			),
39
+		);
40
+	}
41
+
42
+
43
+	protected function _set_page_routes()
44
+	{
45
+
46
+		$tkt_id = ! empty($this->_req_data['TKT_ID']) && ! is_array($this->_req_data['TKT_ID'])
47
+			? $this->_req_data['TKT_ID'] : 0;
48
+
49
+		$this->_page_routes = array(
50
+			'default'         => array(
51
+				'func'       => '_tickets_overview_list_table',
52
+				'capability' => 'ee_read_default_tickets',
53
+			),
54
+			'trash_ticket'    => array(
55
+				'func'       => '_trash_or_restore_ticket',
56
+				'noheader'   => true,
57
+				'args'       => array('trash' => true),
58
+				'capability' => 'ee_delete_default_ticket',
59
+				'obj_id'     => $tkt_id,
60
+			),
61
+			'trash_tickets'   => array(
62
+				'func'       => '_trash_or_restore_ticket',
63
+				'noheader'   => true,
64
+				'args'       => array('trash' => true),
65
+				'capability' => 'ee_delete_default_tickets',
66
+			),
67
+			'restore_ticket'  => array(
68
+				'func'       => '_trash_or_restore_ticket',
69
+				'noheader'   => true,
70
+				'capability' => 'ee_delete_default_ticket',
71
+				'obj_id'     => $tkt_id,
72
+			),
73
+			'restore_tickets' => array(
74
+				'func'       => '_trash_or_restore_ticket',
75
+				'noheader'   => true,
76
+				'capability' => 'ee_delete_default_tickets',
77
+			),
78
+			'delete_ticket'   => array(
79
+				'func'       => '_delete_ticket',
80
+				'noheader'   => true,
81
+				'capability' => 'ee_delete_default_ticket',
82
+				'obj_id'     => $tkt_id,
83
+			),
84
+			'delete_tickets'  => array(
85
+				'func'       => '_delete_ticket',
86
+				'noheader'   => true,
87
+				'capability' => 'ee_delete_default_tickets',
88
+			),
89
+		);
90
+	}
91
+
92
+
93
+	protected function _set_page_config()
94
+	{
95
+		$this->_page_config = array(
96
+			'default' => array(
97
+				'nav'           => array(
98
+					'label' => esc_html__('Default Tickets', 'event_espresso'),
99
+					'order' => 10,
100
+				),
101
+				'list_table'    => 'Tickets_List_Table',
102
+				'require_nonce' => false,
103
+			),
104
+		);
105
+	}
106
+
107
+
108
+	protected function _add_screen_options()
109
+	{
110
+	}
111
+
112
+	protected function _add_screen_options_default()
113
+	{
114
+		$this->_per_page_screen_option();
115
+	}
116
+
117
+
118
+	protected function _add_feature_pointers()
119
+	{
120
+	}
121
+
122
+	public function load_scripts_styles()
123
+	{
124
+	}
125
+
126
+	public function load_scripts_styles_default()
127
+	{
128
+	}
129
+
130
+	public function admin_footer_scripts()
131
+	{
132
+	}
133
+
134
+	public function admin_init()
135
+	{
136
+	}
137
+
138
+	public function admin_notices()
139
+	{
140
+	}
141
+
142
+
143
+	public function _set_list_table_views_default()
144
+	{
145
+		$this->_views = array(
146
+			'all'     => array(
147
+				'slug'        => 'all',
148
+				'label'       => esc_html__('All', 'event_espresso'),
149
+				'count'       => 0,
150
+				'bulk_action' => array(
151
+					'trash_tickets' => esc_html__('Move to Trash', 'event_espresso'),
152
+				),
153
+			),
154
+			'trashed' => array(
155
+				'slug'        => 'trashed',
156
+				'label'       => esc_html__('Trash', 'event_espresso'),
157
+				'count'       => 0,
158
+				'bulk_action' => array(
159
+					'restore_tickets' => esc_html__('Restore from Trash', 'event_espresso'),
160
+					'delete_tickets'  => esc_html__('Delete Permanently', 'event_espresso'),
161
+				),
162
+			),
163
+		);
164
+	}
165
+
166
+
167
+	public function _tickets_overview_list_table()
168
+	{
169
+		$this->_search_btn_label = esc_html__('Tickets', 'event_espresso');
170
+		$this->display_admin_list_table_page_with_no_sidebar();
171
+	}
172
+
173
+
174
+	public function get_default_tickets($per_page = 10, $count = false, $trashed = false)
175
+	{
176
+
177
+		$orderby = empty($this->_req_data['orderby']) ? 'TKT_name' : $this->_req_data['orderby'];
178
+		$order = empty($this->_req_data['order']) ? 'ASC' : $order;
179
+
180
+		switch ($orderby) {
181
+			case 'TKT_name':
182
+				$orderby = array('TKT_name' => $order);
183
+				break;
184
+
185
+			case 'TKT_price':
186
+				$orderby = array('TKT_price' => $order);
187
+				break;
188
+
189
+			case 'TKT_uses':
190
+				$orderby = array('TKT_uses' => $order);
191
+				break;
192
+
193
+			case 'TKT_min':
194
+				$orderby = array('TKT_min' => $order);
195
+				break;
196
+
197
+			case 'TKT_max':
198
+				$orderby = array('TKT_max' => $order);
199
+				break;
200
+
201
+			case 'TKT_qty':
202
+				$orderby = array('TKT_qty' => $order);
203
+				break;
204
+		}
205
+
206
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged'])
207
+			? $this->_req_data['paged'] : 1;
208
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage'])
209
+			? $this->_req_data['perpage'] : $per_page;
210
+
211
+		$_where = array(
212
+			'TKT_is_default' => 1,
213
+			'TKT_deleted'    => $trashed,
214
+		);
215
+
216
+		$offset = ($current_page - 1) * $per_page;
217
+		$limit = array($offset, $per_page);
218
+
219
+		if (isset($this->_req_data['s'])) {
220
+			$sstr = '%' . $this->_req_data['s'] . '%';
221
+			$_where['OR'] = array(
222
+				'TKT_name'        => array('LIKE', $sstr),
223
+				'TKT_description' => array('LIKE', $sstr),
224
+			);
225
+		}
226
+
227
+		$query_params = array(
228
+			$_where,
229
+			'order_by' => $orderby,
230
+			'limit'    => $limit,
231
+			'group_by' => 'TKT_ID',
232
+		);
233
+
234
+		if ($count) {
235
+			return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
236
+		} else {
237
+			return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
238
+		}
239
+	}
240
+
241
+
242
+	protected function _trash_or_restore_ticket($trash = false)
243
+	{
244
+		$success = 1;
245
+
246
+		$TKT = EEM_Ticket::instance();
247
+
248
+		// checkboxes?
249
+		if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
250
+			// if array has more than one element then success message should be plural
251
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
252
+
253
+			// cycle thru the boxes
254
+			while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
255
+				if ($trash) {
256
+					if (! $TKT->delete_by_ID($TKT_ID)) {
257
+						$success = 0;
258
+					}
259
+				} else {
260
+					if (! $TKT->restore_by_ID($TKT_ID)) {
261
+						$success = 0;
262
+					}
263
+				}
264
+			}
265
+		} else {
266
+			// grab single id and trash
267
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
268
+
269
+			if ($trash) {
270
+				if (! $TKT->delete_by_ID($TKT_ID)) {
271
+					$success = 0;
272
+				}
273
+			} else {
274
+				if (! $TKT->restore_by_ID($TKT_ID)) {
275
+					$success = 0;
276
+				}
277
+			}
278
+		}
279
+
280
+		$action_desc = $trash ? 'moved to the trash' : 'restored';
281
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, array());
282
+	}
283
+
284
+
285
+	protected function _delete_ticket()
286
+	{
287
+		$success = 1;
288
+
289
+		$TKT = EEM_Ticket::instance();
290
+
291
+		// checkboxes?
292
+		if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
293
+			// if array has more than one element then success message should be plural
294
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
295
+
296
+			// cycle thru the boxes
297
+			while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
298
+				// delete
299
+				if (! $this->_delete_the_ticket($TKT_ID)) {
300
+					$success = 0;
301
+				}
302
+			}
303
+		} else {
304
+			// grab single id and trash
305
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
306
+			if (! $this->_delete_the_ticket($TKT_ID)) {
307
+				$success = 0;
308
+			}
309
+		}
310
+
311
+		$action_desc = 'deleted';
312
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, array());
313
+	}
314
+
315
+
316
+	protected function _delete_the_ticket($TKT_ID)
317
+	{
318
+		$tkt = EEM_Ticket::instance()->get_one_by_ID($TKT_ID);
319
+
320
+		// delete all related prices first
321
+		$tkt->delete_related_permanently('Price');
322
+		return $tkt->delete_permanently();
323
+	}
324 324
 }
Please login to merge, or discard this patch.
caffeinated/admin/extend/support/Extend_Support_Admin_Page.core.php 2 patches
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -12,71 +12,71 @@
 block discarded – undo
12 12
 class Extend_Support_Admin_Page extends Support_Admin_Page
13 13
 {
14 14
 
15
-    public function __construct($routing = true)
16
-    {
17
-        parent::__construct($routing);
18
-        define('EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'support/templates/');
19
-    }
15
+	public function __construct($routing = true)
16
+	{
17
+		parent::__construct($routing);
18
+		define('EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'support/templates/');
19
+	}
20 20
 
21 21
 
22
-    protected function _extend_page_config()
23
-    {
24
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'support';
25
-        // new routes and new configs (or overrides )
26
-        $new_page_routes = array(
27
-            'faq' => array(
28
-                'func'       => '_faq',
29
-                'capability' => 'ee_read_ee',
30
-            ),
31
-        );
32
-        $this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
33
-        $new_page_config = array(
34
-            'faq' => array(
35
-                'nav'           => array(
36
-                    'label' => esc_html__('FAQ', 'event_espresso'),
37
-                    'order' => 40,
38
-                ),
39
-                'metaboxes'     => array('_espresso_news_post_box', '_espresso_links_post_box'),
40
-                'require_nonce' => false,
41
-            ),
42
-        );
43
-        $this->_page_config = array_merge($this->_page_config, $new_page_config);
44
-        $this->_page_config['default']['metaboxes'][] = '_installation_boxes';
45
-    }
22
+	protected function _extend_page_config()
23
+	{
24
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'support';
25
+		// new routes and new configs (or overrides )
26
+		$new_page_routes = array(
27
+			'faq' => array(
28
+				'func'       => '_faq',
29
+				'capability' => 'ee_read_ee',
30
+			),
31
+		);
32
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
33
+		$new_page_config = array(
34
+			'faq' => array(
35
+				'nav'           => array(
36
+					'label' => esc_html__('FAQ', 'event_espresso'),
37
+					'order' => 40,
38
+				),
39
+				'metaboxes'     => array('_espresso_news_post_box', '_espresso_links_post_box'),
40
+				'require_nonce' => false,
41
+			),
42
+		);
43
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
44
+		$this->_page_config['default']['metaboxes'][] = '_installation_boxes';
45
+	}
46 46
 
47 47
 
48
-    protected function _faq()
49
-    {
50
-        $template_path = EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH . 'support_admin_details_faq.template.php';
51
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template(
52
-            $template_path,
53
-            '',
54
-            true
55
-        );
56
-        $this->display_admin_page_with_sidebar();
57
-    }
48
+	protected function _faq()
49
+	{
50
+		$template_path = EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH . 'support_admin_details_faq.template.php';
51
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
52
+			$template_path,
53
+			'',
54
+			true
55
+		);
56
+		$this->display_admin_page_with_sidebar();
57
+	}
58 58
 
59 59
 
60
-    protected function _installation_boxes()
61
-    {
62
-        $callback_args = array(
63
-            'template_path' => EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH
64
-                               . 'support_admin_details_additional_information.template.php',
65
-        );
66
-        add_meta_box(
67
-            'espresso_additional_information_support',
68
-            esc_html__('Additional Information', 'event_espresso'),
69
-            function ($post, $metabox) {
70
-                echo EEH_Template::display_template(
71
-                    $metabox['args']['template_path'],
72
-                    '',
73
-                    true
74
-                );
75
-            },
76
-            $this->_current_screen->id,
77
-            'normal',
78
-            'high',
79
-            $callback_args
80
-        );
81
-    }
60
+	protected function _installation_boxes()
61
+	{
62
+		$callback_args = array(
63
+			'template_path' => EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH
64
+							   . 'support_admin_details_additional_information.template.php',
65
+		);
66
+		add_meta_box(
67
+			'espresso_additional_information_support',
68
+			esc_html__('Additional Information', 'event_espresso'),
69
+			function ($post, $metabox) {
70
+				echo EEH_Template::display_template(
71
+					$metabox['args']['template_path'],
72
+					'',
73
+					true
74
+				);
75
+			},
76
+			$this->_current_screen->id,
77
+			'normal',
78
+			'high',
79
+			$callback_args
80
+		);
81
+	}
82 82
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,13 +15,13 @@  discard block
 block discarded – undo
15 15
     public function __construct($routing = true)
16 16
     {
17 17
         parent::__construct($routing);
18
-        define('EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'support/templates/');
18
+        define('EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'support/templates/');
19 19
     }
20 20
 
21 21
 
22 22
     protected function _extend_page_config()
23 23
     {
24
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'support';
24
+        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'support';
25 25
         // new routes and new configs (or overrides )
26 26
         $new_page_routes = array(
27 27
             'faq' => array(
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
     protected function _faq()
49 49
     {
50
-        $template_path = EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH . 'support_admin_details_faq.template.php';
50
+        $template_path = EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH.'support_admin_details_faq.template.php';
51 51
         $this->_template_args['admin_page_content'] = EEH_Template::display_template(
52 52
             $template_path,
53 53
             '',
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         add_meta_box(
67 67
             'espresso_additional_information_support',
68 68
             esc_html__('Additional Information', 'event_espresso'),
69
-            function ($post, $metabox) {
69
+            function($post, $metabox) {
70 70
                 echo EEH_Template::display_template(
71 71
                     $metabox['args']['template_path'],
72 72
                     '',
Please login to merge, or discard this patch.
admin/extend/support/templates/support_admin_details_faq.template.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@
 block discarded – undo
4 4
     <h4><?php esc_html_e('New to Event Espresso?', 'event_espresso'); ?></h4>
5 5
 
6 6
     <p><?php
7
-        printf(
8
-            esc_html__(
9
-                'Check out the %1$squick start guide for Event Espresso 4%2$s. It has recommendations, tips, and tutorials so you can get your project started %3$squicker%4$s.',
10
-                'event_espresso'
11
-            ),
12
-            '<a href="https://eventespresso.com/wiki/welcome-to-event-espresso/#event-espresso-4" target="_blank">',
13
-            '</a>',
14
-            '<em>',
15
-            '</em>'
16
-        ); ?></p>
7
+		printf(
8
+			esc_html__(
9
+				'Check out the %1$squick start guide for Event Espresso 4%2$s. It has recommendations, tips, and tutorials so you can get your project started %3$squicker%4$s.',
10
+				'event_espresso'
11
+			),
12
+			'<a href="https://eventespresso.com/wiki/welcome-to-event-espresso/#event-espresso-4" target="_blank">',
13
+			'</a>',
14
+			'<em>',
15
+			'</em>'
16
+		); ?></p>
17 17
 </div>
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
caffeinated/admin/extend/messages/Extend_Messages_Admin_Page.core.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,17 +21,17 @@  discard block
 block discarded – undo
21 21
     public function __construct($routing = true)
22 22
     {
23 23
         parent::__construct($routing);
24
-        if (! defined('EE_MSG_CAF_ASSETS_PATH')) {
25
-            define('EE_MSG_CAF_ASSETS_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/assets/');
26
-            define('EE_MSG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/assets/');
27
-            define('EE_MSG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/templates/');
28
-            define('EE_MSG_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/templates/');
24
+        if ( ! defined('EE_MSG_CAF_ASSETS_PATH')) {
25
+            define('EE_MSG_CAF_ASSETS_PATH', EE_CORE_CAF_ADMIN_EXTEND.'messages/assets/');
26
+            define('EE_MSG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'messages/assets/');
27
+            define('EE_MSG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'messages/templates/');
28
+            define('EE_MSG_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'messages/templates/');
29 29
         }
30 30
     }
31 31
 
32 32
     protected function _extend_page_config()
33 33
     {
34
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'messages';
34
+        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'messages';
35 35
         $this->_page_routes['custom_mtps'] = array(
36 36
             'func'       => '_ee_custom_messages_overview_list_table',
37 37
             'capability' => 'ee_read_messages',
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
     {
77 77
         global $admin_page_hooks;
78 78
 
79
-        if (! empty($admin_page_hooks['espresso_events'])) {
79
+        if ( ! empty($admin_page_hooks['espresso_events'])) {
80 80
             // we're on a EE specific page... good stuff!
81 81
             $hook_prefix = $admin_page_hooks['espresso_events'];
82
-            $filter_ref = $hook_prefix . '_page_' . $this->page_slug;
83
-            add_filter('FHEE_manage_' . $filter_ref . '_columns', array($this, 'add_custom_mtps_columns'), 10, 2);
82
+            $filter_ref = $hook_prefix.'_page_'.$this->page_slug;
83
+            add_filter('FHEE_manage_'.$filter_ref.'_columns', array($this, 'add_custom_mtps_columns'), 10, 2);
84 84
             add_action(
85
-                'AHEE__EE_Admin_List_Table__column_actions__' . $filter_ref,
85
+                'AHEE__EE_Admin_List_Table__column_actions__'.$filter_ref,
86 86
                 array($this, 'custom_mtp_create_button_column'),
87 87
                 10,
88 88
                 2
Please login to merge, or discard this patch.
Indentation   +187 added lines, -187 removed lines patch added patch discarded remove patch
@@ -18,191 +18,191 @@
 block discarded – undo
18 18
 {
19 19
 
20 20
 
21
-    public function __construct($routing = true)
22
-    {
23
-        parent::__construct($routing);
24
-        if (! defined('EE_MSG_CAF_ASSETS_PATH')) {
25
-            define('EE_MSG_CAF_ASSETS_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/assets/');
26
-            define('EE_MSG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/assets/');
27
-            define('EE_MSG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/templates/');
28
-            define('EE_MSG_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/templates/');
29
-        }
30
-    }
31
-
32
-    protected function _extend_page_config()
33
-    {
34
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'messages';
35
-        $this->_page_routes['custom_mtps'] = array(
36
-            'func'       => '_ee_custom_messages_overview_list_table',
37
-            'capability' => 'ee_read_messages',
38
-        );
39
-        $this->_page_config['custom_mtps'] = array(
40
-            'nav'           => array(
41
-                'label' => esc_html__('Custom Message Templates', 'event_espresso'),
42
-                'order' => 30,
43
-            ),
44
-            'list_table'    => 'Custom_Messages_Template_List_Table',
45
-            'help_tabs'     => array(
46
-                'message_overview_message_types_help_tab' => array(
47
-                    'title'    => esc_html__('Message Types', 'event_espresso'),
48
-                    'filename' => 'messages_overview_types',
49
-                ),
50
-                'messages_overview_messengers_help_tab'   => array(
51
-                    'title'    => esc_html__('Messengers', 'event_espresso'),
52
-                    'filename' => 'messages_overview_messengers',
53
-                ),
54
-                'messages_overview_other_help_tab'        => array(
55
-                    'title'    => esc_html__('Messages Other', 'event_espresso'),
56
-                    'filename' => 'messages_overview_other',
57
-                ),
58
-            ),
59
-            'help_tour'     => array(),
60
-            'require_nonce' => false,
61
-        );
62
-
63
-        add_action('current_screen', array($this, 'dynamic_screen_hooks'), 10);
64
-    }
65
-
66
-
67
-    /**
68
-     * Callback for current_screen action
69
-     * This is used for any filters and/or actions that require the dynamic screen hook_prefix to be correct.
70
-     *
71
-     * @since 4.5.0
72
-     *
73
-     * @return void
74
-     */
75
-    public function dynamic_screen_hooks()
76
-    {
77
-        global $admin_page_hooks;
78
-
79
-        if (! empty($admin_page_hooks['espresso_events'])) {
80
-            // we're on a EE specific page... good stuff!
81
-            $hook_prefix = $admin_page_hooks['espresso_events'];
82
-            $filter_ref = $hook_prefix . '_page_' . $this->page_slug;
83
-            add_filter('FHEE_manage_' . $filter_ref . '_columns', array($this, 'add_custom_mtps_columns'), 10, 2);
84
-            add_action(
85
-                'AHEE__EE_Admin_List_Table__column_actions__' . $filter_ref,
86
-                array($this, 'custom_mtp_create_button_column'),
87
-                10,
88
-                2
89
-            );
90
-        }
91
-    }
92
-
93
-
94
-    /**
95
-     * This is the callback for the FHEE__manage_event-espresso_page_espresso_messages_columns to register the
96
-     * caffeinated columns for the global message templates list table.
97
-     *
98
-     * @since 4.3.2
99
-     *
100
-     * @param array  $columns   Original defined list of columns
101
-     * @param string $screen_id The unique screen id for the page.
102
-     */
103
-    public function add_custom_mtps_columns($columns, $screen_id)
104
-    {
105
-        if ($screen_id !== 'espresso_messages_global_mtps') {
106
-            return $columns;
107
-        }
108
-
109
-        $columns['actions'] = '';
110
-        return $columns;
111
-    }
112
-
113
-
114
-    /**
115
-     * Callback for FHEE__EE_Admin_List_Table__column_actions__event-espresso_page_espresso_messages action that allows
116
-     * for adding the content for the registered "action" column.
117
-     *
118
-     * @since 4.3.2
119
-     *
120
-     * @param EE_Base_Class
121
-     * @param string $screen_id Unique screen id for the page
122
-     *
123
-     * @return string html content for the page.
124
-     */
125
-    public function custom_mtp_create_button_column($item, $screen_id)
126
-    {
127
-        if (
128
-            $screen_id !== 'espresso_messages_global_mtps' || ! EE_Registry::instance()->CAP->current_user_can(
129
-                'ee_edit_messages',
130
-                'espresso_messages_add_new_message_template'
131
-            )
132
-        ) {
133
-            return '';
134
-        }
135
-
136
-        // first we consider whether this template has override set.  If it does then that means no custom templates can be created from this template as a base.  So let's just skip the button creation.
137
-        if ($item->get('MTP_is_override')) {
138
-            return '';
139
-        }
140
-
141
-
142
-        $create_args = array(
143
-            'GRP_ID'       => $item->ID(),
144
-            'messenger'    => $item->messenger(),
145
-            'message_type' => $item->message_type(),
146
-            'action'       => 'add_new_message_template',
147
-        );
148
-        $create_link = EE_Admin_Page::add_query_args_and_nonce($create_args, EE_MSG_ADMIN_URL);
149
-        echo sprintf(
150
-            '<a href="%s" class="button button-small">%s</a>',
151
-            $create_link,
152
-            esc_html__('Create Custom', 'event_espresso')
153
-        );
154
-    }
155
-
156
-
157
-    protected function _add_screen_options_custom_mtps()
158
-    {
159
-        $page_title = $this->_admin_page_title;
160
-        $this->_admin_page_title = esc_html__('Custom Message Templates', 'event_espresso');
161
-        $this->_per_page_screen_option();
162
-        $this->_admin_page_title = $page_title;
163
-    }
164
-
165
-
166
-    /**
167
-     * set views array for Custom Templates list table
168
-     *
169
-     * @access public
170
-     * @return void
171
-     */
172
-    public function _set_list_table_views_custom_mtps()
173
-    {
174
-        $this->_views = array(
175
-            'in_use' => array(
176
-                'slug'        => 'in_use',
177
-                'label'       => esc_html__('In Use', 'event_espresso'),
178
-                'count'       => 0,
179
-                'bulk_action' => array(
180
-                    'trash_message_template' => esc_html__('Move to Trash', 'event_espresso'),
181
-                ),
182
-            ),
183
-        );
184
-        if (
185
-            EE_Registry::instance()->CAP->current_user_can(
186
-                'ee_delete_messages',
187
-                'espresso_messages_trash_message_template'
188
-            )
189
-        ) {
190
-            $this->_views['trashed'] = array(
191
-                'slug'        => 'trashed',
192
-                'label'       => esc_html__('Trash', 'event_espresso'),
193
-                'count'       => 0,
194
-                'bulk_action' => array(
195
-                    'restore_message_template' => esc_html__('Restore From Trash', 'event_espresso'),
196
-                    'delete_message_template'  => esc_html__('Delete Permanently', 'event_espresso'),
197
-                ),
198
-            );
199
-        }
200
-    }
201
-
202
-
203
-    protected function _ee_custom_messages_overview_list_table()
204
-    {
205
-        $this->_admin_page_title = esc_html__('Custom Message Templates', 'event_espresso');
206
-        $this->display_admin_list_table_page_with_no_sidebar();
207
-    }
21
+	public function __construct($routing = true)
22
+	{
23
+		parent::__construct($routing);
24
+		if (! defined('EE_MSG_CAF_ASSETS_PATH')) {
25
+			define('EE_MSG_CAF_ASSETS_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/assets/');
26
+			define('EE_MSG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/assets/');
27
+			define('EE_MSG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/templates/');
28
+			define('EE_MSG_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/templates/');
29
+		}
30
+	}
31
+
32
+	protected function _extend_page_config()
33
+	{
34
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'messages';
35
+		$this->_page_routes['custom_mtps'] = array(
36
+			'func'       => '_ee_custom_messages_overview_list_table',
37
+			'capability' => 'ee_read_messages',
38
+		);
39
+		$this->_page_config['custom_mtps'] = array(
40
+			'nav'           => array(
41
+				'label' => esc_html__('Custom Message Templates', 'event_espresso'),
42
+				'order' => 30,
43
+			),
44
+			'list_table'    => 'Custom_Messages_Template_List_Table',
45
+			'help_tabs'     => array(
46
+				'message_overview_message_types_help_tab' => array(
47
+					'title'    => esc_html__('Message Types', 'event_espresso'),
48
+					'filename' => 'messages_overview_types',
49
+				),
50
+				'messages_overview_messengers_help_tab'   => array(
51
+					'title'    => esc_html__('Messengers', 'event_espresso'),
52
+					'filename' => 'messages_overview_messengers',
53
+				),
54
+				'messages_overview_other_help_tab'        => array(
55
+					'title'    => esc_html__('Messages Other', 'event_espresso'),
56
+					'filename' => 'messages_overview_other',
57
+				),
58
+			),
59
+			'help_tour'     => array(),
60
+			'require_nonce' => false,
61
+		);
62
+
63
+		add_action('current_screen', array($this, 'dynamic_screen_hooks'), 10);
64
+	}
65
+
66
+
67
+	/**
68
+	 * Callback for current_screen action
69
+	 * This is used for any filters and/or actions that require the dynamic screen hook_prefix to be correct.
70
+	 *
71
+	 * @since 4.5.0
72
+	 *
73
+	 * @return void
74
+	 */
75
+	public function dynamic_screen_hooks()
76
+	{
77
+		global $admin_page_hooks;
78
+
79
+		if (! empty($admin_page_hooks['espresso_events'])) {
80
+			// we're on a EE specific page... good stuff!
81
+			$hook_prefix = $admin_page_hooks['espresso_events'];
82
+			$filter_ref = $hook_prefix . '_page_' . $this->page_slug;
83
+			add_filter('FHEE_manage_' . $filter_ref . '_columns', array($this, 'add_custom_mtps_columns'), 10, 2);
84
+			add_action(
85
+				'AHEE__EE_Admin_List_Table__column_actions__' . $filter_ref,
86
+				array($this, 'custom_mtp_create_button_column'),
87
+				10,
88
+				2
89
+			);
90
+		}
91
+	}
92
+
93
+
94
+	/**
95
+	 * This is the callback for the FHEE__manage_event-espresso_page_espresso_messages_columns to register the
96
+	 * caffeinated columns for the global message templates list table.
97
+	 *
98
+	 * @since 4.3.2
99
+	 *
100
+	 * @param array  $columns   Original defined list of columns
101
+	 * @param string $screen_id The unique screen id for the page.
102
+	 */
103
+	public function add_custom_mtps_columns($columns, $screen_id)
104
+	{
105
+		if ($screen_id !== 'espresso_messages_global_mtps') {
106
+			return $columns;
107
+		}
108
+
109
+		$columns['actions'] = '';
110
+		return $columns;
111
+	}
112
+
113
+
114
+	/**
115
+	 * Callback for FHEE__EE_Admin_List_Table__column_actions__event-espresso_page_espresso_messages action that allows
116
+	 * for adding the content for the registered "action" column.
117
+	 *
118
+	 * @since 4.3.2
119
+	 *
120
+	 * @param EE_Base_Class
121
+	 * @param string $screen_id Unique screen id for the page
122
+	 *
123
+	 * @return string html content for the page.
124
+	 */
125
+	public function custom_mtp_create_button_column($item, $screen_id)
126
+	{
127
+		if (
128
+			$screen_id !== 'espresso_messages_global_mtps' || ! EE_Registry::instance()->CAP->current_user_can(
129
+				'ee_edit_messages',
130
+				'espresso_messages_add_new_message_template'
131
+			)
132
+		) {
133
+			return '';
134
+		}
135
+
136
+		// first we consider whether this template has override set.  If it does then that means no custom templates can be created from this template as a base.  So let's just skip the button creation.
137
+		if ($item->get('MTP_is_override')) {
138
+			return '';
139
+		}
140
+
141
+
142
+		$create_args = array(
143
+			'GRP_ID'       => $item->ID(),
144
+			'messenger'    => $item->messenger(),
145
+			'message_type' => $item->message_type(),
146
+			'action'       => 'add_new_message_template',
147
+		);
148
+		$create_link = EE_Admin_Page::add_query_args_and_nonce($create_args, EE_MSG_ADMIN_URL);
149
+		echo sprintf(
150
+			'<a href="%s" class="button button-small">%s</a>',
151
+			$create_link,
152
+			esc_html__('Create Custom', 'event_espresso')
153
+		);
154
+	}
155
+
156
+
157
+	protected function _add_screen_options_custom_mtps()
158
+	{
159
+		$page_title = $this->_admin_page_title;
160
+		$this->_admin_page_title = esc_html__('Custom Message Templates', 'event_espresso');
161
+		$this->_per_page_screen_option();
162
+		$this->_admin_page_title = $page_title;
163
+	}
164
+
165
+
166
+	/**
167
+	 * set views array for Custom Templates list table
168
+	 *
169
+	 * @access public
170
+	 * @return void
171
+	 */
172
+	public function _set_list_table_views_custom_mtps()
173
+	{
174
+		$this->_views = array(
175
+			'in_use' => array(
176
+				'slug'        => 'in_use',
177
+				'label'       => esc_html__('In Use', 'event_espresso'),
178
+				'count'       => 0,
179
+				'bulk_action' => array(
180
+					'trash_message_template' => esc_html__('Move to Trash', 'event_espresso'),
181
+				),
182
+			),
183
+		);
184
+		if (
185
+			EE_Registry::instance()->CAP->current_user_can(
186
+				'ee_delete_messages',
187
+				'espresso_messages_trash_message_template'
188
+			)
189
+		) {
190
+			$this->_views['trashed'] = array(
191
+				'slug'        => 'trashed',
192
+				'label'       => esc_html__('Trash', 'event_espresso'),
193
+				'count'       => 0,
194
+				'bulk_action' => array(
195
+					'restore_message_template' => esc_html__('Restore From Trash', 'event_espresso'),
196
+					'delete_message_template'  => esc_html__('Delete Permanently', 'event_espresso'),
197
+				),
198
+			);
199
+		}
200
+	}
201
+
202
+
203
+	protected function _ee_custom_messages_overview_list_table()
204
+	{
205
+		$this->_admin_page_title = esc_html__('Custom Message Templates', 'event_espresso');
206
+		$this->display_admin_list_table_page_with_no_sidebar();
207
+	}
208 208
 }
Please login to merge, or discard this patch.
admin/extend/messages/templates/create_custom_template_form.template.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
             <p>
20 20
                 <label for="custom-message-template-name">
21 21
                     <?php _e(
22
-                        'Name for Template:',
23
-                        'event_espresso'
24
-                    ); ?></label><br/>
22
+						'Name for Template:',
23
+						'event_espresso'
24
+					); ?></label><br/>
25 25
                 <input id="custom-message-template-name" type="text" class="regular-text"
26 26
                        name="custom_template_args[MTP_name]" value="">
27 27
             </p>
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
                        value="<?php _e('Create Template', 'event_espresso'); ?>">
38 38
                 <button type="button" class="button button-secondary cancel-create-template">
39 39
                     <?php _e(
40
-                        'Cancel',
41
-                        'event_espresso'
42
-                    ); ?></button>
40
+						'Cancel',
41
+						'event_espresso'
42
+					); ?></button>
43 43
             </div>
44 44
         </form>
45 45
     </div>
Please login to merge, or discard this patch.
admin/extend/general_settings/Extend_General_Settings_Admin_Page.core.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
     public function __construct($routing = true)
22 22
     {
23 23
         parent::__construct($routing);
24
-        define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/');
24
+        define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'general_settings/templates/');
25 25
     }
26 26
 
27 27
 
28 28
     protected function _extend_page_config()
29 29
     {
30 30
 
31
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings';
31
+        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'general_settings';
32 32
 
33 33
         // filters and action hooks here
34 34
         add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9);
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url)
61 61
                                                && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url)
62 62
             ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : '';
63
-        $template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php';
63
+        $template = GEN_SET_CAF_TEMPLATE_PATH.'debug_log_settings.template.php';
64 64
         EEH_Template::display_template($template, $template_args);
65 65
     }
66 66
 
Please login to merge, or discard this patch.
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -18,68 +18,68 @@
 block discarded – undo
18 18
 {
19 19
 
20 20
 
21
-    public function __construct($routing = true)
22
-    {
23
-        parent::__construct($routing);
24
-        define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/');
25
-    }
21
+	public function __construct($routing = true)
22
+	{
23
+		parent::__construct($routing);
24
+		define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/');
25
+	}
26 26
 
27 27
 
28
-    protected function _extend_page_config()
29
-    {
28
+	protected function _extend_page_config()
29
+	{
30 30
 
31
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings';
31
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings';
32 32
 
33
-        // filters and action hooks here
34
-        add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9);
35
-        add_filter(
36
-            'FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin',
37
-            array($this, 'update_debug_logging_options'),
38
-            10,
39
-            1
40
-        );
41
-    }
33
+		// filters and action hooks here
34
+		add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9);
35
+		add_filter(
36
+			'FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin',
37
+			array($this, 'update_debug_logging_options'),
38
+			10,
39
+			1
40
+		);
41
+	}
42 42
 
43 43
 
44 44
 
45
-    /*************        Logging Settings        *************/
45
+	/*************        Logging Settings        *************/
46 46
 
47
-    /**
48
-     * debug_logging_options
49
-     *
50
-     * @param array $template_args
51
-     *
52
-     * @return void
53
-     */
54
-    public function debug_logging_options($template_args = array())
55
-    {
56
-        $template_args['use_remote_logging'] = isset(EE_Registry::instance()->CFG->admin->use_remote_logging) ? absint(
57
-            EE_Registry::instance()->CFG->admin->use_remote_logging
58
-        ) : false;
59
-        $template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url)
60
-                                               && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url)
61
-            ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : '';
62
-        $template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php';
63
-        EEH_Template::display_template($template, $template_args);
64
-    }
47
+	/**
48
+	 * debug_logging_options
49
+	 *
50
+	 * @param array $template_args
51
+	 *
52
+	 * @return void
53
+	 */
54
+	public function debug_logging_options($template_args = array())
55
+	{
56
+		$template_args['use_remote_logging'] = isset(EE_Registry::instance()->CFG->admin->use_remote_logging) ? absint(
57
+			EE_Registry::instance()->CFG->admin->use_remote_logging
58
+		) : false;
59
+		$template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url)
60
+											   && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url)
61
+			? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : '';
62
+		$template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php';
63
+		EEH_Template::display_template($template, $template_args);
64
+	}
65 65
 
66 66
 
67
-    /**
68
-     * update_debug_logging_options
69
-     *
70
-     * @param array $admin_options
71
-     *
72
-     * @return array
73
-     */
74
-    public function update_debug_logging_options($admin_options = array())
75
-    {
76
-        $admin_options->use_remote_logging = isset($this->_req_data['use_remote_logging']) ? absint(
77
-            $this->_req_data['use_remote_logging']
78
-        ) : $admin_options->use_remote_logging;
79
-        $admin_options->remote_logging_url = isset($this->_req_data['remote_logging_url']) ? esc_url_raw(
80
-            $this->_req_data['remote_logging_url']
81
-        ) : $admin_options->remote_logging_url;
67
+	/**
68
+	 * update_debug_logging_options
69
+	 *
70
+	 * @param array $admin_options
71
+	 *
72
+	 * @return array
73
+	 */
74
+	public function update_debug_logging_options($admin_options = array())
75
+	{
76
+		$admin_options->use_remote_logging = isset($this->_req_data['use_remote_logging']) ? absint(
77
+			$this->_req_data['use_remote_logging']
78
+		) : $admin_options->use_remote_logging;
79
+		$admin_options->remote_logging_url = isset($this->_req_data['remote_logging_url']) ? esc_url_raw(
80
+			$this->_req_data['remote_logging_url']
81
+		) : $admin_options->remote_logging_url;
82 82
 
83
-        return $admin_options;
84
-    }
83
+		return $admin_options;
84
+	}
85 85
 }
Please login to merge, or discard this patch.