Completed
Branch FET-7988-evertec-needs (20e248)
by
unknown
114:06 queued 104:38
created
core/libraries/shortcodes/EE_Line_Item_Shortcodes.lib.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
10 10
 	exit('NO direct script access allowed');
11 11
 
12 12
 /**
@@ -34,23 +34,23 @@  discard block
 block discarded – undo
34 34
 			'[LINE_ITEM_NAME]' => __('Outputs the line item name.', 'event_espresso'),
35 35
 			'[LINE_ITEM_DESCRIPTION]' => __('Outputs a the description for the line item.', 'event_espresso'),
36 36
 			'[LINE_ITEM_QUANTITY]' => __('Outputs the quantity for this line item.', 'event_espresso'),
37
-			'[LINE_ITEM_AMOUNT]' => __('This will either output the unit price for a line item if its not a percent, or the percent of the line item (if it is percent).', 'event_espresso' ),
37
+			'[LINE_ITEM_AMOUNT]' => __('This will either output the unit price for a line item if its not a percent, or the percent of the line item (if it is percent).', 'event_espresso'),
38 38
 			'[LINE_ITEM_TOTAL]' => __('This outputs the line item total.', 'event_espresso'),
39
-			'[LINE_ITEM_TAXABLE_*]' => __('This attribute type shortcode allows users to indicate what to output if a line item is taxable or not.  One can use the key "symbol=" with the shortcode to indicate what they\'d like to represent a taxable line item.  So doing something like <code>[LINE_ITEM_TAXABLE_* symbol="*"]</code> means that when the line item is parsed, if it\'s taxable the "*" symbol will be returned.  The default symbol if no attribute is included is the "*" symbol.', 'event_espresso' )
39
+			'[LINE_ITEM_TAXABLE_*]' => __('This attribute type shortcode allows users to indicate what to output if a line item is taxable or not.  One can use the key "symbol=" with the shortcode to indicate what they\'d like to represent a taxable line item.  So doing something like <code>[LINE_ITEM_TAXABLE_* symbol="*"]</code> means that when the line item is parsed, if it\'s taxable the "*" symbol will be returned.  The default symbol if no attribute is included is the "*" symbol.', 'event_espresso')
40 40
 			);
41 41
 	}
42 42
 
43 43
 
44 44
 
45
-	protected function _parser( $shortcode ) {
45
+	protected function _parser($shortcode) {
46 46
 		//ensure that the incoming object IS a line item.  If it isn't then bail early.
47
-		if ( ! $this->_data instanceof EE_Line_Item ) {
47
+		if ( ! $this->_data instanceof EE_Line_Item) {
48 48
 			return '';
49 49
 		}
50 50
 
51 51
 		$line_item = $this->_data;
52 52
 
53
-		switch ( $shortcode ) {
53
+		switch ($shortcode) {
54 54
 			case '[LINE_ITEM_NAME]' :
55 55
 				return $line_item->name();
56 56
 				break;
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 				break;
65 65
 
66 66
 			case '[LINE_ITEM_AMOUNT]' :
67
-				return $line_item->is_percent() ? $line_item->percent() . '%' : $line_item->unit_price_no_code();
67
+				return $line_item->is_percent() ? $line_item->percent().'%' : $line_item->unit_price_no_code();
68 68
 				break;
69 69
 
70 70
 			case '[LINE_ITEM_TOTAL]' :
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
 				break;
73 73
 		}
74 74
 
75
-		if ( strpos( $shortcode, '[LINE_ITEM_TAXABLE_*' ) !== FALSE ) {
76
-			$attrs = $this->_get_shortcode_attrs( $shortcode );
77
-			if ( $line_item->is_taxable() ) {
78
-				return !empty( $attrs['symbol'] ) ? $attrs['symbol'] : '*';
75
+		if (strpos($shortcode, '[LINE_ITEM_TAXABLE_*') !== FALSE) {
76
+			$attrs = $this->_get_shortcode_attrs($shortcode);
77
+			if ($line_item->is_taxable()) {
78
+				return ! empty($attrs['symbol']) ? $attrs['symbol'] : '*';
79 79
 			}
80 80
 		}
81 81
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Organization_Shortcodes.lib.php 2 patches
Spacing   +24 added lines, -24 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
 /**
@@ -63,91 +63,91 @@  discard block
 block discarded – undo
63 63
 	}
64 64
 
65 65
 
66
-	protected function _parser( $shortcode ) {
66
+	protected function _parser($shortcode) {
67 67
 
68
-		switch ( $shortcode ) {
68
+		switch ($shortcode) {
69 69
 
70 70
 			case '[COMPANY]' :
71
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'name' );
71
+				return EE_Registry::instance()->CFG->organization->get_pretty('name');
72 72
 				break;
73 73
 
74 74
 			case '[CO_ADD1]' :
75
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'address_1' );
75
+				return EE_Registry::instance()->CFG->organization->get_pretty('address_1');
76 76
 				break;
77 77
 
78 78
 			case '[CO_ADD2]' :
79
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'address_2' );
79
+				return EE_Registry::instance()->CFG->organization->get_pretty('address_2');
80 80
 				break;
81 81
 
82 82
 			case '[CO_CITY]' :
83
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'city' );
83
+				return EE_Registry::instance()->CFG->organization->get_pretty('city');
84 84
 				break;
85 85
 
86 86
 			case '[CO_STATE]' :
87
-				$state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( EE_Registry::instance()->CFG->organization->STA_ID );
87
+				$state = EE_Registry::instance()->load_model('State')->get_one_by_ID(EE_Registry::instance()->CFG->organization->STA_ID);
88 88
 				return $state->name();
89 89
 				break;
90 90
 
91 91
 			case '[CO_ZIP]' :
92
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'zip' );
92
+				return EE_Registry::instance()->CFG->organization->get_pretty('zip');
93 93
 				break;
94 94
 
95 95
 			case '[CO_EMAIL]' :
96
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'email' );
96
+				return EE_Registry::instance()->CFG->organization->get_pretty('email');
97 97
 				break;
98 98
 
99 99
 			case '[CO_PHONE]' :
100
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'phone' );
100
+				return EE_Registry::instance()->CFG->organization->get_pretty('phone');
101 101
 				break;
102 102
 
103 103
 			case '[CO_LOGO]' :
104
-				return '<img src="' . EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ) . '" id="headerImage" />';
104
+				return '<img src="'.EE_Registry::instance()->CFG->organization->get_pretty('logo_url').'" id="headerImage" />';
105 105
 				break;
106 106
 
107 107
 			case '[CO_LOGO_URL]' :
108
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' );
108
+				return EE_Registry::instance()->CFG->organization->get_pretty('logo_url');
109 109
 				break;
110 110
 
111 111
 			case '[CO_FACEBOOK_URL]' :
112
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' );
112
+				return EE_Registry::instance()->CFG->organization->get_pretty('facebook');
113 113
 				break;
114 114
 
115 115
 			case '[CO_TWITTER_URL]' :
116
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' );
116
+				return EE_Registry::instance()->CFG->organization->get_pretty('twitter');
117 117
 				break;
118 118
 
119 119
 			case '[CO_PINTEREST_URL]' :
120
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' );
120
+				return EE_Registry::instance()->CFG->organization->get_pretty('pinterest');
121 121
 				break;
122 122
 
123 123
 			case '[CO_LINKEDIN_URL]' :
124
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' );
124
+				return EE_Registry::instance()->CFG->organization->get_pretty('linkedin');
125 125
 				break;
126 126
 
127 127
 			case '[CO_GOOGLE_URL]' :
128
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'google' );
128
+				return EE_Registry::instance()->CFG->organization->get_pretty('google');
129 129
 				break;
130 130
 
131 131
 			case '[CO_INSTAGRAM_URL]' :
132
-				return EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' );
132
+				return EE_Registry::instance()->CFG->organization->get_pretty('instagram');
133 133
 				break;
134 134
 
135 135
 		}
136 136
 
137 137
 		//also allow for parameter shortcode
138
-		if ( strpos( $shortcode, '[CO_TAX_NUMBER_*' ) !== FALSE ) {
138
+		if (strpos($shortcode, '[CO_TAX_NUMBER_*') !== FALSE) {
139 139
 			//first see if there is any company tax number set and bail early if not
140 140
 			$tax_number = EE_Registry::instance()->CFG->organization->vat;
141
-			if ( empty( $tax_number ) ) {
141
+			if (empty($tax_number)) {
142 142
 				return '';
143 143
 			}
144 144
 
145 145
 			//see if there are any attributes.
146
-			$attrs = $this->_get_shortcode_attrs( $shortcode );
146
+			$attrs = $this->_get_shortcode_attrs($shortcode);
147 147
 
148 148
 			//set custom attrs if present (or default)
149
-			$prefix = isset( $attrs['prefix'] ) ? $attrs['prefix'] : __('VAT/Tax Number: ', 'event_espresso');
150
-			return $prefix . $tax_number;
149
+			$prefix = isset($attrs['prefix']) ? $attrs['prefix'] : __('VAT/Tax Number: ', 'event_espresso');
150
+			return $prefix.$tax_number;
151 151
 		}
152 152
 
153 153
 		return '';
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Payment_List_Shortcodes.lib.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
10 10
 	exit('NO direct script access allowed');
11 11
 
12 12
 /**
@@ -32,18 +32,18 @@  discard block
 block discarded – undo
32 32
 		$this->label = __('Payment List Shortcodes', 'event_espresso');
33 33
 		$this->description = __('All shortcodes specific to payment lists', 'event_espresso');
34 34
 		$this->_shortcodes = array(
35
-			'[PAYMENT_LIST_*]' => __('Outputs a list of payment items. Note, this is a dynamic shortcode in that it accepts some attributes for setting certain defaults.  Attributes that are available are:', 'event_espresso') . '<p><ul>' .
36
-				'<li><strong>no_payments</strong>:' . sprintf( __('Indicate with this attribute what will be used if there are no payments present.  Default is: "%sNo approved payments have been received.%s"', 'event_espresso'),  htmlspecialchars('<td class="aln-cntr" colspan="6">'), htmlspecialchars('</td>') ) . '</li>' .
35
+			'[PAYMENT_LIST_*]' => __('Outputs a list of payment items. Note, this is a dynamic shortcode in that it accepts some attributes for setting certain defaults.  Attributes that are available are:', 'event_espresso').'<p><ul>'.
36
+				'<li><strong>no_payments</strong>:'.sprintf(__('Indicate with this attribute what will be used if there are no payments present.  Default is: "%sNo approved payments have been received.%s"', 'event_espresso'), htmlspecialchars('<td class="aln-cntr" colspan="6">'), htmlspecialchars('</td>')).'</li>'.
37 37
 				'</ul></p>'
38 38
 			);
39 39
 	}
40 40
 
41 41
 
42 42
 
43
-	protected function _parser( $shortcode ) {
43
+	protected function _parser($shortcode) {
44 44
 
45
-		if ( strpos( $shortcode, '[PAYMENT_LIST_*' ) !== FALSE ) {
46
-			return $this->_get_payment_list( $shortcode );
45
+		if (strpos($shortcode, '[PAYMENT_LIST_*') !== FALSE) {
46
+			return $this->_get_payment_list($shortcode);
47 47
 		}
48 48
 		return '';
49 49
 	}
@@ -60,33 +60,33 @@  discard block
 block discarded – undo
60 60
 	 *
61 61
 	 * @return string parsed ticket line item list.
62 62
 	 */
