Completed
Branch BUG-9680-compress-dompdf-files... (43e183)
by
unknown
67:53 queued 55:02
created
caffeinated/payment_methods/Mijireh/templates/mijireh_intro.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php printf( esc_html__('Mijireh is an off-site payment method for accepting payments online through over 80+ payment gateways and is available to event organizers in many countries. An account with Mijireh is required to accept payments. Need a Mijireh account? %1$sClick here to sign up for a merchant account%2$s.', 'event_espresso'), '<a href="https://eventespresso.com/go/mijireh/" target="_blank">','</a>' );
2 1
\ No newline at end of file
2
+<?php printf(esc_html__('Mijireh is an off-site payment method for accepting payments online through over 80+ payment gateways and is available to event organizers in many countries. An account with Mijireh is required to accept payments. Need a Mijireh account? %1$sClick here to sign up for a merchant account%2$s.', 'event_espresso'), '<a href="https://eventespresso.com/go/mijireh/" target="_blank">', '</a>');
3 3
\ No newline at end of file
Please login to merge, or discard this patch.
payment_methods/Paypal_Pro/templates/paypal_pro_intro.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php printf( esc_html__('PayPal Pro (Website Payments Pro) is an on-site payment method for accepting credit and debit cards and is available to event organizers in the United States, United Kingdom, and Canada. An account with PayPal is required to accept payments. Need a PayPal Pro account? Call 1-855-456-1338 or %1$sclick here to sign up for a merchant account%2$s.', 'event_espresso'), '<a href="https://eventespresso.com/go/paypalpro/" target="_blank">','</a>' );
2 1
\ No newline at end of file
2
+<?php printf(esc_html__('PayPal Pro (Website Payments Pro) is an on-site payment method for accepting credit and debit cards and is available to event organizers in the United States, United Kingdom, and Canada. An account with PayPal is required to accept payments. Need a PayPal Pro account? Call 1-855-456-1338 or %1$sclick here to sign up for a merchant account%2$s.', 'event_espresso'), '<a href="https://eventespresso.com/go/paypalpro/" target="_blank">', '</a>');
3 3
\ No newline at end of file
Please login to merge, or discard this patch.
caffeinated/admin/extend/events/Extend_Events_Admin_Page.core.php 2 patches
Spacing   +216 added lines, -216 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 class Extend_Events_Admin_Page extends Events_Admin_Page {
31 31
 
32 32
 
33
-	public function __construct( $routing = TRUE ) {
34
-		parent::__construct( $routing );
35
-		define( 'EVENTS_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'events/templates/');
36
-		define( 'EVENTS_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'events/assets/');
37
-		define( 'EVENTS_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'events/assets/');
33
+	public function __construct($routing = TRUE) {
34
+		parent::__construct($routing);
35
+		define('EVENTS_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'events/templates/');
36
+		define('EVENTS_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'events/assets/');
37
+		define('EVENTS_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'events/assets/');
38 38
 	}
39 39
 
40 40
 
41 41
 	protected function _extend_page_config() {
42 42
 
43
-		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'events';
43
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'events';
44 44
 		$default_espresso_boxes = $this->_default_espresso_metaboxes;
45 45
 
46 46
 		//is there a evt_id in the request?
47
-		$evt_id = ! empty( $this->_req_data['EVT_ID'] ) && ! is_array( $this->_req_data['EVT_ID'] ) ? $this->_req_data['EVT_ID'] : 0;
48
-		$evt_id = ! empty( $this->_req_data['post'] ) ? $this->_req_data['post'] : $evt_id;
47
+		$evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : 0;
48
+		$evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
49 49
 
50 50
 		//tkt_id?
51
-		$tkt_id = !empty( $this->_req_data['TKT_ID'] ) && ! is_array( $this->_req_data['TKT_ID'] ) ? $this->_req_data['TKT_ID'] : 0;
51
+		$tkt_id = ! empty($this->_req_data['TKT_ID']) && ! is_array($this->_req_data['TKT_ID']) ? $this->_req_data['TKT_ID'] : 0;
52 52
 
53 53
 		$new_page_routes = array(
54 54
 			'duplicate_event' => array(
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 				'capability' => 'ee_delete_default_ticket',
67 67
 				'obj_id' => $tkt_id,
68 68
 				'noheader' => TRUE,
69
-				'args' => array( 'trash' => TRUE )
69
+				'args' => array('trash' => TRUE)
70 70
 				),
71 71
 			'trash_tickets' => array(
72 72
 				'func' => '_trash_or_restore_ticket',
73 73
 				'capability' => 'ee_delete_default_tickets',
74 74
 				'noheader' => TRUE,
75
-				'args' => array( 'trash' => TRUE )
75
+				'args' => array('trash' => TRUE)
76 76
 				),
77 77
 			'restore_ticket' => array(
78 78
 				'func' => '_trash_or_restore_ticket',
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 				)
133 133
 			);
134 134
 
135
-		$this->_page_routes = array_merge( $this->_page_routes, $new_page_routes );
135
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
136 136
 
137 137
 
138 138
 		//partial route/config override
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 		$this->_page_config['default']['list_table'] = 'Extend_Events_Admin_List_Table';
145 145
 
146 146
 		//add tickets tab but only if there are more than one default ticket!
147
-		$tkt_count = EEM_Ticket::instance()->count_deleted_and_undeleted(array( array('TKT_is_default' => 1 ) ), 'TKT_ID', TRUE );
148
-		if ( $tkt_count > 1 ) {
147
+		$tkt_count = EEM_Ticket::instance()->count_deleted_and_undeleted(array(array('TKT_is_default' => 1)), 'TKT_ID', TRUE);
148
+		if ($tkt_count > 1) {
149 149
 			$new_page_config = array(
150 150
 				'ticket_list_table' => array(
151 151
 					'nav' => array(
@@ -164,14 +164,14 @@  discard block
 block discarded – undo
164 164
 				'label' => esc_html__('Templates', 'event_espresso'),
165 165
 				'order' => 30
166 166
 			),
167
-			'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ),
167
+			'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
168 168
 			'help_tabs' => array(
169 169
 				'general_settings_templates_help_tab' => array(
170 170
 					'title' => __('Templates', 'event_espresso'),
171 171
 					'filename' => 'general_settings_templates'
172 172
 				)
173 173
 			),
174
-			'help_tour' => array( 'Templates_Help_Tour' ),
174
+			'help_tour' => array('Templates_Help_Tour'),
175 175
 			'require_nonce' => FALSE
176 176
 		);
177 177
 
@@ -190,26 +190,26 @@  discard block
 block discarded – undo
190 190
 //				'metaboxes' => $default_espresso_boxes,
191 191
 //				'require_nonce' => FALSE
192 192
 //		);
193
-		$this->_page_config = array_merge( $this->_page_config, $new_page_config );
193
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
194 194
 
195 195
 		//add filters and actions
196 196
 		//modifying _views
197
-		add_filter('FHEE_event_datetime_metabox_add_additional_date_time_template', array( $this, 'add_additional_datetime_button' ), 10, 2 );
198
-		add_filter('FHEE_event_datetime_metabox_clone_button_template', array( $this, 'add_datetime_clone_button' ), 10, 2 );
199
-		add_filter('FHEE_event_datetime_metabox_timezones_template', array( $this, 'datetime_timezones_template'), 10, 2 );
197
+		add_filter('FHEE_event_datetime_metabox_add_additional_date_time_template', array($this, 'add_additional_datetime_button'), 10, 2);
198
+		add_filter('FHEE_event_datetime_metabox_clone_button_template', array($this, 'add_datetime_clone_button'), 10, 2);
199
+		add_filter('FHEE_event_datetime_metabox_timezones_template', array($this, 'datetime_timezones_template'), 10, 2);
200 200
 
201 201
 
202 202
 		//filters for event list table
203
-		add_filter('FHEE__Extend_Events_Admin_List_Table__filters', array( $this, 'list_table_filters'), 10, 2);
204
-		add_filter('FHEE__Events_Admin_List_Table__column_actions__action_links', array( $this, 'extra_list_table_actions'), 10, 2 );
203
+		add_filter('FHEE__Extend_Events_Admin_List_Table__filters', array($this, 'list_table_filters'), 10, 2);
204
+		add_filter('FHEE__Events_Admin_List_Table__column_actions__action_links', array($this, 'extra_list_table_actions'), 10, 2);
205 205
 
206 206
 		//legend item
207
-		add_filter('FHEE__Events_Admin_Page___event_legend_items__items', array( $this, 'additional_legend_items') );
207
+		add_filter('FHEE__Events_Admin_Page___event_legend_items__items', array($this, 'additional_legend_items'));
208 208
 
209
-		add_action('admin_init', array( $this, 'admin_init') );
209
+		add_action('admin_init', array($this, 'admin_init'));
210 210
 
211 211
 		//heartbeat stuff
212
-		add_filter( 'heartbeat_received', array( $this, 'heartbeat_response' ), 10, 2 );
212
+		add_filter('heartbeat_received', array($this, 'heartbeat_response'), 10, 2);
213 213
 
214 214
 	}
215 215
 
@@ -222,12 +222,12 @@  discard block
 block discarded – undo
222 222
 		EE_Registry::$i18n_js_strings = array_merge(
223 223
 			EE_Registry::$i18n_js_strings,
224 224
 			array(
225
-				'image_confirm'          => __( 'Do you really want to delete this image? Please remember to update your event to complete the removal.', 'event_espresso' ),
226
-				'event_starts_on'        => __( 'Event Starts on', 'event_espresso' ),
227
-				'event_ends_on'          => __( 'Event Ends on', 'event_espresso' ),
228
-				'event_datetime_actions' => __( 'Actions', 'event_espresso' ),
229
-				'event_clone_dt_msg'     => __( 'Clone this Event Date and Time', 'event_espresso' ),
230
-				'remove_event_dt_msg'    => __( 'Remove this Event Time', 'event_espresso' )
225
+				'image_confirm'          => __('Do you really want to delete this image? Please remember to update your event to complete the removal.', 'event_espresso'),
226
+				'event_starts_on'        => __('Event Starts on', 'event_espresso'),
227
+				'event_ends_on'          => __('Event Ends on', 'event_espresso'),
228
+				'event_datetime_actions' => __('Actions', 'event_espresso'),
229
+				'event_clone_dt_msg'     => __('Clone this Event Date and Time', 'event_espresso'),
230
+				'remove_event_dt_msg'    => __('Remove this Event Time', 'event_espresso')
231 231
 			)
232 232
 		);
233 233
 	}
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
 	 *
243 243
 	 * @return array  possibly appended response.
244 244
 	 */
245
-	public function heartbeat_response( $response, $data ) {
245
+	public function heartbeat_response($response, $data) {
246 246
 		/**
247 247
 		 * check whether count of tickets is approaching the potential
248 248
 		 * limits for the server.
249 249
 		 */
250
-		if ( ! empty( $data['input_count'] ) ) {
250
+		if ( ! empty($data['input_count'])) {
251 251
 			$response['max_input_vars_check'] = EE_Registry::instance()->CFG->environment->max_input_vars_limit_check($data['input_count']);
252 252
 		}
253 253
 
@@ -262,13 +262,13 @@  discard block
 block discarded – undo
262 262
 
263 263
 
264 264
 
265
-	public function extra_permalink_field_buttons( $return, $id, $new_title, $new_slug ) {
266
-		$return = parent::extra_permalink_field_buttons( $return, $id, $new_title, $new_slug );
265
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug) {
266
+		$return = parent::extra_permalink_field_buttons($return, $id, $new_title, $new_slug);
267 267
 		//make sure this is only when editing
268
-		if ( !empty( $id ) ) {
269
-			$href = EE_Admin_Page::add_query_args_and_nonce( array('action' => 'duplicate_event', 'EVT_ID' => $id), $this->_admin_base_url );
268
+		if ( ! empty($id)) {
269
+			$href = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'duplicate_event', 'EVT_ID' => $id), $this->_admin_base_url);
270 270
 			$title = esc_attr__('Duplicate Event', 'event_espresso');
271
-			$return .= '<a href="' . $href . '" title="' . $title . '" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">' . $title  . '</button>';
271
+			$return .= '<a href="'.$href.'" title="'.$title.'" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">'.$title.'</button>';
272 272
 		}
273 273
 		return $return;
274 274
 	}
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 				'label' => __('Trash', 'event_espresso'),
292 292
 				'count' => 0,
293 293
 				'bulk_action' => array(
294
-					'restore_tickets' => __('Restore from Trash' , 'event_espresso'),
294
+					'restore_tickets' => __('Restore from Trash', 'event_espresso'),
295 295
 					'delete_tickets' => __('Delete Permanently', 'event_espresso')
296 296
 					)
297 297
 				)
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
 
303 303
 	public function load_scripts_styles_edit() {
304
-		wp_register_script( 'ee-event-editor-heartbeat', EVENTS_CAF_ASSETS_URL . 'event-editor-heartbeat.js', array( 'ee_admin_js', 'heartbeat' ), EVENT_ESPRESSO_VERSION, TRUE );
304
+		wp_register_script('ee-event-editor-heartbeat', EVENTS_CAF_ASSETS_URL.'event-editor-heartbeat.js', array('ee_admin_js', 'heartbeat'), EVENT_ESPRESSO_VERSION, TRUE);
305 305
 
306 306
 		/**
307 307
 		 * load accounting js.
@@ -320,20 +320,20 @@  discard block
 block discarded – undo
320 320
 
321 321
 
322 322
 
323
-	public function add_additional_datetime_button( $template, $template_args ) {
324
-		return EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_add_additional_time.template.php', $template_args, TRUE);
323
+	public function add_additional_datetime_button($template, $template_args) {
324
+		return EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'event_datetime_add_additional_time.template.php', $template_args, TRUE);
325 325
 	}
326 326
 
327 327
 
328 328
 
329
-	public function add_datetime_clone_button( $template, $template_args ) {
330
-		return EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_metabox_clone_button.template.php', $template_args, TRUE );
329
+	public function add_datetime_clone_button($template, $template_args) {
330
+		return EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'event_datetime_metabox_clone_button.template.php', $template_args, TRUE);
331 331
 	}
332 332
 
333 333
 
334 334
 
335
-	public function datetime_timezones_template( $template, $template_args ) {
336
-		return EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_timezones.template.php', $template_args, TRUE );
335
+	public function datetime_timezones_template($template, $template_args) {
336
+		return EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'event_datetime_timezones.template.php', $template_args, TRUE);
337 337
 	}
338 338
 
339 339
 
@@ -342,11 +342,11 @@  discard block
 block discarded – undo
342 342
 	protected function _set_list_table_views_default() {
343 343
 		parent::_set_list_table_views_default();
344 344
 		$export_label = __('Export Events', 'event_espresso');
345
-		if ( EE_Registry::instance()->CAP->current_user_can( 'export', 'espresso_events_export' ) ) {
345
+		if (EE_Registry::instance()->CAP->current_user_can('export', 'espresso_events_export')) {
346 346
 //			$this->_views['all']['bulk_action']['export_events'] = $export_label;
347 347
 //			$this->_views['draft']['bulk_action']['export_events'] = $export_label;
348 348
 
349
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) {
349
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
350 350
 //				$this->_views['trash']['bulk_action']['export_events'] = $export_label;
351 351
 			}
352 352
 		}
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 			)
373 373
 		);
374 374
 
375
-		$this->_views = array_merge( $this->_views, $new_views);
375
+		$this->_views = array_merge($this->_views, $new_views);
376 376
 	}
377 377
 
378 378
 
@@ -386,17 +386,17 @@  discard block
 block discarded – undo
386 386
 
387 387
 
388 388
 
389
-	public function extra_list_table_actions( $actionlinks, $event ) {
390
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'espresso_registrations_reports', $event->ID() ) ) {
389
+	public function extra_list_table_actions($actionlinks, $event) {
390
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'espresso_registrations_reports', $event->ID())) {
391 391
 			$reports_query_args = array(
392 392
 					'action' => 'reports',
393 393
 					'EVT_ID' => $event->ID()
394 394
 				);
395
-			$reports_link = EE_Admin_Page::add_query_args_and_nonce( $reports_query_args, REG_ADMIN_URL );
396
-			$actionlinks[] = '<a href="' . $reports_link . '" title="' .  esc_attr__('View Report', 'event_espresso') . '"><div class="dashicons dashicons-chart-bar"></div></a>' . "\n\t";
395
+			$reports_link = EE_Admin_Page::add_query_args_and_nonce($reports_query_args, REG_ADMIN_URL);
396
+			$actionlinks[] = '<a href="'.$reports_link.'" title="'.esc_attr__('View Report', 'event_espresso').'"><div class="dashicons dashicons-chart-bar"></div></a>'."\n\t";
397 397
 		}
398
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) {
399
-			EE_Registry::instance()->load_helper( 'MSG_Template' );
398
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
399
+			EE_Registry::instance()->load_helper('MSG_Template');
400 400
 			$actionlinks[] = EEH_MSG_Template::get_message_action_link(
401 401
 				'see_notifications_for',
402 402
 				null,
@@ -411,15 +411,15 @@  discard block
 block discarded – undo
411 411
 
412 412
 
413 413
 	public function additional_legend_items($items) {
414
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'espresso_registrations_reports' ) ) {
414
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'espresso_registrations_reports')) {
415 415
 			$items['reports'] = array(
416 416
 					'class' => 'dashicons dashicons-chart-bar',
417 417
 					'desc' => __('Event Reports', 'event_espresso')
418 418
 				);
419 419
 		}
420
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) {
421
-			$related_for_icon = EEH_MSG_Template::get_message_action_icon( 'see_notifications_for' );
422
-			if ( isset( $related_for_icon['css_class']) && isset( $related_for_icon['label'] ) ) {
420
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
421
+			$related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for');
422
+			if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) {
423 423
 				$items['view_related_messages'] = array(
424 424
 					'class' => $related_for_icon['css_class'],
425 425
 					'desc' => $related_for_icon['label'],
@@ -444,17 +444,17 @@  discard block
 block discarded – undo
444 444
 	 */
445 445
 	protected function _duplicate_event() {
446 446
 		//first make sure the ID for the event is in the request.  If it isnt' then we need to bail and redirect back to overview list table (cause how did we get here?)
447
-		if ( !isset( $this->_req_data['EVT_ID'] ) ) {
448
-			EE_Error::add_error( __('In order to duplicate an event an Event ID is required.  None was given.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
449
-			$this->_redirect_after_action( FALSE, '', '', array(), TRUE );
447
+		if ( ! isset($this->_req_data['EVT_ID'])) {
448
+			EE_Error::add_error(__('In order to duplicate an event an Event ID is required.  None was given.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
449
+			$this->_redirect_after_action(FALSE, '', '', array(), TRUE);
450 450
 			return;
451 451
 		}
452 452
 
453 453
 		//k we've got EVT_ID so let's use that to get the event we'll duplicate
454
-		$orig_event = EEM_Event::instance()->get_one_by_ID( $this->_req_data['EVT_ID'] );
454
+		$orig_event = EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']);
455 455
 
456
-		if ( ! $orig_event instanceof EE_Event )
457
-			throw new EE_Error( sprintf( __('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso'), $this->_req_data['EVT_ID'] ) );
456
+		if ( ! $orig_event instanceof EE_Event)
457
+			throw new EE_Error(sprintf(__('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso'), $this->_req_data['EVT_ID']));
458 458
 
459 459
 		//k now let's clone the $orig_event before getting relations
460 460
 		$new_event = clone $orig_event;
@@ -467,43 +467,43 @@  discard block
 block discarded – undo
467 467
 
468 468
 
469 469
 		//reset the ID and modify other details to make it clear this is a dupe
470
-		$new_event->set( 'EVT_ID', 0 );
471
-		$new_name = $new_event->name() . ' ' . __('**DUPLICATE**', 'event_espresso');
472
-		$new_event->set( 'EVT_name',  $new_name );
473
-		$new_event->set( 'EVT_slug',  wp_unique_post_slug( sanitize_title( $orig_event->name() ), 0, 'publish', 'espresso_events', 0 ) );
474
-		$new_event->set( 'status', 'draft' );
470
+		$new_event->set('EVT_ID', 0);
471
+		$new_name = $new_event->name().' '.__('**DUPLICATE**', 'event_espresso');
472
+		$new_event->set('EVT_name', $new_name);
473
+		$new_event->set('EVT_slug', wp_unique_post_slug(sanitize_title($orig_event->name()), 0, 'publish', 'espresso_events', 0));
474
+		$new_event->set('status', 'draft');
475 475
 
476 476
 		//duplicate discussion settings
477
-		$new_event->set( 'comment_status', $orig_event->get('comment_status') );
478
-		$new_event->set( 'ping_status', $orig_event->get( 'ping_status' ) );
477
+		$new_event->set('comment_status', $orig_event->get('comment_status'));
478
+		$new_event->set('ping_status', $orig_event->get('ping_status'));
479 479
 
480 480
 		//save the new event
481 481
 		$new_event->save();
482 482
 
483 483
 		//venues
484
-		foreach( $orig_ven as $ven ) {
485
-			$new_event->_add_relation_to( $ven, 'Venue' );
484
+		foreach ($orig_ven as $ven) {
485
+			$new_event->_add_relation_to($ven, 'Venue');
486 486
 		}
487 487
 		$new_event->save();
488 488
 
489 489
 
490 490
 		//now we need to get the question group relations and handle that
491 491
 		//first primary question groups
492
-		$orig_primary_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 1 ) ) );
493
-		if ( !empty( $orig_primary_qgs ) ) {
494
-			foreach ( $orig_primary_qgs as $id => $obj ) {
495
-				if ( $obj instanceof EE_Question_Group ) {
496
-					$new_event->_add_relation_to( $obj, 'Question_Group', array( 'EQG_primary' => 1 ) );
492
+		$orig_primary_qgs = $orig_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 1)));
493
+		if ( ! empty($orig_primary_qgs)) {
494
+			foreach ($orig_primary_qgs as $id => $obj) {
495
+				if ($obj instanceof EE_Question_Group) {
496
+					$new_event->_add_relation_to($obj, 'Question_Group', array('EQG_primary' => 1));
497 497
 				}
498 498
 			}
499 499
 		}
500 500
 
501 501
 		//next additional attendee question groups
502
-		$orig_additional_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 0 ) ) );
503
-		if ( !empty( $orig_additional_qgs ) ) {
504
-			foreach ( $orig_additional_qgs as $id => $obj ) {
505
-				if ( $obj instanceof EE_Question_Group ) {
506
-					$new_event->_add_relation_to( $obj, 'Question_Group', array( 'EQG_primary' => 0 ) );
502
+		$orig_additional_qgs = $orig_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0)));
503
+		if ( ! empty($orig_additional_qgs)) {
504
+			foreach ($orig_additional_qgs as $id => $obj) {
505
+				if ($obj instanceof EE_Question_Group) {
506
+					$new_event->_add_relation_to($obj, 'Question_Group', array('EQG_primary' => 0));
507 507
 				}
508 508
 			}
509 509
 		}
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 
515 515
 		//k now that we have the new event saved we can loop through the datetimes and start adding relations.
516 516
 		$cloned_tickets = array();
517
-		foreach ( $orig_datetimes as $orig_dtt ) {
517
+		foreach ($orig_datetimes as $orig_dtt) {
518 518
 			$new_dtt = clone $orig_dtt;
519 519
 			$orig_tkts = $orig_dtt->tickets();
520 520
 
@@ -522,22 +522,22 @@  discard block
 block discarded – undo
522 522
 			$new_dtt->set('DTT_ID', 0);
523 523
 			$new_dtt->set('DTT_sold', 0);
524 524
 			$new_dtt->save();
525
-			$new_event->_add_relation_to( $new_dtt, 'Datetime');
525
+			$new_event->_add_relation_to($new_dtt, 'Datetime');
526 526
 			$new_event->save();
527 527
 
528 528
 			//now let's get the ticket relations setup.
529
-			foreach ( (array) $orig_tkts as $orig_tkt ) {
529
+			foreach ((array) $orig_tkts as $orig_tkt) {
530 530
 				//it's possible a datetime will have no tickets so let's verify we HAVE a ticket first.
531
-				if ( ! $orig_tkt instanceof EE_Ticket )
531
+				if ( ! $orig_tkt instanceof EE_Ticket)
532 532
 					continue;
533 533
 
534 534
 				//is this ticket archived?  If it is then let's skip
535
-				if ( $orig_tkt->get( 'TKT_deleted' ) ) {
535
+				if ($orig_tkt->get('TKT_deleted')) {
536 536
 					continue;
537 537
 				}
538 538
 
539 539
 				//does this original ticket already exist in the clone_tickets cache?  If so we'll just use the new ticket from it.
540
-				if ( isset( $cloned_tickets[$orig_tkt->ID()] ) ) {
540
+				if (isset($cloned_tickets[$orig_tkt->ID()])) {
541 541
 					$new_tkt = $cloned_tickets[$orig_tkt->ID()];
542 542
 				} else {
543 543
 					$new_tkt = clone $orig_tkt;
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 					$new_tkt->save(); //make sure new ticket has ID.
550 550
 
551 551
 					//price relations on new ticket need to be setup.
552
-					foreach ( $orig_prices as $orig_price ) {
552
+					foreach ($orig_prices as $orig_price) {
553 553
 						$new_price = clone $orig_price;
554 554
 						$new_price->set('PRC_ID', 0);
555 555
 						$new_price->save();
@@ -566,39 +566,39 @@  discard block
 block discarded – undo
566 566
 		}
567 567
 
568 568
 		//clone taxonomy information
569
-		$taxonomies_to_clone_with = apply_filters( 'FHEE__Extend_Events_Admin_Page___duplicate_event__taxonomies_to_clone', array( 'espresso_event_categories', 'espresso_event_type', 'post_tag' ) );
569
+		$taxonomies_to_clone_with = apply_filters('FHEE__Extend_Events_Admin_Page___duplicate_event__taxonomies_to_clone', array('espresso_event_categories', 'espresso_event_type', 'post_tag'));
570 570
 
571 571
 		//get terms for original event (notice)
572
-		$orig_terms = wp_get_object_terms( $orig_event->ID(), $taxonomies_to_clone_with );
572
+		$orig_terms = wp_get_object_terms($orig_event->ID(), $taxonomies_to_clone_with);
573 573
 
574 574
 		//loop through terms and add them to new event.
575
-		foreach ( $orig_terms as $term ) {
576
-			wp_set_object_terms( $new_event->ID(), $term->term_id, $term->taxonomy, true );
575
+		foreach ($orig_terms as $term) {
576
+			wp_set_object_terms($new_event->ID(), $term->term_id, $term->taxonomy, true);
577 577
 		}
578 578
 
579 579
 
580
-		do_action( 'AHEE__Extend_Events_Admin_Page___duplicate_event__after', $new_event, $orig_event );
580
+		do_action('AHEE__Extend_Events_Admin_Page___duplicate_event__after', $new_event, $orig_event);
581 581
 
582 582
 		//now let's redirect to the edit page for this duplicated event if we have a new event id.
583
-		if ( $new_event->ID() ) {
583
+		if ($new_event->ID()) {
584 584
 			$redirect_args = array(
585 585
 				'post' => $new_event->ID(),
586 586
 				'action' => 'edit'
587 587
 			);
588
-			EE_Error::add_success( __('Event successfully duplicated.  Please review the details below and make any necessary edits', 'event_espresso') );
588
+			EE_Error::add_success(__('Event successfully duplicated.  Please review the details below and make any necessary edits', 'event_espresso'));
589 589
 		} else {
590 590
 			$redirect_args = array(
591 591
 				'action' => 'default'
592 592
 				);
593
-			EE_Error::add_error( __('Not able to duplicate event.  Something went wrong.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
593
+			EE_Error::add_error(__('Not able to duplicate event.  Something went wrong.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
594 594
 		}
595 595
 
596
-		$this->_redirect_after_action(FALSE, '', '', $redirect_args, TRUE );
596
+		$this->_redirect_after_action(FALSE, '', '', $redirect_args, TRUE);
597 597
 	}
598 598
 
599 599
 
600 600
 
601
-	protected function _import_page(){
601
+	protected function _import_page() {
602 602
 
603 603
 		$title = __('Import', 'event_espresso');
604 604
 		$intro = __('If you have a previously exported Event Espresso 4 information in a Comma Separated Value (CSV) file format, you can upload the file here: ', 'event_espresso');
@@ -606,8 +606,8 @@  discard block
 block discarded – undo
606 606
 		$action = 'import_events';
607 607
 		$type = 'csv';
608 608
 		$this->_template_args['form'] = EE_Import::instance()->upload_form($title, $intro, $form_url, $action, $type);
609
-		$this->_template_args['sample_file_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'sample_export_file'),$this->_admin_base_url);
610
-		$content = EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH . 'import_page.template.php',$this->_template_args,true);
609
+		$this->_template_args['sample_file_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'sample_export_file'), $this->_admin_base_url);
610
+		$content = EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'import_page.template.php', $this->_template_args, true);
611 611
 
612 612
 
613 613
 		$this->_template_args['admin_page_content'] = $content;
@@ -620,9 +620,9 @@  discard block
 block discarded – undo
620 620
 	 * @return string html
621 621
 	 */
622 622
 	protected function _import_events() {
623
-		require_once(EE_CLASSES . 'EE_Import.class.php');
623
+		require_once(EE_CLASSES.'EE_Import.class.php');
624 624
 		$success = EE_Import::instance()->import();
625
-		$this->_redirect_after_action($success, 'Import File', 'ran', array('action' => 'import_page'),true);
625
+		$this->_redirect_after_action($success, 'Import File', 'ran', array('action' => 'import_page'), true);
626 626
 
627 627
 	}
628 628
 
@@ -636,23 +636,23 @@  discard block
 block discarded – undo
636 636
 	 * @return file
637 637
 	 */
638 638
 	protected function _events_export() {
639
-		if(isset($this->_req_data['EVT_ID'])){
639
+		if (isset($this->_req_data['EVT_ID'])) {
640 640
 			$event_ids = $this->_req_data['EVT_ID'];
641
-		}elseif(isset($this->_req_data['EVT_IDs'])){
641
+		}elseif (isset($this->_req_data['EVT_IDs'])) {
642 642
 			$event_ids = $this->_req_data['EVT_IDs'];
643
-		}else{
643
+		} else {
644 644
 			$event_ids = NULL;
645 645
 		}
646 646
 		//todo: I don't like doing this but it'll do until we modify EE_Export Class.
647 647
 		$new_request_args = array(
648 648
 			'export' => 'report',
649 649
 			'action' => 'all_event_data',
650
-			'EVT_ID' => $event_ids ,
650
+			'EVT_ID' => $event_ids,
651 651
 		);
652 652
 		$this->_req_data = array_merge($this->_req_data, $new_request_args);
653 653
 
654
-		if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
655
-			require_once(EE_CLASSES . 'EE_Export.class.php');
654
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
655
+			require_once(EE_CLASSES.'EE_Export.class.php');
656 656
 			$EE_Export = EE_Export::instance($this->_req_data);
657 657
 			$EE_Export->export();
658 658
 		}
@@ -674,11 +674,11 @@  discard block
 block discarded – undo
674 674
 			'category_ids' => $this->_req_data['EVT_CAT_ID']
675 675
 			);
676 676
 
677
-		$this->_req_data = array_merge( $this->_req_data, $new_request_args );
677
+		$this->_req_data = array_merge($this->_req_data, $new_request_args);
678 678
 
679
-		if ( is_readable( EE_CLASSES . 'EE_Export.class.php') ) {
680
-			require_once( EE_CLASSES . 'EE_Export.class.php');
681
-			$EE_Export = EE_Export::instance( $this->_req_data );
679
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
680
+			require_once(EE_CLASSES.'EE_Export.class.php');
681
+			$EE_Export = EE_Export::instance($this->_req_data);
682 682
 			$EE_Export->export();
683 683
 		}
684 684
 
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 	/**
690 690
 	 * Creates a sample CSV file for importing
691 691
 	 */
692
-	protected function _sample_export_file(){
692
+	protected function _sample_export_file() {
693 693
 //		require_once(EE_CLASSES . 'EE_Export.class.php');
694 694
 		EE_Export::instance()->export_sample();
695 695
 	}
@@ -706,10 +706,10 @@  discard block
 block discarded – undo
706 706
 		 * Note leaving this filter in for backward compatibility this was moved in 4.6.x
707 707
 		 * from General_Settings_Admin_Page to here.
708 708
 		 */
709
-		$this->_template_args = apply_filters( 'FHEE__General_Settings_Admin_Page__template_settings__template_args', $this->_template_args );
710
-		$this->_set_add_edit_form_tags( 'update_template_settings' );
711
-		$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
712
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'template_settings.template.php', $this->_template_args, TRUE );
709
+		$this->_template_args = apply_filters('FHEE__General_Settings_Admin_Page__template_settings__template_args', $this->_template_args);
710
+		$this->_set_add_edit_form_tags('update_template_settings');
711
+		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
712
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'template_settings.template.php', $this->_template_args, TRUE);
713 713
 		$this->display_admin_page_with_sidebar();
714 714
 	}
715 715
 
@@ -721,24 +721,24 @@  discard block
 block discarded – undo
721 721
 		 * Note leaving this filter in for backward compatibility this was moved in 4.6.x
722 722
 		 * from General_Settings_Admin_Page to here.
723 723
 		 */
724
-		EE_Registry::instance()->CFG->template_settings = apply_filters( 'FHEE__General_Settings_Admin_Page__update_template_settings__data', EE_Registry::instance()->CFG->template_settings, $this->_req_data );
724
+		EE_Registry::instance()->CFG->template_settings = apply_filters('FHEE__General_Settings_Admin_Page__update_template_settings__data', EE_Registry::instance()->CFG->template_settings, $this->_req_data);
725 725
 
726 726
 
727 727
 		//update custom post type slugs and detect if we need to flush rewrite rules
728 728
 		$old_slug = EE_Registry::instance()->CFG->core->event_cpt_slug;
729
-		EE_Registry::instance()->CFG->core->event_cpt_slug = empty( $this->_req_data['event_cpt_slug'] ) ? EE_Registry::instance()->CFG->core->event_cpt_slug : sanitize_title_with_dashes( $this->_req_data['event_cpt_slug'] );
729
+		EE_Registry::instance()->CFG->core->event_cpt_slug = empty($this->_req_data['event_cpt_slug']) ? EE_Registry::instance()->CFG->core->event_cpt_slug : sanitize_title_with_dashes($this->_req_data['event_cpt_slug']);
730 730
 
731 731
 
732 732
 		$what = 'Template Settings';
733
-		$success = $this->_update_espresso_configuration( $what, EE_Registry::instance()->CFG->template_settings, __FILE__, __FUNCTION__, __LINE__ );
733
+		$success = $this->_update_espresso_configuration($what, EE_Registry::instance()->CFG->template_settings, __FILE__, __FUNCTION__, __LINE__);
734 734
 
735 735
 
736
-		if ( EE_Registry::instance()->CFG->core->event_cpt_slug != $old_slug ) {
737
-			update_option( 'ee_flush_rewrite_rules', true );
736
+		if (EE_Registry::instance()->CFG->core->event_cpt_slug != $old_slug) {
737
+			update_option('ee_flush_rewrite_rules', true);
738 738
 		}
739 739
 
740 740
 
741
-		$this->_redirect_after_action( $success, $what, 'updated', array( 'action' => 'template_settings' ) );
741
+		$this->_redirect_after_action($success, $what, 'updated', array('action' => 'template_settings'));
742 742
 
743 743
 	}
744 744
 
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 
757 757
 		$this->verify_cpt_object();
758 758
 
759
-		add_meta_box('espresso_event_editor_event_options', __('Event Registration Options', 'event_espresso'), array( $this, 'registration_options_meta_box' ), $this->page_slug, 'side', 'core');
759
+		add_meta_box('espresso_event_editor_event_options', __('Event Registration Options', 'event_espresso'), array($this, 'registration_options_meta_box'), $this->page_slug, 'side', 'core');
760 760
 		//add_meta_box('espresso_event_types', __('Event Type', 'event_espresso'), array( $this, 'event_type_meta_box' ), $this->page_slug, 'side', 'default' ); //add this back in when the feature is ready.
761 761
 
762 762
 		//todo feature in progress
@@ -780,16 +780,16 @@  discard block
 block discarded – undo
780 780
 			array('id' => true, 'text' => __('Yes', 'event_espresso')),
781 781
 			array('id' => false, 'text' => __('No', 'event_espresso'))
782 782
 		);
783
-		$default_reg_status_values = EEM_Registration::reg_status_array(array(EEM_Registration::status_id_cancelled, EEM_Registration::status_id_declined, EEM_Registration::status_id_incomplete ), TRUE);
783
+		$default_reg_status_values = EEM_Registration::reg_status_array(array(EEM_Registration::status_id_cancelled, EEM_Registration::status_id_declined, EEM_Registration::status_id_incomplete), TRUE);
784 784
 		$template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status(FALSE);
785 785
 		$template_args['_event'] = $this->_cpt_model_obj;
786 786
 		$template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
787 787
 		$template_args['default_registration_status'] = EEH_Form_Fields::select_input('default_reg_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status());
788 788
 		$template_args['display_description'] = EEH_Form_Fields::select_input('display_desc', $yes_no_values, $this->_cpt_model_obj->display_description());
789 789
 		$template_args['display_ticket_selector'] = EEH_Form_Fields::select_input('display_ticket_selector', $yes_no_values, $this->_cpt_model_obj->display_ticket_selector(), '', '', false);
790
-		$template_args['EVT_default_registration_status'] = EEH_Form_Fields::select_input('EVT_default_registration_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status() );
791
-		$template_args['additional_registration_options'] = apply_filters( 'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options', '', $template_args, $yes_no_values, $default_reg_status_values );
792
-		$templatepath = EVENTS_CAF_TEMPLATE_PATH . 'event_registration_options.template.php';
790
+		$template_args['EVT_default_registration_status'] = EEH_Form_Fields::select_input('EVT_default_registration_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status());
791
+		$template_args['additional_registration_options'] = apply_filters('FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options', '', $template_args, $yes_no_values, $default_reg_status_values);
792
+		$templatepath = EVENTS_CAF_TEMPLATE_PATH.'event_registration_options.template.php';
793 793
 		EEH_Template::display_template($templatepath, $template_args);
794 794
 	}
795 795
 
@@ -802,9 +802,9 @@  discard block
 block discarded – undo
802 802
 	 * @param  array  $box  metabox args
803 803
 	 * @return string       metabox contents
804 804
 	 */
805
-	public function event_type_meta_box( $post, $box ) {
806
-		$template_args['radio_list'] = $this->wp_terms_radio($post->ID, array( 'taxonomy' => 'espresso_event_type' ) );
807
-		$template = EVENTS_CAF_TEMPLATE_PATH . 'event_type_metabox_contents.template.php';
805
+	public function event_type_meta_box($post, $box) {
806
+		$template_args['radio_list'] = $this->wp_terms_radio($post->ID, array('taxonomy' => 'espresso_event_type'));
807
+		$template = EVENTS_CAF_TEMPLATE_PATH.'event_type_metabox_contents.template.php';
808 808
 		EEH_Template::display_template($template, $template_args);
809 809
 	}
810 810
 
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 
815 815
 
816 816
 
817
-	public function wp_terms_radio( $post_id = 0, $args = array() ) {
817
+	public function wp_terms_radio($post_id = 0, $args = array()) {
818 818
 		$defaults = array(
819 819
 			'descendants_and_self' => 0,
820 820
 			'selected_cats' => false,
@@ -823,11 +823,11 @@  discard block
 block discarded – undo
823 823
 			'taxonomy' => 'category',
824 824
 			'checked_ontop' => true
825 825
 		);
826
-		$args = apply_filters( 'wp_terms_checklist_args', $args, $post_id );
826
+		$args = apply_filters('wp_terms_checklist_args', $args, $post_id);
827 827
 
828
-		extract( wp_parse_args($args, $defaults), EXTR_SKIP );
828
+		extract(wp_parse_args($args, $defaults), EXTR_SKIP);
829 829
 
830
-		if ( empty($walker) || !is_a($walker, 'Walker') )
830
+		if (empty($walker) || ! is_a($walker, 'Walker'))
831 831
 			$walker = new Walker_Radio_Checklist;
832 832
 
833 833
 		$descendants_and_self = (int) $descendants_and_self;
@@ -835,37 +835,37 @@  discard block
 block discarded – undo
835 835
 		$args = array('taxonomy' => $taxonomy);
836 836
 
837 837
 		$tax = get_taxonomy($taxonomy);
838
-		$args['disabled'] = !current_user_can($tax->cap->assign_terms);
838
+		$args['disabled'] = ! current_user_can($tax->cap->assign_terms);
839 839
 
840
-		if ( is_array( $selected_cats ) )
840
+		if (is_array($selected_cats))
841 841
 			$args['selected_cats'] = $selected_cats;
842
-		elseif ( $post_id )
842
+		elseif ($post_id)
843 843
 			$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids')));
844 844
 		else
845 845
 			$args['selected_cats'] = array();
846 846
 
847
-		if ( is_array( $popular_cats ) )
847
+		if (is_array($popular_cats))
848 848
 			$args['popular_cats'] = $popular_cats;
849 849
 		else
850
-			$args['popular_cats'] = get_terms( $taxonomy, array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
850
+			$args['popular_cats'] = get_terms($taxonomy, array('fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false));
851 851
 
852
-		if ( $descendants_and_self ) {
853
-			$categories = (array) get_terms($taxonomy, array( 'child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0 ) );
854
-			$self = get_term( $descendants_and_self, $taxonomy );
855
-			array_unshift( $categories, $self );
852
+		if ($descendants_and_self) {
853
+			$categories = (array) get_terms($taxonomy, array('child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0));
854
+			$self = get_term($descendants_and_self, $taxonomy);
855
+			array_unshift($categories, $self);
856 856
 		} else {
857 857
 			$categories = (array) get_terms($taxonomy, array('get' => 'all'));
858 858
 		}
859 859
 
860
-		if ( $checked_ontop ) {
860
+		if ($checked_ontop) {
861 861
 			// Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
862 862
 			$checked_categories = array();
863
-			$keys = array_keys( $categories );
863
+			$keys = array_keys($categories);
864 864
 
865
-			foreach( $keys as $k ) {
866
-				if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) {
865
+			foreach ($keys as $k) {
866
+				if (in_array($categories[$k]->term_id, $args['selected_cats'])) {
867 867
 					$checked_categories[] = $categories[$k];
868
-					unset( $categories[$k] );
868
+					unset($categories[$k]);
869 869
 				}
870 870
 			}
871 871
 
@@ -890,18 +890,18 @@  discard block
 block discarded – undo
890 890
 	 * @param  array  $list_table_obj the list table object
891 891
 	 * @return array                  new filters
892 892
 	 */
893
-	public function list_table_filters( $oldfilters, $list_table_obj ) {
893
+	public function list_table_filters($oldfilters, $list_table_obj) {
894 894
 		$filters = array();
895 895
 
896 896
 		//first month/year filters
897 897
 		$filters[] = $this->espresso_event_months_dropdown();
898 898
 
899 899
 
900
-		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL;
900
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : NULL;
901 901
 
902 902
 		//active status dropdown
903
-		if ( $status !== 'draft' )
904
-			$filter[] = $this->active_status_dropdown( isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : '' );
903
+		if ($status !== 'draft')
904
+			$filter[] = $this->active_status_dropdown(isset($this->_req_data['active_status']) ? $this->_req_data['active_status'] : '');
905 905
 
906 906
 		//category filter
907 907
 		$filters[] = $this->category_dropdown();
@@ -923,17 +923,17 @@  discard block
 block discarded – undo
923 923
 	 */
924 924
 	public function espresso_event_months_dropdown() {
925 925
 		//what we need to do is get all PRIMARY datetimes for all events to filter on. Note we need to include any other filters that are set!
926
-		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL;
926
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : NULL;
927 927
 
928 928
 		//categories?
929
-		$category = isset( $this->_req_data['EVT_CAT'] ) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
929
+		$category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
930 930
 
931 931
 		//active status?
932
-		$active_status = isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : NULL;
932
+		$active_status = isset($this->_req_data['active_status']) ? $this->_req_data['active_status'] : NULL;
933 933
 
934 934
 		$cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : '';
935 935
 
936
-		return EEH_Form_Fields::generate_event_months_dropdown( $cur_date, $status, $category, $active_status );
936
+		return EEH_Form_Fields::generate_event_months_dropdown($cur_date, $status, $category, $active_status);
937 937
 	}
938 938
 
939 939
 
@@ -944,12 +944,12 @@  discard block
 block discarded – undo
944 944
 	 * @param  string $current_value whatever the ucrrent active status is
945 945
 	 * @return string                html dropdown.
946 946
 	 */
947
-	public function  active_status_dropdown( $current_value = '' ) {
947
+	public function  active_status_dropdown($current_value = '') {
948 948
 		$select_name = 'active_status';
949
-		$values = array('none' => __('Show Active/Inactive', 'event_espresso'), 'active' => __('Active', 'event_espresso'), 'upcoming' => __('Upcoming', 'event_espresso'), 'expired' => __('Expired', 'event_espresso'), 'inactive' => __('Inactive', 'event_espresso') );
949
+		$values = array('none' => __('Show Active/Inactive', 'event_espresso'), 'active' => __('Active', 'event_espresso'), 'upcoming' => __('Upcoming', 'event_espresso'), 'expired' => __('Expired', 'event_espresso'), 'inactive' => __('Inactive', 'event_espresso'));
950 950
 		$id = 'id="espresso-active-status-dropdown-filter"';
951 951
 		$class = 'wide';
952
-		echo EEH_Form_Fields::select_input( $select_name, $values, $current_value, $id, $class );
952
+		echo EEH_Form_Fields::select_input($select_name, $values, $current_value, $id, $class);
953 953
 	}
954 954
 
955 955
 
@@ -961,9 +961,9 @@  discard block
 block discarded – undo
961 961
 	 * @return string html
962 962
 	 */
963 963
 	public function category_dropdown() {
964
-		$cur_cat = isset( $this->_req_data['EVT_CAT'] ) ? $this->_req_data['EVT_CAT'] : -1;
964
+		$cur_cat = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1;
965 965
 
966
-		return EEH_Form_Fields::generate_event_category_dropdown( $cur_cat );
966
+		return EEH_Form_Fields::generate_event_category_dropdown($cur_cat);
967 967
 	}
968 968
 
969 969
 
@@ -975,14 +975,14 @@  discard block
 block discarded – undo
975 975
 	 * @return int
976 976
 	 */
977 977
 	public function total_events_today() {
978
-		$start = EEM_Datetime::instance()->convert_datetime_for_query( 'DTT_EVT_start', date('Y-m-d' ) . ' 00:00:00', 'Y-m-d H:i:s', 'UTC' );
979
-		$end = EEM_Datetime::instance()->convert_datetime_for_query( 'DTT_EVT_start', date('Y-m-d' ) . ' 23:59:59', 'Y-m-d H:i:s', 'UTC' );
978
+		$start = EEM_Datetime::instance()->convert_datetime_for_query('DTT_EVT_start', date('Y-m-d').' 00:00:00', 'Y-m-d H:i:s', 'UTC');
979
+		$end = EEM_Datetime::instance()->convert_datetime_for_query('DTT_EVT_start', date('Y-m-d').' 23:59:59', 'Y-m-d H:i:s', 'UTC');
980 980
 
981 981
 		$where = array(
982
-			'Datetime.DTT_EVT_start' => array( 'BETWEEN', array($start, $end ) )
982
+			'Datetime.DTT_EVT_start' => array('BETWEEN', array($start, $end))
983 983
 			);
984 984
 
985
-		$count = EEM_Event::instance()->count( array( $where, 'caps' => 'read_admin' ), 'EVT_ID', true );
985
+		$count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
986 986
 		return $count;
987 987
 	}
988 988
 
@@ -997,14 +997,14 @@  discard block
 block discarded – undo
997 997
 		$this_year_r = date('Y');
998 998
 		$this_month_r = date('m');
999 999
 		$days_this_month = date('t');
1000
-		$start = EEM_Datetime::instance()->convert_datetime_for_query( 'DTT_EVT_start', $this_year_r . '-' . $this_month_r . '-01 00:00:00', 'Y-m-d H:i:s', 'UTC' );
1001
-		$end = EEM_Datetime::instance()->convert_datetime_for_query( 'DTT_EVT_start', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' 23:59:59', 'Y-m-d H:i:s', 'UTC' );
1000
+		$start = EEM_Datetime::instance()->convert_datetime_for_query('DTT_EVT_start', $this_year_r.'-'.$this_month_r.'-01 00:00:00', 'Y-m-d H:i:s', 'UTC');
1001
+		$end = EEM_Datetime::instance()->convert_datetime_for_query('DTT_EVT_start', $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' 23:59:59', 'Y-m-d H:i:s', 'UTC');
1002 1002
 
1003 1003
 		$where = array(
1004
-			'Datetime.DTT_EVT_start' => array( 'BETWEEN', array($start, $end ) )
1004
+			'Datetime.DTT_EVT_start' => array('BETWEEN', array($start, $end))
1005 1005
 			);
1006 1006
 
1007
-		$count = EEM_Event::instance()->count( array( $where, 'caps' => 'read_admin' ), 'EVT_ID', true );
1007
+		$count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
1008 1008
 		return $count;
1009 1009
 	}
1010 1010
 
@@ -1021,53 +1021,53 @@  discard block
 block discarded – undo
1021 1021
 
1022 1022
 
1023 1023
 
1024
-	public function get_default_tickets( $per_page = 10, $count = FALSE, $trashed = FALSE ) {
1024
+	public function get_default_tickets($per_page = 10, $count = FALSE, $trashed = FALSE) {
1025 1025
 
1026
-		$orderby= empty( $this->_req_data['orderby'] ) ? 'TKT_name' : $this->_req_data['orderby'];
1027
-		$order = empty( $this->_req_data['order'] ) ? 'ASC' : $this->_req_data['order'];
1026
+		$orderby = empty($this->_req_data['orderby']) ? 'TKT_name' : $this->_req_data['orderby'];
1027
+		$order = empty($this->_req_data['order']) ? 'ASC' : $this->_req_data['order'];
1028 1028
 
1029
-		switch ( $orderby ) {
1029
+		switch ($orderby) {
1030 1030
 			case 'TKT_name' :
1031
-				$orderby = array( 'TKT_name' => $order );
1031
+				$orderby = array('TKT_name' => $order);
1032 1032
 				break;
1033 1033
 
1034 1034
 			case 'TKT_price' :
1035
-				$orderby = array( 'TKT_price' => $order );
1035
+				$orderby = array('TKT_price' => $order);
1036 1036
 				break;
1037 1037
 
1038 1038
 			case 'TKT_uses' :
1039
-				$orderby = array( 'TKT_uses' => $order );
1039
+				$orderby = array('TKT_uses' => $order);
1040 1040
 				break;
1041 1041
 
1042 1042
 			case 'TKT_min' :
1043
-				$orderby = array( 'TKT_min' => $order );
1043
+				$orderby = array('TKT_min' => $order);
1044 1044
 				break;
1045 1045
 
1046 1046
 			case 'TKT_max' :
1047
-				$orderby = array( 'TKT_max' => $order );
1047
+				$orderby = array('TKT_max' => $order);
1048 1048
 				break;
1049 1049
 
1050 1050
 			case 'TKT_qty' :
1051
-				$orderby = array( 'TKT_qty' => $order );
1051
+				$orderby = array('TKT_qty' => $order);
1052 1052
 				break;
1053 1053
 		}
1054 1054
 
1055
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
1056
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
1055
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
1056
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
1057 1057
 
1058 1058
 		$_where = array(
1059 1059
 			'TKT_is_default' => 1,
1060 1060
 			'TKT_deleted' => $trashed
1061 1061
 			);
1062 1062
 
1063
-		$offset = ($current_page-1)*$per_page;
1064
-		$limit = array( $offset, $per_page );
1063
+		$offset = ($current_page - 1) * $per_page;
1064
+		$limit = array($offset, $per_page);
1065 1065
 
1066
-		if ( isset( $this->_req_data['s'] ) ) {
1067
-			$sstr = '%' . $this->_req_data['s'] . '%';
1066
+		if (isset($this->_req_data['s'])) {
1067
+			$sstr = '%'.$this->_req_data['s'].'%';
1068 1068
 			$_where['OR'] = array(
1069
-				'TKT_name' => array('LIKE',$sstr ),
1070
-				'TKT_description' => array('LIKE',$sstr )
1069
+				'TKT_name' => array('LIKE', $sstr),
1070
+				'TKT_description' => array('LIKE', $sstr)
1071 1071
 				);
1072 1072
 		}
1073 1073
 
@@ -1078,9 +1078,9 @@  discard block
 block discarded – undo
1078 1078
 			'group_by'=>'TKT_ID'
1079 1079
 			);
1080 1080
 
1081
-		if($count){
1081
+		if ($count) {
1082 1082
 			return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
1083
-		}else{
1083
+		} else {
1084 1084
 			return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
1085 1085
 		}
1086 1086
 
@@ -1090,35 +1090,35 @@  discard block
 block discarded – undo
1090 1090
 
1091 1091
 
1092 1092
 
1093
-	protected function _trash_or_restore_ticket(  $trash = FALSE ) {
1093
+	protected function _trash_or_restore_ticket($trash = FALSE) {
1094 1094
 		$success = 1;
1095 1095
 
1096 1096
 		$TKT = EEM_Ticket::instance();
1097 1097
 
1098 1098
 		//checkboxes?
1099
-		if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) {
1099
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1100 1100
 			//if array has more than one element then success message should be plural
1101
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
1101
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1102 1102
 
1103 1103
 			//cycle thru the boxes
1104
-			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
1105
-				if ( $trash ) {
1106
-					if ( ! $TKT->delete_by_ID( $TKT_ID ) )
1104
+			while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
1105
+				if ($trash) {
1106
+					if ( ! $TKT->delete_by_ID($TKT_ID))
1107 1107
 						$success = 0;
1108 1108
 				} else {
1109
-					if ( ! $TKT->restore_by_ID( $TKT_ID ) )
1109
+					if ( ! $TKT->restore_by_ID($TKT_ID))
1110 1110
 						$success = 0;
1111 1111
 				}
1112 1112
 			}
1113 1113
 		} else {
1114 1114
 			//grab single id and trash
1115
-			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
1115
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
1116 1116
 
1117
-			if ( $trash ) {
1118
-				if ( ! $TKT->delete_by_ID( $TKT_ID ) )
1117
+			if ($trash) {
1118
+				if ( ! $TKT->delete_by_ID($TKT_ID))
1119 1119
 					$success = 0;
1120 1120
 			} else {
1121
-				if ( ! $TKT->restore_by_ID( $TKT_ID ) )
1121
+				if ( ! $TKT->restore_by_ID($TKT_ID))
1122 1122
 					$success = 0;
1123 1123
 			}
1124 1124
 		}
@@ -1128,7 +1128,7 @@  discard block
 block discarded – undo
1128 1128
 			'action' => 'ticket_list_table',
1129 1129
 			'status' => $trash ? '' : 'trashed'
1130 1130
 			);
1131
-		$this->_redirect_after_action( $success, 'Tickets', $action_desc, $query_args );
1131
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, $query_args);
1132 1132
 	}
1133 1133
 
1134 1134
 
@@ -1141,21 +1141,21 @@  discard block
 block discarded – undo
1141 1141
 		$TKT = EEM_Ticket::instance();
1142 1142
 
1143 1143
 		//checkboxes?
1144
-		if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) {
1144
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1145 1145
 			//if array has more than one element then success message should be plural
1146
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
1146
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1147 1147
 
1148 1148
 			//cycle thru the boxes
1149
-			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
1149
+			while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
1150 1150
 				//delete
1151
-				if ( ! $this->_delete_the_ticket( $TKT_ID ) ) {
1151
+				if ( ! $this->_delete_the_ticket($TKT_ID)) {
1152 1152
 					$success = 0;
1153 1153
 				}
1154 1154
 			}
1155 1155
 		} else {
1156 1156
 			//grab single id and trash
1157
-			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
1158
-			if ( ! $this->_delete_the_ticket( $TKT_ID ) ) {
1157
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
1158
+			if ( ! $this->_delete_the_ticket($TKT_ID)) {
1159 1159
 					$success = 0;
1160 1160
 				}
1161 1161
 		}
@@ -1167,16 +1167,16 @@  discard block
 block discarded – undo
1167 1167
 			);
1168 1168
 
1169 1169
 		//failsafe.  If the default ticket count === 1 then we need to redirect to event overview.
1170
-		if ( EEM_Ticket::instance()->count_deleted_and_undeleted( array( array( 'TKT_is_default' => 1 ) ), 'TKT_ID', TRUE ) )
1170
+		if (EEM_Ticket::instance()->count_deleted_and_undeleted(array(array('TKT_is_default' => 1)), 'TKT_ID', TRUE))
1171 1171
 			$query_args = array();
1172
-		$this->_redirect_after_action( $success, 'Tickets', $action_desc, $query_args );
1172
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, $query_args);
1173 1173
 	}
1174 1174
 
1175 1175
 
1176 1176
 
1177 1177
 
1178
-	protected function _delete_the_ticket( $TKT_ID ) {
1179
-		$tkt = EEM_Ticket::instance()->get_one_by_ID( $TKT_ID );
1178
+	protected function _delete_the_ticket($TKT_ID) {
1179
+		$tkt = EEM_Ticket::instance()->get_one_by_ID($TKT_ID);
1180 1180
 		$tkt->_remove_relations('Datetime');
1181 1181
 		//delete all related prices first
1182 1182
 		$tkt->delete_related_permanently('Price');
Please login to merge, or discard this patch.
Braces   +44 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -453,8 +454,9 @@  discard block
 block discarded – undo
453 454
 		//k we've got EVT_ID so let's use that to get the event we'll duplicate
454 455
 		$orig_event = EEM_Event::instance()->get_one_by_ID( $this->_req_data['EVT_ID'] );
455 456
 
456
-		if ( ! $orig_event instanceof EE_Event )
457
-			throw new EE_Error( sprintf( __('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso'), $this->_req_data['EVT_ID'] ) );
457
+		if ( ! $orig_event instanceof EE_Event ) {
458
+					throw new EE_Error( sprintf( __('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso'), $this->_req_data['EVT_ID'] ) );
459
+		}
458 460
 
459 461
 		//k now let's clone the $orig_event before getting relations
460 462
 		$new_event = clone $orig_event;
@@ -528,8 +530,9 @@  discard block
 block discarded – undo
528 530
 			//now let's get the ticket relations setup.
529 531
 			foreach ( (array) $orig_tkts as $orig_tkt ) {
530 532
 				//it's possible a datetime will have no tickets so let's verify we HAVE a ticket first.
531
-				if ( ! $orig_tkt instanceof EE_Ticket )
532
-					continue;
533
+				if ( ! $orig_tkt instanceof EE_Ticket ) {
534
+									continue;
535
+				}
533 536
 
534 537
 				//is this ticket archived?  If it is then let's skip
535 538
 				if ( $orig_tkt->get( 'TKT_deleted' ) ) {
@@ -638,9 +641,9 @@  discard block
 block discarded – undo
638 641
 	protected function _events_export() {
639 642
 		if(isset($this->_req_data['EVT_ID'])){
640 643
 			$event_ids = $this->_req_data['EVT_ID'];
641
-		}elseif(isset($this->_req_data['EVT_IDs'])){
644
+		} elseif(isset($this->_req_data['EVT_IDs'])){
642 645
 			$event_ids = $this->_req_data['EVT_IDs'];
643
-		}else{
646
+		} else{
644 647
 			$event_ids = NULL;
645 648
 		}
646 649
 		//todo: I don't like doing this but it'll do until we modify EE_Export Class.
@@ -827,8 +830,9 @@  discard block
 block discarded – undo
827 830
 
828 831
 		extract( wp_parse_args($args, $defaults), EXTR_SKIP );
829 832
 
830
-		if ( empty($walker) || !is_a($walker, 'Walker') )
831
-			$walker = new Walker_Radio_Checklist;
833
+		if ( empty($walker) || !is_a($walker, 'Walker') ) {
834
+					$walker = new Walker_Radio_Checklist;
835
+		}
832 836
 
833 837
 		$descendants_and_self = (int) $descendants_and_self;
834 838
 
@@ -837,17 +841,19 @@  discard block
 block discarded – undo
837 841
 		$tax = get_taxonomy($taxonomy);
838 842
 		$args['disabled'] = !current_user_can($tax->cap->assign_terms);
839 843
 
840
-		if ( is_array( $selected_cats ) )
841
-			$args['selected_cats'] = $selected_cats;
842
-		elseif ( $post_id )
843
-			$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids')));
844
-		else
845
-			$args['selected_cats'] = array();
844
+		if ( is_array( $selected_cats ) ) {
845
+					$args['selected_cats'] = $selected_cats;
846
+		} elseif ( $post_id ) {
847
+					$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids')));
848
+		} else {
849
+					$args['selected_cats'] = array();
850
+		}
846 851
 
847
-		if ( is_array( $popular_cats ) )
848
-			$args['popular_cats'] = $popular_cats;
849
-		else
850
-			$args['popular_cats'] = get_terms( $taxonomy, array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
852
+		if ( is_array( $popular_cats ) ) {
853
+					$args['popular_cats'] = $popular_cats;
854
+		} else {
855
+					$args['popular_cats'] = get_terms( $taxonomy, array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
856
+		}
851 857
 
852 858
 		if ( $descendants_and_self ) {
853 859
 			$categories = (array) get_terms($taxonomy, array( 'child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0 ) );
@@ -900,8 +906,9 @@  discard block
 block discarded – undo
900 906
 		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL;
901 907
 
902 908
 		//active status dropdown
903
-		if ( $status !== 'draft' )
904
-			$filter[] = $this->active_status_dropdown( isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : '' );
909
+		if ( $status !== 'draft' ) {
910
+					$filter[] = $this->active_status_dropdown( isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : '' );
911
+		}
905 912
 
906 913
 		//category filter
907 914
 		$filters[] = $this->category_dropdown();
@@ -1080,7 +1087,7 @@  discard block
 block discarded – undo
1080 1087
 
1081 1088
 		if($count){
1082 1089
 			return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
1083
-		}else{
1090
+		} else{
1084 1091
 			return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
1085 1092
 		}
1086 1093
 
@@ -1103,11 +1110,13 @@  discard block
 block discarded – undo
1103 1110
 			//cycle thru the boxes
1104 1111
 			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
1105 1112
 				if ( $trash ) {
1106
-					if ( ! $TKT->delete_by_ID( $TKT_ID ) )
1107
-						$success = 0;
1113
+					if ( ! $TKT->delete_by_ID( $TKT_ID ) ) {
1114
+											$success = 0;
1115
+					}
1108 1116
 				} else {
1109
-					if ( ! $TKT->restore_by_ID( $TKT_ID ) )
1110
-						$success = 0;
1117
+					if ( ! $TKT->restore_by_ID( $TKT_ID ) ) {
1118
+											$success = 0;
1119
+					}
1111 1120
 				}
1112 1121
 			}
1113 1122
 		} else {
@@ -1115,11 +1124,13 @@  discard block
 block discarded – undo
1115 1124
 			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
1116 1125
 
1117 1126
 			if ( $trash ) {
1118
-				if ( ! $TKT->delete_by_ID( $TKT_ID ) )
1119
-					$success = 0;
1127
+				if ( ! $TKT->delete_by_ID( $TKT_ID ) ) {
1128
+									$success = 0;
1129
+				}
1120 1130
 			} else {
1121
-				if ( ! $TKT->restore_by_ID( $TKT_ID ) )
1122
-					$success = 0;
1131
+				if ( ! $TKT->restore_by_ID( $TKT_ID ) ) {
1132
+									$success = 0;
1133
+				}
1123 1134
 			}
1124 1135
 		}
1125 1136
 
@@ -1167,8 +1178,9 @@  discard block
 block discarded – undo
1167 1178
 			);
1168 1179
 
1169 1180
 		//failsafe.  If the default ticket count === 1 then we need to redirect to event overview.
1170
-		if ( EEM_Ticket::instance()->count_deleted_and_undeleted( array( array( 'TKT_is_default' => 1 ) ), 'TKT_ID', TRUE ) )
1171
-			$query_args = array();
1181
+		if ( EEM_Ticket::instance()->count_deleted_and_undeleted( array( array( 'TKT_is_default' => 1 ) ), 'TKT_ID', TRUE ) ) {
1182
+					$query_args = array();
1183
+		}
1172 1184
 		$this->_redirect_after_action( $success, 'Tickets', $action_desc, $query_args );
1173 1185
 	}
1174 1186
 
Please login to merge, or discard this patch.
public/Espresso_Arabica_2014/content-espresso_events-venues.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -1,69 +1,69 @@
 block discarded – undo
1 1
 <?php
2 2
 //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' &nbsp; <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>';
3 3
 if (
4
-	( is_single() && espresso_display_venue_in_event_details() )
5
-	|| ( is_archive() && espresso_display_venue_in_event_list() )
4
+	(is_single() && espresso_display_venue_in_event_details())
5
+	|| (is_archive() && espresso_display_venue_in_event_list())
6 6
 ) :
7 7
 	global $post;
8
-	do_action( 'AHEE_event_details_before_venue_details', $post );
9
-	$venue_name = espresso_venue_name( 0, 'details', FALSE );
10
-	if ( empty( $venue_name ) && espresso_is_venue_private() ) {
11
-		do_action( 'AHEE_event_details_after_venue_details', $post );
8
+	do_action('AHEE_event_details_before_venue_details', $post);
9
+	$venue_name = espresso_venue_name(0, 'details', FALSE);
10
+	if (empty($venue_name) && espresso_is_venue_private()) {
11
+		do_action('AHEE_event_details_after_venue_details', $post);
12 12
 		return '';
13 13
 	}
14 14
 ?>
15 15
 
16 16
 <div class="espresso-venue-dv<?php echo espresso_is_venue_private() ? ' espresso-private-venue-dv' : ''; ?>">
17 17
 	<h3 class="event-venues-h3 ee-event-h3">
18
-		<?php _e( 'Location', 'event_espresso' ); ?>
18
+		<?php _e('Location', 'event_espresso'); ?>
19 19
 	</h3>
20
-	<h4><strong><?php _e( 'Venue:', 'event_espresso' ); ?></strong>&nbsp;&nbsp; <strong> <?php echo $venue_name; ?></strong></h4>
20
+	<h4><strong><?php _e('Venue:', 'event_espresso'); ?></strong>&nbsp;&nbsp; <strong> <?php echo $venue_name; ?></strong></h4>
21 21
 	<p><span class="smaller-text tags-links"><?php echo espresso_venue_categories(); ?></span></p>
22
-<?php  if ( $venue_phone = espresso_venue_phone( $post->ID, FALSE )) : ?>
22
+<?php  if ($venue_phone = espresso_venue_phone($post->ID, FALSE)) : ?>
23 23
 	<p>
24
-		<span class="small-text"><strong><?php _e( 'Venue Phone:', 'event_espresso' ); ?></strong></span> <?php echo $venue_phone; ?>
24
+		<span class="small-text"><strong><?php _e('Venue Phone:', 'event_espresso'); ?></strong></span> <?php echo $venue_phone; ?>
25 25
 	</p>
26
-<?php endif;  ?>
27
-<?php if ( $venue_website = espresso_venue_website( $post->ID, FALSE )) : ?>
26
+<?php endif; ?>
27
+<?php if ($venue_website = espresso_venue_website($post->ID, FALSE)) : ?>
28 28
 	<p>
29
-		<span class="small-text"><strong><?php _e( 'Venue Website:', 'event_espresso' ); ?></strong></span> <?php echo $venue_website; ?>
29
+		<span class="small-text"><strong><?php _e('Venue Website:', 'event_espresso'); ?></strong></span> <?php echo $venue_website; ?>
30 30
 	</p>
31 31
 <?php endif; ?>
32
-<?php  if ( espresso_venue_has_address( $post->ID )) : ?>
33
-	<strong><span class="dashicons dashicons-location-alt"></span><?php _e( 'Address:', 'event_espresso' ); ?></strong>
34
-	<?php espresso_venue_address( 'inline' ); ?>
35
-	<?php espresso_venue_gmap( $post->ID ); ?>
32
+<?php  if (espresso_venue_has_address($post->ID)) : ?>
33
+	<strong><span class="dashicons dashicons-location-alt"></span><?php _e('Address:', 'event_espresso'); ?></strong>
34
+	<?php espresso_venue_address('inline'); ?>
35
+	<?php espresso_venue_gmap($post->ID); ?>
36 36
 	<div class="clear"><br/></div>
37
-<?php endif;  ?>
37
+<?php endif; ?>
38 38
 
39
-	<?php $VNU_ID = espresso_venue_id( $post->ID ); ?>
40
-	<?php if ( is_single() ) : ?>
41
-		<?php $venue_description = espresso_venue_description( $VNU_ID, FALSE ); ?>
42
-		<?php if ( $venue_description ) : ?>
39
+	<?php $VNU_ID = espresso_venue_id($post->ID); ?>
40
+	<?php if (is_single()) : ?>
41
+		<?php $venue_description = espresso_venue_description($VNU_ID, FALSE); ?>
42
+		<?php if ($venue_description) : ?>
43 43
 	<p>
44
-		<strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/>
45
-		<?php echo do_shortcode( $venue_description ); ?>
44
+		<strong><?php _e('Description:', 'event_espresso'); ?></strong><br/>
45
+		<?php echo do_shortcode($venue_description); ?>
46 46
 	</p>
47
-		<?php endif;  ?>
47
+		<?php endif; ?>
48 48
 	<?php else : ?>
49
-		<?php $venue_excerpt = espresso_venue_excerpt( $VNU_ID, FALSE ); ?>
50
-		<?php if ( $venue_excerpt ) : ?>
49
+		<?php $venue_excerpt = espresso_venue_excerpt($VNU_ID, FALSE); ?>
50
+		<?php if ($venue_excerpt) : ?>
51 51
 	<p>
52
-		<strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/>
52
+		<strong><?php _e('Description:', 'event_espresso'); ?></strong><br/>
53 53
 		<?php echo $venue_excerpt; ?>
54 54
 	</p>
55
-			<?php endif;  ?>
56
-		<?php endif;  ?>
55
+			<?php endif; ?>
56
+		<?php endif; ?>
57 57
 </div>
58 58
 <!-- .espresso-venue-dv -->
59 59
 <?php
60
-do_action( 'AHEE_event_details_after_venue_details', $post );
60
+do_action('AHEE_event_details_after_venue_details', $post);
61 61
 else :
62
-	if ( espresso_venue_is_password_protected() ) :
62
+	if (espresso_venue_is_password_protected()) :
63 63
 ?>
64 64
 	<div class="espresso-venue-dv  espresso-password-protected-venue-dv" >
65 65
 		<h3 class="event-venues-h3 ee-event-h3">
66
-			<?php _e( 'Location', 'event_espresso' );?>
66
+			<?php _e('Location', 'event_espresso'); ?>
67 67
 		</h3>
68 68
 		<?php echo espresso_password_protected_venue_form(); ?>
69 69
 	</div>
Please login to merge, or discard this patch.
Paypal_Standard/templates/paypal_standard_intro.template.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 $closing_tag = '</a>';
3 3
 //if this is decaf, which is put on WordPress.org, we need to inform users that
4 4
 //we just put an affiliate link there. See https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/ section 12
5
-if( apply_filters( 'FHEE__ee_show_affiliate_links', true ) ) {
6
-	$closing_tag .= esc_html__( ' (affiliate link)', 'event_espresso' );
5
+if (apply_filters('FHEE__ee_show_affiliate_links', true)) {
6
+	$closing_tag .= esc_html__(' (affiliate link)', 'event_espresso');
7 7
 }
8
-printf( esc_html__('PayPal Standard (PayPal Payments Standard) is an off-site payment method and is available to event organizers in many countries. A PayPal premier or business account is needed to accept payments. Need a PayPal account? Call 1-855-456-1338 or %1$sclick here to sign up for a merchant account%2$s.', 'event_espresso'), '<a href="https://eventespresso.com/go/paypalstandard/" target="_blank">', $closing_tag );
9 8
\ No newline at end of file
9
+printf(esc_html__('PayPal Standard (PayPal Payments Standard) is an off-site payment method and is available to event organizers in many countries. A PayPal premier or business account is needed to accept payments. Need a PayPal account? Call 1-855-456-1338 or %1$sclick here to sign up for a merchant account%2$s.', 'event_espresso'), '<a href="https://eventespresso.com/go/paypalstandard/" target="_blank">', $closing_tag);
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
Paypal_Standard/templates/paypal_standard_settings_before_form.template.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('No direct script access allowed');
5 5
 /**
6 6
  * Event Espresso
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  * ------------------------------------------------------------------------
26 26
  */
27 27
 ?>
28
-<strong style="color:#F00"><?php esc_html_e('Please Note:','event_espresso')?></strong> <?php esc_html_e("You will need a PayPal Premier or Business account for the PayPal IPN to work correctly.", 'event_espresso');
28
+<strong style="color:#F00"><?php esc_html_e('Please Note:', 'event_espresso')?></strong> <?php esc_html_e("You will need a PayPal Premier or Business account for the PayPal IPN to work correctly.", 'event_espresso');
29 29
 
30 30
 
31 31
 // End of file paypal_standard_settings_before_form.template.php
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if (!defined('EVENT_ESPRESSO_VERSION')) {
4 4
 	exit('No direct script access allowed');
5
+}
5 6
 /**
6 7
  * Event Espresso
7 8
  *
Please login to merge, or discard this patch.
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -3,27 +3,27 @@
 block discarded – undo
3 3
 if (!defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('No direct script access allowed');
5 5
 /**
6
- * Event Espresso
7
- *
8
- * Event Registration and Management Plugin for WordPress
9
- *
10
- * @ package			Event Espresso
11
- * @ author			Seth Shoultes
12
- * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
13
- * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
14
- * @ link					http://www.eventespresso.com
15
- * @ version		 	4.3
16
- *
17
- * ------------------------------------------------------------------------
18
- *
19
- * paypal_standard_settings_before_form
20
- *
21
- * @package			Event Espresso
22
- * @subpackage		
23
- * @author				Mike Nelson
24
- *
25
- * ------------------------------------------------------------------------
26
- */
6
+	 * Event Espresso
7
+	 *
8
+	 * Event Registration and Management Plugin for WordPress
9
+	 *
10
+	 * @ package			Event Espresso
11
+	 * @ author			Seth Shoultes
12
+	 * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
13
+	 * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
14
+	 * @ link					http://www.eventespresso.com
15
+	 * @ version		 	4.3
16
+	 *
17
+	 * ------------------------------------------------------------------------
18
+	 *
19
+	 * paypal_standard_settings_before_form
20
+	 *
21
+	 * @package			Event Espresso
22
+	 * @subpackage		
23
+	 * @author				Mike Nelson
24
+	 *
25
+	 * ------------------------------------------------------------------------
26
+	 */
27 27
 ?>
28 28
 <strong style="color:#F00"><?php esc_html_e('Please Note:','event_espresso')?></strong> <?php esc_html_e("You will need a PayPal Premier or Business account for the PayPal IPN to work correctly.", 'event_espresso');
29 29
 
Please login to merge, or discard this patch.
espresso.php 1 patch
Spacing   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined( 'ABSPATH' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('ABSPATH')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /*
5 5
   Plugin Name:		Event Espresso
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
  *
42 42
  */
43 43
 
44
-if ( function_exists( 'espresso_version' ) ) {
44
+if (function_exists('espresso_version')) {
45 45
 
46 46
 	/**
47 47
 	 *    espresso_duplicate_plugin_error
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
 	function espresso_duplicate_plugin_error() {
51 51
 		?>
52 52
 		<div class="error">
53
-			<p><?php _e( 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso' ); ?></p>
53
+			<p><?php _e('Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso'); ?></p>
54 54
 		</div>
55 55
 		<?php
56
-		espresso_deactivate_plugin( plugin_basename( __FILE__ ) );
56
+		espresso_deactivate_plugin(plugin_basename(__FILE__));
57 57
 	}
58
-	add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 );
58
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
59 59
 
60 60
 } else {
61 61
 
@@ -66,103 +66,103 @@  discard block
 block discarded – undo
66 66
 	 * @return string
67 67
 	 */
68 68
 	function espresso_version() {
69
-		return apply_filters( 'FHEE__espresso__espresso_version', '4.9.5.rc.007' );
69
+		return apply_filters('FHEE__espresso__espresso_version', '4.9.5.rc.007');
70 70
 	}
71 71
 
72 72
 	// define versions
73
-	define( 'EVENT_ESPRESSO_VERSION', espresso_version() );
74
-	define( 'EE_MIN_WP_VER_REQUIRED', '4.1' );
75
-	define( 'EE_MIN_WP_VER_RECOMMENDED', '4.4.2' );
76
-	define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' );
77
-	define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.44' );
78
-	define( 'EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - ' . EVENT_ESPRESSO_VERSION );
79
-	define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ );
73
+	define('EVENT_ESPRESSO_VERSION', espresso_version());
74
+	define('EE_MIN_WP_VER_REQUIRED', '4.1');
75
+	define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2');
76
+	define('EE_MIN_PHP_VER_REQUIRED', '5.3.0');
77
+	define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44');
78
+	define('EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - '.EVENT_ESPRESSO_VERSION);
79
+	define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
80 80
 	//used to be DIRECTORY_SEPARATOR, but that caused issues on windows
81
-	if ( ! defined( 'DS' ) ) {
82
-		define( 'DS', '/' );
81
+	if ( ! defined('DS')) {
82
+		define('DS', '/');
83 83
 	}
84
-	if ( ! defined( 'PS' ) ) {
85
-		define( 'PS', PATH_SEPARATOR );
84
+	if ( ! defined('PS')) {
85
+		define('PS', PATH_SEPARATOR);
86 86
 	}
87
-	if ( ! defined( 'SP' ) ) {
88
-		define( 'SP', ' ' );
87
+	if ( ! defined('SP')) {
88
+		define('SP', ' ');
89 89
 	}
90
-	if ( ! defined( 'EENL' ) ) {
91
-		define( 'EENL', "\n" );
90
+	if ( ! defined('EENL')) {
91
+		define('EENL', "\n");
92 92
 	}
93
-	define( 'EE_SUPPORT_EMAIL', '[email protected]' );
93
+	define('EE_SUPPORT_EMAIL', '[email protected]');
94 94
 	// define the plugin directory and URL
95
-	define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE ) );
96
-	define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE ) );
97
-	define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE ) );
95
+	define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE));
96
+	define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE));
97
+	define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE));
98 98
 	// main root folder paths
99
-	define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS );
100
-	define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS );
101
-	define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS );
102
-	define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS );
103
-	define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS );
104
-	define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS );
105
-	define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS );
106
-	define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS );
99
+	define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS);
100
+	define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS);
101
+	define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS);
102
+	define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS);
103
+	define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS);
104
+	define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS);
105
+	define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS);
106
+	define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS);
107 107
 	// core system paths
108
-	define( 'EE_ADMIN', EE_CORE . 'admin' . DS );
109
-	define( 'EE_CPTS', EE_CORE . 'CPTs' . DS );
110
-	define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS );
111
-	define( 'EE_INTERFACES', EE_CORE . 'interfaces' . DS );
112
-	define( 'EE_BUSINESS', EE_CORE . 'business' . DS );
113
-	define( 'EE_MODELS', EE_CORE . 'db_models' . DS );
114
-	define( 'EE_HELPERS', EE_CORE . 'helpers' . DS );
115
-	define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS );
116
-	define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS );
117
-	define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS );
118
-	define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS );
119
-	define( 'EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS );
108
+	define('EE_ADMIN', EE_CORE.'admin'.DS);
109
+	define('EE_CPTS', EE_CORE.'CPTs'.DS);
110
+	define('EE_CLASSES', EE_CORE.'db_classes'.DS);
111
+	define('EE_INTERFACES', EE_CORE.'interfaces'.DS);
112
+	define('EE_BUSINESS', EE_CORE.'business'.DS);
113
+	define('EE_MODELS', EE_CORE.'db_models'.DS);
114
+	define('EE_HELPERS', EE_CORE.'helpers'.DS);
115
+	define('EE_LIBRARIES', EE_CORE.'libraries'.DS);
116
+	define('EE_TEMPLATES', EE_CORE.'templates'.DS);
117
+	define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS);
118
+	define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS);
119
+	define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS);
120 120
 	// gateways
121
-	define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS );
122
-	define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS );
121
+	define('EE_GATEWAYS', EE_MODULES.'gateways'.DS);
122
+	define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS);
123 123
 	// asset URL paths
124
-	define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS );
125
-	define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS );
126
-	define( 'EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS );
127
-	define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS );
128
-	define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' );
129
-	define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/' );
124
+	define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS);
125
+	define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS);
126
+	define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS);
127
+	define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS);
128
+	define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/');
129
+	define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/');
130 130
 	// define upload paths
131 131
 	$uploads = wp_upload_dir();
132 132
 	// define the uploads directory and URL
133
-	define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS );
134
-	define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS );
133
+	define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS);
134
+	define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS);
135 135
 	// define the templates directory and URL
136
-	define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'templates' . DS );
137
-	define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'templates' . DS );
136
+	define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS);
137
+	define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS);
138 138
 	// define the gateway directory and URL
139
-	define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'gateways' . DS );
140
-	define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'gateways' . DS );
139
+	define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS);
140
+	define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS);
141 141
 	// languages folder/path
142
-	define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS );
143
-	define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS );
142
+	define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS);
143
+	define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS);
144 144
 	//check for dompdf fonts in uploads
