Completed
Branch BUG-8866-category-permalink (0af2d2)
by
unknown
22:53 queued 19s
created
core/db_models/fields/EE_Maybe_Serialized_Simple_HTML_Field.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,6 @@
 block discarded – undo
19 19
  * @package			Event Espresso
20 20
  * @subpackage		includes/models/
21 21
  * @author				Michael Nelson
22
-
23 22
  * Model field for representing a column that CAN contain serialized text, or a regular string.
24 23
  * But either way, the string or the array's values can ONLY contain simple HTML tags.
25 24
  * If you want to allow Full HTML in the value, use EE_Maybe_Serialized_Text_Field
Please login to merge, or discard this patch.
core/db_models/EEM_Venue.model.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * ------------------------------------------------------------------------
23 23
  */
24
-require_once ( EE_MODELS . 'EEM_Base.model.php' );
24
+require_once (EE_MODELS.'EEM_Base.model.php');
25 25
 
26 26
 class EEM_Venue extends EEM_CPT_Base {
27 27
 
28 28
   	// private instance of the Attendee object
29 29
 	protected static $_instance = NULL;
30 30
 
31
-	protected function __construct( $timezone = NULL ) {
32
-		$this->singular_item = __('Venue','event_espresso');
33
-		$this->plural_item = __('Venues','event_espresso');
31
+	protected function __construct($timezone = NULL) {
32
+		$this->singular_item = __('Venue', 'event_espresso');
33
+		$this->plural_item = __('Venues', 'event_espresso');
34 34
 		$this->_tables = array(
35 35
 			'Venue_CPT'=> new EE_Primary_Table('posts', 'ID'),
36 36
 			'Venue_Meta'=>new EE_Secondary_Table('esp_venue_meta', 'VNUM_ID', 'VNU_ID')
@@ -39,32 +39,32 @@  discard block
 block discarded – undo
39 39
 			'Venue_CPT'=>array(
40 40
 				'VNU_ID'=>new EE_Primary_Key_Int_Field('ID', __("Venue ID", "event_espresso")),
41 41
 				'VNU_name'=>new EE_Plain_Text_Field('post_title', __("Venue Name", "event_espresso"), false, ''),
42
-				'VNU_desc'=>new EE_Post_Content_Field('post_content', __("Venue Description", "event_espresso"), false,''),
43
-				'VNU_identifier'=>new EE_Slug_Field('post_name', __("Venue Identifier", "event_espresso"), false,''),
44
-				'VNU_created'=>new EE_Datetime_Field('post_date', __("Date Venue Created", "event_espresso"), FALSE,time()),
45
-				'VNU_short_desc'=>new EE_Plain_Text_Field('post_excerpt', __("Short Description of Venue", "event_espresso"), true,''),
46
-				'VNU_modified'=>new EE_Datetime_Field('post_modified', __("Venue Modified Date", "event_espresso"), FALSE,time()),
47
-				'VNU_wp_user'=>new EE_WP_User_Field('post_author', __("Venue Creator ID", "event_espresso"), false ),
48
-				'parent'=>new EE_Integer_Field('post_parent', __("Venue Parent ID", "event_espresso"), false,0),
42
+				'VNU_desc'=>new EE_Post_Content_Field('post_content', __("Venue Description", "event_espresso"), false, ''),
43
+				'VNU_identifier'=>new EE_Slug_Field('post_name', __("Venue Identifier", "event_espresso"), false, ''),
44
+				'VNU_created'=>new EE_Datetime_Field('post_date', __("Date Venue Created", "event_espresso"), FALSE, time()),
45
+				'VNU_short_desc'=>new EE_Plain_Text_Field('post_excerpt', __("Short Description of Venue", "event_espresso"), true, ''),
46
+				'VNU_modified'=>new EE_Datetime_Field('post_modified', __("Venue Modified Date", "event_espresso"), FALSE, time()),
47
+				'VNU_wp_user'=>new EE_WP_User_Field('post_author', __("Venue Creator ID", "event_espresso"), false),
48
+				'parent'=>new EE_Integer_Field('post_parent', __("Venue Parent ID", "event_espresso"), false, 0),
49 49
 				'VNU_order'=>new EE_Integer_Field('menu_order', __("Venue order", "event_espresso"), false, 1),
50
-				'post_type'=>new EE_WP_Post_Type_Field('espresso_venues'),// EE_Plain_Text_Field('post_type', __("Venue post type", "event_espresso"), false, 'espresso_venues'),
50
+				'post_type'=>new EE_WP_Post_Type_Field('espresso_venues'), // EE_Plain_Text_Field('post_type', __("Venue post type", "event_espresso"), false, 'espresso_venues'),
51 51
 				),
52 52
 			'Venue_Meta'=>array(
53 53
 				'VNUM_ID'=>new EE_DB_Only_Int_Field('VNUM_ID', __("ID of Venue Meta Row", "event_espresso"), false),
54 54
 				'VNU_ID_fk'=>new EE_DB_Only_Int_Field('VNU_ID', __("Foreign Key to Venue Post ", "event_espresso"), false),
55 55
 				'VNU_address'=>new EE_Plain_Text_Field('VNU_address', __("Venue Address line 1", "event_espresso"), true, ''),
56
-				'VNU_address2'=>new EE_Plain_Text_Field('VNU_address2', __("Venue Address line 2", "event_espresso"), true,''),
56
+				'VNU_address2'=>new EE_Plain_Text_Field('VNU_address2', __("Venue Address line 2", "event_espresso"), true, ''),
57 57
 				'VNU_city'=>new EE_Plain_Text_Field('VNU_city', __("Venue City", "event_espresso"), true, ''),
58 58
 				'STA_ID'=>new EE_Foreign_Key_Int_Field('STA_ID', __("State ID", "event_espresso"), true, null, 'State'),
59 59
 				'CNT_ISO'=>new EE_Foreign_Key_String_Field('CNT_ISO', __("Country Code", "event_espresso"), true, null, 'Country'),
60 60
 				'VNU_zip'=>new EE_Plain_Text_Field('VNU_zip', __("Venue Zip/Postal Code", "event_espresso"), true),
61 61
 				'VNU_phone'=>new EE_Plain_Text_Field('VNU_phone', __("Venue Phone", "event_espresso"), true),
62
-				'VNU_capacity'=>new EE_Infinite_Integer_Field('VNU_capacity', __("Venue Capacity", "event_espresso"), true,EE_INF),
62
+				'VNU_capacity'=>new EE_Infinite_Integer_Field('VNU_capacity', __("Venue Capacity", "event_espresso"), true, EE_INF),
63 63
 				'VNU_url'=>new EE_Plain_Text_Field('VNU_url', __('Venue Website', 'event_espresso'), true),
64 64
 				'VNU_virtual_phone'=>new EE_Plain_Text_Field('VNU_virtual_phone', __('Call in Number', 'event_espresso'), true),
65
-				'VNU_virtual_url'=>new EE_Plain_Text_Field('VNU_virtual_url', __('Virtual URL', 'event_espresso'), true ),
66
-				'VNU_google_map_link'=>new EE_Plain_Text_Field('VNU_google_map_link', __('Google Map Link', 'event_espresso'), true ),
67
-				'VNU_enable_for_gmap'=>new EE_Boolean_Field('VNU_enable_for_gmap', __('Show Google Map?', 'event_espresso'), false, false )
65
+				'VNU_virtual_url'=>new EE_Plain_Text_Field('VNU_virtual_url', __('Virtual URL', 'event_espresso'), true),
66
+				'VNU_google_map_link'=>new EE_Plain_Text_Field('VNU_google_map_link', __('Google Map Link', 'event_espresso'), true),
67
+				'VNU_enable_for_gmap'=>new EE_Boolean_Field('VNU_enable_for_gmap', __('Show Google Map?', 'event_espresso'), false, false)
68 68
 
69 69
 			));
70 70
 		$this->_model_relations = array(
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 			'WP_User' => new EE_Belongs_To_Relation()
76 76
 		);
77 77
 		//this model is generally available for reading
78
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public();
79
-		parent::__construct( $timezone );
78
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
79
+		parent::__construct($timezone);
80 80
 	}
81 81
 
82 82
 }
Please login to merge, or discard this patch.
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.
core/db_models/fields/EE_Infinite_Integer_Field.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,33 +7,33 @@  discard block
 block discarded – undo
7 7
  * other than explicitly setting it to EE_INF.
8 8
  * Makes use of constant EE_INF_IN_DB set in espresso.php, and EE_INF, which is a PHP constant definedin the ether
9 9
  */
10
-class EE_Infinite_Integer_Field extends EE_Model_Field_Base{
11
-	function get_wpdb_data_type(){
10
+class EE_Infinite_Integer_Field extends EE_Model_Field_Base {
11
+	function get_wpdb_data_type() {
12 12
 		return '%d';
13 13
 	}
14 14
 	function prepare_for_use_in_db($value_of_field_on_model_object) {
15
-		if($value_of_field_on_model_object === EE_INF){
15
+		if ($value_of_field_on_model_object === EE_INF) {
16 16
 			return EE_INF_IN_DB;
17
-		}else{
17
+		} else {
18 18
 			return intval($value_of_field_on_model_object);
19 19
 		}
20 20
 	}
21 21
 	function prepare_for_set($value_inputted_for_field_on_model_object) {
22
-		if($value_inputted_for_field_on_model_object === EE_INF_IN_DB ||
22
+		if ($value_inputted_for_field_on_model_object === EE_INF_IN_DB ||
23 23
 				$value_inputted_for_field_on_model_object === EE_INF ||
24 24
 				$value_inputted_for_field_on_model_object === "EE_INF" || 
25 25
 				$value_inputted_for_field_on_model_object === "" 
26
-				){
26
+				) {
27 27
 			return EE_INF;
28
-		}else{
28
+		} else {
29 29
 			return intval($value_inputted_for_field_on_model_object);
30 30
 		}
31 31
 	}
32 32
 	function prepare_for_set_from_db($value_inputted_for_field_on_model_object) {
33 33
 		$intval = intval($value_inputted_for_field_on_model_object);
34
-		if($intval == EE_INF_IN_DB){
34
+		if ($intval == EE_INF_IN_DB) {
35 35
 			return EE_INF;
36
-		}else{
36
+		} else {
37 37
 			return $intval;
38 38
 		}
39 39
 	}
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 	 * @param string $schema input, symbol, text; or any string you want to show if the value equals EE_INF
47 47
 	 * @return string
48 48
 	 */
49
-	function prepare_for_pretty_echoing( $value_on_field_to_be_outputted, $schema = null ) {
50
-		if( $value_on_field_to_be_outputted === EE_INF ){
51
-			switch($schema){
49
+	function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null) {
50
+		if ($value_on_field_to_be_outputted === EE_INF) {
51
+			switch ($schema) {
52 52
 				case 'input':
53 53
 				case 'form_input':
54 54
 					return '';
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	function prepare_for_use_in_db($value_of_field_on_model_object) {
15 15
 		if($value_of_field_on_model_object === EE_INF){
16 16
 			return EE_INF_IN_DB;
17
-		}else{
17
+		} else{
18 18
 			return intval($value_of_field_on_model_object);
19 19
 		}
20 20
 	}
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 				$value_inputted_for_field_on_model_object === "" 
26 26
 				){
27 27
 			return EE_INF;
28
-		}else{
28
+		} else{
29 29
 			return intval($value_inputted_for_field_on_model_object);
30 30
 		}
31 31
 	}
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 		$intval = intval($value_inputted_for_field_on_model_object);
34 34
 		if($intval == EE_INF_IN_DB){
35 35
 			return EE_INF;
36
-		}else{
36
+		} else{
37 37
 			return $intval;
38 38
 		}
39 39
 	}
Please login to merge, or discard this patch.
core/db_models/EEM_Transaction.model.php 2 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
 require_once ( EE_MODELS . 'EEM_Base.model.php' );
3 5
 /**
4 6
  *
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2
-require_once ( EE_MODELS . 'EEM_Base.model.php' );
2
+require_once (EE_MODELS.'EEM_Base.model.php');
3 3
 /**
4 4
  *
5 5
  * Transaction Model
@@ -68,35 +68,35 @@  discard block
 block discarded – undo
68 68
 	 * 		Note this just sends the timezone info to the date time model field objects.  Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
69 69
 	 *	@return EEM_Transaction
70 70
 	 */
71
-	protected function __construct( $timezone ) {
72
-		$this->singular_item = __('Transaction','event_espresso');
73
-		$this->plural_item = __('Transactions','event_espresso');
71
+	protected function __construct($timezone) {
72
+		$this->singular_item = __('Transaction', 'event_espresso');
73
+		$this->plural_item = __('Transactions', 'event_espresso');
74 74
 
75 75
 		$this->_tables = array(
76
-			'Transaction'=>new EE_Primary_Table('esp_transaction','TXN_ID')
76
+			'Transaction'=>new EE_Primary_Table('esp_transaction', 'TXN_ID')
77 77
 		);
78 78
 		$this->_fields = array(
79 79
 			'Transaction'=>array(
80
-				'TXN_ID'=>new EE_Primary_Key_Int_Field('TXN_ID', __('Transaction ID','event_espresso')),
81
-				'TXN_timestamp'=>new EE_Datetime_Field('TXN_timestamp', __('date when transaction was created','event_espresso'), false, time(), $timezone ),
82
-				'TXN_total'=>new EE_Money_Field('TXN_total', __('Total value of Transaction','event_espresso'), false, 0),
83
-				'TXN_paid'=>new EE_Money_Field('TXN_paid', __('Amount paid towards transaction to date','event_espresso'), false, 0),
84
-				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID','event_espresso'), false, EEM_Transaction::failed_status_code, 'Status'),
85
-				'TXN_session_data'=>new EE_Serialized_Text_Field('TXN_session_data', __('Serialized session data','event_espresso'), true, ''),
86
-				'TXN_hash_salt'=>new EE_Plain_Text_Field('TXN_hash_salt', __('Transaction Hash Salt','event_espresso'), true, ''),
80
+				'TXN_ID'=>new EE_Primary_Key_Int_Field('TXN_ID', __('Transaction ID', 'event_espresso')),
81
+				'TXN_timestamp'=>new EE_Datetime_Field('TXN_timestamp', __('date when transaction was created', 'event_espresso'), false, time(), $timezone),
82
+				'TXN_total'=>new EE_Money_Field('TXN_total', __('Total value of Transaction', 'event_espresso'), false, 0),
83
+				'TXN_paid'=>new EE_Money_Field('TXN_paid', __('Amount paid towards transaction to date', 'event_espresso'), false, 0),
84
+				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID', 'event_espresso'), false, EEM_Transaction::failed_status_code, 'Status'),
85
+				'TXN_session_data'=>new EE_Serialized_Text_Field('TXN_session_data', __('Serialized session data', 'event_espresso'), true, ''),
86
+				'TXN_hash_salt'=>new EE_Plain_Text_Field('TXN_hash_salt', __('Transaction Hash Salt', 'event_espresso'), true, ''),
87 87
 				'PMD_ID'=>new EE_Foreign_Key_Int_Field('PMD_ID', __("Last Used Payment Method", 'event_espresso'), true, NULL, 'Payment_Method'),
88
-				'TXN_reg_steps' => new EE_Serialized_Text_Field( 'TXN_reg_steps', __( 'Registration Steps', 'event_espresso' ), FALSE, array() ),
88
+				'TXN_reg_steps' => new EE_Serialized_Text_Field('TXN_reg_steps', __('Registration Steps', 'event_espresso'), FALSE, array()),
89 89
 			)
90 90
 		);
91 91
 		$this->_model_relations = array(
92 92
 			'Registration'=>new EE_Has_Many_Relation(),
93 93
 			'Payment'=>new EE_Has_Many_Relation(),
94 94
 			'Status'=>new EE_Belongs_To_Relation(),
95
-			'Line_Item'=>new EE_Has_Many_Relation(false),//you can delete a transaction without needing to delete its line items
95
+			'Line_Item'=>new EE_Has_Many_Relation(false), //you can delete a transaction without needing to delete its line items
96 96
 			'Payment_Method'=>new EE_Belongs_To_Relation(),
97 97
 		);
98 98
 		$this->_model_chain_to_wp_user = 'Registration.Event';
99
-		parent::__construct( $timezone );
99
+		parent::__construct($timezone);
100 100
 
101 101
 	}
102 102
 
@@ -107,19 +107,19 @@  discard block
 block discarded – undo
107 107
 	 * @param string $period
108 108
 	 * @return \stdClass[]
109 109
 	 */
110
-	public function get_revenue_per_day_report( $period = '-1 month' ) {
110
+	public function get_revenue_per_day_report($period = '-1 month') {
111 111
 
112
-		$sql_date = $this->convert_datetime_for_query( 'TXN_timestamp', date("Y-m-d H:i:s", strtotime($period) ), 'Y-m-d H:i:s', 'UTC' );
112
+		$sql_date = $this->convert_datetime_for_query('TXN_timestamp', date("Y-m-d H:i:s", strtotime($period)), 'Y-m-d H:i:s', 'UTC');
113 113
 		$results = $this->_get_all_wpdb_results(
114 114
 			array(
115 115
 				array(
116 116
 					'TXN_timestamp' => array('>=', $sql_date)),
117 117
 				'group_by' => 'txnDate',
118
-				'order_by' => array('TXN_timestamp' => 'DESC' )
118
+				'order_by' => array('TXN_timestamp' => 'DESC')
119 119
 			),
120 120
 			OBJECT,
121 121
 			array(
122
-				'txnDate' => array('DATE(Transaction.TXN_timestamp)','%s'),
122
+				'txnDate' => array('DATE(Transaction.TXN_timestamp)', '%s'),
123 123
 				'revenue' => array('SUM(Transaction.TXN_paid)', '%d')
124 124
 			));
125 125
 		return $results;
@@ -135,22 +135,22 @@  discard block
 block discarded – undo
135 135
 	 * @throws \EE_Error
136 136
 	 * @return mixed
137 137
 	 */
138
-	public function get_revenue_per_event_report( $period = 'month' ) {
138
+	public function get_revenue_per_event_report($period = 'month') {
139 139
 		/** @type WPDB $wpdb */
140 140
 		global $wpdb;
141
-		$date_mod = strtotime( '-1 ' . $period );
141
+		$date_mod = strtotime('-1 '.$period);
142 142
 
143 143
 		$SQL = 'SELECT post_title as event_name, SUM(TXN_paid) AS revenue';
144
-		$SQL .= ' FROM ' . $this->_get_main_table()->get_table_name() . ' txn';
145
-		$SQL .= ' LEFT JOIN ' . $wpdb->prefix . 'esp_registration reg ON reg.TXN_ID = txn.TXN_ID';
146
-		$SQL .= ' LEFT JOIN ' . $wpdb->posts . ' evt ON evt.ID = reg.EVT_ID';
144
+		$SQL .= ' FROM '.$this->_get_main_table()->get_table_name().' txn';
145
+		$SQL .= ' LEFT JOIN '.$wpdb->prefix.'esp_registration reg ON reg.TXN_ID = txn.TXN_ID';
146
+		$SQL .= ' LEFT JOIN '.$wpdb->posts.' evt ON evt.ID = reg.EVT_ID';
147 147
 		$SQL .= ' WHERE REG_count = 1';
148 148
 		$SQL .= ' AND REG_date >= %d';
149 149
 		$SQL .= ' GROUP BY event_name';
150 150
 		$SQL .= ' ORDER BY event_name';
151 151
 		$SQL .= ' LIMIT 0, 24';
152 152
 
153
-		return $this->_do_wpdb_query( 'get_results', array(  $wpdb->prepare( $SQL, $date_mod ) ) );
153
+		return $this->_do_wpdb_query('get_results', array($wpdb->prepare($SQL, $date_mod)));
154 154
 
155 155
 	}
156 156
 
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
 	 * @param string $reg_url_link
167 167
 	 * @return EE_Transaction
168 168
 	 */
169
-	public function get_transaction_from_reg_url_link( $reg_url_link = '' ){
170
-		return $this->get_one( array(
169
+	public function get_transaction_from_reg_url_link($reg_url_link = '') {
170
+		return $this->get_one(array(
171 171
 			array(
172
-				'Registration.REG_url_link' => ! empty( $reg_url_link ) ? $reg_url_link : EE_Registry::instance()->REQ->get( 'e_reg_url_link', '' )
172
+				'Registration.REG_url_link' => ! empty($reg_url_link) ? $reg_url_link : EE_Registry::instance()->REQ->get('e_reg_url_link', '')
173 173
 			)
174 174
 		));
175 175
 	}
@@ -189,15 +189,15 @@  discard block
 block discarded – undo
189 189
 	 * @param boolean $save_txn whether or not to save the transaction during this function call
190 190
 	 * @return boolean
191 191
 	 */
192
-	public function update_based_on_payments( $transaction_obj_or_id, $save_txn = TRUE ){
192
+	public function update_based_on_payments($transaction_obj_or_id, $save_txn = TRUE) {
193 193
 		EE_Error::doing_it_wrong(
194
-			__CLASS__ . '::' . __FUNCTION__,
195
-			sprintf( __( 'This method is deprecated. Please use "%s" instead', 'event_espresso' ), 'EE_Transaction_Processor::update_transaction_and_registrations_after_checkout_or_payment()' ),
194
+			__CLASS__.'::'.__FUNCTION__,
195
+			sprintf(__('This method is deprecated. Please use "%s" instead', 'event_espresso'), 'EE_Transaction_Processor::update_transaction_and_registrations_after_checkout_or_payment()'),
196 196
 			'4.6.0'
197 197
 		);
198 198
 		/** @type EE_Transaction_Processor $transaction_processor */
199
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
200
-		return  $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment( $this->ensure_is_obj( $transaction_obj_or_id ));
199
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
200
+		return  $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment($this->ensure_is_obj($transaction_obj_or_id));
201 201
 	}
202 202
 
203 203
 	/**
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 			array(
229 229
 				0 => array(
230 230
 					'STS_ID' => EEM_Transaction::failed_status_code,
231
-					'TXN_timestamp' => array( '<', time() - $time_to_leave_alone )
231
+					'TXN_timestamp' => array('<', time() - $time_to_leave_alone)
232 232
 				)
233 233
 			),
234 234
 			$time_to_leave_alone
@@ -241,26 +241,26 @@  discard block
 block discarded – undo
241 241
 		 */
242 242
 		$txn_ids = apply_filters(
243 243
 			'FHEE__EEM_Transaction__delete_junk_transactions__transaction_ids_to_delete',
244
-			EEM_Transaction::instance()->get_col( $ids_query, 'TXN_ID' ),
244
+			EEM_Transaction::instance()->get_col($ids_query, 'TXN_ID'),
245 245
 			$time_to_leave_alone
246 246
 		);
247 247
 
248 248
 		//now that we have the ids to delete, let's get deletin'
249 249
 		//Why no wpdb->prepare?  Because the data is trusted.  We got the ids from the original query to get them FROM
250 250
 		//the db (which is sanitized) so no need to prepare them again.
251
-		if ( $txn_ids ) {
252
-			$query   = '
251
+		if ($txn_ids) {
252
+			$query = '
253 253
 				DELETE
254
-				FROM ' . $this->table() . '
254
+				FROM ' . $this->table().'
255 255
 				WHERE
256
-					TXN_ID IN ( ' . implode( ",", $txn_ids ) . ')';
257
-			$deleted = $wpdb->query( $query );
256
+					TXN_ID IN ( ' . implode(",", $txn_ids).')';
257
+			$deleted = $wpdb->query($query);
258 258
 		}
259
-		if ( $deleted ) {
259
+		if ($deleted) {
260 260
 			/**
261 261
 			 * Allows code to do something after the transactions have been deleted.
262 262
 			 */
263
-			do_action( 'AHEE__EEM_Transaction__delete_junk_transactions__successful_deletion', $txn_ids );
263
+			do_action('AHEE__EEM_Transaction__delete_junk_transactions__successful_deletion', $txn_ids);
264 264
 		}
265 265
 		return $deleted;
266 266
 	}
Please login to merge, or discard this patch.
finalize_registration/EE_SPCO_Reg_Step_Finalize_Registration.class.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@
 block discarded – undo
170 170
 
171 171
 
172 172
 	/**
173
-	 * @return boolean
173
+	 * @return boolean|null
174 174
 	 */
175 175
 	public function update_reg_step() {
176 176
 		EE_Error::doing_it_wrong( __CLASS__ . '::' . __FILE__, __( 'Can not call update_reg_step() on the Finalize Registration reg step.', 'event_espresso'), '4.6.0' );
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 * @param    EE_Checkout $checkout
21 21
 	 * @return 	\EE_SPCO_Reg_Step_Finalize_Registration
22 22
 	 */
23
-	public function __construct( EE_Checkout $checkout ) {
23
+	public function __construct(EE_Checkout $checkout) {
24 24
 		$this->_slug = 'finalize_registration';
25 25
 		$this->_name = __('Finalize Registration', 'event_espresso');
26 26
 		$this->_submit_button_text = $this->_name;
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public function initialize_reg_step() {
48 48
 		// there's actually no reg form to process if this is the final step
49
-		if ( $this->is_current_step() ) {
49
+		if ($this->is_current_step()) {
50 50
 			$this->checkout->step = $_REQUEST['step'] = $this->slug();
51
-			$this->checkout->action = $_REQUEST[ 'action' ] = 'process_reg_step';
51
+			$this->checkout->action = $_REQUEST['action'] = 'process_reg_step';
52 52
 			$this->checkout->generate_reg_form = false;
53 53
 		}
54 54
 		return true;
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	public function process_reg_step() {
73 73
 		// ensure all data gets refreshed from the db
74
-		$this->checkout->refresh_all_entities( true );
74
+		$this->checkout->refresh_all_entities(true);
75 75
 		// ensures that all details and statuses for transaction, registration, and payments are updated
76 76
 		$txn_update_params = $this->_finalize_transaction();
77 77
 		// DEBUG LOG
@@ -85,16 +85,16 @@  discard block
 block discarded – undo
85 85
 		//	)
86 86
 		//);
87 87
 		// set a hook point
88
-		do_action( 'AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', $this->checkout, $txn_update_params );
88
+		do_action('AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', $this->checkout, $txn_update_params);
89 89
 		// check if transaction has a primary registrant and that it has a related Attendee object
90
-		if ( $this->checkout->transaction_has_primary_registrant() ) {
90
+		if ($this->checkout->transaction_has_primary_registrant()) {
91 91
 			// setup URL for redirect
92 92
 			$this->checkout->redirect_url = add_query_arg(
93
-				array( 'e_reg_url_link' => $this->checkout->transaction->primary_registration()->reg_url_link() ),
93
+				array('e_reg_url_link' => $this->checkout->transaction->primary_registration()->reg_url_link()),
94 94
 				$this->checkout->thank_you_page_url
95 95
 			);
96 96
 		} else {
97
-			EE_Error::add_error( __( 'A valid Primary Registration for this Transaction could not be found.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
97
+			EE_Error::add_error(__('A valid Primary Registration for this Transaction could not be found.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
98 98
 			$this->checkout->redirect = false;
99 99
 			$this->checkout->continue_reg = false;
100 100
 			return false;
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 		// you don't have to go home but you can't stay here !
103 103
 		$this->checkout->redirect = true;
104 104
 		$this->checkout->continue_reg = true;
105
-		$this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url );
106
-		if ( ! ( $this->checkout->payment_method instanceof EE_Payment_Method && $this->checkout->payment_method->is_off_site() ) ) {
105
+		$this->checkout->json_response->set_redirect_url($this->checkout->redirect_url);
106
+		if ( ! ($this->checkout->payment_method instanceof EE_Payment_Method && $this->checkout->payment_method->is_off_site())) {
107 107
 			// mark this reg step as completed
108 108
 			$this->set_completed();
109 109
 		}
@@ -120,43 +120,43 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	protected function _finalize_transaction() {
122 122
 		/** @type EE_Transaction_Processor $transaction_processor */
123
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
123
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
124 124
 		//set revisit flag in txn processor
125
-		$transaction_processor->set_revisit( $this->checkout->revisit );
125
+		$transaction_processor->set_revisit($this->checkout->revisit);
126 126
 		// at this point we'll consider a TXN to not have been abandoned
127
-		$transaction_processor->toggle_abandoned_transaction_status( $this->checkout->transaction );
128
-		if ( $this->checkout->cart instanceof EE_Cart ) {
127
+		$transaction_processor->toggle_abandoned_transaction_status($this->checkout->transaction);
128
+		if ($this->checkout->cart instanceof EE_Cart) {
129 129
 			// save TXN data to the cart
130
-			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( $this->checkout->transaction->ID() );
130
+			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn($this->checkout->transaction->ID());
131 131
 		}
132 132
 		/** @type EE_Transaction_Payments $transaction_payments */
133
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
133
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
134 134
 		// maybe update status, but don't save transaction just yet
135
-		$transaction_payments->update_transaction_status_based_on_total_paid( $this->checkout->transaction, false );
135
+		$transaction_payments->update_transaction_status_based_on_total_paid($this->checkout->transaction, false);
136 136
 		// If the selected method of payment used an off-site gateway...
137
-		if ( $this->checkout->payment_method instanceof EE_Payment_Method ) {
138
-			$is_revisit = filter_var( $this->checkout->revisit, FILTER_VALIDATE_BOOLEAN );
139
-			if ( $this->checkout->payment_method instanceof EE_Payment_Method && $this->checkout->payment_method->is_off_site() ) {
140
-				$gateway= $this->checkout->payment_method->type_obj()->get_gateway();
141
-				if ( $gateway instanceof EE_Offsite_Gateway && $gateway->uses_separate_IPN_request() ) {
137
+		if ($this->checkout->payment_method instanceof EE_Payment_Method) {
138
+			$is_revisit = filter_var($this->checkout->revisit, FILTER_VALIDATE_BOOLEAN);
139
+			if ($this->checkout->payment_method instanceof EE_Payment_Method && $this->checkout->payment_method->is_off_site()) {
140
+				$gateway = $this->checkout->payment_method->type_obj()->get_gateway();
141
+				if ($gateway instanceof EE_Offsite_Gateway && $gateway->uses_separate_IPN_request()) {
142 142
 					// do NOT trigger notifications because it was already done during the IPN
143
-					remove_all_filters( 'FHEE__EED_Messages___maybe_registration__deliver_notifications' );
144
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15 );
145
-				} else if ( ! $is_revisit ) {
146
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
143
+					remove_all_filters('FHEE__EED_Messages___maybe_registration__deliver_notifications');
144
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15);
145
+				} else if ( ! $is_revisit) {
146
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
147 147
 				}
148 148
 			} else if (
149 149
 				// if SPCO revisit and TXN status has changed due to a payment
150
-				$is_revisit && ( $this->checkout->txn_status_updated || $this->checkout->any_reg_status_updated() )
150
+				$is_revisit && ($this->checkout->txn_status_updated || $this->checkout->any_reg_status_updated())
151 151
 			) {
152 152
 				// send out notifications
153
-				add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
154
-			} else if ( ! $is_revisit ) {
155
-				add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
153
+				add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
154
+			} else if ( ! $is_revisit) {
155
+				add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
156 156
 			}
157 157
 		}
158 158
 		// this will result in the base session properties getting saved to the TXN_Session_data field
159
-		$this->checkout->transaction->set_txn_session_data( EE_Registry::instance()->SSN->get_session_data( null, true ));
159
+		$this->checkout->transaction->set_txn_session_data(EE_Registry::instance()->SSN->get_session_data(null, true));
160 160
 
161 161
 		// update the TXN if payment conditions have changed
162 162
 		return $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment(
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 * @return boolean
174 174
 	 */
175 175
 	public function update_reg_step() {
176
-		EE_Error::doing_it_wrong( __CLASS__ . '::' . __FILE__, __( 'Can not call update_reg_step() on the Finalize Registration reg step.', 'event_espresso'), '4.6.0' );
176
+		EE_Error::doing_it_wrong(__CLASS__.'::'.__FILE__, __('Can not call update_reg_step() on the Finalize Registration reg step.', 'event_espresso'), '4.6.0');
177 177
 	 }
178 178
 
179 179
 
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_7_0.dms.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 // (all other times it gets resurrected from a wordpress option)
15 15
 $stages = glob(EE_CORE.'data_migration_scripts/4_7_0_stages/*');
16 16
 $class_to_filepath = array();
17
-foreach($stages as $filepath){
17
+foreach ($stages as $filepath) {
18 18
 	$matches = array();
19
-	preg_match('~4_7_0_stages/(.*).dmsstage.php~',$filepath,$matches);
19
+	preg_match('~4_7_0_stages/(.*).dmsstage.php~', $filepath, $matches);
20 20
 	$class_to_filepath[$matches[1]] = $filepath;
21 21
 }
22 22
 //give addons a chance to autoload their stages too
23
-$class_to_filepath = apply_filters('FHEE__EE_DMS_4_7_0__autoloaded_stages',$class_to_filepath);
23
+$class_to_filepath = apply_filters('FHEE__EE_DMS_4_7_0__autoloaded_stages', $class_to_filepath);
24 24
 EEH_Autoloader::register_autoloader($class_to_filepath);
25 25
 
26 26
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
  * @since                4.7.0
37 37
  *
38 38
  */
39
-class EE_DMS_Core_4_7_0 extends EE_Data_Migration_Script_Base{
39
+class EE_DMS_Core_4_7_0 extends EE_Data_Migration_Script_Base {
40 40
 
41 41
 	/**
42 42
 	 * return EE_DMS_Core_4_7_0
@@ -58,18 +58,18 @@  discard block
 block discarded – undo
58 58
 	 * @return bool
59 59
 	 */
60 60
 	public function can_migrate_from_version($version_array) {
61
-		EE_Registry::instance()->load_helper( 'Activation' );
61
+		EE_Registry::instance()->load_helper('Activation');
62 62
 		$version_string = $version_array['Core'];
63 63
 		if (
64
-			( $version_string <= '4.7.0' && $version_string >= '4.6.0' )
64
+			($version_string <= '4.7.0' && $version_string >= '4.6.0')
65 65
 			||
66
-			( $version_string >= '4.7.0' &&
67
-					! EEH_Activation::table_exists( 'esp_registration_payment' ) &&
68
-					EEH_Activation::table_exists( 'esp_registration' ) ) ) {
66
+			($version_string >= '4.7.0' &&
67
+					! EEH_Activation::table_exists('esp_registration_payment') &&
68
+					EEH_Activation::table_exists('esp_registration')) ) {
69 69
 			return true;
70
-		} elseif ( ! $version_string ) {
70
+		} elseif ( ! $version_string) {
71 71
 			//no version string provided... this must be pre 4.3
72
-			return false;//changed mind. dont want people thinking they should migrate yet because they cant
72
+			return false; //changed mind. dont want people thinking they should migrate yet because they cant
73 73
 		} else {
74 74
 			return false;
75 75
 		}
@@ -91,16 +91,16 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function schema_changes_before_migration() {
93 93
 		//relies on 4.1's EEH_Activation::create_table
94
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
95
-		$table_name='esp_answer';
96
-		$sql=" ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
94
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
95
+		$table_name = 'esp_answer';
96
+		$sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
97 97
 					REG_ID INT UNSIGNED NOT NULL,
98 98
 					QST_ID INT UNSIGNED NOT NULL,
99 99
 					ANS_value TEXT NOT NULL,
100 100
 					PRIMARY KEY  (ANS_ID),
101 101
 					KEY REG_ID (REG_ID),
102 102
 					KEY QST_ID (QST_ID)";
103
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
103
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
104 104
 
105 105
 		$table_name = 'esp_attendee_meta';
106 106
 		$sql = "ATTM_ID INT(10) UNSIGNED NOT	NULL AUTO_INCREMENT,
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 					  CNT_is_EU TINYINT(1) DEFAULT '0',
141 141
 					  CNT_active TINYINT(1) DEFAULT '0',
142 142
 					  PRIMARY KEY  (CNT_ISO)";
143
-		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' );
143
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
144 144
 
145 145
 		$table_name = 'esp_currency';
146 146
 		$sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL,
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 				CUR_dec_plc VARCHAR(1) COLLATE utf8_bin NOT NULL DEFAULT '2',
151 151
 				CUR_active TINYINT(1) DEFAULT '0',
152 152
 				PRIMARY KEY  (CUR_code)";
153
-		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' );
153
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
154 154
 
155 155
 
156 156
 		$table_name = 'esp_currency_payment_method';
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 						KEY EVT_ID (EVT_ID),
181 181
 						KEY DTT_is_primary (DTT_is_primary)";
182 182
 
183
-		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' );
183
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
184 184
 
185 185
 		$table_name = 'esp_event_meta';
186 186
 		$sql = "
@@ -199,44 +199,44 @@  discard block
 block discarded – undo
199 199
 			EVT_donations TINYINT(1) NULL,
200 200
 			PRIMARY KEY  (EVTM_ID),
201 201
 			KEY EVT_ID (EVT_ID)";
202
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
202
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
203 203
 
204 204
 
205 205
 
206
-		$table_name='esp_event_question_group';
207
-		$sql="EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
206
+		$table_name = 'esp_event_question_group';
207
+		$sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
208 208
 					EVT_ID BIGINT(20) UNSIGNED NOT NULL,
209 209
 					QSG_ID INT UNSIGNED NOT NULL,
210 210
 					EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
211 211
 					PRIMARY KEY  (EQG_ID),
212 212
 					KEY EVT_ID (EVT_ID),
213 213
 					KEY QSG_ID (QSG_ID)";
214
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
214
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
215 215
 
216 216
 
217 217
 
218
-		$table_name='esp_event_venue';
219
-		$sql="EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
218
+		$table_name = 'esp_event_venue';
219
+		$sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
220 220
 				EVT_ID BIGINT(20) UNSIGNED NOT NULL,
221 221
 				VNU_ID BIGINT(20) UNSIGNED NOT NULL,
222 222
 				EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
223 223
 				PRIMARY KEY  (EVV_ID)";
224
-		$this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB');
224
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
225 225
 
226 226
 
227 227
 
228
-		$table_name='esp_extra_meta';
229
-		$sql="EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
228
+		$table_name = 'esp_extra_meta';
229
+		$sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
230 230
 				OBJ_ID INT(11) DEFAULT NULL,
231 231
 				EXM_type VARCHAR(45) DEFAULT NULL,
232 232
 				EXM_key VARCHAR(45) DEFAULT NULL,
233 233
 				EXM_value TEXT,
234 234
 				PRIMARY KEY  (EXM_ID),
235 235
 				KEY EXM_type (EXM_type, OBJ_ID, EXM_key(45))";
236
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
236
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
237 237
 
238
-		$table_name='esp_line_item';
239
-		$sql="LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
238
+		$table_name = 'esp_line_item';
239
+		$sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
240 240
 				LIN_code VARCHAR(245) NOT NULL DEFAULT '',
241 241
 				TXN_ID INT(11) DEFAULT NULL,
242 242
 				LIN_name VARCHAR(245) NOT NULL DEFAULT '',
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 				PRIMARY KEY  (LIN_ID),
255 255
 				KEY LIN_code (LIN_code(191)),
256 256
 				KEY TXN_ID (TXN_ID)";
257
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB' );
257
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
258 258
 
259 259
 		$table_name = 'esp_log';
260 260
 		$sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT,
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 					MTP_is_active TINYINT(1) NOT NULL DEFAULT '1',
295 295
 					PRIMARY KEY  (GRP_ID),
296 296
 					KEY MTP_user_id (MTP_user_id)";
297
-		$this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB');
297
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
298 298
 
299 299
 		$table_name = 'esp_event_message_template';
300 300
 		$sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 					PRIMARY KEY  (EMT_ID),
304 304
 					KEY EVT_ID (EVT_ID),
305 305
 					KEY GRP_ID (GRP_ID)";
306
-		$this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB');
306
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
307 307
 
308 308
 
309 309
 		$table_name = 'esp_payment';
@@ -376,8 +376,8 @@  discard block
 block discarded – undo
376 376
 					  PRIMARY KEY  (TTM_ID)";
377 377
 		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
378 378
 
379
-		$table_name='esp_question';
380
-		$sql='QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
379
+		$table_name = 'esp_question';
380
+		$sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
381 381
 					QST_display_text TEXT NOT NULL,
382 382
 					QST_admin_label VARCHAR(255) NOT NULL,
383 383
 					QST_system VARCHAR(25) DEFAULT NULL,
@@ -390,22 +390,22 @@  discard block
 block discarded – undo
390 390
 					QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0,
391 391
 					PRIMARY KEY  (QST_ID),
392 392
 					KEY QST_order (QST_order)';
393
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
393
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
394 394
 
395
-		$table_name='esp_question_group_question';
396
-		$sql="QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
395
+		$table_name = 'esp_question_group_question';
396
+		$sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
397 397
 					QSG_ID INT UNSIGNED NOT NULL,
398 398
 					QST_ID INT UNSIGNED NOT NULL,
399 399
 					QGQ_order INT UNSIGNED NOT NULL DEFAULT 0,
400 400
 					PRIMARY KEY  (QGQ_ID),
401 401
 					KEY QST_ID (QST_ID),
402 402
 					KEY QSG_ID_order (QSG_ID, QGQ_order)";
403
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
403
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
404 404
 
405 405
 
406 406
 
407
-		$table_name='esp_question_option';
408
-		$sql="QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
407
+		$table_name = 'esp_question_option';
408
+		$sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
409 409
 					QSO_value VARCHAR(255) NOT NULL,
410 410
 					QSO_desc TEXT NOT NULL,
411 411
 					QST_ID INT UNSIGNED NOT NULL,
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 					PRIMARY KEY  (QSO_ID),
415 415
 					KEY QST_ID (QST_ID),
416 416
 					KEY QSO_order (QSO_order)";
417
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
417
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
418 418
 
419 419
 
420 420
 
@@ -460,8 +460,8 @@  discard block
 block discarded – undo
460 460
 
461 461
 
462 462
 
463
-		$table_name='esp_checkin';
464
-		$sql="CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
463
+		$table_name = 'esp_checkin';
464
+		$sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
465 465
 					REG_ID INT(10) UNSIGNED NOT NULL,
466 466
 					DTT_ID INT(10) UNSIGNED NOT NULL,
467 467
 					CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1,
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 					  PRC_parent INT(10) UNSIGNED DEFAULT 0,
557 557
 					  PRIMARY KEY  (PRC_ID),
558 558
 					  KEY PRT_ID (PRT_ID)";
559
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
559
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
560 560
 
561 561
 		$table_name = "esp_price_type";
562 562
 		$sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -594,10 +594,10 @@  discard block
 block discarded – undo
594 594
 					  TKT_deleted TINYINT(1) NOT NULL DEFAULT '0',
595 595
 					  PRIMARY KEY  (TKT_ID),
596 596
 					  KEY TKT_start_date (TKT_start_date)";
597
-		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' );
597
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
598 598
 
599 599
 		$table_name = 'esp_question_group';
600
-		$sql='QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
600
+		$sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
601 601
 					QSG_name VARCHAR(255) NOT NULL,
602 602
 					QSG_identifier VARCHAR(100) NOT NULL,
603 603
 					QSG_desc TEXT NULL,
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
 					PRIMARY KEY  (QSG_ID),
611 611
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier),
612 612
 					KEY QSG_order (QSG_order)';
613
-		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' );
613
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
614 614
 
615 615
 		/** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
616 616
 		$script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 		return true;
643 643
 	}
644 644
 
645
-	public function migration_page_hooks(){
645
+	public function migration_page_hooks() {
646 646
 
647 647
 	}
648 648
 }
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Event_Shortcodes.lib.php 1 patch
Spacing   +32 added lines, -32 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
 /**
@@ -56,34 +56,34 @@  discard block
 block discarded – undo
56 56
 			'[EVENT_NAME]' => __("This also can be used for the name of the event", 'event_espresso'),
57 57
 			'[EVENT_PHONE]' => __('The phone number for the event (usually an info number)', 'event_espresso'),
58 58
 			'[EVENT_DESCRIPTION]' => __('The description of the event', 'event_espresso'),
59
-			'[EVENT_EXCERPT]' => __( 'This gets parsed to the value for the excerpt field in the event or blank if there is no excerpt.', 'event_espresso' ),
59
+			'[EVENT_EXCERPT]' => __('This gets parsed to the value for the excerpt field in the event or blank if there is no excerpt.', 'event_espresso'),
60 60
 			'[EVENT_LINK]' => __('A link associated with the event', 'event_espresso'),
61 61
 			'[EVENT_URL]' => __('A link to the event set up on the host site.', 'event_espresso'),
62 62
 			'[VIRTUAL_URL]' => __('What was used for the "URL of Event" field in the Venue settings', 'event_espresso'),
63 63
 			'[VIRTUAL_PHONE]' => __('An alternate phone number for the event. Typically used as a "call-in" number', 'event_espresso'),
64 64
 			'[EVENT_IMAGE]' => __('This will parse to the Feature image for the event.', 'event_espresso'),
65 65
 			'[EVENT_TOTAL_AVAILABLE_SPACES_*]' => sprintf(
66
-				__( 'This will parse to the total available spaces for an event. Calculating total spaces is approximate because it is dependent on the complexity of limits on your event.  There are two methods of calculation (which can be indicated by the %1$smethod%2$s param on the shortcode).  %1$scurrent%2$s which will do a more accurate calculation of total available spaces based on current sales, and %1$sfull%2$s which will be the maximum total available spaces that is on the event in optimal conditions. The shortcode will default to current.', 'event_espresso' ),
66
+				__('This will parse to the total available spaces for an event. Calculating total spaces is approximate because it is dependent on the complexity of limits on your event.  There are two methods of calculation (which can be indicated by the %1$smethod%2$s param on the shortcode).  %1$scurrent%2$s which will do a more accurate calculation of total available spaces based on current sales, and %1$sfull%2$s which will be the maximum total available spaces that is on the event in optimal conditions. The shortcode will default to current.', 'event_espresso'),
67 67
 				'<code>',
68 68
 				'</code>'
69 69
 				),
70
-			'[EVENT_TOTAL_SPOTS_TAKEN]' => __( 'This shortcode will parse to the output the total approved registrations for this event', 'event_espresso' ),
70
+			'[EVENT_TOTAL_SPOTS_TAKEN]' => __('This shortcode will parse to the output the total approved registrations for this event', 'event_espresso'),
71 71
 			'[EVENT_FACEBOOK_URL]' => __('This will return the Facebook URL for the event if you have it set via custom field in your event, otherwise it will use the Facebook URL set in "Your Organization Settings". To set the facebook url in your event, add a custom field with the key as <code>event_facebook</code> and the value as your facebook url.', 'event_espresso'),
72 72
 			'[EVENT_TWITTER_URL]' => __('This will return the Twitter URL for the event if you have it set via custom field in your event, otherwise it will use the Twitter URL set in "Your Organization Settings". To set the facebook url in your event, add a custom field with the key as <code>event_twitter</code> and the value as your facebook url', 'event_espresso'),
73 73
 			'[EVENT_META_*]' => __('This is a special dynamic shortcode. After the "*", add the exact name for your custom field, if there is a value set for that custom field within the event then it will be output in place of this shortcode.', 'event_espresso'),
74
-			'[REGISTRATION_LIST_TABLE_FOR_EVENT_URL]' => __( 'This parses to the url for the registration list table filtered by registrations for this event.', 'event_espresso' ),
74
+			'[REGISTRATION_LIST_TABLE_FOR_EVENT_URL]' => __('This parses to the url for the registration list table filtered by registrations for this event.', 'event_espresso'),
75 75
 			);
76 76
 	}
77 77
 
78 78
 
79
-	protected function _parser( $shortcode ) {
79
+	protected function _parser($shortcode) {
80 80
 
81
-		EE_Registry::instance()->load_helper( 'Formatter' );
81
+		EE_Registry::instance()->load_helper('Formatter');
82 82
 
83 83
 		$this->_event = $this->_data instanceof EE_Event ? $this->_data : null;
84 84
 
85 85
 		//if no event, then let's see if there is a reg_obj.  If there IS, then we'll try and grab the event from the reg_obj instead.
86
-		if ( empty( $this->_event ) ) {
86
+		if (empty($this->_event)) {
87 87
 			$aee = $this->_data instanceof EE_Messages_Addressee ? $this->_data : NULL;
88 88
 			$aee = $this->_extra_data instanceof EE_Messages_Addressee ? $this->_extra_data : $aee;
89 89
 
@@ -92,17 +92,17 @@  discard block
 block discarded – undo
92 92
 
93 93
 
94 94
 		//If there is no event objecdt by now then get out.
95
-		if ( ! $this->_event instanceof EE_Event )
95
+		if ( ! $this->_event instanceof EE_Event)
96 96
 			return '';
97 97
 
98
-		switch ( $shortcode ) {
98
+		switch ($shortcode) {
99 99
 
100 100
 			case '[EVENT_ID]' :
101 101
 				return $this->_event->ID();
102 102
 				break;
103 103
 
104 104
 			case '[EVENT_IDENTIFIER]' :
105
-				return isset($this->_data['line_ref']) ? $this->_data['line_ref']: '';
105
+				return isset($this->_data['line_ref']) ? $this->_data['line_ref'] : '';
106 106
 				break;
107 107
 
108 108
 			case '[EVENT]' :
@@ -132,71 +132,71 @@  discard block
 block discarded – undo
132 132
 
133 133
 			case '[VIRTUAL_URL]' :
134 134
 				$venue = $this->_event->get_first_related('Venue');
135
-				if ( empty( $venue ) )
135
+				if (empty($venue))
136 136
 					return '';
137 137
 				return $venue->get('VNU_virtual_url');
138 138
 
139 139
 			case '[VIRTUAL_PHONE]' :
140 140
 				$venue = $this->_event->get_first_related('Venue');
141
-				if ( empty( $venue ) )
141
+				if (empty($venue))
142 142
 					return '';
143 143
 				return $venue->get('VNU_virtual_phone');
144 144
 				break;
145 145
 
146 146
 			case '[EVENT_IMAGE]' :
147
-				$image = $this->_event->feature_image_url(array(600,300) );
147
+				$image = $this->_event->feature_image_url(array(600, 300));
148 148
 				// @todo: eventually we should make this an attribute shortcode so that em can send along what size they want returned.
149
-				return !empty( $image ) ? '<img src="' . $image . '" alt="' . sprintf( esc_attr__( '%s Feature Image', 'event_espresso'), $this->_event->get('EVT_name') ) . '" />' : '';
149
+				return ! empty($image) ? '<img src="'.$image.'" alt="'.sprintf(esc_attr__('%s Feature Image', 'event_espresso'), $this->_event->get('EVT_name')).'" />' : '';
150 150
 				break;
151 151
 
152 152
 			case '[EVENT_FACEBOOK_URL]' :
153
-				$facebook_url = $this->_event->get_post_meta('event_facebook', true );
154
-				return empty( $facebook_url ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' ) : $facebook_url;
153
+				$facebook_url = $this->_event->get_post_meta('event_facebook', true);
154
+				return empty($facebook_url) ? EE_Registry::instance()->CFG->organization->get_pretty('facebook') : $facebook_url;
155 155
 				break;
156 156
 
157 157
 			case '[EVENT_TWITTER_URL]' :
158 158
 				$twitter_url = $this->_event->get_post_meta('event_twitter', true);
159
-				return empty( $twitter_url ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' ) : $twitter_url;
159
+				return empty($twitter_url) ? EE_Registry::instance()->CFG->organization->get_pretty('twitter') : $twitter_url;
160 160
 				break;
161 161
 
162 162
 			case '[EVENT_AUTHOR_EMAIL]' :
163 163
 				$author_id = $this->_event->get('EVT_wp_user');
164
-				$user_data = get_userdata( (int) $author_id );
164
+				$user_data = get_userdata((int) $author_id);
165 165
 				return $user_data->user_email;
166 166
 				break;
167 167
 
168 168
 			case '[EVENT_TOTAL_SPOTS_TAKEN]' :
169
-				return EEM_Registration::instance()->count( array( array( 'EVT_ID' => $this->_event->ID(), 'STS_ID' => EEM_Registration::status_id_approved ) ), 'REG_ID', true );
169
+				return EEM_Registration::instance()->count(array(array('EVT_ID' => $this->_event->ID(), 'STS_ID' => EEM_Registration::status_id_approved)), 'REG_ID', true);
170 170
 				break;
171 171
 
172 172
 			case '[REGISTRATION_LIST_TABLE_FOR_EVENT_URL]' :
173
-				EE_Registry::instance()->load_helper( 'URL' );
173
+				EE_Registry::instance()->load_helper('URL');
174 174
 				return EEH_URL::add_query_args_and_nonce(
175 175
 					array(
176 176
 						'event_id' => $this->_event->ID(),
177 177
 						'page' => 'espresso_registrations',
178 178
 						'action' => 'default'
179 179
 					),
180
-					admin_url( 'admin.php' ),
180
+					admin_url('admin.php'),
181 181
 					true
182 182
 				);
183 183
 				break;
184 184
 		}
185 185
 
186
-		if ( strpos( $shortcode, '[EVENT_META_*' ) !== false ) {
187
-			$shortcode = str_replace( '[EVENT_META_*', '', $shortcode );
188
-			$shortcode = trim( str_replace( ']', '', $shortcode ) );
186
+		if (strpos($shortcode, '[EVENT_META_*') !== false) {
187
+			$shortcode = str_replace('[EVENT_META_*', '', $shortcode);
188
+			$shortcode = trim(str_replace(']', '', $shortcode));
189 189
 
190 190
 			//pull the meta value from the event post
191
-			$event_meta = $this->_event->get_post_meta( $shortcode, true );
191
+			$event_meta = $this->_event->get_post_meta($shortcode, true);
192 192
 
193
-			return !empty( $event_meta ) ? $this->_event->get_post_meta( $shortcode, true ) : '';
193
+			return ! empty($event_meta) ? $this->_event->get_post_meta($shortcode, true) : '';
194 194
 
195 195
 		}
196 196
 
197
-		if ( strpos( $shortcode, '[EVENT_TOTAL_AVAILABLE_SPACES_*' ) !== false ) {
198
-			$attrs = $this->_get_shortcode_attrs( $shortcode );
199
-			$method = empty( $attrs['method'] ) ? 'current' : $attrs['method'];
197
+		if (strpos($shortcode, '[EVENT_TOTAL_AVAILABLE_SPACES_*') !== false) {
198
+			$attrs = $this->_get_shortcode_attrs($shortcode);
199
+			$method = empty($attrs['method']) ? 'current' : $attrs['method'];
200 200
 			$method = $method === 'current';
201 201
 			$available = $this->_event->total_available_spaces($method);
202 202
 			return $available === EE_INF ? '&infin;' : $available;
@@ -212,10 +212,10 @@  discard block
 block discarded – undo
212 212
 	 * @param  boolean $full_link if TRUE (default) we return the html for the name of the event linked to the event.  Otherwise we just return the url of the event.
213 213
 	 * @return string
214 214
 	 */
215
-	private function _get_event_link( $event, $full_link = TRUE ) {
215
+	private function _get_event_link($event, $full_link = TRUE) {
216 216
 		$url = get_permalink($event->ID());
217 217
 
218
-		return $full_link ? '<a href="' . $url . '">' . $event->get('EVT_name') . '</a>' : $url;
218
+		return $full_link ? '<a href="'.$url.'">'.$event->get('EVT_name').'</a>' : $url;
219 219
 	}
220 220
 
221 221
 
Please login to merge, or discard this patch.
core/db_classes/EE_CSV.class.php 2 patches
Spacing   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3 3
  * CSV Import Export class
4 4
  * 
@@ -45,31 +45,31 @@  discard block
 block discarded – undo
45 45
 		global $wpdb;
46 46
 
47 47
 		$this->_primary_keys = array(
48
-				$wpdb->prefix . 'esp_answer' => array( 'ANS_ID' ),
49
-				$wpdb->prefix . 'esp_attendee' => array( 'ATT_ID' ),
50
-				$wpdb->prefix . 'esp_datetime'	=> array( 'DTT_ID' ),
51
-				$wpdb->prefix . 'esp_event_question_group'	=> array( 'EQG_ID' ),
52
-				$wpdb->prefix . 'esp_message_template'	=> array( 'MTP_ID' ),
53
-				$wpdb->prefix . 'esp_payment'	=> array( 'PAY_ID' ),
54
-				$wpdb->prefix . 'esp_price'	=> array( 'PRC_ID' ),
55
-				$wpdb->prefix . 'esp_price_type'	=> array( 'PRT_ID' ),
56
-				$wpdb->prefix . 'esp_question'	=> array( 'QST_ID' ),
57
-				$wpdb->prefix . 'esp_question_group'	=> array( 'QSG_ID' ),
58
-				$wpdb->prefix . 'esp_question_group_question'	=> array( 'QGQ_ID' ),
59
-				$wpdb->prefix . 'esp_question_option'	=> array( 'QSO_ID' ),
60
-				$wpdb->prefix . 'esp_registration'	=> array( 'REG_ID' ),
61
-				$wpdb->prefix . 'esp_status'	=> array( 'STS_ID' ),
62
-				$wpdb->prefix . 'esp_transaction'	=> array( 'TXN_ID' ),
63
-				$wpdb->prefix . 'esp_transaction'	=> array( 'TXN_ID' ),
64
-				$wpdb->prefix . 'events_detail'	=> array( 'id' ),
65
-				$wpdb->prefix . 'events_category_detail'	=> array( 'id' ),
66
-				$wpdb->prefix . 'events_category_rel'	=> array( 'id' ),
67
-				$wpdb->prefix . 'events_venue'	=> array( 'id' ),
68
-				$wpdb->prefix . 'events_venue_rel' =>  array( 'emeta_id' ),
69
-				$wpdb->prefix . 'events_locale'	=> array( 'id' ),
70
-				$wpdb->prefix . 'events_locale_rel'	=> array( 'id' ),
71
-				$wpdb->prefix . 'events_personnel' =>  array( 'id' ),
72
-				$wpdb->prefix . 'events_personnel_rel' =>  array( 'id' ),
48
+				$wpdb->prefix.'esp_answer' => array('ANS_ID'),
49
+				$wpdb->prefix.'esp_attendee' => array('ATT_ID'),
50
+				$wpdb->prefix.'esp_datetime'	=> array('DTT_ID'),
51
+				$wpdb->prefix.'esp_event_question_group'	=> array('EQG_ID'),
52
+				$wpdb->prefix.'esp_message_template'	=> array('MTP_ID'),
53
+				$wpdb->prefix.'esp_payment'	=> array('PAY_ID'),
54
+				$wpdb->prefix.'esp_price'	=> array('PRC_ID'),
55
+				$wpdb->prefix.'esp_price_type'	=> array('PRT_ID'),
56
+				$wpdb->prefix.'esp_question'	=> array('QST_ID'),
57
+				$wpdb->prefix.'esp_question_group'	=> array('QSG_ID'),
58
+				$wpdb->prefix.'esp_question_group_question'	=> array('QGQ_ID'),
59
+				$wpdb->prefix.'esp_question_option'	=> array('QSO_ID'),
60
+				$wpdb->prefix.'esp_registration'	=> array('REG_ID'),
61
+				$wpdb->prefix.'esp_status'	=> array('STS_ID'),
62
+				$wpdb->prefix.'esp_transaction'	=> array('TXN_ID'),
63
+				$wpdb->prefix.'esp_transaction'	=> array('TXN_ID'),
64
+				$wpdb->prefix.'events_detail'	=> array('id'),
65
+				$wpdb->prefix.'events_category_detail'	=> array('id'),
66
+				$wpdb->prefix.'events_category_rel'	=> array('id'),
67
+				$wpdb->prefix.'events_venue'	=> array('id'),
68
+				$wpdb->prefix.'events_venue_rel' =>  array('emeta_id'),
69
+				$wpdb->prefix.'events_locale'	=> array('id'),
70
+				$wpdb->prefix.'events_locale_rel'	=> array('id'),
71
+				$wpdb->prefix.'events_personnel' =>  array('id'),
72
+				$wpdb->prefix.'events_personnel_rel' =>  array('id'),
73 73
 			);
74 74
 
75 75
 	}
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 	 *		@ access public
82 82
 	 *		@return EE_CSV
83 83
 	 */
84
-	public static function instance ( ) {
84
+	public static function instance( ) {
85 85
 		// check if class object is instantiated
86
-		if ( self::$_instance === NULL  or ! is_object( self::$_instance ) or ! ( self::$_instance instanceof EE_CSV )) {
86
+		if (self::$_instance === NULL or ! is_object(self::$_instance) or ! (self::$_instance instanceof EE_CSV)) {
87 87
 			self::$_instance = new self();
88 88
 		}
89 89
 		return self::$_instance;
@@ -95,22 +95,22 @@  discard block
 block discarded – undo
95 95
 	 * @return string
96 96
 	 * @throws EE_Error
97 97
 	 */
98
-	private function read_unicode_file($file_path){
98
+	private function read_unicode_file($file_path) {
99 99
 		$fc = "";
100
-		$fh = fopen($file_path,"rb");
101
-		if( ! $fh ){
102
-			throw new EE_Error( sprintf( __("Cannot open file for read: %s<br>\n", 'event_espresso'), $file_path ) );
100
+		$fh = fopen($file_path, "rb");
101
+		if ( ! $fh) {
102
+			throw new EE_Error(sprintf(__("Cannot open file for read: %s<br>\n", 'event_espresso'), $file_path));
103 103
 		}
104 104
 		$flen = filesize($file_path);
105 105
 		$bc = fread($fh, $flen);
106
-		for ($i=0; $i<$flen; $i++){
107
-			$c = substr($bc,$i,1);
108
-			if ((ord($c) != 0) && (ord($c) != 13)){
109
-			  $fc = $fc . $c;
106
+		for ($i = 0; $i < $flen; $i++) {
107
+			$c = substr($bc, $i, 1);
108
+			if ((ord($c) != 0) && (ord($c) != 13)) {
109
+			  $fc = $fc.$c;
110 110
 			}
111 111
 		}
112
-		if ((ord(substr($fc,0,1)) == 255) && (ord(substr($fc,1,1)) == 254))
113
-		$fc = substr($fc,2);
112
+		if ((ord(substr($fc, 0, 1)) == 255) && (ord(substr($fc, 1, 1)) == 254))
113
+		$fc = substr($fc, 2);
114 114
 		return ($fc);
115 115
 }
116 116
 
@@ -122,15 +122,15 @@  discard block
 block discarded – undo
122 122
 	 * @param string $path_to_file
123 123
 	 * @return array of arrays. Top-level array has rows, second-level array has each item
124 124
 	 */
125
-	public function import_csv_to_multi_dimensional_array($path_to_file){
125
+	public function import_csv_to_multi_dimensional_array($path_to_file) {
126 126
 		// needed to deal with Mac line endings
127
-		ini_set('auto_detect_line_endings',TRUE);
127
+		ini_set('auto_detect_line_endings', TRUE);
128 128
 
129 129
 		// because fgetcsv does not correctly deal with backslashed quotes such as \"
130 130
 		// we'll read the file into a string
131
-		$file_contents = $this->read_unicode_file( $path_to_file );
131
+		$file_contents = $this->read_unicode_file($path_to_file);
132 132
 		// replace backslashed quotes with CSV enclosures
133
-		$file_contents = str_replace ( '\\"', '"""', $file_contents );
133
+		$file_contents = str_replace('\\"', '"""', $file_contents);
134 134
 		// HEY YOU! PUT THAT FILE BACK!!!
135 135
 		file_put_contents($path_to_file, $file_contents);
136 136
 
@@ -140,25 +140,25 @@  discard block
 block discarded – undo
140 140
 			$csvarray = array();
141 141
 
142 142
 			// in PHP 5.3 fgetcsv accepts a 5th parameter, but the pre 5.3 versions of fgetcsv choke if passed more than 4 - is that crazy or what?
143
-			if ( version_compare( PHP_VERSION, '5.3.0' ) < 0 ) {
143
+			if (version_compare(PHP_VERSION, '5.3.0') < 0) {
144 144
 
145 145
 				//  PHP 5.2- version
146 146
 
147 147
 				// loop through each row of the file
148
-				while(($data = fgetcsv($file_handle, 0, ',', '"' )) !== FALSE){
149
-					$csvarray[]= $data;
148
+				while (($data = fgetcsv($file_handle, 0, ',', '"')) !== FALSE) {
149
+					$csvarray[] = $data;
150 150
 				}
151
-			}else{
151
+			} else {
152 152
 				// loop through each row of the file
153
-				while (( $data = fgetcsv( $file_handle, 0, ',', '"', '\\' )) !== FALSE ) {
154
-					$csvarray[]=$data;
153
+				while (($data = fgetcsv($file_handle, 0, ',', '"', '\\')) !== FALSE) {
154
+					$csvarray[] = $data;
155 155
 				}
156 156
 			}
157 157
 			# Close the File.
158 158
 			fclose($file_handle);
159 159
 			return $csvarray;
160
-		}else{
161
-			EE_Error::add_error( sprintf(__("An error occurred - the file: %s could not opened.", "event_espresso"),$path_to_file), __FILE__, __FUNCTION__, __LINE__ );
160
+		} else {
161
+			EE_Error::add_error(sprintf(__("An error occurred - the file: %s could not opened.", "event_espresso"), $path_to_file), __FILE__, __FUNCTION__, __LINE__);
162 162
 			return false;
163 163
 		}
164 164
 	}
@@ -188,9 +188,9 @@  discard block
 block discarded – undo
188 188
 	 *						...
189 189
 	 *						)
190 190
 	 */
191
-	public function import_csv_to_model_data_array( $path_to_file, $model_name = FALSE, $first_row_is_headers = TRUE ) {
191
+	public function import_csv_to_model_data_array($path_to_file, $model_name = FALSE, $first_row_is_headers = TRUE) {
192 192
 		$multi_dimensional_array = $this->import_csv_to_multi_dimensional_array($path_to_file);
193
-		if( ! $multi_dimensional_array ){
193
+		if ( ! $multi_dimensional_array) {
194 194
 			return false;
195 195
 		}
196 196
 		// gotta start somewhere
@@ -199,9 +199,9 @@  discard block
 block discarded – undo
199 199
 		$ee_formatted_data = array();
200 200
 		// array to store headers (column names)
201 201
 		$headers = array();
202
-		foreach($multi_dimensional_array as $data){
202
+		foreach ($multi_dimensional_array as $data) {
203 203
 			// if first cell is MODEL, then second cell is the MODEL name
204
-			if ( $data[0]	== 'MODEL' ) {
204
+			if ($data[0] == 'MODEL') {
205 205
 				$model_name = $data[1];
206 206
 				//don't bother looking for model data in this row. The rest of this
207 207
 				//row should be blank
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 				$headers = array();
212 212
 				continue;
213 213
 			}
214
-			if( strpos( $data[0], EE_CSV::metadata_header ) !==FALSE ){
214
+			if (strpos($data[0], EE_CSV::metadata_header) !== FALSE) {
215 215
 				$model_name = EE_CSV::metadata_header;
216 216
 				//store like model data, we just won't try importing it etc.
217 217
 				$row = 1;
@@ -224,31 +224,31 @@  discard block
 block discarded – undo
224 224
 
225 225
 			$model_entry = array();
226 226
 			// loop through each column
227
-			for ( $i=0; $i < $columns; $i++ ) {
227
+			for ($i = 0; $i < $columns; $i++) {
228 228
 
229 229
 				//replace csv_enclosures with backslashed quotes
230
-				$data[$i] = str_replace ( '"""', '\\"', $data[$i] );
230
+				$data[$i] = str_replace('"""', '\\"', $data[$i]);
231 231
 				// do we need to grab the column names?
232
-				if ( $row === 1){
233
-					if( $first_row_is_headers ) {
232
+				if ($row === 1) {
233
+					if ($first_row_is_headers) {
234 234
 						// store the column names to use for keys
235 235
 						$column_name = $data[$i];
236 236
 						//check it's not blank... sometimes CSV editign programs adda bunch of empty columns onto the end...
237
-						if(!$column_name){continue;}
237
+						if ( ! $column_name) {continue; }
238 238
 						$matches = array();
239
-						if($model_name == EE_CSV::metadata_header){
239
+						if ($model_name == EE_CSV::metadata_header) {
240 240
 							$headers[$i] = $column_name;
241
-						}else{
241
+						} else {
242 242
 							//now get the db table name from it (the part between square brackets)
243
-							$success = preg_match('~(.*)\[(.*)\]~', $column_name,$matches);
244
-							if (!$success){
245
-								EE_Error::add_error( sprintf(__("The column titled %s is invalid for importing. It must be be in the format of 'Nice Name[model_field_name]' in row %s", "event_espresso"),$column_name,implode(",",$data)), __FILE__, __FUNCTION__, __LINE__ );
243
+							$success = preg_match('~(.*)\[(.*)\]~', $column_name, $matches);
244
+							if ( ! $success) {
245
+								EE_Error::add_error(sprintf(__("The column titled %s is invalid for importing. It must be be in the format of 'Nice Name[model_field_name]' in row %s", "event_espresso"), $column_name, implode(",", $data)), __FILE__, __FUNCTION__, __LINE__);
246 246
 								return false;
247 247
 							}
248 248
 							$headers[$i] = $matches[2];
249 249
 						}
250 250
 
251
-					}else{
251
+					} else {
252 252
 						// no column names means our final array will just use counters for keys
253 253
 						$model_entry[$headers[$i]] = $data[$i];
254 254
 						$headers[$i] = $i;
@@ -256,14 +256,14 @@  discard block
 block discarded – undo
256 256
 					// and we need to store csv data
257 257
 				} else {
258 258
 					// this column isn' ta header, store it if there is a header for it
259
-					if(isset($headers[$i])){
259
+					if (isset($headers[$i])) {
260 260
 						$model_entry[$headers[$i]] = $data[$i];
261 261
 					}
262 262
 				}
263 263
 
264 264
 			}
265 265
 			//save the row's data IF it's a non-header-row
266
-			if( ! $first_row_is_headers || ($first_row_is_headers && $row > 1)){
266
+			if ( ! $first_row_is_headers || ($first_row_is_headers && $row > 1)) {
267 267
 				$ee_formatted_data[$model_name][] = $model_entry;
268 268
 			}
269 269
 			// advance to next row
@@ -282,9 +282,9 @@  discard block
 block discarded – undo
282 282
 	}
283 283
 
284 284
 
285
-	public function save_csv_to_db( $csv_data_array, $model_name = FALSE ) {
286
-		EE_Error::doing_it_wrong('save_csv_to_db', __( 'Function moved to EE_Import and renamed to save_csv_data_array_to_db', 'event_espresso' ), '4.6.7' );
287
-		return EE_Import::instance()->save_csv_data_array_to_db( $csv_data_array, $model_name );
285
+	public function save_csv_to_db($csv_data_array, $model_name = FALSE) {
286
+		EE_Error::doing_it_wrong('save_csv_to_db', __('Function moved to EE_Import and renamed to save_csv_data_array_to_db', 'event_espresso'), '4.6.7');
287
+		return EE_Import::instance()->save_csv_data_array_to_db($csv_data_array, $model_name);
288 288
 	}
289 289
 
290 290
 	/**
@@ -294,11 +294,11 @@  discard block
 block discarded – undo
294 294
 	 * @param string $new_filename the name of the file that the user will download
295 295
 	 * @return resource, like the results of fopen(), which can be used for fwrite, fputcsv2, etc.
296 296
 	 */
297
-	public function begin_sending_csv($filename){
297
+	public function begin_sending_csv($filename) {
298 298
 		// grab file extension
299 299
 		$ext = substr(strrchr($filename, '.'), 1);
300
-		if ( $ext == '.csv' or  $ext == '.xls' ) {
301
-			str_replace( $ext, '', $filename );
300
+		if ($ext == '.csv' or $ext == '.xls') {
301
+			str_replace($ext, '', $filename);
302 302
 		}
303 303
 		$filename .= '.csv';
304 304
 
@@ -319,8 +319,8 @@  discard block
 block discarded – undo
319 319
 //		header("Content-Type: application/download");
320 320
 		header('Content-disposition: attachment; filename='.$filename);
321 321
 		header("Content-Type: text/csv; charset=utf-8");
322
-                do_action( 'AHEE__EE_CSV__begin_sending_csv__headers' );
323
-		echo apply_filters('FHEE__EE_CSV__begin_sending_csv__start_writing', "\xEF\xBB\xBF" ); // makes excel open it as UTF-8. UTF-8 BOM, see http://stackoverflow.com/a/4440143/2773835
322
+                do_action('AHEE__EE_CSV__begin_sending_csv__headers');
323
+		echo apply_filters('FHEE__EE_CSV__begin_sending_csv__start_writing', "\xEF\xBB\xBF"); // makes excel open it as UTF-8. UTF-8 BOM, see http://stackoverflow.com/a/4440143/2773835
324 324
 		$fh = fopen('php://output', 'w');
325 325
 		return $fh;
326 326
 	}
@@ -330,12 +330,12 @@  discard block
 block discarded – undo
330 330
 	 * mentioning the version and timezone
331 331
 	 * @param resource $filehandle
332 332
 	 */
333
-	public function write_metadata_to_csv($filehandle){
333
+	public function write_metadata_to_csv($filehandle) {
334 334
 		EE_Registry::instance()->load_helper('DTT_Helper');
335
-		$data_row = array(EE_CSV::metadata_header);//do NOT translate because this exact string is used when importing
335
+		$data_row = array(EE_CSV::metadata_header); //do NOT translate because this exact string is used when importing
336 336
 		$this->fputcsv2($filehandle, $data_row);
337 337
 		EE_Registry::instance()->load_helper('DTT_Helper');
338
-		$meta_data = array( 0=> array(
338
+		$meta_data = array(0=> array(
339 339
 			'version'=>espresso_version(),
340 340
 			'timezone'=>  EEH_DTT_Helper::get_timezone(),
341 341
 			'time_of_export'=>current_time('mysql'),
@@ -353,30 +353,30 @@  discard block
 block discarded – undo
353 353
 	 * then the first row we'd write to the CSV would be "EVT_ID,EVT_name,..."
354 354
 	 * @return boolean if we successfully wrote to the CSV or not. If there's no $data, we consider that a success (because we wrote everything there was...nothing)
355 355
 	 */
356
-	public function write_data_array_to_csv($filehandle, $data){
356
+	public function write_data_array_to_csv($filehandle, $data) {
357 357
 		EE_Registry::instance()->load_helper('Array');
358 358
 
359 359
 
360 360
 		//determine if $data is actually a 2d array
361
-		if ( $data && is_array($data) && is_array(EEH_Array::get_one_item_from_array($data))){
361
+		if ($data && is_array($data) && is_array(EEH_Array::get_one_item_from_array($data))) {
362 362
 			//make sure top level is numerically indexed,
363 363
 
364
-			if( EEH_Array::is_associative_array($data)){
365
-				throw new EE_Error(sprintf(__("top-level array must be numerically indexed. Does these look like numbers to you? %s","event_espresso"),implode(",",array_keys($data))));
364
+			if (EEH_Array::is_associative_array($data)) {
365
+				throw new EE_Error(sprintf(__("top-level array must be numerically indexed. Does these look like numbers to you? %s", "event_espresso"), implode(",", array_keys($data))));
366 366
 			}
367 367
 			$item_in_top_level_array = EEH_Array::get_one_item_from_array($data);
368 368
 			//now, is the last item in the top-level array of $data an associative or numeric array?
369
-			if(EEH_Array::is_associative_array($item_in_top_level_array)){
369
+			if (EEH_Array::is_associative_array($item_in_top_level_array)) {
370 370
 				//its associative, so we want to output its keys as column headers
371 371
 				$keys = array_keys($item_in_top_level_array);
372 372
 				echo $this->fputcsv2($filehandle, $keys);
373 373
 			}
374 374
 			//start writing data
375
-			foreach($data as $data_row){
375
+			foreach ($data as $data_row) {
376 376
 				echo $this->fputcsv2($filehandle, $data_row);
377 377
 			}
378 378
 			return true;
379
-		}else{
379
+		} else {
380 380
 			//no data TO write... so we can assume that's a success
381 381
 			return true;
382 382
 		}
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 	 * Calls exit to prevent polluting the CSV file with other junk
422 422
 	 * @param resource $fh filehandle where we're writing the CSV to
423 423
 	 */
424
-	public function end_sending_csv($fh){
424
+	public function end_sending_csv($fh) {
425 425
 		fclose($fh);
426 426
 		exit(0);
427 427
 	}
@@ -434,23 +434,23 @@  discard block
 block discarded – undo
434 434
 	 * has all the attributes o fthat model object (eg, the event's id, name, etc)
435 435
 	 * @return boolean success
436 436
 	 */
437
-	public function write_model_data_to_csv($filehandle,$model_data_array){
437
+	public function write_model_data_to_csv($filehandle, $model_data_array) {
438 438
 		$this->write_metadata_to_csv($filehandle);
439
-		foreach($model_data_array as $model_name => $model_instance_arrays){
439
+		foreach ($model_data_array as $model_name => $model_instance_arrays) {
440 440
 			//first: output a special row stating the model
441
-			echo $this->fputcsv2($filehandle,array('MODEL',$model_name));
441
+			echo $this->fputcsv2($filehandle, array('MODEL', $model_name));
442 442
 			//if we have items to put in the CSV, do it normally
443 443
 
444
-			if( ! empty($model_instance_arrays) ){
444
+			if ( ! empty($model_instance_arrays)) {
445 445
 				$this->write_data_array_to_csv($filehandle, $model_instance_arrays);
446
-			}else{
446
+			} else {
447 447
 //				echo "no data to write... so just write the headers";
448 448
 				//so there's actually NO model objects for that model.
449 449
 				//probably still want to show the columns
450 450
 				$model = EE_Registry::instance()->load_model($model_name);
451 451
 				$column_names = array();
452
-				foreach($model->field_settings() as $field){
453
-					$column_names[$field->get_nicename()."[".$field->get_name()."]"] = null ;
452
+				foreach ($model->field_settings() as $field) {
453
+					$column_names[$field->get_nicename()."[".$field->get_name()."]"] = null;
454 454
 				}
455 455
 				$this->write_data_array_to_csv($filehandle, array($column_names));
456 456
 			}
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 	 * @param array $model_data_array 3d array, as described in EE_CSV::write_model_data_to_csv()
465 465
 	 * @return bool | void writes CSV file to output and dies
466 466
 	 */
467
-	public function export_multiple_model_data_to_csv($filename,$model_data_array){
467
+	public function export_multiple_model_data_to_csv($filename, $model_data_array) {
468 468
 		$filehandle = $this->begin_sending_csv($filename);
469 469
 		$this->write_model_data_to_csv($filehandle, $model_data_array);
470 470
 		$this->end_sending_csv($filehandle);
@@ -476,15 +476,15 @@  discard block
 block discarded – undo
476 476
 	 *			@param string $filename - name for newly created csv file
477 477
 	 *			@return TRUE on success, FALSE on fail
478 478
 	 */
479
-	public function export_array_to_csv( $data = FALSE, $filename = FALSE  ) {
479
+	public function export_array_to_csv($data = FALSE, $filename = FALSE) {
480 480
 
481 481
 		// no data file?? get outta here
482
-		if ( ! $data or ! is_array( $data ) or empty( $data ) ) {
482
+		if ( ! $data or ! is_array($data) or empty($data)) {
483 483
 			return FALSE;
484 484
 		}
485 485
 
486 486
 		// no filename?? get outta here
487
-		if ( ! $filename ) {
487
+		if ( ! $filename) {
488 488
 			return FALSE;
489 489
 		}
490 490
 
@@ -510,11 +510,11 @@  discard block
 block discarded – undo
510 510
 	 *			@param int $percent_of_max - desired percentage of the max upload_mb
511 511
 	 *			@return int KB
512 512
 	 */
513
-	public function get_max_upload_size ( $percent_of_max = FALSE ) {
513
+	public function get_max_upload_size($percent_of_max = FALSE) {
514 514
 
515
-		$max_upload = (int)(ini_get('upload_max_filesize'));
516
-		$max_post = (int)(ini_get('post_max_size'));
517
-		$memory_limit = (int)(ini_get('memory_limit'));
515
+		$max_upload = (int) (ini_get('upload_max_filesize'));
516
+		$max_post = (int) (ini_get('post_max_size'));
517
+		$memory_limit = (int) (ini_get('memory_limit'));
518 518
 
519 519
 		// determine the smallest of the three values from above
520 520
 		$upload_mb = min($max_upload, $max_post, $memory_limit);
@@ -523,9 +523,9 @@  discard block
 block discarded – undo
523 523
 		$upload_mb = $upload_mb * 1024;
524 524
 
525 525
 		// don't want the full monty? then reduce the max uplaod size
526
-		if ( $percent_of_max ) {
526
+		if ($percent_of_max) {
527 527
 			// is percent_of_max like this -> 50 or like this -> 0.50 ?
528
-			if ( $percent_of_max > 1 ) {
528
+			if ($percent_of_max > 1) {
529 529
 				// chnages 50 to 0.50
530 530
 				$percent_of_max = $percent_of_max / 100;
531 531
 			}
@@ -547,17 +547,17 @@  discard block
 block discarded – undo
547 547
 	 *			@param string $mysql_null - allows php NULL to be overridden with MySQl's insertable NULL value
548 548
 	 *			@return void
549 549
 	 */
550
-	private function fputcsv2 ($fh, array $row, $delimiter = ',', $enclosure = '"', $mysql_null = FALSE) {
550
+	private function fputcsv2($fh, array $row, $delimiter = ',', $enclosure = '"', $mysql_null = FALSE) {
551 551
 		//Allow user to filter the csv delimiter and enclosure for other countries csv standards
552
-		$delimiter = apply_filters( 'FHEE__EE_CSV__fputcsv2__delimiter', $delimiter );
553
-		$enclosure = apply_filters( 'FHEE__EE_CSV__fputcsv2__enclosure', $enclosure );
552
+		$delimiter = apply_filters('FHEE__EE_CSV__fputcsv2__delimiter', $delimiter);
553
+		$enclosure = apply_filters('FHEE__EE_CSV__fputcsv2__enclosure', $enclosure);
554 554
 
555 555
 		$delimiter_esc = preg_quote($delimiter, '/');
556 556
 		$enclosure_esc = preg_quote($enclosure, '/');
557 557
 
558 558
 		$output = array();
559 559
 		foreach ($row as $field_value) {
560
-			if(is_object($field_value) || is_array($field_value)){
560
+			if (is_object($field_value) || is_array($field_value)) {
561 561
 				$field_value = serialize($field_value);
562 562
 			}
563 563
 			if ($field_value === null && $mysql_null) {
@@ -566,10 +566,10 @@  discard block
 block discarded – undo
566 566
 			}
567 567
 
568 568
 			$output[] = preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field_value) ?
569
-				( $enclosure . str_replace($enclosure, $enclosure . $enclosure, $field_value) . $enclosure ) : $field_value;
569
+				($enclosure.str_replace($enclosure, $enclosure.$enclosure, $field_value).$enclosure) : $field_value;
570 570
 		}
571 571
 
572
-		fwrite($fh, join($delimiter, $output) . PHP_EOL);
572
+		fwrite($fh, join($delimiter, $output).PHP_EOL);
573 573
 	}
574 574
 
575 575
 
@@ -607,8 +607,8 @@  discard block
 block discarded – undo
607 607
 	 * @param string $current_format
608 608
 	 * @return string
609 609
 	 */
610
-	public function get_date_format_for_csv( $current_format = null ) {
611
-		return apply_filters( 'FHEE__EE_CSV__get_date_format_for_csv__format', 'Y-m-d', $current_format );
610
+	public function get_date_format_for_csv($current_format = null) {
611
+		return apply_filters('FHEE__EE_CSV__get_date_format_for_csv__format', 'Y-m-d', $current_format);
612 612
 	}
613 613
 
614 614
 	/**
@@ -616,8 +616,8 @@  discard block
 block discarded – undo
616 616
 	 * @param string $current_format
617 617
 	 * @return string
618 618
 	 */
619
-	public function get_time_format_for_csv( $current_format = null ) {
620
-		return apply_filters( 'FHEE__EE_CSV__get_time_format_for_csv__format', 'H:i:s', $current_format );
619
+	public function get_time_format_for_csv($current_format = null) {
620
+		return apply_filters('FHEE__EE_CSV__get_time_format_for_csv__format', 'H:i:s', $current_format);
621 621
 	}
622 622
 
623 623
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 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
  * CSV Import Export class
4 6
  * 
@@ -109,8 +111,9 @@  discard block
 block discarded – undo
109 111
 			  $fc = $fc . $c;
110 112
 			}
111 113
 		}
112
-		if ((ord(substr($fc,0,1)) == 255) && (ord(substr($fc,1,1)) == 254))
113
-		$fc = substr($fc,2);
114
+		if ((ord(substr($fc,0,1)) == 255) && (ord(substr($fc,1,1)) == 254)) {
115
+				$fc = substr($fc,2);
116
+		}
114 117
 		return ($fc);
115 118
 }
116 119
 
@@ -148,7 +151,7 @@  discard block
 block discarded – undo
148 151
 				while(($data = fgetcsv($file_handle, 0, ',', '"' )) !== FALSE){
149 152
 					$csvarray[]= $data;
150 153
 				}
151
-			}else{
154
+			} else{
152 155
 				// loop through each row of the file
153 156
 				while (( $data = fgetcsv( $file_handle, 0, ',', '"', '\\' )) !== FALSE ) {
154 157
 					$csvarray[]=$data;
@@ -157,7 +160,7 @@  discard block
 block discarded – undo
157 160
 			# Close the File.
158 161
 			fclose($file_handle);
159 162
 			return $csvarray;
160
-		}else{
163
+		} else{
161 164
 			EE_Error::add_error( sprintf(__("An error occurred - the file: %s could not opened.", "event_espresso"),$path_to_file), __FILE__, __FUNCTION__, __LINE__ );
162 165
 			return false;
163 166
 		}
@@ -238,7 +241,7 @@  discard block
 block discarded – undo
238 241
 						$matches = array();
239 242
 						if($model_name == EE_CSV::metadata_header){
240 243
 							$headers[$i] = $column_name;
241
-						}else{
244
+						} else{
242 245
 							//now get the db table name from it (the part between square brackets)
243 246
 							$success = preg_match('~(.*)\[(.*)\]~', $column_name,$matches);
244 247
 							if (!$success){
@@ -248,7 +251,7 @@  discard block
 block discarded – undo
248 251
 							$headers[$i] = $matches[2];
249 252
 						}
250 253
 
251
-					}else{
254
+					} else{
252 255
 						// no column names means our final array will just use counters for keys
253 256
 						$model_entry[$headers[$i]] = $data[$i];
254 257
 						$headers[$i] = $i;
@@ -376,7 +379,7 @@  discard block
 block discarded – undo
376 379
 				echo $this->fputcsv2($filehandle, $data_row);
377 380
 			}
378 381
 			return true;
379
-		}else{
382
+		} else{
380 383
 			//no data TO write... so we can assume that's a success
381 384
 			return true;
382 385
 		}
@@ -443,7 +446,7 @@  discard block
 block discarded – undo
443 446
 
444 447
 			if( ! empty($model_instance_arrays) ){
445 448
 				$this->write_data_array_to_csv($filehandle, $model_instance_arrays);
446
-			}else{
449
+			} else{
447 450
 //				echo "no data to write... so just write the headers";
448 451
 				//so there's actually NO model objects for that model.
449 452
 				//probably still want to show the columns
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 {
@@ -243,16 +243,16 @@  discard block
 block discarded – undo
243 243
 	 * constructor
244 244
 	 * @param EE_Admin_Page object $admin_page we use this for obtaining everything we need in the list table.
245 245
 	 */
246
-	public function __construct( EE_Admin_Page $admin_page ) {
246
+	public function __construct(EE_Admin_Page $admin_page) {
247 247
 		$this->_admin_page = $admin_page;
248 248
 		$this->_req_data = $this->_admin_page->get_request_data();
249 249
 		$this->_view = $this->_admin_page->get_view();
250
-		$this->_views = empty( $this->_views ) ? $this->_admin_page->get_list_table_view_RLs() : $this->_views;
250
+		$this->_views = empty($this->_views) ? $this->_admin_page->get_list_table_view_RLs() : $this->_views;
251 251
 		$this->_current_page = $this->get_pagenum();
252
-		$this->_screen = $this->_admin_page->get_current_page() . '_' . $this->_admin_page->get_current_view();
253
-		$this->_yes_no = array(  __('No', 'event_espresso'), __('Yes', 'event_espresso'));
252
+		$this->_screen = $this->_admin_page->get_current_page().'_'.$this->_admin_page->get_current_view();
253
+		$this->_yes_no = array(__('No', 'event_espresso'), __('Yes', 'event_espresso'));
254 254
 
255
-		$this->_per_page = $this->get_items_per_page( $this->_screen . '_per_page', 10 );
255
+		$this->_per_page = $this->get_items_per_page($this->_screen.'_per_page', 10);
256 256
 
257 257
 		$this->_setup_data();
258 258
 		$this->_add_view_counts();
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 		$this->_set_properties();
263 263
 
264 264
 		//set primary column
265
-		add_filter( 'list_table_primary_column', array( $this, 'set_primary_column' ) );
265
+		add_filter('list_table_primary_column', array($this, 'set_primary_column'));
266 266
 
267 267
 		//set parent defaults
268 268
 		parent::__construct($this->_wp_list_args);
@@ -338,17 +338,17 @@  discard block
 block discarded – undo
338 338
 	 * @return html string
339 339
 	 */
340 340
 	protected function _get_hidden_fields() {
341
-		$action = isset( $this->_req_data['route'] ) ? $this->_req_data['route'] : '';
342
-		$action = empty( $action ) && isset( $this->_req_data['action'] ) ? $this->_req_data['action'] : $action;
341
+		$action = isset($this->_req_data['route']) ? $this->_req_data['route'] : '';
342
+		$action = empty($action) && isset($this->_req_data['action']) ? $this->_req_data['action'] : $action;
343 343
 		//if action is STILL empty, then we set it to default
344
-		$action = empty( $action ) ? 'default' : $action;
345
-		$field = '<input type="hidden" name="page" value="' . $this->_req_data['page'] . '" />' . "\n";
346
-		$field .= '<input type="hidden" name="route" value="'. $action .'" />' . "\n";/**/
347
-		$field .= '<input type="hidden" name="perpage" value="' . $this->_per_page . '" />' . "\n";
344
+		$action = empty($action) ? 'default' : $action;
345
+		$field = '<input type="hidden" name="page" value="'.$this->_req_data['page'].'" />'."\n";
346
+		$field .= '<input type="hidden" name="route" value="'.$action.'" />'."\n"; /**/
347
+		$field .= '<input type="hidden" name="perpage" value="'.$this->_per_page.'" />'."\n";
348 348
 
349 349
 		$bulk_actions = $this->_get_bulk_actions();
350
-		foreach ( $bulk_actions as $bulk_action => $label ) {
351
-			$field .= '<input type="hidden" name="' . $bulk_action . '_nonce" value="' . wp_create_nonce  ( $bulk_action . '_nonce' ) . '" />' . "\n";
350
+		foreach ($bulk_actions as $bulk_action => $label) {
351
+			$field .= '<input type="hidden" name="'.$bulk_action.'_nonce" value="'.wp_create_nonce($bulk_action.'_nonce').'" />'."\n";
352 352
 		}
353 353
 
354 354
 		return $field;
@@ -378,15 +378,15 @@  discard block
 block discarded – undo
378 378
 		 *
379 379
 		 * @var array
380 380
 		 */
381
-		$_sortable = apply_filters( "FHEE_manage_{$this->screen->id}_sortable_columns", $_sortable, $this->_screen );
381
+		$_sortable = apply_filters("FHEE_manage_{$this->screen->id}_sortable_columns", $_sortable, $this->_screen);
382 382
 
383 383
 		$sortable = array();
384
-		foreach ( $_sortable as $id => $data ) {
385
-			if ( empty( $data ) )
384
+		foreach ($_sortable as $id => $data) {
385
+			if (empty($data))
386 386
 				continue;
387 387
 
388 388
 			//fix for offset errors with WP_List_Table default get_columninfo()
389
-			if ( is_array($data) ) {
389
+			if (is_array($data)) {
390 390
 				$_data[0] = key($data);
391 391
 				$_data[1] = isset($data[1]) ? $data[1] : false;
392 392
 			} else {
@@ -395,14 +395,14 @@  discard block
 block discarded – undo
395 395
 
396 396
 			$data = (array) $data;
397 397
 
398
-			if ( !isset( $data[1] ) )
398
+			if ( ! isset($data[1]))
399 399
 				$_data[1] = false;
400 400
 
401 401
 
402 402
 			$sortable[$id] = $_data;
403 403
 		}
404 404
 		$primary = $this->get_primary_column_name();
405
-		$this->_column_headers = array( $columns, $hidden, $sortable, $primary );
405
+		$this->_column_headers = array($columns, $hidden, $sortable, $primary);
406 406
 	}
407 407
 
408 408
 
@@ -411,8 +411,8 @@  discard block
 block discarded – undo
411 411
 	 * @return string
412 412
 	 */
413 413
 	protected function get_primary_column_name() {
414
-		foreach( class_parents( $this ) as $parent ) {
415
-			if ( method_exists( $parent, 'get_primary_column_name' ) && $parent == 'WP_List_Table' ) {
414
+		foreach (class_parents($this) as $parent) {
415
+			if (method_exists($parent, 'get_primary_column_name') && $parent == 'WP_List_Table') {
416 416
 				return parent::get_primary_column_name();
417 417
 			}
418 418
 		}
@@ -424,10 +424,10 @@  discard block
 block discarded – undo
424 424
 	 * Added for WP4.1 backward compat (@see https://events.codebasehq.com/projects/event-espresso/tickets/8814)
425 425
 	 * @return string
426 426
 	 */
427
-	protected function handle_row_actions( $item, $column_name, $primary ) {
428
-		foreach( class_parents( $this ) as $parent ) {
429
-			if ( method_exists( $parent, 'handle_row_actions' ) && $parent == 'WP_List_Table' ) {
430
-				return parent::handle_row_actions( $item, $column_name, $primary );
427
+	protected function handle_row_actions($item, $column_name, $primary) {
428
+		foreach (class_parents($this) as $parent) {
429
+			if (method_exists($parent, 'handle_row_actions') && $parent == 'WP_List_Table') {
430
+				return parent::handle_row_actions($item, $column_name, $primary);
431 431
 			}
432 432
 		}
433 433
 		return '';
@@ -445,11 +445,11 @@  discard block
 block discarded – undo
445 445
 	protected function _get_bulk_actions() {
446 446
 		$actions = array();
447 447
 		//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();
448
-		foreach ( $this->_views as $view => $args) {
449
-			if ( isset( $args['bulk_action']) && is_array($args['bulk_action']) && $this->_view == $view )
448
+		foreach ($this->_views as $view => $args) {
449
+			if (isset($args['bulk_action']) && is_array($args['bulk_action']) && $this->_view == $view)
450 450
 				//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.
451
-				foreach ( $args['bulk_action'] as $route =>$label ) {
452
-					if ( $this->_admin_page->check_user_access( $route, true ) ) {
451
+				foreach ($args['bulk_action'] as $route =>$label) {
452
+					if ($this->_admin_page->check_user_access($route, true)) {
453 453
 						$actions[$route] = $label;
454 454
 					}
455 455
 				}
@@ -467,18 +467,18 @@  discard block
 block discarded – undo
467 467
 	 */
468 468
 	private function _filters() {
469 469
 		$classname = get_class($this);
470
-		$filters = apply_filters( "FHEE__{$classname}__filters", (array) $this->_get_table_filters(), $this, $this->_screen );
470
+		$filters = apply_filters("FHEE__{$classname}__filters", (array) $this->_get_table_filters(), $this, $this->_screen);
471 471
 
472
-		if ( empty( $filters )) {
472
+		if (empty($filters)) {
473 473
 			return;
474 474
 		}
475
-		foreach ( $filters as $filter ) {
475
+		foreach ($filters as $filter) {
476 476
 			echo $filter;
477 477
 		}
478 478
 		//add filter button at end
479
-		echo '<input type="submit" class="button-secondary" value="' . __('Filter', 'event_espresso') . '" id="post-query-submit" />';
479
+		echo '<input type="submit" class="button-secondary" value="'.__('Filter', 'event_espresso').'" id="post-query-submit" />';
480 480
 		//add reset filters button at end
481
-		echo '<a class="button button-secondary"  href="' . $this->_admin_page->get_current_page_view_url() . '" style="display:inline-block">' . __('Reset Filters', 'event_espresso') . '</a>';
481
+		echo '<a class="button button-secondary"  href="'.$this->_admin_page->get_current_page_view_url().'" style="display:inline-block">'.__('Reset Filters', 'event_espresso').'</a>';
482 482
 	}
483 483
 
484 484
 
@@ -492,8 +492,8 @@  discard block
 block discarded – undo
492 492
 	 * @param string $column_name
493 493
 	 * @return string
494 494
 	 */
495
-	public function set_primary_column( $column_name ) {
496
-		return ! empty( $this->_primary_column ) ? $this->_primary_column : $column_name;
495
+	public function set_primary_column($column_name) {
496
+		return ! empty($this->_primary_column) ? $this->_primary_column : $column_name;
497 497
 	}
498 498
 
499 499
 
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 			array(
513 513
 				'total_items' => $total_items,
514 514
 				'per_page' => $this->_per_page,
515
-				'total_pages' => ceil($total_items / $this->_per_page )
515
+				'total_pages' => ceil($total_items / $this->_per_page)
516 516
 			)
517 517
 		);
518 518
 	}
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 	 *
529 529
 	 * @return string html content for the column
530 530
 	 */
531
-	public function column_default( $item, $column_name ) {
531
+	public function column_default($item, $column_name) {
532 532
 		/**
533 533
 		 * Dynamic hook allowing for adding additional column content in this list table.
534 534
 		 * Note that $this->screen->id is in the format
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 		 * hook prefix ("event-espresso") will be different.
539 539
 		 *
540 540
 		 */
541
-		do_action( 'AHEE__EE_Admin_List_Table__column_' . $column_name . '__' . $this->screen->id, $item, $this->_screen );
541
+		do_action('AHEE__EE_Admin_List_Table__column_'.$column_name.'__'.$this->screen->id, $item, $this->_screen);
542 542
 	}
543 543
 
544 544
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 		 *
555 555
 		 * @var array
556 556
 		 */
557
-		$columns = apply_filters( 'FHEE_manage_'.$this->screen->id.'_columns', $this->_columns, $this->_screen );
557
+		$columns = apply_filters('FHEE_manage_'.$this->screen->id.'_columns', $this->_columns, $this->_screen);
558 558
 		return $columns;
559 559
 	}
560 560
 
@@ -566,18 +566,18 @@  discard block
 block discarded – undo
566 566
 		$views = $this->get_views();
567 567
 		$assembled_views = '';
568 568
 
569
-		if ( empty( $views )) {
569
+		if (empty($views)) {
570 570
 			return;
571 571
 		}
572 572
 		echo "<ul class='subsubsub'>\n";
573
-		foreach ( $views as $view ) {
574
-			$count = isset($view['count'] ) && !empty($view['count']) ? absint( $view['count'] )  : 0;
575
-			if ( isset( $view['slug'] ) && isset( $view['class'] ) && isset( $view['url'] ) && isset( $view['label']) ) {
576
-				$assembled_views[ $view['slug'] ] = "\t<li class='" . $view['class'] . "'>" . '<a href="' . $view['url'] . '">' . $view['label'] . '</a> <span class="count">(' . $count . ')</span>';
573
+		foreach ($views as $view) {
574
+			$count = isset($view['count']) && ! empty($view['count']) ? absint($view['count']) : 0;
575
+			if (isset($view['slug']) && isset($view['class']) && isset($view['url']) && isset($view['label'])) {
576
+				$assembled_views[$view['slug']] = "\t<li class='".$view['class']."'>".'<a href="'.$view['url'].'">'.$view['label'].'</a> <span class="count">('.$count.')</span>';
577 577
 			}
578 578
 		}
579 579
 
580
-		echo is_array( $assembled_views) && ! empty( $assembled_views ) ? implode( " |</li>\n", $assembled_views ) . "</li>\n" : '';
580
+		echo is_array($assembled_views) && ! empty($assembled_views) ? implode(" |</li>\n", $assembled_views)."</li>\n" : '';
581 581
 		echo "</ul>";
582 582
 	}
583 583
 
@@ -590,10 +590,10 @@  discard block
 block discarded – undo
590 590
 	 *
591 591
 	 * @param object $item The current item
592 592
 	 */
593
-	public function single_row( $item ) {
594
-		$row_class = $this->_get_row_class( $item );
595
-		echo '<tr class="' . esc_attr( $row_class ) . '">';
596
-		$this->single_row_columns( $item );
593
+	public function single_row($item) {
594
+		$row_class = $this->_get_row_class($item);
595
+		echo '<tr class="'.esc_attr($row_class).'">';
596
+		$this->single_row_columns($item);
597 597
 		echo '</tr>';
598 598
 	}
599 599
 
@@ -604,13 +604,13 @@  discard block
 block discarded – undo
604 604
 	 * @param  object $item the current item
605 605
 	 * @return string
606 606
 	 */
607
-	protected function _get_row_class( $item ) {
607
+	protected function _get_row_class($item) {
608 608
 		static $row_class = '';
609
-		$row_class = ( $row_class == '' ? 'alternate' : '' );
609
+		$row_class = ($row_class == '' ? 'alternate' : '');
610 610
 
611 611
 		$new_row_class = $row_class;
612 612
 
613
-		if ( !empty($this->_ajax_sorting_callback) ) {
613
+		if ( ! empty($this->_ajax_sorting_callback)) {
614 614
 			$new_row_class .= ' rowsortable';
615 615
 		}
616 616
 
@@ -629,13 +629,13 @@  discard block
 block discarded – undo
629 629
 
630 630
 	public function get_hidden_columns() {
631 631
 		$user_id = get_current_user_id();
632
-		$has_default = get_user_option('default'. $this->screen->id . 'columnshidden', $user_id);
633
-		if ( empty( $has_default ) && !empty($this->_hidden_columns ) ) {
634
-			update_user_option($user_id, 'default'.$this->screen->id . 'columnshidden', TRUE);
635
-			update_user_option($user_id, 'manage' . $this->screen->id . 'columnshidden', $this->_hidden_columns, TRUE );
632
+		$has_default = get_user_option('default'.$this->screen->id.'columnshidden', $user_id);
633
+		if (empty($has_default) && ! empty($this->_hidden_columns)) {
634
+			update_user_option($user_id, 'default'.$this->screen->id.'columnshidden', TRUE);
635
+			update_user_option($user_id, 'manage'.$this->screen->id.'columnshidden', $this->_hidden_columns, TRUE);
636 636
 		}
637
-		$ref = 'manage' . $this->screen->id . 'columnshidden';
638
-		$saved_columns = (array) get_user_option( $ref, $user_id );
637
+		$ref = 'manage'.$this->screen->id.'columnshidden';
638
+		$saved_columns = (array) get_user_option($ref, $user_id);
639 639
 		return $saved_columns;
640 640
 	}
641 641
 
@@ -650,47 +650,47 @@  discard block
 block discarded – undo
650 650
 	 *
651 651
 	 * @param object $item The current item
652 652
 	 */
653
-	public function single_row_columns( $item ) {
654
-		list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
653
+	public function single_row_columns($item) {
654
+		list($columns, $hidden, $sortable, $primary) = $this->get_column_info();
655 655
 
656 656
 		global $wp_version;
657
-		$use_hidden_class = version_compare( $wp_version, '4.3-RC', '>=' );
657
+		$use_hidden_class = version_compare($wp_version, '4.3-RC', '>=');
658 658
 
659
-		foreach ( $columns as $column_name => $column_display_name ) {
659
+		foreach ($columns as $column_name => $column_display_name) {
660 660
 
661 661
 			/**
662 662
 			 * With WordPress version 4.3.RC+ WordPress started using the hidden css class to control whether columns are
663 663
 			 * hidden or not instead of using "display:none;".  This bit of code provides backward compat.
664 664
 			 */
665
-			$hidden_class = $use_hidden_class && in_array( $column_name, $hidden ) ? ' hidden' : '';
666
-			$style = ! $use_hidden_class && in_array( $column_name, $hidden ) ? ' style="display:none;"' : '';
665
+			$hidden_class = $use_hidden_class && in_array($column_name, $hidden) ? ' hidden' : '';
666
+			$style = ! $use_hidden_class && in_array($column_name, $hidden) ? ' style="display:none;"' : '';
667 667
 
668
-			$classes = $column_name . ' column-' . $column_name.$hidden_class;
669
-			if ( $primary == $column_name ) {
668
+			$classes = $column_name.' column-'.$column_name.$hidden_class;
669
+			if ($primary == $column_name) {
670 670
 				$classes .= ' has-row-actions column-primary';
671 671
 			}
672 672
 
673
-			$data = ' data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
673
+			$data = ' data-colname="'.wp_strip_all_tags($column_display_name).'"';
674 674
 
675 675
 			$class = "class='$classes'";
676 676
 
677 677
 			$attributes = "$class$style$data";
678 678
 
679
-			if ( 'cb' === $column_name ) {
679
+			if ('cb' === $column_name) {
680 680
 				echo '<th scope="row" class="check-column">';
681
-				echo apply_filters( 'FHEE__EE_Admin_List_Table__single_row_columns__column_cb_content', $this->column_cb( $item ), $item, $this );
681
+				echo apply_filters('FHEE__EE_Admin_List_Table__single_row_columns__column_cb_content', $this->column_cb($item), $item, $this);
682 682
 				echo '</th>';
683 683
 			}
684
-			elseif ( method_exists( $this, 'column_' . $column_name ) ) {
684
+			elseif (method_exists($this, 'column_'.$column_name)) {
685 685
 				echo "<td $attributes>";
686
-				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 );
687
-				echo $this->handle_row_actions( $item, $column_name, $primary );
686
+				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);
687
+				echo $this->handle_row_actions($item, $column_name, $primary);
688 688
 				echo "</td>";
689 689
 			}
690 690
 			else {
691 691
 				echo "<td $attributes>";
692
-				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 );
693
-				echo $this->handle_row_actions( $item, $column_name, $primary );
692
+				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);
693
+				echo $this->handle_row_actions($item, $column_name, $primary);
694 694
 				echo "</td>";
695 695
 			}
696 696
 		}
@@ -698,19 +698,19 @@  discard block
 block discarded – undo
698 698
 
699 699
 
700 700
 
701
-	public function extra_tablenav( $which ) {
702
-		if ( $which == 'top' ) {
701
+	public function extra_tablenav($which) {
702
+		if ($which == 'top') {
703 703
 			$this->_filters();
704 704
 			echo $this->_get_hidden_fields();
705 705
 			echo '<br class="clear">';
706
-		}else{
706
+		} else {
707 707
 			echo '<div class="list-table-bottom-buttons alignleft actions">';
708
-			foreach($this->_bottom_buttons as $type => $action){
709
-				$route = isset( $action['route'] ) ? $action['route'] : '';
710
-				$extra_request = isset( $action['extra_request'] ) ? $action['extra_request'] : '';
708
+			foreach ($this->_bottom_buttons as $type => $action) {
709
+				$route = isset($action['route']) ? $action['route'] : '';
710
+				$extra_request = isset($action['extra_request']) ? $action['extra_request'] : '';
711 711
 				echo $this->_admin_page->get_action_link_or_button($route, $type, $extra_request);
712 712
 			}
713
-			do_action( 'AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', $this, $this->_screen );
713
+			do_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', $this, $this->_screen);
714 714
 			echo '</div>';
715 715
 		}
716 716
 		//echo $this->_entries_per_page_dropdown;
@@ -760,13 +760,13 @@  discard block
 block discarded – undo
760 760
 	 *
761 761
 	 * @return string The assembled action elements container.
762 762
 	 */
763
-	protected function _action_string( $action_items, $item, $action_container = 'ul', $action_class = '', $action_id = '' ) {
763
+	protected function _action_string($action_items, $item, $action_container = 'ul', $action_class = '', $action_id = '') {
764 764
 		$content = '';
765
-		$action_class = ! empty( $action_class ) ? ' class="' . $action_class . '"' : '';
766
-		$action_id = ! empty( $action_id ) ? ' id="' . $action_id . '"' : '';
767
-		$content .= ! empty( $action_container ) ? '<' . $action_container . $action_class . $action_id . '>' : '';
768
-		$content .= apply_filters( 'FHEE__EE_Admin_List_Table___action_string__action_items', $action_items, $item, $this );
769
-		$content .= ! empty( $container ) ? '</' . $container . '>' : '';
765
+		$action_class = ! empty($action_class) ? ' class="'.$action_class.'"' : '';
766
+		$action_id = ! empty($action_id) ? ' id="'.$action_id.'"' : '';
767
+		$content .= ! empty($action_container) ? '<'.$action_container.$action_class.$action_id.'>' : '';
768
+		$content .= apply_filters('FHEE__EE_Admin_List_Table___action_string__action_items', $action_items, $item, $this);
769
+		$content .= ! empty($container) ? '</'.$container.'>' : '';
770 770
 		return $content;
771 771
 	}
772 772
 }
Please login to merge, or discard this patch.