63
-	private function _get_payment_list( $shortcode ) {
63
+	private function _get_payment_list($shortcode) {
64 64
 		$this->_validate_list_requirements();
65 65
 		$this->_set_shortcode_helper();
66 66
 
67 67
 
68
-		if ( ! $this->_data['data'] instanceof EE_Messages_Addressee ) {
68
+		if ( ! $this->_data['data'] instanceof EE_Messages_Addressee) {
69 69
 			return '';
70 70
 		}
71 71
 
72
-		$valid_shortcodes = array( 'payment' );
72
+		$valid_shortcodes = array('payment');
73 73
 
74 74
 		$addressee_obj = $this->_data['data'];
75 75
 		$templates = $this->_extra_data['template'];
76 76
 		$payments = $addressee_obj->payments;
77 77
 
78 78
 		//let's get any attributes that may be present and set the defaults.
79
-		$atts = $this->_get_shortcode_attrs( $shortcode );
79
+		$atts = $this->_get_shortcode_attrs($shortcode);
80 80
 
81
-		$no_payments_msg = empty( $atts['no_payments'] ) ?  __('No approved payments have been received.','event_espresso') : $atts['no_payments'];
81
+		$no_payments_msg = empty($atts['no_payments']) ? __('No approved payments have been received.', 'event_espresso') : $atts['no_payments'];
82 82
 
83 83
 		//made it here so we have an array of paymnets, so we should have what we need.
84
-		$payment_content = empty( $payments ) ? $no_payments_msg : '';
84
+		$payment_content = empty($payments) ? $no_payments_msg : '';
85 85
 
86 86
 		$payments = (array) $payments;
87 87
 
88
-		foreach ( $payments as $payment ) {
89
-			$payment_content .= $this->_shortcode_helper->parse_payment_list_template( $templates['payment_list'], $payment, $valid_shortcodes, $this->_extra_data );
88
+		foreach ($payments as $payment) {
89
+			$payment_content .= $this->_shortcode_helper->parse_payment_list_template($templates['payment_list'], $payment, $valid_shortcodes, $this->_extra_data);
90 90
 		}
91 91
 
92 92
 		return $payment_content;
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Payment_Shortcodes.lib.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
10 10
 	exit('NO direct script access allowed');
11 11
 
12 12
 /**
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 			'[PAYMENT_TIMESTAMP]' => __('Outputs the date of the payment (using the default date format).', 'event_espresso'),
35 35
 			'[PAYMENT_METHOD]' => __('Outputs a the payment method.', 'event_espresso'),
36 36
 			'[PAYMENT_AMOUNT]' => __('Outputs the payment amount (with currency symbol).', 'event_espresso'),
37
-			'[PAYMENT_GATEWAY]' => __('Outputs the gateway used for the payment.', 'event_espresso' ),
37
+			'[PAYMENT_GATEWAY]' => __('Outputs the gateway used for the payment.', 'event_espresso'),
38 38
 			'[PAYMENT_GATEWAY_RESPONSE]' => __('Outputs the payment gateway response.', 'event_espresso'),
39 39
 			'[PAYMENT_GATEWAY_TXN_ID]' => __('This will either be the gateway transaction ID, or the manual ID added with payment applied via the admin.', 'event_espresso'),
40 40
 			'[PAYMENT_PO_NUMBER]' => __('Purchase Order number (if present)', 'event_espresso'),
@@ -46,15 +46,15 @@  discard block
 block discarded – undo
46 46
 
47 47
 
48 48
 
49
-	protected function _parser( $shortcode ) {
49
+	protected function _parser($shortcode) {
50 50
 		//ensure that the incoming object is an EE_Payment object.  If it isn't then bail early.
51
-		if ( ! $this->_data instanceof EE_Payment ) {
51
+		if ( ! $this->_data instanceof EE_Payment) {
52 52
 			return '';
53 53
 		}
54 54
 
55 55
 		$payment = $this->_data;
56 56
 
57
-		switch ( $shortcode ) {
57
+		switch ($shortcode) {
58 58
 			case '[PAYMENT_TIMESTAMP]' :
59 59
 				return $payment->timestamp();
60 60
 				break;
@@ -70,10 +70,10 @@  discard block
 block discarded – undo
70 70
 
71 71
 			case '[PAYMENT_GATEWAY]' :
72 72
 				//previously teh column 'PMD_ID' was more-or-less 'PAY_gateway'
73
-				if( $payment->payment_method() instanceof EE_Payment_Method ){
73
+				if ($payment->payment_method() instanceof EE_Payment_Method) {
74 74
 					return $payment->payment_method()->name();
75
-				}else{
76
-					return __( 'Unknown', 'event_espresso' );
75
+				} else {
76
+					return __('Unknown', 'event_espresso');
77 77
 				}
78 78
 				break;
79 79
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 				break;
99 99
 
100 100
 			case '[PAYMENT_STATUS_WITH_ICONS]' :
101
-				return $payment->pretty_status( TRUE );
101
+				return $payment->pretty_status(TRUE);
102 102
 				break;
103 103
 
104 104
 			default :
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@  discard block
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
@@ -72,7 +73,7 @@  discard block
 block discarded – undo
72 73
 				//previously teh column 'PMD_ID' was more-or-less 'PAY_gateway'
73 74
 				if( $payment->payment_method() instanceof EE_Payment_Method ){
74 75
 					return $payment->payment_method()->name();
75
-				}else{
76
+				} else{
76 77
 					return __( 'Unknown', 'event_espresso' );
77 78
 				}
78 79
 				break;
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Shortcodes.lib.php 2 patches
Spacing   +25 added lines, -25 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
 /**
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	protected function _set_shortcode_helper() {
159 159
 		//shortcode helper
160
-		EE_Registry::instance()->load_helper( 'Parse_Shortcodes' );
160
+		EE_Registry::instance()->load_helper('Parse_Shortcodes');
161 161
 		//get shortcode_replace instance- set when _get_messages is called in child...
162 162
 		$this->_shortcode_helper = new EEH_Parse_Shortcodes();
163 163
 	}
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 
166 166
 
167 167
 	public function get_shortcode_helper() {
168
-		if ( ! $this->_shortcode_helper instanceof EEH_Parse_Shortcodes )
168
+		if ( ! $this->_shortcode_helper instanceof EEH_Parse_Shortcodes)
169 169
 			$this->_set_shortcode_helper();
170 170
 		return $this->_shortcode_helper;
171 171
 	}
@@ -178,25 +178,25 @@  discard block
 block discarded – undo
178 178
 	 * @param  mixed (object|array) $extra_data extra incoming data (usually EE_Messages_Addressee)
179 179
 	 * @return string            parsed shortcode.
180 180
 	 */
181
-	public function parser($shortcode, $data, $extra_data = array() ) {
181
+	public function parser($shortcode, $data, $extra_data = array()) {
182 182
 
183 183
 		//filter setup shortcodes
184 184
 		$this->_shortcodes = $this->get_shortcodes();
185 185
 
186 186
 		//we need to setup any dynamic shortcodes so that they work with the array_key_exists
187
-		$sc = preg_match_all( '/(\[[A-Za-z0-9\_]+_\*)/', $shortcode, $matches );
188
-		$sc_to_verify = !empty($matches[0] ) ? $matches[0][0] . ']' : $shortcode;
187
+		$sc = preg_match_all('/(\[[A-Za-z0-9\_]+_\*)/', $shortcode, $matches);
188
+		$sc_to_verify = ! empty($matches[0]) ? $matches[0][0].']' : $shortcode;
189 189
 
190 190
 		//first we want to make sure this is a valid shortcode
191
-		if ( !array_key_exists($sc_to_verify, $this->_shortcodes ) )
191
+		if ( ! array_key_exists($sc_to_verify, $this->_shortcodes))
192 192
 			return false; //get out, this parser doesn't handle the incoming shortcode.
193 193
 		$this->_data = $data;
194 194
 		$this->_extra_data = $extra_data;
195 195
 		$this->_set_messages_properties();
196
-		$parsed = apply_filters( 'FHEE__' . get_class($this) . '__parser_after', $this->_parser($shortcode), $shortcode, $data, $extra_data, $this );
196
+		$parsed = apply_filters('FHEE__'.get_class($this).'__parser_after', $this->_parser($shortcode), $shortcode, $data, $extra_data, $this);
197 197
 
198 198
 		//note the below filter applies to ALL shortcode parsers... be careful!
199
-		$parsed = apply_filters( 'FHEE__EE_Shortcodes__parser_after', $parsed, $shortcode, $data, $extra_data, $this );
199
+		$parsed = apply_filters('FHEE__EE_Shortcodes__parser_after', $parsed, $shortcode, $data, $extra_data, $this);
200 200
 		return $parsed;
201 201
 	}
202 202
 
@@ -212,10 +212,10 @@  discard block
 block discarded – undo
212 212
 	 * @return array array of shortcodes => description pairs
213 213
 	 */
214 214
 	public function get_shortcodes() {
215
-		$this->_shortcodes = apply_filters( 'FHEE__' . get_class($this) . '__shortcodes', $this->_shortcodes, $this );
215
+		$this->_shortcodes = apply_filters('FHEE__'.get_class($this).'__shortcodes', $this->_shortcodes, $this);
216 216
 
217 217
 		//note the below filter applies to ALL shortcode parsers... be careful!
218
-		$this->_shortcodes = apply_filters( 'FHEE__EE_Shortcodes__shortcodes', $this->_shortcodes, $this );
218
+		$this->_shortcodes = apply_filters('FHEE__EE_Shortcodes__shortcodes', $this->_shortcodes, $this);
219 219
 
220 220
 		return $this->_shortcodes;
221 221
 	}
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	 * @param mixed (object|array) $data incoming data for the parser.  The data could be either an object or array because there are some shortcodes that might be replaced by prepared data that has multiple items in a list (i.e. list of attendees in an event and we're showing fname/lname for each attendee).  In this case data will be in an array.  Otherwise the data shoudl be in a properly formatted object.  The EEH_Parse_Shortcodes.helper.php describes the data object we're expecting.
246 246
 	 * @return string parsed shortcode
247 247
 	 */
248
-	abstract protected function _parser( $shortcode );
248
+	abstract protected function _parser($shortcode);
249 249
 
250 250
 
251 251
 
@@ -257,22 +257,22 @@  discard block
 block discarded – undo
257 257
 	protected function _validate_list_requirements() {
258 258
 
259 259
 		//first test to make sure we've got an array!
260
-		if ( !is_array($this->_data) ) {
261
-			throw new EE_Error( sprintf( __('Expecting an array for the data sent to %s. Instead it was %s', 'event_espresso'), get_class($this), gettype( $this->_data ) ) );
260
+		if ( ! is_array($this->_data)) {
261
+			throw new EE_Error(sprintf(__('Expecting an array for the data sent to %s. Instead it was %s', 'event_espresso'), get_class($this), gettype($this->_data)));
262 262
 		}
263 263
 
264 264
 		//next test to make sure we've got the required template in the index!
265
-		if ( !isset( $this->_data['template'] ) ) {
266
-			throw new EE_Error( sprintf( __('The incoming data does not have the required template index in its array', 'event_espresso') ) );
265
+		if ( ! isset($this->_data['template'])) {
266
+			throw new EE_Error(sprintf(__('The incoming data does not have the required template index in its array', 'event_espresso')));
267 267
 		}
268 268
 
269 269
 		//next test to make sure we've got got a data index in the incoming data array
270
-		if ( !isset( $this->_data['data'] ) )
271
-			throw new EE_Error( __('The incoming data does not have the required data index in its array', 'event_espresso') );
270
+		if ( ! isset($this->_data['data']))
271
+			throw new EE_Error(__('The incoming data does not have the required data index in its array', 'event_espresso'));
272 272
 
273 273
 		//all is well let's make sure _extra_data always has the values needed.
274 274
 		//let's make sure that extra_data includes all templates (for later parsing if necessary)
275
-		if ( empty( $this->_extra_data ) || ( empty( $this->_extra_data['data'] ) && empty( $this->_extra_data['template'] ) ) ) {
275
+		if (empty($this->_extra_data) || (empty($this->_extra_data['data']) && empty($this->_extra_data['template']))) {
276 276
 			$this->_extra_data['data'] = $this->_data['data'];
277 277
 			$this->_extra_data['template'] = $this->_data['template'];
278 278
 		}
@@ -289,16 +289,16 @@  discard block
 block discarded – undo
289 289
 	 *
290 290
 	 * @return array An array with the attributes
291 291
 	 */
292
-	protected function _get_shortcode_attrs( $shortcode ) {
292
+	protected function _get_shortcode_attrs($shortcode) {
293 293
 		//make sure the required wp helper function is present
294 294
 		//require the shortcode file if necessary
295
-		if ( ! function_exists( 'shortcode_parse_atts' ) ) {
296
-			require_once( ABSPATH . WPINC . '/shortcodes.php');
295
+		if ( ! function_exists('shortcode_parse_atts')) {
296
+			require_once(ABSPATH.WPINC.'/shortcodes.php');
297 297
 		}
298 298
 
299 299
 		//let's get any attributes that may be present and set the defaults.
300
-		$shortcode_to_parse = str_replace( '[', '', str_replace( ']', '', $shortcode ) );
301
-		return shortcode_parse_atts( $shortcode_to_parse );
300
+		$shortcode_to_parse = str_replace('[', '', str_replace(']', '', $shortcode));
301
+		return shortcode_parse_atts($shortcode_to_parse);
302 302
 	}
303 303
 
304 304
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 	 */
314 314
 	protected function _set_messages_properties() {
315 315
 		//should be in _extra_data
316
-		if ( isset( $this->_extra_data['messenger'] ) ) {
316
+		if (isset($this->_extra_data['messenger'])) {
317 317
 			$this->_messenger = $this->_extra_data['messenger'];
318 318
 			$this->_message_type = $this->_extra_data['message_type'];
319 319
 			$this->_context = $this->_extra_data['context'];
Please login to merge, or discard this patch.
Braces   +12 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  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 7
 /**
7 8
  * Event Espresso
@@ -165,8 +166,9 @@  discard block
 block discarded – undo
165 166
 
166 167
 
167 168
 	public function get_shortcode_helper() {
168
-		if ( ! $this->_shortcode_helper instanceof EEH_Parse_Shortcodes )
169
-			$this->_set_shortcode_helper();
169
+		if ( ! $this->_shortcode_helper instanceof EEH_Parse_Shortcodes ) {
170
+					$this->_set_shortcode_helper();
171
+		}
170 172
 		return $this->_shortcode_helper;
171 173
 	}
172 174
 
@@ -188,8 +190,10 @@  discard block
 block discarded – undo
188 190
 		$sc_to_verify = !empty($matches[0] ) ? $matches[0][0] . ']' : $shortcode;
189 191
 
190 192
 		//first we want to make sure this is a valid shortcode
191
-		if ( !array_key_exists($sc_to_verify, $this->_shortcodes ) )
192
-			return false; //get out, this parser doesn't handle the incoming shortcode.
193
+		if ( !array_key_exists($sc_to_verify, $this->_shortcodes ) ) {
194
+					return false;
195
+		}
196
+		//get out, this parser doesn't handle the incoming shortcode.
193 197
 		$this->_data = $data;
194 198
 		$this->_extra_data = $extra_data;
195 199
 		$this->_set_messages_properties();
@@ -267,8 +271,9 @@  discard block
 block discarded – undo
267 271
 		}
268 272
 
269 273
 		//next test to make sure we've got got a data index in the incoming data array
270
-		if ( !isset( $this->_data['data'] ) )
271
-			throw new EE_Error( __('The incoming data does not have the required data index in its array', 'event_espresso') );
274
+		if ( !isset( $this->_data['data'] ) ) {
275
+					throw new EE_Error( __('The incoming data does not have the required data index in its array', 'event_espresso') );
276
+		}
272 277
 
273 278
 		//all is well let's make sure _extra_data always has the values needed.
274 279
 		//let's make sure that extra_data includes all templates (for later parsing if necessary)
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Ticket_List_Shortcodes.lib.php 2 patches
Braces   +12 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  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 7
 /**
7 8
  * Event Espresso
@@ -68,18 +69,18 @@  discard block
 block discarded – undo
68 69
 		$this->_set_shortcode_helper();
69 70
 
70 71
 
71
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
72
-			return $this->_get_ticket_list_for_main();
73
-
74
-		else if ( $this->_data['data'] instanceof EE_Registration )
75
-			return $this->_get_ticket_list_for_attendee();
76
-
77
-		else if ( $this->_data['data'] instanceof EE_Event )
78
-			return $this->_get_ticket_list_for_event();
72
+		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
73
+					return $this->_get_ticket_list_for_main();
74
+		} else if ( $this->_data['data'] instanceof EE_Registration ) {
75
+					return $this->_get_ticket_list_for_attendee();
76
+		} else if ( $this->_data['data'] instanceof EE_Event ) {
77
+					return $this->_get_ticket_list_for_event();
78
+		}
79 79
 
80 80
 		//prevent recursive loop
81
-		else
82
-			return '';
81
+		else {
82
+					return '';
83
+		}
83 84
 	}
84 85
 
85 86
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 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
 /**
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 
49 49
 
50 50
 
51
-	protected function _parser( $shortcode ) {
52
-		switch ( $shortcode ) {
51
+	protected function _parser($shortcode) {
52
+		switch ($shortcode) {
53 53
 			case '[TICKET_LIST]' :
54 54
 				return $this->_get_ticket_list();
55 55
 				break;
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
 		$this->_set_shortcode_helper();
69 69
 
70 70
 
71
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
71
+		if ($this->_data['data'] instanceof EE_Messages_Addressee)
72 72
 			return $this->_get_ticket_list_for_main();
73 73
 
74
-		else if ( $this->_data['data'] instanceof EE_Registration )
74
+		else if ($this->_data['data'] instanceof EE_Registration)
75 75
 			return $this->_get_ticket_list_for_attendee();
76 76
 
77
-		else if ( $this->_data['data'] instanceof EE_Event )
77
+		else if ($this->_data['data'] instanceof EE_Event)
78 78
 			return $this->_get_ticket_list_for_event();
79 79
 
80 80
 		//prevent recursive loop
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
 	 * This returns the parsed ticket list for main template;
92 92
 	 */
93 93
 	private function _get_ticket_list_for_main() {
94
-		$valid_shortcodes = array('ticket', 'event_list', 'attendee_list','datetime_list', 'attendee', 'line_item_list', 'primary_registration_details');
94
+		$valid_shortcodes = array('ticket', 'event_list', 'attendee_list', 'datetime_list', 'attendee', 'line_item_list', 'primary_registration_details');
95 95
 		$template = $this->_data['template'];
96 96
 		$data = $this->_data['data'];
97 97
 		$tktparsed = '';
98 98
 
99 99
 
100 100
 		//now we need to loop through the ticket list and send data to the EE_Parser helper.
101
-		foreach ( $data->tickets as $ticket ) {
101
+		foreach ($data->tickets as $ticket) {
102 102
 			$tktparsed .= $this->_shortcode_helper->parse_ticket_list_template($template, $ticket['ticket'], $valid_shortcodes, $this->_extra_data);
103 103
 		}
104 104
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 */
114 114
 	private function _get_ticket_list_for_event() {
115 115
 		$valid_shortcodes = array('ticket', 'attendee_list', 'datetime_list', 'attendee', 'venue', 'line_item_list', 'primary_registration_details');
116
-		$template = is_array($this->_data['template'] ) && isset($this->_data['template']['ticket_list']) ? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
116
+		$template = is_array($this->_data['template']) && isset($this->_data['template']['ticket_list']) ? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
117 117
 		$event = $this->_data['data'];
118 118
 
119 119
 		//let's remove any existing [EVENT_LIST] shortcodes from the ticket list template so that we don't get recursion.
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		$tickets = $this->_get_tickets_from_event($event);
125 125
 
126 126
 		//each ticket in this case should be an ticket object.
127
-		foreach ( $tickets as $ticket ) {
127
+		foreach ($tickets as $ticket) {
128 128
 			$tkt_parsed .= $this->_shortcode_helper->parse_ticket_list_template($template, $ticket, $valid_shortcodes, $this->_extra_data);
129 129
 		}
130 130
 
@@ -151,18 +151,18 @@  discard block
 block discarded – undo
151 151
 		$tickets = $this->_get_ticket_list_from_registration($registration);
152 152
 
153 153
 		//each ticket in this case should be an ticket object.
154
-		foreach ( $tickets as $ticket ) {
154
+		foreach ($tickets as $ticket) {
155 155
 			$tkt_parsed .= $this->_shortcode_helper->parse_ticket_list_template($template, $ticket, $valid_shortcodes, $this->_extra_data);
156 156
 		}
157 157
 
158 158
 		return $tkt_parsed;
159 159
 	}
160 160
 
161
-	private function _get_tickets_from_event( EE_Event $event ) {
161
+	private function _get_tickets_from_event(EE_Event $event) {
162 162
 		return isset($this->_extra_data['data']->events) ? $this->_extra_data['data']->events[$event->ID()]['tkt_objs'] : array();
163 163
 	}
164 164
 
165
-	private function _get_ticket_list_from_registration( EE_Registration $registration, $att = NULL ) {
165
+	private function _get_ticket_list_from_registration(EE_Registration $registration, $att = NULL) {
166 166
 		return isset($this->_extra_data['data']->registrations) ? array($this->_extra_data['data']->registrations[$registration->ID()]['tkt_obj']) : array();
167 167
 	}
168 168
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Ticket_Shortcodes.lib.php 2 patches
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  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 7
 /**
7 8
  * Event Espresso
@@ -80,8 +81,9 @@  discard block
 block discarded – undo
80 81
 
81 82
 
82 83
 		//If there is no event object by now then get out.
83
-		if ( ! $this->_ticket instanceof EE_Ticket )
84
-			return '';
84
+		if ( ! $this->_ticket instanceof EE_Ticket ) {
85
+					return '';
86
+		}
85 87
 
86 88
 		switch ( $shortcode ) {
87 89
 
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 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
 /**
@@ -49,40 +49,40 @@  discard block
 block discarded – undo
49 49
 			'[TICKET_DESCRIPTION]' => __('The description of the ticket', 'event_espresso'),
50 50
 			'[TICKET_PRICE]' => __('The price of the ticket', 'event_espresso'),
51 51
 			'[TKT_QTY_PURCHASED]' => __('The total quantity of the current ticket in the list that has been purchased in this transaction', 'event_espresso'),
52
-			'[TKT_USES_*]' => __( 'This attribute based shortcode parses to show the number of uses the ticket has.  The optional "schema" attribute can be used to indicate what schema is used when the uses is infinite.  Options are:', 'event_espresso' ) .
53
-				'<p><ul>' .
54
-				'<li><strong>symbol</strong>:' . __('This returns the &infin; symbol.', 'event_espresso') . '</li>' .
55
-				'<li><strong>text</strong>:' . __('This returns the word, "Unlimited". This is also the default if the "schema" attribute is not used.', 'event_espresso' ) . '</li>' .
56
-				'<li><strong>{custom}</strong>:' . __('You can put anything you want as a string instead and that will be used.  So you could have the world "any" and whenever uses for a ticket is infinity, this shortcode will parse to "any".', 'event_espresso' ) . '</li>' .
52
+			'[TKT_USES_*]' => __('This attribute based shortcode parses to show the number of uses the ticket has.  The optional "schema" attribute can be used to indicate what schema is used when the uses is infinite.  Options are:', 'event_espresso').
53
+				'<p><ul>'.
54
+				'<li><strong>symbol</strong>:'.__('This returns the &infin; symbol.', 'event_espresso').'</li>'.
55
+				'<li><strong>text</strong>:'.__('This returns the word, "Unlimited". This is also the default if the "schema" attribute is not used.', 'event_espresso').'</li>'.
56
+				'<li><strong>{custom}</strong>:'.__('You can put anything you want as a string instead and that will be used.  So you could have the world "any" and whenever uses for a ticket is infinity, this shortcode will parse to "any".', 'event_espresso').'</li>'.
57 57
 				'</ul></p>'
58 58
 			);
59 59
 	}
60 60
 
61 61
 
62
-	protected function _parser( $shortcode ) {
62
+	protected function _parser($shortcode) {
63 63
 
64
-		EE_Registry::instance()->load_helper( 'Template' );
64
+		EE_Registry::instance()->load_helper('Template');
65 65
 
66 66
 		$this->_ticket = $this->_data instanceof EE_Ticket ? $this->_data : null;
67 67
 
68 68
 		$aee = $this->_data instanceof EE_Messages_Addressee ? $this->_data : null;
69
-		$aee = ! $aee instanceof EE_Messages_Addressee && is_array( $this->_extra_data ) && isset( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $aee;
69
+		$aee = ! $aee instanceof EE_Messages_Addressee && is_array($this->_extra_data) && isset($this->_extra_data['data']) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $aee;
70 70
 
71 71
 
72 72
 		//possible EE_Line_Item may be incoming data
73
-		$this->_ticket = empty( $this->_ticket ) && $this->_data instanceof EE_Line_Item && $aee instanceof EE_Messages_Addressee && ! empty( $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] ) && $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] instanceof EE_Ticket ? $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] : $this->_ticket;
73
+		$this->_ticket = empty($this->_ticket) && $this->_data instanceof EE_Line_Item && $aee instanceof EE_Messages_Addressee && ! empty($aee->line_items_with_children[$this->_data->ID()]['EE_Ticket']) && $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] instanceof EE_Ticket ? $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] : $this->_ticket;
74 74
 
75 75
 		//if still no ticket, then let's see if there is a reg_obj.  If there IS, then we'll try and grab the ticket from the reg_obj instead.
76
-		if ( empty( $this->_ticket ) ) {
76
+		if (empty($this->_ticket)) {
77 77
 			$this->_ticket = $aee instanceof EE_Messages_Addressee && $aee->reg_obj instanceof EE_Registration ? $aee->reg_obj->ticket() : NULL;
78 78
 		}
79 79
 
80 80
 
81 81
 		//If there is no event object by now then get out.
82
-		if ( ! $this->_ticket instanceof EE_Ticket )
82
+		if ( ! $this->_ticket instanceof EE_Ticket)
83 83
 			return '';
84 84
 
85
-		switch ( $shortcode ) {
85
+		switch ($shortcode) {
86 86
 
87 87
 			case '[TICKET_ID]' :
88 88
 				return $this->_ticket->ID();
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 				break;
98 98
 
99 99
 			case '[TICKET_PRICE]' :
100
-				return EEH_Template::format_currency( $this->_ticket->get('TKT_price') );
100
+				return EEH_Template::format_currency($this->_ticket->get('TKT_price'));
101 101
 				break;
102 102
 
103 103
 			case '[TKT_QTY_PURCHASED]' :
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
 				break;
106 106
 		}
107 107
 
108
-		if ( strpos( $shortcode, '[TKT_USES_*') !== FALSE  ) {
109
-			$attrs = $this->_get_shortcode_attrs( $shortcode );
110
-			$schema = empty( $attrs['schema'] ) ? null : $attrs['schema'];
111
-			return $this->_ticket->get_pretty( 'TKT_uses', $schema );
108
+		if (strpos($shortcode, '[TKT_USES_*') !== FALSE) {
109
+			$attrs = $this->_get_shortcode_attrs($shortcode);
110
+			$schema = empty($attrs['schema']) ? null : $attrs['schema'];
111
+			return $this->_ticket->get_pretty('TKT_uses', $schema);
112 112
 		}
113 113
 		return '';
114 114
 
Please login to merge, or discard this patch.
core/templates/maintenance_mode.template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@
 block discarded – undo
20 20
 		<div id="ee-maintenance-mode-dv" class="" role="main">
21 21
 			<article id="ee-maintenance-mode">
22 22
 				<header class="event-header">
23
-					<h1  id="ee-maintenance-mode-h1"><?php _e( 'Maintenance Mode', 'event_espresso' ); ?></h1>
23
+					<h1  id="ee-maintenance-mode-h1"><?php _e('Maintenance Mode', 'event_espresso'); ?></h1>
24 24
 				</header>
25 25
 				<div class="ee-maintenance-mode-dv">
26
-					<p><?php _e( 'Event Registration has been temporarily closed while system maintenance is being performed. We\'re sorry for any inconveniences this may have caused. Please try back again later.	', 'event_espresso' ); ?></p>
26
+					<p><?php _e('Event Registration has been temporarily closed while system maintenance is being performed. We\'re sorry for any inconveniences this may have caused. Please try back again later.	', 'event_espresso'); ?></p>
27 27
 				</div>
28 28
 			</article>
29 29
 		</div>
Please login to merge, or discard this patch.
espresso.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('ABSPATH')) exit('No direct script access allowed');
1
+<?php if ( ! defined('ABSPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /*
3 5
   Plugin Name:		Event Espresso
4 6
   Plugin URI:  		http://eventespresso.com/pricing/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=wordpress_plugins_page&utm_content=support_link
Please login to merge, or discard this patch.
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
  */
41 41
 
42 42
 //Returns the plugin version
43
-if ( ! function_exists( 'espresso_version' )) {
43
+if ( ! function_exists('espresso_version')) {
44 44
 	/**
45 45
 	 * espresso_version
46 46
 	 * @return string
@@ -49,92 +49,92 @@  discard block
 block discarded – undo
49 49
 		return '4.6.26.rc.000';
50 50
 	}
51 51
 } else {
52
-	unset( $_GET['activate'] );
53
-	add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 );
52
+	unset($_GET['activate']);
53
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
54 54
 }
55 55
 // define versions
56
-define( 'EVENT_ESPRESSO_VERSION', espresso_version());
57
-define( 'EE_MIN_WP_VER_REQUIRED', '4.0' );
58
-define( 'EE_MIN_WP_VER_RECOMMENDED', '4.1' );
59
-define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' );
60
-define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.33' );
61
-define( 'EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - ' . EVENT_ESPRESSO_VERSION );
62
-define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ );
56
+define('EVENT_ESPRESSO_VERSION', espresso_version());
57
+define('EE_MIN_WP_VER_REQUIRED', '4.0');
58
+define('EE_MIN_WP_VER_RECOMMENDED', '4.1');
59
+define('EE_MIN_PHP_VER_REQUIRED', '5.3.0');
60
+define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.33');
61
+define('EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - '.EVENT_ESPRESSO_VERSION);
62
+define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
63 63
 
64 64
 //used to be DIRECTORY_SEPARATOR, but that caused issues on windows
65
-if ( ! defined( 'DS' )) {
66
-	define( 'DS', '/' );
65
+if ( ! defined('DS')) {
66
+	define('DS', '/');
67 67
 }
68
-if ( ! defined( 'PS' )) {
69
-	define( 'PS', PATH_SEPARATOR );
68
+if ( ! defined('PS')) {
69
+	define('PS', PATH_SEPARATOR);
70 70
 }
71
-if( ! defined( 'SP' )){
72
-	define( 'SP', ' ' );
71
+if ( ! defined('SP')) {
72
+	define('SP', ' ');
73 73
 }
74
-if( ! defined( 'EENL' )){
75
-	define( 'EENL', "\n" );
74
+if ( ! defined('EENL')) {
75
+	define('EENL', "\n");
76 76
 }
77 77
 
78 78
 
79
-define( 'EE_SUPPORT_EMAIL', '[email protected]');
79
+define('EE_SUPPORT_EMAIL', '[email protected]');
80 80
 // define the plugin directory and URL
81
-define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE ));
82
-define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE ));
83
-define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE ));
81
+define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE));
82
+define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE));
83
+define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE));
84 84
 // main root folder paths
85
-define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS );
86
-define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS );
87
-define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS );
88
-define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS );
89
-define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS );
90
-define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS );
91
-define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS);
92
-define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS );
85
+define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS);
86
+define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS);
87
+define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS);
88
+define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS);
89
+define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS);
90
+define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS);
91
+define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS);
92
+define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS);
93 93
 // core system paths
94
-define( 'EE_ADMIN', EE_CORE . 'admin' . DS );
95
-define( 'EE_CPTS', EE_CORE . 'CPTs' . DS );
96
-define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS );
97
-define( 'EE_BUSINESS', EE_CORE . 'business' . DS );
98
-define( 'EE_MODELS', EE_CORE . 'db_models' . DS );
99
-define( 'EE_HELPERS', EE_CORE . 'helpers' . DS );
100
-define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS );
101
-define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS );
102
-define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS );
103
-define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS );
104
-define( 'EE_FORM_SECTIONS', EE_LIBRARIES  .'form_sections' . DS );
94
+define('EE_ADMIN', EE_CORE.'admin'.DS);
95
+define('EE_CPTS', EE_CORE.'CPTs'.DS);
96
+define('EE_CLASSES', EE_CORE.'db_classes'.DS);
97
+define('EE_BUSINESS', EE_CORE.'business'.DS);
98
+define('EE_MODELS', EE_CORE.'db_models'.DS);
99
+define('EE_HELPERS', EE_CORE.'helpers'.DS);
100
+define('EE_LIBRARIES', EE_CORE.'libraries'.DS);
101
+define('EE_TEMPLATES', EE_CORE.'templates'.DS);
102
+define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS);
103
+define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS);
104
+define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS);
105 105
 // gateways
106
-define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS );
107
-define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS );
106
+define('EE_GATEWAYS', EE_MODULES.'gateways'.DS);
107
+define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS);
108 108
 // asset URL paths
109
-define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS );
110
-define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS );
111
-define( 'EE_IMAGES_URL',  EE_GLOBAL_ASSETS_URL . 'images' . DS );
112
-define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS );
113
-define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' );
114
-define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/');
109
+define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS);
110
+define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS);
111
+define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS);
112
+define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS);
113
+define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/');
114
+define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/');
115 115
 
116 116
 // define upload paths
117 117
 $uploads = wp_upload_dir();
118 118
 // define the uploads directory and URL
119
-define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'] . DS . 'espresso' . DS );
120
-define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'] . DS . 'espresso' . DS );
119
+define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS);
120
+define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS);
121 121
 // define the templates directory and URL
122
-define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'templates' . DS );
123
-define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'templates' . DS );
122
+define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS);
123
+define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS);
124 124
 // define the gateway directory and URL
125
-define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'gateways' . DS );
126
-define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'gateways' . DS );
125
+define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS);
126
+define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS);
127 127
 // languages folder/path
128
-define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS );
129
-define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS );
128
+define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS);
129
+define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS);
130 130
 //check for dompdf fonts in uploads
131
-if( file_exists(EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ){
132
-	define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS  );
131
+if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) {
132
+	define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS);
133 133
 }
134 134
 
135 135
 //ajax constants
136
-define( 'EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset( $_REQUEST['data']['ee_front_ajax'] ) ? TRUE : FALSE );
137
-define( 'EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset( $_REQUEST['data']['ee_admin_ajax'] ) ? TRUE : FALSE );
136
+define('EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? TRUE : FALSE);
137
+define('EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? TRUE : FALSE);
138 138
 //just a handy constant occasionally needed for finding values representing infinity in the DB
139 139
 //you're better to use this than its straight value (currently -1) in case you ever
140 140
 //want to change its default value! or find when -1 means infinity
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
 function espresso_duplicate_plugin_error() {
150 150
 	?>
151 151
 	<div class="error">
152
-	<p><?php _e( 'Can not run multiple versions of Event Espresso! Please deactivate one of the versions.', 'event_espresso' ); ?></p>
152
+	<p><?php _e('Can not run multiple versions of Event Espresso! Please deactivate one of the versions.', 'event_espresso'); ?></p>
153 153
 	</div>
154 154
 	<?php
155
-	EE_System::deactivate_plugin( EE_PLUGIN_BASENAME );
155
+	EE_System::deactivate_plugin(EE_PLUGIN_BASENAME);
156 156
 }
157 157
 
158 158
 
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
  * 	adds a wp-option to indicate that EE has been activated via the WP admin plugins page
163 163
  */
164 164
 function espresso_plugin_activation() {
165
-	update_option( 'ee_espresso_activation', TRUE );
165
+	update_option('ee_espresso_activation', TRUE);
166 166
 }
167
-register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' );
167
+register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
168 168
 
169 169
 
170 170
 
@@ -172,10 +172,10 @@  discard block
 block discarded – undo
172 172
  * 	espresso_plugin_deactivation
173 173
  */
174 174
 function espresso_plugin_deactivation() {
175
-	espresso_load_required( 'EEH_Activation', EE_HELPERS . 'EEH_Activation.helper.php' );
175
+	espresso_load_required('EEH_Activation', EE_HELPERS.'EEH_Activation.helper.php');
176 176
 	EEH_Activation::plugin_deactivation();
177 177
 }
178
-register_deactivation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation' );
178
+register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation');
179 179
 
180 180
 
181 181
 
@@ -185,15 +185,15 @@  discard block
 block discarded – undo
185 185
  */
186 186
 function espresso_load_error_handling() {
187 187
 	// load debugging tools
188
-	if ( WP_DEBUG === TRUE ) {
189
-		require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' );
188
+	if (WP_DEBUG === TRUE) {
189
+		require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php');
190 190
 		EEH_Debug_Tools::instance();
191 191
 	}
192 192
 	// load error handling
193
-	if ( is_readable( EE_CORE . 'EE_Error.core.php' )) {
194
-		 require_once( EE_CORE . 'EE_Error.core.php' );
193
+	if (is_readable(EE_CORE.'EE_Error.core.php')) {
194
+		 require_once(EE_CORE.'EE_Error.core.php');
195 195
 	} else {
196
-		wp_die( __( 'The EE_Error core class could not be loaded.', 'event_espresso' ));
196
+		wp_die(__('The EE_Error core class could not be loaded.', 'event_espresso'));
197 197
 	}
198 198
 }
199 199
 
@@ -203,13 +203,13 @@  discard block
 block discarded – undo
203 203
  * 	espresso_load_required
204 204
  * 	given a class name and path, this function will load that file or throw an exception
205 205
  */
206
-function espresso_load_required( $classname, $full_path_to_file ) {
206
+function espresso_load_required($classname, $full_path_to_file) {
207 207
 	espresso_load_error_handling();
208
-	if ( is_readable( $full_path_to_file )) {
209
-		require_once( $full_path_to_file );
208
+	if (is_readable($full_path_to_file)) {
209
+		require_once($full_path_to_file);
210 210
 	} else {
211
-		throw new EE_Error ( sprintf (
212
-			__( 'The %s class file could not be located or is not readable due to file permissions.', 'event_espresso' ),
211
+		throw new EE_Error(sprintf(
212
+			__('The %s class file could not be located or is not readable due to file permissions.', 'event_espresso'),
213 213
 			$classname
214 214
 		));
215 215
 	}
@@ -217,5 +217,5 @@  discard block
 block discarded – undo
217 217
 
218 218
 
219 219
 
220
-espresso_load_required( 'EE_System', EE_CORE . 'EE_System.core.php' );
220
+espresso_load_required('EE_System', EE_CORE.'EE_System.core.php');
221 221
 EE_System::instance();
Please login to merge, or discard this patch.