145
-	if ( file_exists( EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ) {
146
-		define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS );
145
+	if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) {
146
+		define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS);
147 147
 	}
148 148
 	//ajax constants
149
-	define( 'EE_FRONT_AJAX', isset( $_REQUEST[ 'ee_front_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_front_ajax' ] ) ? true : false );
150
-	define( 'EE_ADMIN_AJAX', isset( $_REQUEST[ 'ee_admin_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_admin_ajax' ] ) ? true : false );
149
+	define('EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false);
150
+	define('EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false);
151 151
 	//just a handy constant occasionally needed for finding values representing infinity in the DB
152 152
 	//you're better to use this than its straight value (currently -1) in case you ever
153 153
 	//want to change its default value! or find when -1 means infinity
154
-	define( 'EE_INF_IN_DB', -1 );
155
-	define( 'EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX );
156
-	define( 'EE_DEBUG', false );
154
+	define('EE_INF_IN_DB', -1);
155
+	define('EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX);
156
+	define('EE_DEBUG', false);
157 157
 
158 158
 	/**
159 159
 	 *    espresso_plugin_activation
160 160
 	 *    adds a wp-option to indicate that EE has been activated via the WP admin plugins page
161 161
 	 */
162 162
 	function espresso_plugin_activation() {
163
-		update_option( 'ee_espresso_activation', true );
163
+		update_option('ee_espresso_activation', true);
164 164
 	}
165
-	register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' );
165
+	register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
166 166
 
167 167
 
168 168
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 		//	}
177 177
 		//
178 178
 	}
179
-	register_deactivation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation' );
179
+	register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation');
180 180
 
181 181
 
182 182
 
@@ -186,15 +186,15 @@  discard block
 block discarded – undo
186 186
 	 */
187 187
 	function espresso_load_error_handling() {
188 188
 		// load debugging tools
189
-		if ( WP_DEBUG === true && is_readable( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ) ) {
190
-			require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' );
189
+		if (WP_DEBUG === true && is_readable(EE_HELPERS.'EEH_Debug_Tools.helper.php')) {
190
+			require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php');
191 191
 			EEH_Debug_Tools::instance();
192 192
 		}
193 193
 		// load error handling
194
-		if ( is_readable( EE_CORE . 'EE_Error.core.php' ) ) {
195
-			require_once( EE_CORE . 'EE_Error.core.php' );
194
+		if (is_readable(EE_CORE.'EE_Error.core.php')) {
195
+			require_once(EE_CORE.'EE_Error.core.php');
196 196
 		} else {
197
-			wp_die( __( 'The EE_Error core class could not be loaded.', 'event_espresso' ) );
197
+			wp_die(__('The EE_Error core class could not be loaded.', 'event_espresso'));
198 198
 		}
199 199
 	}
200 200
 
@@ -208,25 +208,25 @@  discard block
 block discarded – undo
208 208
 	 * @param    string $full_path_to_file
209 209
 	 * @throws    EE_Error
210 210
 	 */
211
-	function espresso_load_required( $classname, $full_path_to_file ) {
211
+	function espresso_load_required($classname, $full_path_to_file) {
212 212
 		static $error_handling_loaded = false;
213
-		if ( ! $error_handling_loaded ) {
213
+		if ( ! $error_handling_loaded) {
214 214
 			espresso_load_error_handling();
215 215
 			$error_handling_loaded = true;
216 216
 		}
217
-		if ( is_readable( $full_path_to_file ) ) {
218
-			require_once( $full_path_to_file );
217
+		if (is_readable($full_path_to_file)) {
218
+			require_once($full_path_to_file);
219 219
 		} else {
220
-			throw new EE_Error ( sprintf(
221
-				__( 'The %s class file could not be located or is not readable due to file permissions.', 'event_espresso' ),
220
+			throw new EE_Error(sprintf(
221
+				__('The %s class file could not be located or is not readable due to file permissions.', 'event_espresso'),
222 222
 				$classname
223
-			) );
223
+			));
224 224
 		}
225 225
 	}
226 226
 
227
-	espresso_load_required( 'EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' );
228
-	espresso_load_required( 'EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' );
229
-	espresso_load_required( 'EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php' );
227
+	espresso_load_required('EEH_Base', EE_CORE.'helpers'.DS.'EEH_Base.helper.php');
228
+	espresso_load_required('EEH_File', EE_CORE.'helpers'.DS.'EEH_File.helper.php');
229
+	espresso_load_required('EE_Bootstrap', EE_CORE.'EE_Bootstrap.core.php');
230 230
 	new EE_Bootstrap();
231 231
 
232 232
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
 
237 237
 
238
-if ( ! function_exists( 'espresso_deactivate_plugin' ) ) {
238
+if ( ! function_exists('espresso_deactivate_plugin')) {
239 239
 	/**
240 240
 	*    deactivate_plugin
241 241
 	* usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
@@ -244,12 +244,12 @@  discard block
 block discarded – undo
244 244
 	* @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
245 245
 	* @return    void
246 246
 	*/
247
-	function espresso_deactivate_plugin( $plugin_basename = '' ) {
248
-		if ( ! function_exists( 'deactivate_plugins' ) ) {
249
-			require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
247
+	function espresso_deactivate_plugin($plugin_basename = '') {
248
+		if ( ! function_exists('deactivate_plugins')) {
249
+			require_once(ABSPATH.'wp-admin/includes/plugin.php');
250 250
 		}
251
-		unset( $_GET[ 'activate' ] );
252
-		unset( $_REQUEST[ 'activate' ] );
253
-		deactivate_plugins( $plugin_basename );
251
+		unset($_GET['activate']);
252
+		unset($_REQUEST['activate']);
253
+		deactivate_plugins($plugin_basename);
254 254
 	}
255 255
 }
Please login to merge, or discard this patch.
core/admin/EE_Admin_List_Table.core.php 1 patch
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
  * ------------------------------------------------------------------------
32 32
  */
33 33
 
34
-if ( ! class_exists( 'WP_List_Table' )) {
35
-    require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
34
+if ( ! class_exists('WP_List_Table')) {
35
+    require_once(ABSPATH.'wp-admin/includes/class-wp-list-table.php');
36 36
 }
37 37
 
38 38
 abstract class EE_Admin_List_Table extends WP_List_Table {
@@ -244,16 +244,16 @@  discard block
 block discarded – undo
244 244
 	 * constructor
245 245
 	 * @param EE_Admin_Page $admin_page we use this for obtaining everything we need in the list table.
246 246
 	 */
247
-	public function __construct( EE_Admin_Page $admin_page ) {
247
+	public function __construct(EE_Admin_Page $admin_page) {
248 248
 		$this->_admin_page = $admin_page;
249 249
 		$this->_req_data = $this->_admin_page->get_request_data();
250 250
 		$this->_view = $this->_admin_page->get_view();
251
-		$this->_views = empty( $this->_views ) ? $this->_admin_page->get_list_table_view_RLs() : $this->_views;
251
+		$this->_views = empty($this->_views) ? $this->_admin_page->get_list_table_view_RLs() : $this->_views;
252 252
 		$this->_current_page = $this->get_pagenum();
253
-		$this->_screen = $this->_admin_page->get_current_page() . '_' . $this->_admin_page->get_current_view();
254
-		$this->_yes_no = array(  __('No', 'event_espresso'), __('Yes', 'event_espresso'));
253
+		$this->_screen = $this->_admin_page->get_current_page().'_'.$this->_admin_page->get_current_view();
254
+		$this->_yes_no = array(__('No', 'event_espresso'), __('Yes', 'event_espresso'));
255 255
 
256
-		$this->_per_page = $this->get_items_per_page( $this->_screen . '_per_page', 10 );
256
+		$this->_per_page = $this->get_items_per_page($this->_screen.'_per_page', 10);
257 257
 
258 258
 		$this->_setup_data();
259 259
 		$this->_add_view_counts();
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 		$this->_set_properties();
264 264
 
265 265
 		//set primary column
266
-		add_filter( 'list_table_primary_column', array( $this, 'set_primary_column' ) );
266
+		add_filter('list_table_primary_column', array($this, 'set_primary_column'));
267 267
 
268 268
 		//set parent defaults
269 269
 		parent::__construct($this->_wp_list_args);
@@ -339,17 +339,17 @@  discard block
 block discarded – undo
339 339
 	 * @return string
340 340
 	 */
341 341
 	protected function _get_hidden_fields() {
342
-		$action = isset( $this->_req_data['route'] ) ? $this->_req_data['route'] : '';
343
-		$action = empty( $action ) && isset( $this->_req_data['action'] ) ? $this->_req_data['action'] : $action;
342
+		$action = isset($this->_req_data['route']) ? $this->_req_data['route'] : '';
343
+		$action = empty($action) && isset($this->_req_data['action']) ? $this->_req_data['action'] : $action;
344 344
 		//if action is STILL empty, then we set it to default
345
-		$action = empty( $action ) ? 'default' : $action;
346
-		$field = '<input type="hidden" name="page" value="' . $this->_req_data['page'] . '" />' . "\n";
347
-		$field .= '<input type="hidden" name="route" value="'. $action .'" />' . "\n";/**/
348
-		$field .= '<input type="hidden" name="perpage" value="' . $this->_per_page . '" />' . "\n";
345
+		$action = empty($action) ? 'default' : $action;
346
+		$field = '<input type="hidden" name="page" value="'.$this->_req_data['page'].'" />'."\n";
347
+		$field .= '<input type="hidden" name="route" value="'.$action.'" />'."\n"; /**/
348
+		$field .= '<input type="hidden" name="perpage" value="'.$this->_per_page.'" />'."\n";
349 349
 
350 350
 		$bulk_actions = $this->_get_bulk_actions();
351
-		foreach ( $bulk_actions as $bulk_action => $label ) {
352
-			$field .= '<input type="hidden" name="' . $bulk_action . '_nonce" value="' . wp_create_nonce  ( $bulk_action . '_nonce' ) . '" />' . "\n";
351
+		foreach ($bulk_actions as $bulk_action => $label) {
352
+			$field .= '<input type="hidden" name="'.$bulk_action.'_nonce" value="'.wp_create_nonce($bulk_action.'_nonce').'" />'."\n";
353 353
 		}
354 354
 
355 355
 		return $field;
@@ -379,15 +379,15 @@  discard block
 block discarded – undo
379 379
 		 *
380 380
 		 * @var array
381 381
 		 */
382
-		$_sortable = apply_filters( "FHEE_manage_{$this->screen->id}_sortable_columns", $_sortable, $this->_screen );
382
+		$_sortable = apply_filters("FHEE_manage_{$this->screen->id}_sortable_columns", $_sortable, $this->_screen);
383 383
 
384 384
 		$sortable = array();
385
-		foreach ( $_sortable as $id => $data ) {
386
-			if ( empty( $data ) )
385
+		foreach ($_sortable as $id => $data) {
386
+			if (empty($data))
387 387
 				continue;
388 388
 
389 389
 			//fix for offset errors with WP_List_Table default get_columninfo()
390
-			if ( is_array($data) ) {
390
+			if (is_array($data)) {
391 391
 				$_data[0] = key($data);
392 392
 				$_data[1] = isset($data[1]) ? $data[1] : false;
393 393
 			} else {
@@ -396,14 +396,14 @@  discard block
 block discarded – undo
396 396
 
397 397
 			$data = (array) $data;
398 398
 
399
-			if ( !isset( $data[1] ) )
399
+			if ( ! isset($data[1]))
400 400
 				$_data[1] = false;
401 401
 
402 402
 
403 403
 			$sortable[$id] = $_data;
404 404
 		}
405 405
 		$primary = $this->get_primary_column_name();
406
-		$this->_column_headers = array( $columns, $hidden, $sortable, $primary );
406
+		$this->_column_headers = array($columns, $hidden, $sortable, $primary);
407 407
 	}
408 408
 
409 409
 
@@ -412,8 +412,8 @@  discard block
 block discarded – undo
412 412
 	 * @return string
413 413
 	 */
414 414
 	protected function get_primary_column_name() {
415
-		foreach( class_parents( $this ) as $parent ) {
416
-			if ( method_exists( $parent, 'get_primary_column_name' ) && $parent == 'WP_List_Table' ) {
415
+		foreach (class_parents($this) as $parent) {
416
+			if (method_exists($parent, 'get_primary_column_name') && $parent == 'WP_List_Table') {
417 417
 				return parent::get_primary_column_name();
418 418
 			}
419 419
 		}
@@ -430,10 +430,10 @@  discard block
 block discarded – undo
430 430
 	 * @param string $primary
431 431
 	 * @return string
432 432
 	 */
433
-	protected function handle_row_actions( $item, $column_name, $primary ) {
434
-		foreach( class_parents( $this ) as $parent ) {
435
-			if ( method_exists( $parent, 'handle_row_actions' ) && $parent == 'WP_List_Table' ) {
436
-				return parent::handle_row_actions( $item, $column_name, $primary );
433
+	protected function handle_row_actions($item, $column_name, $primary) {
434
+		foreach (class_parents($this) as $parent) {
435
+			if (method_exists($parent, 'handle_row_actions') && $parent == 'WP_List_Table') {
436
+				return parent::handle_row_actions($item, $column_name, $primary);
437 437
 			}
438 438
 		}
439 439
 		return '';
@@ -451,11 +451,11 @@  discard block
 block discarded – undo
451 451
 	protected function _get_bulk_actions() {
452 452
 		$actions = array();
453 453
 		//the _views property should have the bulk_actions, so let's go through and extract them into a properly formatted array for the wp_list_table();
454
-		foreach ( $this->_views as $view => $args) {
455
-			if ( isset( $args['bulk_action']) && is_array($args['bulk_action']) && $this->_view == $view )
454
+		foreach ($this->_views as $view => $args) {
455
+			if (isset($args['bulk_action']) && is_array($args['bulk_action']) && $this->_view == $view)
456 456
 				//each bulk action will correspond with a admin page route, so we can check whatever the capability is for that page route and skip adding the bulk action if no access for the current logged in user.
457
-				foreach ( $args['bulk_action'] as $route =>$label ) {
458
-					if ( $this->_admin_page->check_user_access( $route, true ) ) {
457
+				foreach ($args['bulk_action'] as $route =>$label) {
458
+					if ($this->_admin_page->check_user_access($route, true)) {
459 459
 						$actions[$route] = $label;
460 460
 					}
461 461
 				}
@@ -473,18 +473,18 @@  discard block
 block discarded – undo
473 473
 	 */
474 474
 	private function _filters() {
475 475
 		$classname = get_class($this);
476
-		$filters = apply_filters( "FHEE__{$classname}__filters", (array) $this->_get_table_filters(), $this, $this->_screen );
476
+		$filters = apply_filters("FHEE__{$classname}__filters", (array) $this->_get_table_filters(), $this, $this->_screen);
477 477
 
478
-		if ( empty( $filters )) {
478
+		if (empty($filters)) {
479 479
 			return;
480 480
 		}
481
-		foreach ( $filters as $filter ) {
481
+		foreach ($filters as $filter) {
482 482
 			echo $filter;
483 483
 		}
484 484
 		//add filter button at end
485
-		echo '<input type="submit" class="button-secondary" value="' . __('Filter', 'event_espresso') . '" id="post-query-submit" />';
485
+		echo '<input type="submit" class="button-secondary" value="'.__('Filter', 'event_espresso').'" id="post-query-submit" />';
486 486
 		//add reset filters button at end
487
-		echo '<a class="button button-secondary"  href="' . $this->_admin_page->get_current_page_view_url() . '" style="display:inline-block">' . __('Reset Filters', 'event_espresso') . '</a>';
487
+		echo '<a class="button button-secondary"  href="'.$this->_admin_page->get_current_page_view_url().'" style="display:inline-block">'.__('Reset Filters', 'event_espresso').'</a>';
488 488
 	}
489 489
 
490 490
 
@@ -498,8 +498,8 @@  discard block
 block discarded – undo
498 498
 	 * @param string $column_name
499 499
 	 * @return string
500 500
 	 */
501
-	public function set_primary_column( $column_name ) {
502
-		return ! empty( $this->_primary_column ) ? $this->_primary_column : $column_name;
501
+	public function set_primary_column($column_name) {
502
+		return ! empty($this->_primary_column) ? $this->_primary_column : $column_name;
503 503
 	}
504 504
 
505 505
 
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 			array(
519 519
 				'total_items' => $total_items,
520 520
 				'per_page' => $this->_per_page,
521
-				'total_pages' => ceil($total_items / $this->_per_page )
521
+				'total_pages' => ceil($total_items / $this->_per_page)
522 522
 			)
523 523
 		);
524 524
 	}
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	 *
535 535
 	 * @return string html content for the column
536 536
 	 */
537
-	public function column_default( $item, $column_name ) {
537
+	public function column_default($item, $column_name) {
538 538
 		/**
539 539
 		 * Dynamic hook allowing for adding additional column content in this list table.
540 540
 		 * Note that $this->screen->id is in the format
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 		 * hook prefix ("event-espresso") will be different.
545 545
 		 *
546 546
 		 */
547
-		do_action( 'AHEE__EE_Admin_List_Table__column_' . $column_name . '__' . $this->screen->id, $item, $this->_screen );
547
+		do_action('AHEE__EE_Admin_List_Table__column_'.$column_name.'__'.$this->screen->id, $item, $this->_screen);
548 548
 	}
549 549
 
550 550
 
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 		 *
561 561
 		 * @var array
562 562
 		 */
563
-		$columns = apply_filters( 'FHEE_manage_'.$this->screen->id.'_columns', $this->_columns, $this->_screen );
563
+		$columns = apply_filters('FHEE_manage_'.$this->screen->id.'_columns', $this->_columns, $this->_screen);
564 564
 		return $columns;
565 565
 	}
566 566
 
@@ -572,18 +572,18 @@  discard block
 block discarded – undo
572 572
 		$views = $this->get_views();
573 573
 		$assembled_views = '';
574 574
 
575
-		if ( empty( $views )) {
575
+		if (empty($views)) {
576 576
 			return;
577 577
 		}
578 578
 		echo "<ul class='subsubsub'>\n";
579
-		foreach ( $views as $view ) {
580
-			$count = isset($view['count'] ) && !empty($view['count']) ? absint( $view['count'] )  : 0;
581
-			if ( isset( $view['slug'] ) && isset( $view['class'] ) && isset( $view['url'] ) && isset( $view['label']) ) {
582
-				$assembled_views[ $view['slug'] ] = "\t<li class='" . $view['class'] . "'>" . '<a href="' . $view['url'] . '">' . $view['label'] . '</a> <span class="count">(' . $count . ')</span>';
579
+		foreach ($views as $view) {
580
+			$count = isset($view['count']) && ! empty($view['count']) ? absint($view['count']) : 0;
581
+			if (isset($view['slug']) && isset($view['class']) && isset($view['url']) && isset($view['label'])) {
582
+				$assembled_views[$view['slug']] = "\t<li class='".$view['class']."'>".'<a href="'.$view['url'].'">'.$view['label'].'</a> <span class="count">('.$count.')</span>';
583 583
 			}
584 584
 		}
585 585
 
586
-		echo is_array( $assembled_views) && ! empty( $assembled_views ) ? implode( " |</li>\n", $assembled_views ) . "</li>\n" : '';
586
+		echo is_array($assembled_views) && ! empty($assembled_views) ? implode(" |</li>\n", $assembled_views)."</li>\n" : '';
587 587
 		echo "</ul>";
588 588
 	}
589 589
 
@@ -596,10 +596,10 @@  discard block
 block discarded – undo
596 596
 	 *
597 597
 	 * @param object $item The current item
598 598
 	 */
599
-	public function single_row( $item ) {
600
-		$row_class = $this->_get_row_class( $item );
601
-		echo '<tr class="' . esc_attr( $row_class ) . '">';
602
-		$this->single_row_columns( $item );
599
+	public function single_row($item) {
600
+		$row_class = $this->_get_row_class($item);
601
+		echo '<tr class="'.esc_attr($row_class).'">';
602
+		$this->single_row_columns($item);
603 603
 		echo '</tr>';
604 604
 	}
605 605
 
@@ -610,13 +610,13 @@  discard block
 block discarded – undo
610 610
 	 * @param  object $item the current item
611 611
 	 * @return string
612 612
 	 */
613
-	protected function _get_row_class( $item ) {
613
+	protected function _get_row_class($item) {
614 614
 		static $row_class = '';
615
-		$row_class = ( $row_class == '' ? 'alternate' : '' );
615
+		$row_class = ($row_class == '' ? 'alternate' : '');
616 616
 
617 617
 		$new_row_class = $row_class;
618 618
 
619
-		if ( !empty($this->_ajax_sorting_callback) ) {
619
+		if ( ! empty($this->_ajax_sorting_callback)) {
620 620
 			$new_row_class .= ' rowsortable';
621 621
 		}
622 622
 
@@ -635,13 +635,13 @@  discard block
 block discarded – undo
635 635
 
636 636
 	public function get_hidden_columns() {
637 637
 		$user_id = get_current_user_id();
638
-		$has_default = get_user_option('default'. $this->screen->id . 'columnshidden', $user_id);
639
-		if ( empty( $has_default ) && !empty($this->_hidden_columns ) ) {
640
-			update_user_option($user_id, 'default'.$this->screen->id . 'columnshidden', TRUE);
641
-			update_user_option($user_id, 'manage' . $this->screen->id . 'columnshidden', $this->_hidden_columns, TRUE );
638
+		$has_default = get_user_option('default'.$this->screen->id.'columnshidden', $user_id);
639
+		if (empty($has_default) && ! empty($this->_hidden_columns)) {
640
+			update_user_option($user_id, 'default'.$this->screen->id.'columnshidden', TRUE);
641
+			update_user_option($user_id, 'manage'.$this->screen->id.'columnshidden', $this->_hidden_columns, TRUE);
642 642
 		}
643
-		$ref = 'manage' . $this->screen->id . 'columnshidden';
644
-		$saved_columns = (array) get_user_option( $ref, $user_id );
643
+		$ref = 'manage'.$this->screen->id.'columnshidden';
644
+		$saved_columns = (array) get_user_option($ref, $user_id);
645 645
 		return $saved_columns;
646 646
 	}
647 647
 
@@ -656,47 +656,47 @@  discard block
 block discarded – undo
656 656
 	 *
657 657
 	 * @param object $item The current item
658 658
 	 */
659
-	public function single_row_columns( $item ) {
660
-		list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
659
+	public function single_row_columns($item) {
660
+		list($columns, $hidden, $sortable, $primary) = $this->get_column_info();
661 661
 
662 662
 		global $wp_version;
663
-		$use_hidden_class = version_compare( $wp_version, '4.3-RC', '>=' );
663
+		$use_hidden_class = version_compare($wp_version, '4.3-RC', '>=');
664 664
 
665
-		foreach ( $columns as $column_name => $column_display_name ) {
665
+		foreach ($columns as $column_name => $column_display_name) {
666 666
 
667 667
 			/**
668 668
 			 * With WordPress version 4.3.RC+ WordPress started using the hidden css class to control whether columns are
669 669
 			 * hidden or not instead of using "display:none;".  This bit of code provides backward compat.
670 670
 			 */
671
-			$hidden_class = $use_hidden_class && in_array( $column_name, $hidden ) ? ' hidden' : '';
672
-			$style = ! $use_hidden_class && in_array( $column_name, $hidden ) ? ' style="display:none;"' : '';
671
+			$hidden_class = $use_hidden_class && in_array($column_name, $hidden) ? ' hidden' : '';
672
+			$style = ! $use_hidden_class && in_array($column_name, $hidden) ? ' style="display:none;"' : '';
673 673
 
674
-			$classes = $column_name . ' column-' . $column_name.$hidden_class;
675
-			if ( $primary == $column_name ) {
674
+			$classes = $column_name.' column-'.$column_name.$hidden_class;
675
+			if ($primary == $column_name) {
676 676
 				$classes .= ' has-row-actions column-primary';
677 677
 			}
678 678
 
679
-			$data = ' data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
679
+			$data = ' data-colname="'.wp_strip_all_tags($column_display_name).'"';
680 680
 
681 681
 			$class = "class='$classes'";
682 682
 
683 683
 			$attributes = "$class$style$data";
684 684
 
685
-			if ( 'cb' === $column_name ) {
685
+			if ('cb' === $column_name) {
686 686
 				echo '<th scope="row" class="check-column">';
687
-				echo apply_filters( 'FHEE__EE_Admin_List_Table__single_row_columns__column_cb_content', $this->column_cb( $item ), $item, $this );
687
+				echo apply_filters('FHEE__EE_Admin_List_Table__single_row_columns__column_cb_content', $this->column_cb($item), $item, $this);
688 688
 				echo '</th>';
689 689
 			}
690
-			elseif ( method_exists( $this, 'column_' . $column_name ) ) {
690
+			elseif (method_exists($this, 'column_'.$column_name)) {
691 691
 				echo "<td $attributes>";
692
-				echo apply_filters( 'FHEE__EE_Admin_List_Table__single_row_columns__column_' . $column_name . '__column_content', call_user_func( array( $this, 'column_' . $column_name ), $item ), $item, $this );
693
-				echo $this->handle_row_actions( $item, $column_name, $primary );
692
+				echo apply_filters('FHEE__EE_Admin_List_Table__single_row_columns__column_'.$column_name.'__column_content', call_user_func(array($this, 'column_'.$column_name), $item), $item, $this);
693
+				echo $this->handle_row_actions($item, $column_name, $primary);
694 694
 				echo "</td>";
695 695
 			}
696 696
 			else {
697 697
 				echo "<td $attributes>";
698
-				echo apply_filters( 'FHEE__EE_Admin_List_Table__single_row_columns__column_default__column_content', $this->column_default( $item, $column_name ), $item, $column_name, $this );
699
-				echo $this->handle_row_actions( $item, $column_name, $primary );
698
+				echo apply_filters('FHEE__EE_Admin_List_Table__single_row_columns__column_default__column_content', $this->column_default($item, $column_name), $item, $column_name, $this);
699
+				echo $this->handle_row_actions($item, $column_name, $primary);
700 700
 				echo "</td>";
701 701
 			}
702 702
 		}
@@ -704,19 +704,19 @@  discard block
 block discarded – undo
704 704
 
705 705
 
706 706
 
707
-	public function extra_tablenav( $which ) {
708
-		if ( $which == 'top' ) {
707
+	public function extra_tablenav($which) {
708
+		if ($which == 'top') {
709 709
 			$this->_filters();
710 710
 			echo $this->_get_hidden_fields();
711 711
 			echo '<br class="clear">';
712
-		}else{
712
+		} else {
713 713
 			echo '<div class="list-table-bottom-buttons alignleft actions">';
714
-			foreach($this->_bottom_buttons as $type => $action){
715
-				$route = isset( $action['route'] ) ? $action['route'] : '';
716
-				$extra_request = isset( $action['extra_request'] ) ? $action['extra_request'] : '';
714
+			foreach ($this->_bottom_buttons as $type => $action) {
715
+				$route = isset($action['route']) ? $action['route'] : '';
716
+				$extra_request = isset($action['extra_request']) ? $action['extra_request'] : '';
717 717
 				echo $this->_admin_page->get_action_link_or_button($route, $type, $extra_request);
718 718
 			}
719
-			do_action( 'AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', $this, $this->_screen );
719
+			do_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', $this, $this->_screen);
720 720
 			echo '</div>';
721 721
 		}
722 722
 		//echo $this->_entries_per_page_dropdown;
@@ -766,13 +766,13 @@  discard block
 block discarded – undo
766 766
 	 *
767 767
 	 * @return string The assembled action elements container.
768 768
 	 */
769
-	protected function _action_string( $action_items, $item, $action_container = 'ul', $action_class = '', $action_id = '' ) {
769
+	protected function _action_string($action_items, $item, $action_container = 'ul', $action_class = '', $action_id = '') {
770 770
 		$content = '';
771
-		$action_class = ! empty( $action_class ) ? ' class="' . $action_class . '"' : '';
772
-		$action_id = ! empty( $action_id ) ? ' id="' . $action_id . '"' : '';
773
-		$content .= ! empty( $action_container ) ? '<' . $action_container . $action_class . $action_id . '>' : '';
774
-		$content .= apply_filters( 'FHEE__EE_Admin_List_Table___action_string__action_items', $action_items, $item, $this );
775
-		$content .= ! empty( $action_container ) ? '</' . $action_container . '>' : '';
771
+		$action_class = ! empty($action_class) ? ' class="'.$action_class.'"' : '';
772
+		$action_id = ! empty($action_id) ? ' id="'.$action_id.'"' : '';
773
+		$content .= ! empty($action_container) ? '<'.$action_container.$action_class.$action_id.'>' : '';
774
+		$content .= apply_filters('FHEE__EE_Admin_List_Table___action_string__action_items', $action_items, $item, $this);
775
+		$content .= ! empty($action_container) ? '</'.$action_container.'>' : '';
776 776
 		return $content;
777 777
 	}
778 778
 }
Please login to merge, or discard this patch.
core/helpers/EEH_File.helper.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -656,8 +656,6 @@
 block discarded – undo
656 656
 	 * converts it into a "remote" filepath (the filepath the currently-in-use 
657 657
 	 * $wp_filesystem needs to use access the folder or file).
658 658
 	 * See http://wordpress.stackexchange.com/questions/124900/using-wp-filesystem-in-plugins
659
-	 * @param WP_Filesystem_Base $wp_filesystem we aren't initially sure which one
660
-	 * is in use, so you need to provide it
661 659
 	 * @param string $local_filepath the filepath to the folder/file locally
662 660
 	 * @throws EE_Error if filesystem credentials are required
663 661
 	 * @return string the remote filepath (eg the filepath the filesystem method, eg 
Please login to merge, or discard this patch.
Spacing   +179 added lines, -179 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
  * @ version		 	4.0
13 13
  *
14 14
  */
15
-require_once( EE_HELPERS . 'EEH_Base.helper.php' );
16
-require_once( EE_INTERFACES . 'EEI_Interfaces.php' );
15
+require_once(EE_HELPERS.'EEH_Base.helper.php');
16
+require_once(EE_INTERFACES.'EEI_Interfaces.php');
17 17
 /**
18 18
  *
19 19
  * Class EEH_File
@@ -52,30 +52,30 @@  discard block
 block discarded – undo
52 52
 	 * @throws EE_Error if filesystem credentials are required
53 53
 	 * @return WP_Filesystem_Base
54 54
 	 */
55
-	private static function _get_wp_filesystem( $filepath = null) {
56
-		if( apply_filters( 
55
+	private static function _get_wp_filesystem($filepath = null) {
56
+		if (apply_filters( 
57 57
 				'FHEE__EEH_File___get_wp_filesystem__allow_using_filesystem_direct', 
58
-				$filepath && EEH_File::is_in_uploads_folder( $filepath ), 
59
-				$filepath ) ) {
60
-			if( ! EEH_File::$_wp_filesystem_direct instanceof WP_Filesystem_Direct ) {
61
-				require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php');
58
+				$filepath && EEH_File::is_in_uploads_folder($filepath), 
59
+				$filepath )) {
60
+			if ( ! EEH_File::$_wp_filesystem_direct instanceof WP_Filesystem_Direct) {
61
+				require_once(ABSPATH.'wp-admin/includes/class-wp-filesystem-base.php');
62 62
 				$method = 'direct';
63
-				$wp_filesystem_direct_file = apply_filters( 'filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method );
63
+				$wp_filesystem_direct_file = apply_filters('filesystem_method_file', ABSPATH.'wp-admin/includes/class-wp-filesystem-'.$method.'.php', $method);
64 64
 				//check constants defined, just like in wp-admin/includes/file.php's WP_Filesystem()
65
-				if ( ! defined('FS_CHMOD_DIR') ) {
66
-					define('FS_CHMOD_DIR', ( fileperms( ABSPATH ) & 0777 | 0755 ) );
65
+				if ( ! defined('FS_CHMOD_DIR')) {
66
+					define('FS_CHMOD_DIR', (fileperms(ABSPATH) & 0777 | 0755));
67 67
 				}
68
-				if ( ! defined('FS_CHMOD_FILE') ) {
69
-					define('FS_CHMOD_FILE', ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ) );
68
+				if ( ! defined('FS_CHMOD_FILE')) {
69
+					define('FS_CHMOD_FILE', (fileperms(ABSPATH.'index.php') & 0777 | 0644));
70 70
 				}
71
-				require_once( $wp_filesystem_direct_file );
72
-				EEH_File::$_wp_filesystem_direct = new WP_Filesystem_Direct( array() );
71
+				require_once($wp_filesystem_direct_file);
72
+				EEH_File::$_wp_filesystem_direct = new WP_Filesystem_Direct(array());
73 73
 			}
74 74
 			return EEH_File::$_wp_filesystem_direct;
75 75
 		}
76 76
 		global $wp_filesystem;
77 77
 		// no filesystem setup ???
78
-		if ( ! $wp_filesystem instanceof WP_Filesystem_Base ) {
78
+		if ( ! $wp_filesystem instanceof WP_Filesystem_Base) {
79 79
 			// if some eager beaver's just trying to get in there too early...
80 80
 			// let them do it, because we are one of those eager beavers! :P
81 81
 			/**
@@ -88,34 +88,34 @@  discard block
 block discarded – undo
88 88
 			 * and there may be troubles if the WP files are owned by a different user
89 89
 			 * than the server user. But both of these issues should exist in 4.4 and earlier too
90 90
 			 */
91
-			if ( FALSE && ! did_action( 'wp_loaded' )) {
91
+			if (FALSE && ! did_action('wp_loaded')) {
92 92
 				$msg = __('An attempt to access and/or write to a file on the server could not be completed due to a lack of sufficient credentials.', 'event_espresso');
93
-				if ( WP_DEBUG ) {
94
-					$msg .= '<br />' .  __('The WP Filesystem can not be accessed until after the "wp_loaded" hook has run, so it\'s best not to attempt access until the "admin_init" hookpoint.', 'event_espresso');
93
+				if (WP_DEBUG) {
94
+					$msg .= '<br />'.__('The WP Filesystem can not be accessed until after the "wp_loaded" hook has run, so it\'s best not to attempt access until the "admin_init" hookpoint.', 'event_espresso');
95 95
 				}
96
-				throw new EE_Error( $msg );
96
+				throw new EE_Error($msg);
97 97
 			} else {
98 98
 				// should be loaded if we are past the wp_loaded hook...
99
-				if ( ! function_exists( 'WP_Filesystem' )) {
100
-					require_once( ABSPATH . 'wp-admin/includes/file.php' );
101
-					require_once( ABSPATH . 'wp-admin/includes/template.php' );
99
+				if ( ! function_exists('WP_Filesystem')) {
100
+					require_once(ABSPATH.'wp-admin/includes/file.php');
101
+					require_once(ABSPATH.'wp-admin/includes/template.php');
102 102
 				}
103 103
 				// turn on output buffering so that we can capture the credentials form
104 104
 				ob_start();
105
-				$credentials = request_filesystem_credentials( '' );
105
+				$credentials = request_filesystem_credentials('');
106 106
 				// store credentials form for the time being
107 107
 				EEH_File::$_credentials_form = ob_get_clean();
108 108
 				// basically check for direct or previously configured access
109
-				if ( ! WP_Filesystem( $credentials ) ) {
109
+				if ( ! WP_Filesystem($credentials)) {
110 110
 					// if credentials do NOT exist
111
-					if ( $credentials === FALSE ) {
112
-						add_action( 'admin_notices', array( 'EEH_File', 'display_request_filesystem_credentials_form' ), 999 );
113
-						throw new EE_Error( __('An attempt to access and/or write to a file on the server could not be completed due to a lack of sufficient credentials.', 'event_espresso'));
114
-					} elseif( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) {
115
-						add_action( 'admin_notices', array( 'EEH_File', 'display_request_filesystem_credentials_form' ), 999 );
111
+					if ($credentials === FALSE) {
112
+						add_action('admin_notices', array('EEH_File', 'display_request_filesystem_credentials_form'), 999);
113
+						throw new EE_Error(__('An attempt to access and/or write to a file on the server could not be completed due to a lack of sufficient credentials.', 'event_espresso'));
114
+					} elseif (is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) {
115
+						add_action('admin_notices', array('EEH_File', 'display_request_filesystem_credentials_form'), 999);
116 116
 						throw new EE_Error(
117 117
 								sprintf(
118
-										__( 'WP Filesystem Error: $1%s', 'event_espresso' ),
118
+										__('WP Filesystem Error: $1%s', 'event_espresso'),
119 119
 										$wp_filesystem->errors->get_error_message() ) );
120 120
 					}
121 121
 				}
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
 	 * display_request_filesystem_credentials_form
129 129
 	 */
130 130
 	public static function display_request_filesystem_credentials_form() {
131
-		if ( ! empty( EEH_File::$_credentials_form )) {
132
-			echo '<div class="updated espresso-notices-attention"><p>' . EEH_File::$_credentials_form . '</p></div>';
131
+		if ( ! empty(EEH_File::$_credentials_form)) {
132
+			echo '<div class="updated espresso-notices-attention"><p>'.EEH_File::$_credentials_form.'</p></div>';
133 133
 		}
134 134
 	}
135 135
 
@@ -147,29 +147,29 @@  discard block
 block discarded – undo
147 147
 	 * @throws EE_Error if filesystem credentials are required
148 148
 	 * @return bool
149 149
 	 */
150
-	public static function verify_filepath_and_permissions( $full_file_path = '', $file_name = '', $file_ext = '', $type_of_file = '' ) {
150
+	public static function verify_filepath_and_permissions($full_file_path = '', $file_name = '', $file_ext = '', $type_of_file = '') {
151 151
 		// load WP_Filesystem and set file permissions
152
-		$wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path );
153
-		$full_file_path = EEH_File::standardise_directory_separators( $full_file_path );
154
-		if ( ! $wp_filesystem->is_readable( EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ) )) {
155
-			$file_name = ! empty( $type_of_file ) ? $file_name . ' ' . $type_of_file : $file_name;
156
-			$file_name .= ! empty( $file_ext ) ? ' file' : ' folder';
152
+		$wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path);
153
+		$full_file_path = EEH_File::standardise_directory_separators($full_file_path);
154
+		if ( ! $wp_filesystem->is_readable(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path))) {
155
+			$file_name = ! empty($type_of_file) ? $file_name.' '.$type_of_file : $file_name;
156
+			$file_name .= ! empty($file_ext) ? ' file' : ' folder';
157 157
 			$msg = sprintf(
158
-				__( 'The requested %1$s could not be found or is not readable, possibly due to an incorrect filepath, or incorrect file permissions.%2$s', 'event_espresso' ),
158
+				__('The requested %1$s could not be found or is not readable, possibly due to an incorrect filepath, or incorrect file permissions.%2$s', 'event_espresso'),
159 159
 				$file_name,
160 160
 				'<br />'
161 161
 			);
162
-			if ( EEH_File::exists( $full_file_path )) {
163
-				$msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_file_path, $type_of_file );
162
+			if (EEH_File::exists($full_file_path)) {
163
+				$msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_file_path, $type_of_file);
164 164
 			} else {
165 165
 				// no file permissions means the file was not found
166 166
 				$msg .= sprintf(
167
-					__( 'Please ensure the following path is correct: "%s".', 'event_espresso' ),
167
+					__('Please ensure the following path is correct: "%s".', 'event_espresso'),
168 168
 					$full_file_path
169 169
 				);
170 170
 			}
171
-			if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
172
-				throw new EE_Error( $msg . '||' . $msg );
171
+			if (defined('WP_DEBUG') && WP_DEBUG) {
172
+				throw new EE_Error($msg.'||'.$msg);
173 173
 			}
174 174
 			return FALSE;
175 175
 		}
@@ -187,24 +187,24 @@  discard block
 block discarded – undo
187 187
 	 * @throws EE_Error if filesystem credentials are required
188 188
 	 * @return string
189 189
 	 */
190
-	private static function _permissions_error_for_unreadable_filepath( $full_file_path = '', $type_of_file = '' ){
190
+	private static function _permissions_error_for_unreadable_filepath($full_file_path = '', $type_of_file = '') {
191 191
 		// load WP_Filesystem and set file permissions
192
-		$wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path );
192
+		$wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path);
193 193
 		// check file permissions
194
-		$perms = $wp_filesystem->getchmod( EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ) );
195
-		if ( $perms ) {
194
+		$perms = $wp_filesystem->getchmod(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path));
195
+		if ($perms) {
196 196
 			// file permissions exist, but way be set incorrectly
197
-			$type_of_file = ! empty( $type_of_file ) ? $type_of_file . ' ' : '';
198
-			$type_of_file .= ! empty( $type_of_file ) ? 'file' : 'folder';
197
+			$type_of_file = ! empty($type_of_file) ? $type_of_file.' ' : '';
198
+			$type_of_file .= ! empty($type_of_file) ? 'file' : 'folder';
199 199
 			return sprintf(
200
-				__( 'File permissions for the requested %1$s are currently set at "%2$s". The recommended permissions are 644 for files and 755 for folders.', 'event_espresso' ),
200
+				__('File permissions for the requested %1$s are currently set at "%2$s". The recommended permissions are 644 for files and 755 for folders.', 'event_espresso'),
201 201
 				$type_of_file,
202 202
 				$perms
203 203
 			);
204 204
 		} else {
205 205
 			// file exists but file permissions could not be read ?!?!
206 206
 			return sprintf(
207
-				__( 'Please ensure that the server and/or PHP configuration allows the current process to access the following file: "%s".', 'event_espresso' ),
207
+				__('Please ensure that the server and/or PHP configuration allows the current process to access the following file: "%s".', 'event_espresso'),
208 208
 				$full_file_path
209 209
 			);
210 210
 		}
@@ -222,35 +222,35 @@  discard block
 block discarded – undo
222 222
 	 * can't write to it
223 223
 	 * @return bool false if folder isn't writable; true if it exists and is writeable,
224 224
 	 */
225
-	public static function ensure_folder_exists_and_is_writable( $folder = '' ){
226
-		if ( empty( $folder )) {
225
+	public static function ensure_folder_exists_and_is_writable($folder = '') {
226
+		if (empty($folder)) {
227 227
 			return false;
228 228
 		}
229 229
 		// remove ending DS
230
-		$folder = EEH_File::standardise_directory_separators( rtrim( $folder, '/\\' ));
231
-		$parent_folder = EEH_File::get_parent_folder( $folder );
230
+		$folder = EEH_File::standardise_directory_separators(rtrim($folder, '/\\'));
231
+		$parent_folder = EEH_File::get_parent_folder($folder);
232 232
 		// add DS to folder
233
-		$folder = EEH_File::end_with_directory_separator( $folder );
234
-		$wp_filesystem = EEH_File::_get_wp_filesystem( $folder );
235
-		if ( ! $wp_filesystem->is_dir( EEH_File::convert_local_filepath_to_remote_filepath( $folder ) ) ) {
233
+		$folder = EEH_File::end_with_directory_separator($folder);
234
+		$wp_filesystem = EEH_File::_get_wp_filesystem($folder);
235
+		if ( ! $wp_filesystem->is_dir(EEH_File::convert_local_filepath_to_remote_filepath($folder))) {
236 236
 			//ok so it doesn't exist. Does its parent? Can we write to it?
237
-			if(	! EEH_File::ensure_folder_exists_and_is_writable( $parent_folder ) ) {
237
+			if ( ! EEH_File::ensure_folder_exists_and_is_writable($parent_folder)) {
238 238
 				return false;
239 239
 			}
240
-			if ( ! EEH_File::verify_is_writable( $parent_folder, 'folder' )) {
240
+			if ( ! EEH_File::verify_is_writable($parent_folder, 'folder')) {
241 241
 				return false;
242 242
 			} else {
243
-				if ( ! $wp_filesystem->mkdir( EEH_File::convert_local_filepath_to_remote_filepath(  $folder ) ) ) {
244
-					if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
245
-						$msg = sprintf( __( '"%s" could not be created.', 'event_espresso' ), $folder );
246
-						$msg .= EEH_File::_permissions_error_for_unreadable_filepath( $folder );
247
-						throw new EE_Error( $msg );
243
+				if ( ! $wp_filesystem->mkdir(EEH_File::convert_local_filepath_to_remote_filepath($folder))) {
244
+					if (defined('WP_DEBUG') && WP_DEBUG) {
245
+						$msg = sprintf(__('"%s" could not be created.', 'event_espresso'), $folder);
246
+						$msg .= EEH_File::_permissions_error_for_unreadable_filepath($folder);
247
+						throw new EE_Error($msg);
248 248
 					}
249 249
 					return false;
250 250
 				}
251
-				EEH_File::add_index_file( $folder );
251
+				EEH_File::add_index_file($folder);
252 252
 			}
253
-		} elseif ( ! EEH_File::verify_is_writable( $folder, 'folder' )) {
253
+		} elseif ( ! EEH_File::verify_is_writable($folder, 'folder')) {
254 254
 			return false;
255 255
 		}
256 256
 		return true;
@@ -265,15 +265,15 @@  discard block
 block discarded – undo
265 265
 	 * @throws EE_Error if filesystem credentials are required
266 266
 	 * @return bool
267 267
 	 */
268
-	public static function verify_is_writable( $full_path = '', $file_or_folder = 'folder' ){
268
+	public static function verify_is_writable($full_path = '', $file_or_folder = 'folder') {
269 269
 		// load WP_Filesystem and set file permissions
270
-		$wp_filesystem = EEH_File::_get_wp_filesystem( $full_path );
271
-		$full_path = EEH_File::standardise_directory_separators( $full_path );
272
-		if ( ! $wp_filesystem->is_writable( EEH_File::convert_local_filepath_to_remote_filepath( $full_path ) ) ) {
273
-			if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
274
-				$msg = sprintf( __( 'The "%1$s" %2$s is not writable.', 'event_espresso' ), $full_path, $file_or_folder );
275
-				$msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_path );
276
-				throw new EE_Error( $msg );
270
+		$wp_filesystem = EEH_File::_get_wp_filesystem($full_path);
271
+		$full_path = EEH_File::standardise_directory_separators($full_path);
272
+		if ( ! $wp_filesystem->is_writable(EEH_File::convert_local_filepath_to_remote_filepath($full_path))) {
273
+			if (defined('WP_DEBUG') && WP_DEBUG) {
274
+				$msg = sprintf(__('The "%1$s" %2$s is not writable.', 'event_espresso'), $full_path, $file_or_folder);
275
+				$msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_path);
276
+				throw new EE_Error($msg);
277 277
 			}
278 278
 			return FALSE;
279 279
 		}
@@ -290,25 +290,25 @@  discard block
 block discarded – undo
290 290
 	 * @throws EE_Error if filesystem credentials are required
291 291
 	 * @return bool
292 292
 	 */
293
-	public static function ensure_file_exists_and_is_writable( $full_file_path = '' ) {
293
+	public static function ensure_file_exists_and_is_writable($full_file_path = '') {
294 294
 		// load WP_Filesystem and set file permissions
295
-		$wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path );
296
-		$full_file_path = EEH_File::standardise_directory_separators( $full_file_path );
297
-		$parent_folder = EEH_File::get_parent_folder( $full_file_path );
298
-		if ( ! EEH_File::exists( $full_file_path )) {
299
-			if( ! EEH_File::ensure_folder_exists_and_is_writable( $parent_folder ) ) {
295
+		$wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path);
296
+		$full_file_path = EEH_File::standardise_directory_separators($full_file_path);
297
+		$parent_folder = EEH_File::get_parent_folder($full_file_path);
298
+		if ( ! EEH_File::exists($full_file_path)) {
299
+			if ( ! EEH_File::ensure_folder_exists_and_is_writable($parent_folder)) {
300 300
 				return false;
301 301
 			}
302
-			if ( ! $wp_filesystem->touch( EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ) ) ) {
303
-				if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
304
-					$msg = sprintf( __( 'The "%s" file could not be created.', 'event_espresso' ), $full_file_path );
305
-					$msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_file_path );
306
-					throw new EE_Error( $msg );
302
+			if ( ! $wp_filesystem->touch(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path))) {
303
+				if (defined('WP_DEBUG') && WP_DEBUG) {
304
+					$msg = sprintf(__('The "%s" file could not be created.', 'event_espresso'), $full_file_path);
305
+					$msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_file_path);
306
+					throw new EE_Error($msg);
307 307
 				}
308 308
 				return false;
309 309
 			}
310 310
 		}
311
-		if ( ! EEH_File::verify_is_writable( $full_file_path, 'file' )) {
311
+		if ( ! EEH_File::verify_is_writable($full_file_path, 'file')) {
312 312
 			return false;
313 313
 		}
314 314
 		return true;
@@ -320,15 +320,15 @@  discard block
 block discarded – undo
320 320
 	 * @param string $file_or_folder_path
321 321
 	 * @return string parent folder, ENDING with a directory separator
322 322
 	 */
323
-	public static function get_parent_folder( $file_or_folder_path ) {
323
+	public static function get_parent_folder($file_or_folder_path) {
324 324
 		//find the last DS, ignoring a DS on the very end
325 325
 		//eg if given "/var/something/somewhere/", we want to get "somewhere"'s
326 326
 		//parent folder, "/var/something/"
327
-		$ds = strrpos( $file_or_folder_path, DS, -2 );
328
-		return substr( $file_or_folder_path, 0, $ds + 1 );
327
+		$ds = strrpos($file_or_folder_path, DS, -2);
328
+		return substr($file_or_folder_path, 0, $ds + 1);
329 329
 	}
330 330
 	
331
-	public static function ensure_folder_exists_recursively( $folder ) {
331
+	public static function ensure_folder_exists_recursively($folder) {
332 332
 		
333 333
 	}
334 334
 
@@ -340,12 +340,12 @@  discard block
 block discarded – undo
340 340
 	 * @throws EE_Error if filesystem credentials are required
341 341
 	 * @return string
342 342
 	 */
343
-	public static function get_file_contents( $full_file_path = '' ){
344
-		$full_file_path = EEH_File::standardise_directory_separators( $full_file_path );
345
-		if ( EEH_File::verify_filepath_and_permissions( $full_file_path, EEH_File::get_filename_from_filepath( $full_file_path ) , EEH_File::get_file_extension( $full_file_path ))) {
343
+	public static function get_file_contents($full_file_path = '') {
344
+		$full_file_path = EEH_File::standardise_directory_separators($full_file_path);
345
+		if (EEH_File::verify_filepath_and_permissions($full_file_path, EEH_File::get_filename_from_filepath($full_file_path), EEH_File::get_file_extension($full_file_path))) {
346 346
 			// load WP_Filesystem and set file permissions
347
-			$wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path );
348
-			return $wp_filesystem->get_contents(EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ) );
347
+			$wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path);
348
+			return $wp_filesystem->get_contents(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path));
349 349
 		}
350 350
 		return '';
351 351
 	}
@@ -360,26 +360,26 @@  discard block
 block discarded – undo
360 360
 	 * @throws EE_Error if filesystem credentials are required
361 361
 	 * @return bool
362 362
 	 */
363
-	public static function write_to_file( $full_file_path = '', $file_contents = '', $file_type = '' ){
364
-		$full_file_path = EEH_File::standardise_directory_separators( $full_file_path );
365
-		$file_type = ! empty( $file_type ) ? rtrim( $file_type, ' ' ) . ' ' : '';
366
-		$folder = EEH_File::remove_filename_from_filepath( $full_file_path );
367
-		if ( ! EEH_File::verify_is_writable( $folder, 'folder' )) {
368
-			if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
369
-				$msg = sprintf( __( 'The %1$sfile located at "%2$s" is not writable.', 'event_espresso' ), $file_type, $full_file_path );
370
-				$msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_file_path );
371
-				throw new EE_Error( $msg );
363
+	public static function write_to_file($full_file_path = '', $file_contents = '', $file_type = '') {
364
+		$full_file_path = EEH_File::standardise_directory_separators($full_file_path);
365
+		$file_type = ! empty($file_type) ? rtrim($file_type, ' ').' ' : '';
366
+		$folder = EEH_File::remove_filename_from_filepath($full_file_path);
367
+		if ( ! EEH_File::verify_is_writable($folder, 'folder')) {
368
+			if (defined('WP_DEBUG') && WP_DEBUG) {
369
+				$msg = sprintf(__('The %1$sfile located at "%2$s" is not writable.', 'event_espresso'), $file_type, $full_file_path);
370
+				$msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_file_path);
371
+				throw new EE_Error($msg);
372 372
 			}
373 373
 			return FALSE;
374 374
 		}
375 375
 		// load WP_Filesystem and set file permissions
376
-		$wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path );
376
+		$wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path);
377 377
 		// write the file
378
-		if ( ! $wp_filesystem->put_contents(EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ), $file_contents )) {
379
-			if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
380
-				$msg = sprintf( __( 'The %1$sfile located at "%2$s" could not be written to.', 'event_espresso' ), $file_type, $full_file_path );
381
-				$msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_file_path, 'f' );
382
-				throw new EE_Error( $msg );
378
+		if ( ! $wp_filesystem->put_contents(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path), $file_contents)) {
379
+			if (defined('WP_DEBUG') && WP_DEBUG) {
380
+				$msg = sprintf(__('The %1$sfile located at "%2$s" could not be written to.', 'event_espresso'), $file_type, $full_file_path);
381
+				$msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_file_path, 'f');
382
+				throw new EE_Error($msg);
383 383
 			}
384 384
 			return FALSE;
385 385
 		}
@@ -395,9 +395,9 @@  discard block
 block discarded – undo
395 395
 	 * @throws EE_Error if filesystem credentials are required
396 396
 	 * @return boolean
397 397
 	 */
398
-	public static function delete( $filepath, $recursive = false, $type = false ) {
398
+	public static function delete($filepath, $recursive = false, $type = false) {
399 399
 		$wp_filesystem = EEH_File::_get_wp_filesystem();
400
-		return $wp_filesystem->delete( $filepath, $recursive, $type ) ? TRUE : FALSE;
400
+		return $wp_filesystem->delete($filepath, $recursive, $type) ? TRUE : FALSE;
401 401
 	}
402 402
 
403 403
 
@@ -409,9 +409,9 @@  discard block
 block discarded – undo
409 409
 	 * @throws EE_Error if filesystem credentials are required
410 410
 	 * @return bool
411 411
 	 */
412
-	public static function exists( $full_file_path = '' ) {
413
-		$wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path );
414
-		return $wp_filesystem->exists( EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ) ) ? TRUE : FALSE;
412
+	public static function exists($full_file_path = '') {
413
+		$wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path);
414
+		return $wp_filesystem->exists(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path)) ? TRUE : FALSE;
415 415
 	}
416 416
 
417 417
 
@@ -424,9 +424,9 @@  discard block
 block discarded – undo
424 424
 	 * @throws EE_Error if filesystem credentials are required
425 425
 	 * @return bool
426 426
 	 */
427
-	public static function is_readable( $full_file_path = '' ) {
428
-		$wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path );
429
-		if( $wp_filesystem->is_readable( EEH_File::convert_local_filepath_to_remote_filepath(  $full_file_path ) ) ) {
427
+	public static function is_readable($full_file_path = '') {
428
+		$wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path);
429
+		if ($wp_filesystem->is_readable(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path))) {
430 430
 			return true;
431 431
 		} else {
432 432
 			return false;
@@ -442,8 +442,8 @@  discard block
 block discarded – undo
442 442
 	 * @param string $full_file_path
443 443
 	 * @return string
444 444
 	 */
445
-	public static function remove_filename_from_filepath( $full_file_path = '' ) {
446
-		return pathinfo( $full_file_path, PATHINFO_DIRNAME );
445
+	public static function remove_filename_from_filepath($full_file_path = '') {
446
+		return pathinfo($full_file_path, PATHINFO_DIRNAME);
447 447
 	}
448 448
 
449 449
 
@@ -453,8 +453,8 @@  discard block
 block discarded – undo
453 453
 	 * @param string $full_file_path
454 454
 	 * @return string
455 455
 	 */
456
-	public static function get_filename_from_filepath( $full_file_path = '' ) {
457
-		return pathinfo( $full_file_path, PATHINFO_BASENAME );
456
+	public static function get_filename_from_filepath($full_file_path = '') {
457
+		return pathinfo($full_file_path, PATHINFO_BASENAME);
458 458
 	}
459 459
 
460 460
 
@@ -464,8 +464,8 @@  discard block
 block discarded – undo
464 464
 	 * @param string $full_file_path
465 465
 	 * @return string
466 466
 	 */
467
-	public static function get_file_extension( $full_file_path = '' ) {
468
-		return pathinfo( $full_file_path, PATHINFO_EXTENSION );
467
+	public static function get_file_extension($full_file_path = '') {
468
+		return pathinfo($full_file_path, PATHINFO_EXTENSION);
469 469
 	}
470 470
 
471 471
 
@@ -476,10 +476,10 @@  discard block
 block discarded – undo
476 476
 	 * @throws EE_Error if filesystem credentials are required
477 477
 	 * @return bool
478 478
 	 */
479
-	public static function add_htaccess_deny_from_all( $folder = '' ) {
480
-		$folder = EEH_File::standardise_and_end_with_directory_separator( $folder );
481
-		if ( ! EEH_File::exists( $folder . '.htaccess' ) ) {
482
-			if ( ! EEH_File::write_to_file( $folder . '.htaccess', 'deny from all', '.htaccess' )) {
479
+	public static function add_htaccess_deny_from_all($folder = '') {
480
+		$folder = EEH_File::standardise_and_end_with_directory_separator($folder);
481
+		if ( ! EEH_File::exists($folder.'.htaccess')) {
482
+			if ( ! EEH_File::write_to_file($folder.'.htaccess', 'deny from all', '.htaccess')) {
483 483
 				return FALSE;
484 484
 			}
485 485
 		}
@@ -493,10 +493,10 @@  discard block
 block discarded – undo
493 493
 	 * @throws EE_Error if filesystem credentials are required
494 494
 	 * @return boolean
495 495
 	 */
496
-	public static function add_index_file( $folder ) {
497
-		$folder = EEH_File::standardise_and_end_with_directory_separator( $folder );
498
-		if ( ! EEH_File::exists( $folder . 'index.php' ) ) {
499
-			if ( ! EEH_File::write_to_file( $folder . 'index.php', 'You are not permitted to read from this folder', '.php' )) {
496
+	public static function add_index_file($folder) {
497
+		$folder = EEH_File::standardise_and_end_with_directory_separator($folder);
498
+		if ( ! EEH_File::exists($folder.'index.php')) {
499
+			if ( ! EEH_File::write_to_file($folder.'index.php', 'You are not permitted to read from this folder', '.php')) {
500 500
 				return false;
501 501
 			}
502 502
 		}
@@ -511,11 +511,11 @@  discard block
 block discarded – undo
511 511
 	 * @param string $file_path
512 512
 	 * @return string
513 513
 	 */
514
-	public static function get_classname_from_filepath_with_standard_filename( $file_path ){
514
+	public static function get_classname_from_filepath_with_standard_filename($file_path) {
515 515
 		//extract file from path
516
-		$filename = basename( $file_path );
516
+		$filename = basename($file_path);
517 517
 		//now remove the first period and everything after
518
-		$pos_of_first_period = strpos( $filename,'.' );
518
+		$pos_of_first_period = strpos($filename, '.');
519 519
 		return substr($filename, 0, $pos_of_first_period);
520 520
 	}
521 521
 
@@ -527,8 +527,8 @@  discard block
 block discarded – undo
527 527
 	 * @param string $file_path
528 528
 	 * @return string
529 529
 	 */
530
-	public static function standardise_directory_separators( $file_path ){
531
-		return str_replace( array( '\\', '/' ), DS, $file_path );
530
+	public static function standardise_directory_separators($file_path) {
531
+		return str_replace(array('\\', '/'), DS, $file_path);
532 532
 	}
533 533
 
534 534
 
@@ -539,8 +539,8 @@  discard block
 block discarded – undo
539 539
 	 * @param string $file_path
540 540
 	 * @return string
541 541
 	 */
542
-	public static function end_with_directory_separator( $file_path ){
543
-		return rtrim( $file_path, '/\\' ) . DS;
542
+	public static function end_with_directory_separator($file_path) {
543
+		return rtrim($file_path, '/\\').DS;
544 544
 	}
545 545
 
546 546
 
@@ -550,8 +550,8 @@  discard block
 block discarded – undo
550 550
 	 * @param $file_path
551 551
 	 * @return string
552 552
 	 */
553
-	public static function standardise_and_end_with_directory_separator( $file_path ){
554
-		return self::end_with_directory_separator( self::standardise_directory_separators( $file_path ));
553
+	public static function standardise_and_end_with_directory_separator($file_path) {
554
+		return self::end_with_directory_separator(self::standardise_directory_separators($file_path));
555 555
 	}
556 556
 
557 557
 
@@ -568,21 +568,21 @@  discard block
 block discarded – undo
568 568
 	 *		if $index_numerically == FALSE (Default) keys are what the class names SHOULD be;
569 569
 	 *		 and values are their filepaths
570 570
 	 */
571
-	public static function get_contents_of_folders( $folder_paths = array(), $index_numerically = FALSE ){
571
+	public static function get_contents_of_folders($folder_paths = array(), $index_numerically = FALSE) {
572 572
 		$class_to_folder_path = array();
573
-		foreach( $folder_paths as $folder_path ){
574
-			$folder_path = self::standardise_and_end_with_directory_separator( $folder_path );
573
+		foreach ($folder_paths as $folder_path) {
574
+			$folder_path = self::standardise_and_end_with_directory_separator($folder_path);
575 575
 			// load WP_Filesystem and set file permissions
576
-			$files_in_folder = glob( $folder_path . '*' );
576
+			$files_in_folder = glob($folder_path.'*');
577 577
 			$class_to_folder_path = array();
578
-			if ( $files_in_folder ) {
579
-				foreach( $files_in_folder as $file_path ){
578
+			if ($files_in_folder) {
579
+				foreach ($files_in_folder as $file_path) {
580 580
 					//only add files, not folders
581
-					if ( ! is_dir( $file_path )) {
582
-						if ( $index_numerically ) {
581
+					if ( ! is_dir($file_path)) {
582
+						if ($index_numerically) {
583 583
 							$class_to_folder_path[] = $file_path;
584 584
 						} else {
585
-							$classname = self::get_classname_from_filepath_with_standard_filename( $file_path );
585
+							$classname = self::get_classname_from_filepath_with_standard_filename($file_path);
586 586
 							$class_to_folder_path[$classname] = $file_path;
587 587
 						}
588 588
 					}
@@ -602,39 +602,39 @@  discard block
 block discarded – undo
602 602
 	 * @throws EE_Error if filesystem credentials are required
603 603
 	 * @return boolean success
604 604
 	 */
605
-	public static function copy( $source_file, $destination_file, $overwrite = FALSE ){
606
-		$full_source_path = EEH_File::standardise_directory_separators( $source_file );
607
-		if( ! EEH_File::exists( $full_source_path ) ){
608
-			if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
609
-				$msg = sprintf( __( 'The file located at "%2$s" is not readable or doesn\'t exist.', 'event_espresso' ), $full_source_path );
610
-				$msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_source_path );
611
-				throw new EE_Error( $msg );
605
+	public static function copy($source_file, $destination_file, $overwrite = FALSE) {
606
+		$full_source_path = EEH_File::standardise_directory_separators($source_file);
607
+		if ( ! EEH_File::exists($full_source_path)) {
608
+			if (defined('WP_DEBUG') && WP_DEBUG) {
609
+				$msg = sprintf(__('The file located at "%2$s" is not readable or doesn\'t exist.', 'event_espresso'), $full_source_path);
610
+				$msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_source_path);
611
+				throw new EE_Error($msg);
612 612
 			}
613 613
 			return FALSE;
614 614
 		}
615 615
 
616
-		$full_dest_path = EEH_File::standardise_directory_separators( $destination_file );
617
-		$folder = EEH_File::remove_filename_from_filepath( $full_dest_path );
618
-		if ( ! EEH_File::verify_is_writable( $folder, 'folder' )) {
619
-			if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
620
-				$msg = sprintf( __( 'The file located at "%2$s" is not writable.', 'event_espresso' ), $full_dest_path );
621
-				$msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_dest_path );
622
-				throw new EE_Error( $msg );
616
+		$full_dest_path = EEH_File::standardise_directory_separators($destination_file);
617
+		$folder = EEH_File::remove_filename_from_filepath($full_dest_path);
618
+		if ( ! EEH_File::verify_is_writable($folder, 'folder')) {
619
+			if (defined('WP_DEBUG') && WP_DEBUG) {
620
+				$msg = sprintf(__('The file located at "%2$s" is not writable.', 'event_espresso'), $full_dest_path);
621
+				$msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_dest_path);
622
+				throw new EE_Error($msg);
623 623
 			}
624 624
 			return FALSE;
625 625
 		}
626 626
 
627 627
 		// load WP_Filesystem and set file permissions
628
-		$wp_filesystem = EEH_File::_get_wp_filesystem( $destination_file );
628
+		$wp_filesystem = EEH_File::_get_wp_filesystem($destination_file);
629 629
 		// write the file
630 630
 		if ( ! $wp_filesystem->copy( 
631
-						EEH_File::convert_local_filepath_to_remote_filepath( $full_source_path ), 
632
-						EEH_File::convert_local_filepath_to_remote_filepath( $full_dest_path ), 
631
+						EEH_File::convert_local_filepath_to_remote_filepath($full_source_path), 
632
+						EEH_File::convert_local_filepath_to_remote_filepath($full_dest_path), 
633 633
 						$overwrite )) {
634
-			if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
635
-				$msg = sprintf( __( 'Attempted writing to file %1$s, but could not, probably because of permissions issues', 'event_espresso' ), $full_source_path );
636
-				$msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_source_path, 'f' );
637
-				throw new EE_Error( $msg );
634
+			if (defined('WP_DEBUG') && WP_DEBUG) {
635
+				$msg = sprintf(__('Attempted writing to file %1$s, but could not, probably because of permissions issues', 'event_espresso'), $full_source_path);
636
+				$msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_source_path, 'f');
637
+				throw new EE_Error($msg);
638 638
 			}
639 639
 			return FALSE;
640 640
 		}
@@ -646,9 +646,9 @@  discard block
 block discarded – undo
646 646
 	 * @param string $filepath
647 647
 	 * @return boolean
648 648
 	 */
649
-	public static function is_in_uploads_folder( $filepath ) {
649
+	public static function is_in_uploads_folder($filepath) {
650 650
 		$uploads = wp_upload_dir();
651
-		return strpos( $filepath, $uploads[ 'basedir' ] ) === 0 ? true : false;
651
+		return strpos($filepath, $uploads['basedir']) === 0 ? true : false;
652 652
 	}
653 653
 	
654 654
 	/**
@@ -663,9 +663,9 @@  discard block
 block discarded – undo
663 663
 	 * @return string the remote filepath (eg the filepath the filesystem method, eg 
664 664
 	 * ftp or ssh, will use to access the folder
665 665
 	 */
666
-	public static function convert_local_filepath_to_remote_filepath( $local_filepath ) {
667
-		$wp_filesystem = EEH_File::_get_wp_filesystem( $local_filepath );
668
-		return str_replace( WP_CONTENT_DIR . DS, $wp_filesystem->wp_content_dir(), $local_filepath );
666
+	public static function convert_local_filepath_to_remote_filepath($local_filepath) {
667
+		$wp_filesystem = EEH_File::_get_wp_filesystem($local_filepath);
668
+		return str_replace(WP_CONTENT_DIR.DS, $wp_filesystem->wp_content_dir(), $local_filepath);
669 669
 	}
670 670
 }
671 671
 // End of file EEH_File.helper.php
Please login to merge, or discard this patch.