Completed
Branch FET-7988-evertec-needs (20e248)
by
unknown
1119:58 queued 1106:57
created
core/db_models/relations/EE_Belongs_To_Relation.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once( EE_MODELS . 'relations/EE_Model_Relation_Base.php');
2
+require_once(EE_MODELS.'relations/EE_Model_Relation_Base.php');
3 3
 /**
4 4
  * Class EE_Belongs_To_Relation
5 5
  *
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
 		//create the sql string like
37 37
 		$this_table_fk_field = $this->get_this_model()->get_foreign_key_to($this->get_other_model()->get_this_model_name());
38 38
 		$other_table_pk_field = $this->get_other_model()->get_primary_key_field();
39
-		$this_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_this_model()->get_this_model_name()) . $this_table_fk_field->get_table_alias();
40
-		$other_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_other_model()->get_this_model_name()) . $other_table_pk_field->get_table_alias();
39
+		$this_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_this_model()->get_this_model_name()).$this_table_fk_field->get_table_alias();
40
+		$other_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_other_model()->get_this_model_name()).$other_table_pk_field->get_table_alias();
41 41
 		$other_table = $this->get_other_model()->get_table_for_alias($other_table_alias);
42
-		return $this->_left_join($other_table, $other_table_alias, $other_table_pk_field->get_table_column(), $this_table_alias, $this_table_fk_field->get_table_column()) . $this->get_other_model()->_construct_internal_join_to_table_with_alias($other_table_alias);
42
+		return $this->_left_join($other_table, $other_table_alias, $other_table_pk_field->get_table_column(), $this_table_alias, $this_table_fk_field->get_table_column()).$this->get_other_model()->_construct_internal_join_to_table_with_alias($other_table_alias);
43 43
 	}
44 44
 
45 45
 	/**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		$other_model_obj = $this->get_other_model()->ensure_is_obj($other_obj_or_id, true);
54 54
 		//find the field on the other model which is a foreign key to this model
55 55
 		$fk_on_this_model = $this->get_this_model()->get_foreign_key_to($this->get_other_model()->get_this_model_name());
56
-		if ( $this_model_obj->get($fk_on_this_model->get_name()) != $other_model_obj->ID()){
56
+		if ($this_model_obj->get($fk_on_this_model->get_name()) != $other_model_obj->ID()) {
57 57
 			//set that field on the other model to this model's ID
58 58
 			$this_model_obj->set($fk_on_this_model->get_name(), $other_model_obj->ID());
59 59
 			$this_model_obj->save();
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	function remove_relation_to($this_obj_or_id, $other_obj_or_id) {
71 71
 		$this_model_obj = $this->get_this_model()->ensure_is_obj($this_obj_or_id, true);
72
-		$other_model_obj = $this->get_other_model()->ensure_is_obj( $other_obj_or_id );
72
+		$other_model_obj = $this->get_other_model()->ensure_is_obj($other_obj_or_id);
73 73
 		//find the field on the other model which is a foreign key to this model
74 74
 		$fk_on_this_model = $this->get_this_model()->get_foreign_key_to($this->get_other_model()->get_this_model_name());
75 75
 		//set that field on the other model to this model's ID
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 		//get column on this model object which is a foreign key to the other model
90 90
 		$fk_field_obj = $this->get_this_model()->get_foreign_key_to($this->get_other_model()->get_this_model_name());
91 91
 		//get its value
92
-		if( $model_obj_or_id instanceof EE_Base_Class){
92
+		if ($model_obj_or_id instanceof EE_Base_Class) {
93 93
 			$model_obj = $model_obj_or_id;
94
-		}else{
94
+		} else {
95 95
 			$model_obj = $this->get_this_model()->ensure_is_obj($model_obj_or_id);
96 96
 		}
97 97
 		$ID_value_on_other_model = $model_obj->get($fk_field_obj->get_name());
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 		//so in case teh IPN is arriving later, let's try to process an IPN!
91 91
 		if($_SERVER['REQUEST_METHOD'] == 'POST'){
92 92
 			return $this->handle_ipn($_POST, $transaction );
93
-		}else{
93
+		} else{
94 94
 			return parent::finalize_payment_for( $transaction );
95 95
 		}
96 96
 	}
Please login to merge, or discard this patch.
core/db_models/relations/EE_Has_Many_Any_Relation.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@  discard block
 block discarded – undo
7 7
  * ID 34 or Registration with ID 34? The EE_Any_Foreign_Model_name_Field specifies which of the two). 
8 8
  * 
9 9
  */
10
-require_once( EE_MODELS . 'relations/EE_Model_Relation_Base.php');
11
-class EE_Has_Many_Any_Relation extends EE_Has_Many_Relation{	
10
+require_once(EE_MODELS.'relations/EE_Model_Relation_Base.php');
11
+class EE_Has_Many_Any_Relation extends EE_Has_Many_Relation {	
12 12
 	
13
-	function get_join_statement($model_relation_chain){
13
+	function get_join_statement($model_relation_chain) {
14 14
 		//create the sql string like
15 15
 		// LEFT JOIN other_table AS table_alias ON this_table_alias.pk = other_table_alias.fk extra_join_conditions
16 16
 		$this_table_pk_field = $this->get_this_model()->get_primary_key_field();
17 17
 		$other_table_fk_field = $this->get_other_model()->get_foreign_key_to($this->get_this_model()->get_this_model_name());
18
-		$pk_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_this_model()->get_this_model_name()) . $this_table_pk_field->get_table_alias();
19
-		$fk_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_other_model()->get_this_model_name()) . $other_table_fk_field->get_table_alias();
18
+		$pk_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_this_model()->get_this_model_name()).$this_table_pk_field->get_table_alias();
19
+		$fk_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_other_model()->get_this_model_name()).$other_table_fk_field->get_table_alias();
20 20
 		$fk_table = $this->get_other_model()->get_table_for_alias($fk_table_alias);
21 21
 		$field_with_model_name = $this->get_other_model()->get_field_containing_related_model_name();
22 22
 		
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @param EE_Base_Class/int $other_obj_or_id
35 35
 	 * @return EE_Base_Class
36 36
 	 */
37
-	 function add_relation_to($this_obj_or_id, $other_obj_or_id ){
37
+	 function add_relation_to($this_obj_or_id, $other_obj_or_id) {
38 38
 		 $this_model_obj = $this->get_this_model()->ensure_is_obj($this_obj_or_id, true);
39 39
 		 $other_model_obj = $this->get_other_model()->ensure_is_obj($other_obj_or_id, true);
40 40
 		 
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 	 * @param EE_Base_Class/int $other_obj_or_id
54 54
 	 * @return EE_Base_Class
55 55
 	 */
56
-	 function remove_relation_to($this_obj_or_id, $other_obj_or_id){
56
+	 function remove_relation_to($this_obj_or_id, $other_obj_or_id) {
57 57
 		 $other_model_obj = $this->get_other_model()->ensure_is_obj($other_obj_or_id, true);
58 58
 		 //find the field on th eother model which is a foreign key to this model
59 59
 		 $fk_field_on_other_model = $this->get_other_model()->get_foreign_key_to($this->get_this_model()->get_this_model_name());
60 60
 		 //set that field on the other model to this model's ID
61
-		 $other_model_obj->set($fk_field_on_other_model->get_name(),null, true);
61
+		 $other_model_obj->set($fk_field_on_other_model->get_name(), null, true);
62 62
 		 $other_model_obj->set($this->get_other_model()->get_field_containing_related_model_name()->get_name(), null, true);
63 63
 		 $other_model_obj->save();
64 64
 		 return $other_model_obj;
Please login to merge, or discard this patch.
core/db_models/strategies/EE_Soft_Delete_Where_Conditions.strategy.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 		//so in case teh IPN is arriving later, let's try to process an IPN!
91 91
 		if($_SERVER['REQUEST_METHOD'] == 'POST'){
92 92
 			return $this->handle_ipn($_POST, $transaction );
93
-		}else{
93
+		} else{
94 94
 			return parent::finalize_payment_for( $transaction );
95 95
 		}
96 96
 	}
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 /*
4 4
  * Strategy specifically for adding where conditions specific to CPT models.
5 5
  */
6
-class EE_Soft_Delete_Where_Conditions extends EE_Default_Where_Conditions{
6
+class EE_Soft_Delete_Where_Conditions extends EE_Default_Where_Conditions {
7 7
 	/**
8 8
 	 * Strategy for setting default soft delete where conditions. This strategy will find
9 9
 	 * the field of type 'EE_Trashed_Flag_Field', and add a condition that it be FALSE on all queries involving
@@ -12,16 +12,16 @@  discard block
 block discarded – undo
12 12
 	 * Eg,
13 13
 	 *
14 14
 	 */
15
-	function __construct(){}
15
+	function __construct() {}
16 16
 	/**
17 17
 	 * Gets the where default where conditions for a custom post type model
18 18
 	 * @param string $model_relation_path. Eg, from Event to Payment, this should be "Registration.Transaction.Payment"
19 19
 	 * @return array like EEM_Base::get_all's $query_params's index [0] (where conditions)
20 20
 	 */
21
-	function get_default_where_conditions($model_relation_chain = null){
21
+	function get_default_where_conditions($model_relation_chain = null) {
22 22
 		//make sure there's a period at the end of $model_relation_chain
23
-		if($model_relation_chain != '' && $model_relation_chain[strlen($model_relation_chain)-1] !='.'){
24
-			$model_relation_chain=$model_relation_chain.".";
23
+		if ($model_relation_chain != '' && $model_relation_chain[strlen($model_relation_chain) - 1] != '.') {
24
+			$model_relation_chain = $model_relation_chain.".";
25 25
 		}
26 26
 
27 27
 		$trashed_field_name = $this->deleted_field_name();
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
 	 * @return string
36 36
 	 * @throws EE_Error
37 37
 	 */
38
-	private function deleted_field_name(){
38
+	private function deleted_field_name() {
39 39
 		$field = $this->_model->get_a_field_of_type('EE_Trashed_Flag_Field');
40
-		if($field){
40
+		if ($field) {
41 41
 			return $field->get_name();
42
-		}else{
43
-			throw new EE_Error(sprintf(__('We are trying to find the deleted flag field on %s, but none was found. Are you sure there is a field of type EE_Trashed_Flag_Field in %s constructor?','event_espresso'),get_class($this),get_class($this)));
42
+		} else {
43
+			throw new EE_Error(sprintf(__('We are trying to find the deleted flag field on %s, but none was found. Are you sure there is a field of type EE_Trashed_Flag_Field in %s constructor?', 'event_espresso'), get_class($this), get_class($this)));
44 44
 		}
45 45
 	}
46 46
 }
47 47
\ No newline at end of file
Please login to merge, or discard this patch.
core/helpers/EEH_Venue_View.helper.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
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Spacing   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -44,16 +44,16 @@  discard block
 block discarded – undo
44 44
 	 *                             		     regardless of access.
45 45
 	 * @return EE_Venue | null
46 46
 	 */
47
-	public static function get_venue( $VNU_ID = 0, $look_in_event = TRUE, $privacy_check = true ) {
48
-		$VNU_ID = absint( $VNU_ID );
47
+	public static function get_venue($VNU_ID = 0, $look_in_event = TRUE, $privacy_check = true) {
48
+		$VNU_ID = absint($VNU_ID);
49 49
 		// do we already have the Venue you are looking for?
50
-		if ( EEH_Venue_View::$_venue instanceof EE_Venue && EEH_Venue_View::$_venue->ID() == $VNU_ID ) {
51
-			return EEH_Venue_View::_get_venue( $privacy_check );
50
+		if (EEH_Venue_View::$_venue instanceof EE_Venue && EEH_Venue_View::$_venue->ID() == $VNU_ID) {
51
+			return EEH_Venue_View::_get_venue($privacy_check);
52 52
 		}
53 53
 		// international newspaper?
54 54
 		global $post;
55
-		if ( $post instanceof WP_Post ) {
56
-			switch ( $post->post_type ) {
55
+		if ($post instanceof WP_Post) {
56
+			switch ($post->post_type) {
57 57
 				// if this is being called from an EE_Venue post,
58 58
 				// and the EE_Venue post corresponds to the EE_Venue that is being asked for,
59 59
 				// then we can try to just grab the attached EE_Venue object
@@ -61,31 +61,31 @@  discard block
 block discarded – undo
61 61
 					// the post already contains the related EE_Venue object AND one of the following is TRUE:
62 62
 					// the requested Venue ID matches the post ID OR...
63 63
 					// there was no specific Venue ID requested
64
-					if ( isset( $post->EE_Venue ) && ( $VNU_ID == $post->ID || ! $VNU_ID )) {
64
+					if (isset($post->EE_Venue) && ($VNU_ID == $post->ID || ! $VNU_ID)) {
65 65
 						// use existing related EE_Venue object
66
-						EEH_Venue_View::$_venue =  $post->EE_Venue;
67
-					} else if ( $VNU_ID ) {
66
+						EEH_Venue_View::$_venue = $post->EE_Venue;
67
+					} else if ($VNU_ID) {
68 68
 						// there WAS a specific Venue ID requested, but it's NOT the current post object
69
-						EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID( $VNU_ID );
69
+						EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID($VNU_ID);
70 70
 					} else {
71 71
 						// no specific Venue ID requested, so use post ID to generate EE_Venue object
72
-						EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID( $post->ID );
72
+						EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID($post->ID);
73 73
 					}
74 74
 				break;
75 75
 
76 76
 				case 'espresso_events':
77
-					if ( $look_in_event ) {
77
+					if ($look_in_event) {
78 78
 						// grab the events related venues
79 79
 						$venues = EEH_Venue_View::get_event_venues();
80 80
 						// make sure the result is an array
81
-						$venues = is_array( $venues ) ? $venues : array();
81
+						$venues = is_array($venues) ? $venues : array();
82 82
 						// do we have an ID for a specific venue?
83
-						if ( $VNU_ID ) {
83
+						if ($VNU_ID) {
84 84
 							// loop thru the related venues
85
-							foreach( $venues as $venue ) {
86
-								if ( $venue instanceof EE_Venue ) {
85
+							foreach ($venues as $venue) {
86
+								if ($venue instanceof EE_Venue) {
87 87
 									// until we find the venue we're looking for
88
-									if ( $venue->ID() == $VNU_ID ) {
88
+									if ($venue->ID() == $VNU_ID) {
89 89
 										EEH_Venue_View::$_venue = $venue;
90 90
 										break;
91 91
 									}
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 							// then the global post is an events post and this function was called with no argument
98 98
 						} else {
99 99
 							// just grab the first related event venue
100
-							EEH_Venue_View::$_venue = reset( $venues );
100
+							EEH_Venue_View::$_venue = reset($venues);
101 101
 						}
102 102
 					}
103 103
 				break;
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
 			}
106 106
 		}
107 107
 		// now if we STILL do NOT have an EE_Venue model object, BUT we have a Venue ID...
108
-		if ( ! EEH_Venue_View::$_venue instanceof EE_Venue && $VNU_ID ) {
108
+		if ( ! EEH_Venue_View::$_venue instanceof EE_Venue && $VNU_ID) {
109 109
 			// sigh... pull it from the db
110
-			EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID( $VNU_ID );
110
+			EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID($VNU_ID);
111 111
 		}
112
-		return EEH_Venue_View::_get_venue( $privacy_check );
112
+		return EEH_Venue_View::_get_venue($privacy_check);
113 113
 	}
114 114
 
115 115
 
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
 	 *                             		     regardless of access.
122 122
 	 *  @return 	EE_Venue
123 123
 	 */
124
-	protected static function _get_venue( $privacy_check = true ) {
124
+	protected static function _get_venue($privacy_check = true) {
125 125
 		// check for private venues.
126
-		if ( EEH_Venue_View::$_venue instanceof EE_Venue && EEH_Venue_View::$_venue->status() == 'private' && $privacy_check && ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_venues', 'get_venues' ) ) {
126
+		if (EEH_Venue_View::$_venue instanceof EE_Venue && EEH_Venue_View::$_venue->status() == 'private' && $privacy_check && ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_venues', 'get_venues')) {
127 127
 			return null;
128 128
 		}
129 129
 		return EEH_Venue_View::$_venue instanceof EE_Venue ? EEH_Venue_View::$_venue : null;
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
 	 */
140 140
 	public static function get_event_venues() {
141 141
 		global $post;
142
-		if ( $post->post_type == 'espresso_events' ) {
143
-			if ( isset( $post->EE_Event ) && $post->EE_Event instanceof EE_Event ) {
142
+		if ($post->post_type == 'espresso_events') {
143
+			if (isset($post->EE_Event) && $post->EE_Event instanceof EE_Event) {
144 144
 				return $post->EE_Event->venues();
145 145
 			}
146 146
 		}
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
 	 *
161 161
 	 * @return bool|null
162 162
 	 */
163
-	public static function is_venue_private( $VNU_ID = false ) {
164
-		$venue = EEH_Venue_View::get_venue( $VNU_ID, true, true );
165
-		if ( ! $venue instanceof EE_Venue ) {
163
+	public static function is_venue_private($VNU_ID = false) {
164
+		$venue = EEH_Venue_View::get_venue($VNU_ID, true, true);
165
+		if ( ! $venue instanceof EE_Venue) {
166 166
 			return null;
167 167
 		}
168 168
 
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 	 * @param int $VNU_ID
179 179
 	 * @return string
180 180
 	 */
181
-	public static function venue_description( $VNU_ID = 0 ) {
182
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
183
-		if ( $venue instanceof EE_Venue ) {
181
+	public static function venue_description($VNU_ID = 0) {
182
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
183
+		if ($venue instanceof EE_Venue) {
184 184
 			return$venue->description();
185 185
 		}
186 186
 		return '';
@@ -195,12 +195,12 @@  discard block
 block discarded – undo
195 195
 	 * @param int $VNU_ID
196 196
 	 * @return string
197 197
 	 */
198
-	public static function venue_excerpt( $VNU_ID = 0 ) {
199
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
200
-		if ( $venue instanceof EE_Venue ) {
198
+	public static function venue_excerpt($VNU_ID = 0) {
199
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
200
+		if ($venue instanceof EE_Venue) {
201 201
 			$excerpt = $venue->excerpt() != NULL && $venue->excerpt() ? $venue->excerpt() : $venue->description();
202
-			$venue_link = ' ' . EEH_Venue_View::venue_details_link( $venue->ID(), __( 'more', 'event_espresso' ) . '&hellip;' );
203
-			return ! empty( $excerpt ) ? wp_trim_words( $excerpt, 25, '' ) . $venue_link : '';
202
+			$venue_link = ' '.EEH_Venue_View::venue_details_link($venue->ID(), __('more', 'event_espresso').'&hellip;');
203
+			return ! empty($excerpt) ? wp_trim_words($excerpt, 25, '').$venue_link : '';
204 204
 		}
205 205
 		return '';
206 206
 	}
@@ -215,22 +215,22 @@  discard block
 block discarded – undo
215 215
 	 * @param bool $hide_uncategorized
216 216
 	 * @return string
217 217
 	 */
218
-	public static function venue_categories( $VNU_ID = 0, $hide_uncategorized = TRUE ) {
218
+	public static function venue_categories($VNU_ID = 0, $hide_uncategorized = TRUE) {
219 219
 		$category_links = array();
220
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
221
-		if ( $venue instanceof EE_Venue ) {
220
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
221
+		if ($venue instanceof EE_Venue) {
222 222
 			// get category terms
223
-			if ( $venue_categories = get_the_terms( $venue->ID(), 'espresso_venue_categories' )) {
223
+			if ($venue_categories = get_the_terms($venue->ID(), 'espresso_venue_categories')) {
224 224
 				// loop thru terms and create links
225
-				foreach ( $venue_categories as $term ) {
226
-					$url = get_term_link( $term, 'espresso_venue_categories' );
227
-					if ( ! is_wp_error( $url ) && (( $hide_uncategorized && strtolower( $term->name ) != __( 'uncategorized', 'event_espresso' )) || ! $hide_uncategorized )) {
228
-						$category_links[] = '<a href="' . esc_url( $url ) . '" rel="tag">' . $term->name . '</a> ';
225
+				foreach ($venue_categories as $term) {
226
+					$url = get_term_link($term, 'espresso_venue_categories');
227
+					if ( ! is_wp_error($url) && (($hide_uncategorized && strtolower($term->name) != __('uncategorized', 'event_espresso')) || ! $hide_uncategorized)) {
228
+						$category_links[] = '<a href="'.esc_url($url).'" rel="tag">'.$term->name.'</a> ';
229 229
 					}
230 230
 				}
231 231
 			}
232 232
 		}
233
-		return implode( ', ', $category_links );
233
+		return implode(', ', $category_links);
234 234
 	}
235 235
 
236 236
 
@@ -245,11 +245,11 @@  discard block
 block discarded – undo
245 245
 	 * @param bool $add_wrapper
246 246
 	 * @return string
247 247
 	 */
248
-	public static function venue_address( $type = 'multiline', $VNU_ID = 0, $use_schema = true, $add_wrapper = true ) {
249
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
250
-		if ( $venue instanceof EE_Venue ) {
251
-			EE_Registry::instance()->load_helper( 'Formatter' );
252
-			return EEH_Address::format( $venue, $type, $use_schema, $add_wrapper );
248
+	public static function venue_address($type = 'multiline', $VNU_ID = 0, $use_schema = true, $add_wrapper = true) {
249
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
250
+		if ($venue instanceof EE_Venue) {
251
+			EE_Registry::instance()->load_helper('Formatter');
252
+			return EEH_Address::format($venue, $type, $use_schema, $add_wrapper);
253 253
 		}
254 254
 		return '';
255 255
 	}
@@ -263,11 +263,11 @@  discard block
 block discarded – undo
263 263
 	 * @param int $VNU_ID
264 264
 	 * @return bool|string
265 265
 	 */
266
-	public static function venue_has_address( $VNU_ID = 0 ) {
267
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
268
-		if ( $venue instanceof EE_Venue ) {
269
-			EE_Registry::instance()->load_helper( 'Formatter' );
270
-			return EEH_Address::format( $venue, 'inline', FALSE, FALSE );
266
+	public static function venue_has_address($VNU_ID = 0) {
267
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
268
+		if ($venue instanceof EE_Venue) {
269
+			EE_Registry::instance()->load_helper('Formatter');
270
+			return EEH_Address::format($venue, 'inline', FALSE, FALSE);
271 271
 		}
272 272
 		return false;
273 273
 	}
@@ -282,26 +282,26 @@  discard block
 block discarded – undo
282 282
 	 * @param int $VNU_ID
283 283
 	 * @return string
284 284
 	 */
285
-	public static function venue_name( $link_to = 'details', $VNU_ID = 0 ) {
286
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
287
-		if ( $venue instanceof EE_Venue ) {
288
-			EE_Registry::instance()->load_helper( 'Formatter' );
285
+	public static function venue_name($link_to = 'details', $VNU_ID = 0) {
286
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
287
+		if ($venue instanceof EE_Venue) {
288
+			EE_Registry::instance()->load_helper('Formatter');
289 289
 			$venue_name = apply_filters(
290 290
 				'FHEE__EEH_Venue__venue_name__append_private_venue_name',
291 291
 				EEH_Venue_View::is_venue_private()
292
-					? EEH_Venue_View::$_venue->name() . "&nbsp;" . __( '(Private)', 'event_espresso' )
292
+					? EEH_Venue_View::$_venue->name()."&nbsp;".__('(Private)', 'event_espresso')
293 293
 					: EEH_Venue_View::$_venue->name(),
294 294
 				EEH_Venue_View::$_venue
295 295
 			);
296
-			$venue_name = EEH_Schema::name( $venue_name );
297
-			switch( $link_to ) {
296
+			$venue_name = EEH_Schema::name($venue_name);
297
+			switch ($link_to) {
298 298
 
299 299
 				case 'details' :
300
-					return EEH_Venue_View::venue_details_link( $venue->ID(), $venue_name );
300
+					return EEH_Venue_View::venue_details_link($venue->ID(), $venue_name);
301 301
 				break;
302 302
 
303 303
 				case 'website' :
304
-					return EEH_Venue_View::venue_website_link( $venue->ID(), $venue_name );
304
+					return EEH_Venue_View::venue_website_link($venue->ID(), $venue_name);
305 305
 				break;
306 306
 
307 307
 				default :
@@ -321,10 +321,10 @@  discard block
 block discarded – undo
321 321
 	 * @param    string $text
322 322
 	 * @return string
323 323
 	 */
324
-	public static function venue_details_link( $VNU_ID = 0, $text = '' ) {
325
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
326
-		if ( $venue instanceof EE_Venue ) {
327
-			return EEH_Schema::url( get_permalink( $venue->ID() ), $text );
324
+	public static function venue_details_link($VNU_ID = 0, $text = '') {
325
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
326
+		if ($venue instanceof EE_Venue) {
327
+			return EEH_Schema::url(get_permalink($venue->ID()), $text);
328 328
 		}
329 329
 		return '';
330 330
 	}
@@ -339,13 +339,13 @@  discard block
 block discarded – undo
339 339
 	 * @param    string $text
340 340
 	 * @return string
341 341
 	 */
342
-	public static function venue_website_link( $VNU_ID = 0, $text = '' ) {
343
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
344
-		if ( $venue instanceof EE_Venue ) {
345
-			EE_Registry::instance()->load_helper( 'Formatter' );
342
+	public static function venue_website_link($VNU_ID = 0, $text = '') {
343
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
344
+		if ($venue instanceof EE_Venue) {
345
+			EE_Registry::instance()->load_helper('Formatter');
346 346
 			$url = $venue->venue_url();
347
-			$text = ! empty( $text ) ? $text : $url;
348
-			return ! empty( $url ) ? EEH_Schema::url( $url, $text ) : '';
347
+			$text = ! empty($text) ? $text : $url;
348
+			return ! empty($url) ? EEH_Schema::url($url, $text) : '';
349 349
 		}
350 350
 		return '';
351 351
 	}
@@ -359,11 +359,11 @@  discard block
 block discarded – undo
359 359
 	 * @param int $VNU_ID
360 360
 	 * @return string
361 361
 	 */
362
-	public static function venue_phone( $VNU_ID = 0) {
363
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
364
-		if ( $venue instanceof EE_Venue ) {
365
-			EE_Registry::instance()->load_helper( 'Formatter' );
366
-			return EEH_Schema::telephone( $venue->phone() );
362
+	public static function venue_phone($VNU_ID = 0) {
363
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
364
+		if ($venue instanceof EE_Venue) {
365
+			EE_Registry::instance()->load_helper('Formatter');
366
+			return EEH_Schema::telephone($venue->phone());
367 367
 		}
368 368
 		return '';
369 369
 	}
@@ -379,51 +379,51 @@  discard block
 block discarded – undo
379 379
 	 * @param    array $gmap map options
380 380
 	 * @return string
381 381
 	 */
382
-	public static function venue_gmap( $VNU_ID = 0, $map_ID = FALSE, $gmap = array() ) {
382
+	public static function venue_gmap($VNU_ID = 0, $map_ID = FALSE, $gmap = array()) {
383 383
 
384
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
385
-		if ( $venue instanceof EE_Venue ) {
384
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
385
+		if ($venue instanceof EE_Venue) {
386 386
 			// check for global espresso_events post and use it's ID if no map_ID is set
387 387
 			global $post;
388
-			$map_ID = empty( $map_ID ) && $post->post_type == 'espresso_events' ? $post->ID : $map_ID;
388
+			$map_ID = empty($map_ID) && $post->post_type == 'espresso_events' ? $post->ID : $map_ID;
389 389
 			// grab map settings
390 390
 			$map_cfg = EE_Registry::instance()->CFG->map_settings;
391 391
 			// are maps enabled ?
392
-			if ( $map_cfg->use_google_maps && $venue->enable_for_gmap() ) {
392
+			if ($map_cfg->use_google_maps && $venue->enable_for_gmap()) {
393 393
 
394
-				EE_Registry::instance()->load_helper( 'Maps' );
395
-				EE_Registry::instance()->load_helper( 'Formatter' );
394
+				EE_Registry::instance()->load_helper('Maps');
395
+				EE_Registry::instance()->load_helper('Formatter');
396 396
 
397 397
 				$details_page = is_single();
398 398
 				$options = array();
399
-				$options['map_ID'] = $map_ID && $map_ID != $venue->ID() ? $map_ID . '-' . $venue->ID()/* . '-' . $static_map_id*/ : $venue->ID()/* . '-' . $static_map_id*/;
399
+				$options['map_ID'] = $map_ID && $map_ID != $venue->ID() ? $map_ID.'-'.$venue->ID()/* . '-' . $static_map_id*/ : $venue->ID()/* . '-' . $static_map_id*/;
400 400
 
401
-				$options['location'] = EEH_Address::format( $venue, 'inline', FALSE, FALSE );
401
+				$options['location'] = EEH_Address::format($venue, 'inline', FALSE, FALSE);
402 402
 
403 403
 				$options['ee_map_width'] = $details_page ? $map_cfg->event_details_map_width : $map_cfg->event_list_map_width;
404
-				$options['ee_map_width'] = isset( $gmap['ee_map_width'] ) && ! empty( $gmap['ee_map_width'] ) ? $gmap['ee_map_width'] : $options['ee_map_width'];
404
+				$options['ee_map_width'] = isset($gmap['ee_map_width']) && ! empty($gmap['ee_map_width']) ? $gmap['ee_map_width'] : $options['ee_map_width'];
405 405
 
406 406
 				$options['ee_map_height'] = $details_page ? $map_cfg->event_details_map_height : $map_cfg->event_list_map_height;
407
-				$options['ee_map_height'] = isset( $gmap['ee_map_height'] ) && ! empty( $gmap['ee_map_height'] ) ? $gmap['ee_map_height'] : $options['ee_map_height'];
407
+				$options['ee_map_height'] = isset($gmap['ee_map_height']) && ! empty($gmap['ee_map_height']) ? $gmap['ee_map_height'] : $options['ee_map_height'];
408 408
 
409 409
 				$options['ee_map_zoom'] = $details_page ? $map_cfg->event_details_map_zoom : $map_cfg->event_list_map_zoom;
410
-				$options['ee_map_zoom'] = isset( $gmap['ee_map_zoom'] ) && ! empty( $gmap['ee_map_zoom'] ) ? $gmap['ee_map_zoom'] : $options['ee_map_zoom'];
410
+				$options['ee_map_zoom'] = isset($gmap['ee_map_zoom']) && ! empty($gmap['ee_map_zoom']) ? $gmap['ee_map_zoom'] : $options['ee_map_zoom'];
411 411
 
412 412
 				$options['ee_map_nav_display'] = $details_page ? $map_cfg->event_details_display_nav : $map_cfg->event_list_display_nav;
413
-				$options['ee_map_nav_display'] = isset( $gmap['ee_map_nav_display'] ) && ! empty( $gmap['ee_map_nav_display'] ) ? 'true' : $options['ee_map_nav_display'];;
413
+				$options['ee_map_nav_display'] = isset($gmap['ee_map_nav_display']) && ! empty($gmap['ee_map_nav_display']) ? 'true' : $options['ee_map_nav_display']; ;
414 414
 
415 415
 				$options['ee_map_nav_size'] = $details_page ? $map_cfg->event_details_nav_size : $map_cfg->event_list_nav_size;
416
-				$options['ee_map_nav_size'] =  isset( $gmap['ee_map_nav_size'] ) && ! empty( $gmap['ee_map_nav_size'] )? $gmap['ee_map_nav_size'] : $options['ee_map_nav_size'];
416
+				$options['ee_map_nav_size'] = isset($gmap['ee_map_nav_size']) && ! empty($gmap['ee_map_nav_size']) ? $gmap['ee_map_nav_size'] : $options['ee_map_nav_size'];
417 417
 
418 418
 				$options['ee_map_type_control'] = $details_page ? $map_cfg->event_details_control_type : $map_cfg->event_list_control_type;
419
-				$options['ee_map_type_control'] =  isset( $gmap['ee_map_type_control'] ) && ! empty( $gmap['ee_map_type_control'] )? $gmap['ee_map_type_control'] : $options['ee_map_type_control'];
419
+				$options['ee_map_type_control'] = isset($gmap['ee_map_type_control']) && ! empty($gmap['ee_map_type_control']) ? $gmap['ee_map_type_control'] : $options['ee_map_type_control'];
420 420
 
421 421
 				$options['ee_map_align'] = $details_page ? $map_cfg->event_details_map_align : $map_cfg->event_list_map_align;
422
-				$options['ee_map_align'] =  isset( $gmap['ee_map_align'] ) && ! empty( $gmap['ee_map_align'] )? $gmap['ee_map_align'] : $options['ee_map_align'];
422
+				$options['ee_map_align'] = isset($gmap['ee_map_align']) && ! empty($gmap['ee_map_align']) ? $gmap['ee_map_align'] : $options['ee_map_align'];
423 423
 
424
-				$options['ee_static_url'] =  isset( $gmap['ee_static_url'] ) && ! empty( $gmap['ee_static_url'] ) ? (bool)absint( $gmap['ee_static_url'] ) : $venue->google_map_link();
424
+				$options['ee_static_url'] = isset($gmap['ee_static_url']) && ! empty($gmap['ee_static_url']) ? (bool) absint($gmap['ee_static_url']) : $venue->google_map_link();
425 425
 
426
-				return EEH_Maps::google_map( $options );
426
+				return EEH_Maps::google_map($options);
427 427
 
428 428
 			}
429 429
 		}
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 	 * @param array $atts like EEH_Maps::google_map_link
439 439
 	 * @return string
440 440
 	 */
441
-	public static function espresso_google_static_map( EE_Venue $venue, $atts = array() ){
441
+	public static function espresso_google_static_map(EE_Venue $venue, $atts = array()) {
442 442
 		EE_Registry::instance()->load_helper('Maps');
443 443
 		$state = $venue->state_obj();
444 444
 		$country = $venue->country_obj();
@@ -470,23 +470,23 @@  discard block
 block discarded – undo
470 470
 	 * @param string $after
471 471
 	 * @return string
472 472
 	 */
473
-	public static function edit_venue_link( $VNU_ID = 0, $link = '', $before = '<p class="edit-venue-lnk small-txt">', $after = '</p>' ) {
474
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
475
-		if ( $venue instanceof EE_Venue ) {
473
+	public static function edit_venue_link($VNU_ID = 0, $link = '', $before = '<p class="edit-venue-lnk small-txt">', $after = '</p>') {
474
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
475
+		if ($venue instanceof EE_Venue) {
476 476
 			// can the user edit this post ?
477
-			if ( current_user_can( 'edit_post', $venue->ID() )) {
477
+			if (current_user_can('edit_post', $venue->ID())) {
478 478
 				// set link text
479
-				$link = ! empty( $link ) ? $link : __('edit this venue');
479
+				$link = ! empty($link) ? $link : __('edit this venue');
480 480
 				// generate nonce
481
-				$nonce = wp_create_nonce( 'edit_nonce' );
481
+				$nonce = wp_create_nonce('edit_nonce');
482 482
 				// generate url to venue editor for this venue
483
-				$url = add_query_arg( array( 'page' => 'espresso_venues', 'action' => 'edit', 'post' => $venue->ID(), 'edit_nonce' => $nonce ), admin_url( 'admin.php' ) );
483
+				$url = add_query_arg(array('page' => 'espresso_venues', 'action' => 'edit', 'post' => $venue->ID(), 'edit_nonce' => $nonce), admin_url('admin.php'));
484 484
 				// get edit CPT text
485
-				$post_type_obj = get_post_type_object( 'espresso_venues' );
485
+				$post_type_obj = get_post_type_object('espresso_venues');
486 486
 				// build final link html
487
-				$link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( $post_type_obj->labels->edit_item ) . '">' . $link . '</a>';
487
+				$link = '<a class="post-edit-link" href="'.$url.'" title="'.esc_attr($post_type_obj->labels->edit_item).'">'.$link.'</a>';
488 488
 				// put it all together
489
-				return $before . apply_filters( 'edit_post_link', $link, $venue->ID() ) . $after;
489
+				return $before.apply_filters('edit_post_link', $link, $venue->ID()).$after;
490 490
 			}
491 491
 		}
492 492
 		return '';
Please login to merge, or discard this patch.
form_sections/strategies/display/EE_Checkbox_Display_Strategy.strategy.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -11,38 +11,38 @@
 block discarded – undo
11 11
  * @since 				$VID:$
12 12
  *
13 13
  */
14
-class EE_Checkbox_Display_Strategy extends EE_Display_Strategy_Base{
14
+class EE_Checkbox_Display_Strategy extends EE_Display_Strategy_Base {
15 15
 
16 16
 	/**
17 17
 	 *
18 18
 	 * @throws EE_Error
19 19
 	 * @return string of html to display the field
20 20
 	 */
21
-	function display(){
22
-		if( ! $this->_input instanceof EE_Form_Input_With_Options_Base ){
21
+	function display() {
22
+		if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base) {
23 23
 			throw new EE_Error(sprintf(__("Cannot use Checkbox Display Strategy with an input that doesn't have options", "event_espresso")));
24 24
 		}
25 25
 		//d( $this->_input );
26
-		$multi = count( $this->_input->options() ) > 1 ? TRUE : FALSE;
26
+		$multi = count($this->_input->options()) > 1 ? TRUE : FALSE;
27 27
 		$this->_input->set_label_sizes();
28 28
 		$label_size_class = $this->_input->get_label_size_class();
29 29
 		$html = '';
30
-		foreach( $this->_input->options() as $value => $display_text ){
31
-			$option_value_as_string = $this->_input->get_normalization_strategy()->unnormalize_one( $value );
32
-			$html_id = $multi ? $this->_input->html_id() . '-' . sanitize_key( $option_value_as_string ) : $this->_input->html_id();
33
-			$html .= EEH_HTML::nl( 0, 'checkbox' );
34
-			$html .= '<label for="' . $html_id . '" id="' . $html_id . '-lbl" class="ee-checkbox-label-after' . $label_size_class . '">';
35
-			$html .= EEH_HTML::nl( 1, 'checkbox' );
30
+		foreach ($this->_input->options() as $value => $display_text) {
31
+			$option_value_as_string = $this->_input->get_normalization_strategy()->unnormalize_one($value);
32
+			$html_id = $multi ? $this->_input->html_id().'-'.sanitize_key($option_value_as_string) : $this->_input->html_id();
33
+			$html .= EEH_HTML::nl(0, 'checkbox');
34
+			$html .= '<label for="'.$html_id.'" id="'.$html_id.'-lbl" class="ee-checkbox-label-after'.$label_size_class.'">';
35
+			$html .= EEH_HTML::nl(1, 'checkbox');
36 36
 			$html .= '<input type="checkbox"';
37
-			$html .= ' name="' . $this->_input->html_name() . '[]"';
38
-			$html .= ' id="' . $html_id . '"';
39
-			$html .= ' class="' . $this->_input->html_class() . '"';
40
-			$html .= ' style="' . $this->_input->html_style() . '"';
41
-			$html .= ' value="' . esc_attr( $value ) . '"';
42
-			$html .= $this->_input->raw_value() && in_array( $value, $this->_input->raw_value() ) ? ' checked="checked"' : '';
37
+			$html .= ' name="'.$this->_input->html_name().'[]"';
38
+			$html .= ' id="'.$html_id.'"';
39
+			$html .= ' class="'.$this->_input->html_class().'"';
40
+			$html .= ' style="'.$this->_input->html_style().'"';
41
+			$html .= ' value="'.esc_attr($value).'"';
42
+			$html .= $this->_input->raw_value() && in_array($value, $this->_input->raw_value()) ? ' checked="checked"' : '';
43 43
 			$html .= '>&nbsp;';
44 44
 			$html .= $display_text;
45
-			$html .= EEH_HTML::nl( -1, 'checkbox' ) . '</label>';
45
+			$html .= EEH_HTML::nl( -1, 'checkbox' ).'</label>';
46 46
 		}
47 47
 		return $html;
48 48
 	}
Please login to merge, or discard this patch.
strategies/validation/EE_Simple_HTML_Validation_Strategy.strategy.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -10,20 +10,20 @@  discard block
 block discarded – undo
10 10
  * @since 				4.6
11 11
  *
12 12
  */
13
-class EE_Simple_HTML_Validation_Strategy extends EE_Validation_Strategy_Base{
13
+class EE_Simple_HTML_Validation_Strategy extends EE_Validation_Strategy_Base {
14 14
 
15 15
 	/**
16 16
 	 * @param null $validation_error_message
17 17
 	 */
18
-	public function __construct( $validation_error_message = NULL ) {
19
-		if( ! $validation_error_message ){
18
+	public function __construct($validation_error_message = NULL) {
19
+		if ( ! $validation_error_message) {
20 20
 			global $allowedtags;
21
-			$allowedtags['ol']=array();
22
-			$allowedtags['ul']=array();
23
-			$allowedtags['li']=array();
24
-			$validation_error_message = sprintf( __( "Only simple HTML tags are allowed. Eg, %s", "event_espresso" ), implode( ",", array_keys( $allowedtags ) ) );
21
+			$allowedtags['ol'] = array();
22
+			$allowedtags['ul'] = array();
23
+			$allowedtags['li'] = array();
24
+			$validation_error_message = sprintf(__("Only simple HTML tags are allowed. Eg, %s", "event_espresso"), implode(",", array_keys($allowedtags)));
25 25
 		}
26
-		parent::__construct( $validation_error_message );
26
+		parent::__construct($validation_error_message);
27 27
 	}
28 28
 
29 29
 
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	public function validate($normalized_value) {
36 36
 		global $allowedtags;
37 37
 		parent::validate($normalized_value);
38
-		$normalized_value_sans_tags =  wp_kses("$normalized_value",$allowedtags);
39
-		if(strlen($normalized_value) > strlen($normalized_value_sans_tags)){
40
-			throw new EE_Validation_Error( $this->get_validation_error_message(), 'complex_html_tags' );
38
+		$normalized_value_sans_tags = wp_kses("$normalized_value", $allowedtags);
39
+		if (strlen($normalized_value) > strlen($normalized_value_sans_tags)) {
40
+			throw new EE_Validation_Error($this->get_validation_error_message(), 'complex_html_tags');
41 41
 		}
42 42
 	}
43 43
 }
44 44
\ No newline at end of file
Please login to merge, or discard this patch.
libraries/messages/data_class/EE_Messages_Preview_incoming_data.class.php 2 patches
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.
Spacing   +53 added lines, -53 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
 /**
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 * For the constructor of this special preview class.  We're either looking for an event id or empty data.  If we have an event id (or ids) then we'll use that as the source for the "dummy" data.  If the data is empty then we'll get the first three published events from the users database and use that as a source.
43 43
 	 * @param array $data
44 44
 	 */
45
-	public function __construct( $data = array() ) {
45
+	public function __construct($data = array()) {
46 46
 
47 47
 		$data = empty($data) ? array() : $data['event_ids'];
48 48
 		$this->_setup_attendees_events();
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 
66 66
 		$answers_n_questions = $this->_get_some_q_and_as();
67 67
 
68
-		if ( count( $events ) < 1 ) {
69
-			throw new EE_Error( __('We can\'t generate a preview for you because there are no active events in your database', 'event_espresso' ) );
68
+		if (count($events) < 1) {
69
+			throw new EE_Error(__('We can\'t generate a preview for you because there are no active events in your database', 'event_espresso'));
70 70
 		}
71 71
 
72 72
 
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
 
77 77
 		//we'll actually use the generated line_item identifiers for our loop
78 78
 		$dtts = array();
79
-		foreach( $events as $id => $event ) {
79
+		foreach ($events as $id => $event) {
80 80
 			$this->_events[$id]['ID'] = $id;
81 81
 			$this->_events[$id]['name'] = $event->get('EVT_name');
82 82
 			$datetime = $event->get_first_related('Datetime');
83
-			$tickets = $datetime instanceof EE_Datetime ? $datetime->get_many_related('Ticket', array('default_where_conditions' => 'none') ) : array();
83
+			$tickets = $datetime instanceof EE_Datetime ? $datetime->get_many_related('Ticket', array('default_where_conditions' => 'none')) : array();
84 84
 			$this->_events[$id]['event'] = $event;
85 85
 			$this->_events[$id]['reg_objs'] = array();
86 86
 			$this->_events[$id]['tkt_objs'] = $tickets;
@@ -88,15 +88,15 @@  discard block
 block discarded – undo
88 88
 
89 89
 			$dttcache = array();
90 90
 			$tkts = array();
91
-			foreach ( $tickets as $ticket ) {
91
+			foreach ($tickets as $ticket) {
92 92
 				$tkts[$ticket->ID()]['ticket'] = $ticket;
93 93
 				$reldatetime = $ticket->datetimes();
94 94
 				$tkts[$ticket->ID()]['dtt_objs'] = $reldatetime;
95 95
 				$tkts[$ticket->ID()]['att_objs'] = $attendees;
96 96
 				$tkts[$ticket->ID()]['count'] = count($attendees);
97 97
 				$tkts[$ticket->ID()]['EE_Event'] = $event;
98
-				foreach ( $reldatetime as $datetime ) {
99
-					if ( !isset( $dtts[$datetime->ID()] ) ) {
98
+				foreach ($reldatetime as $datetime) {
99
+					if ( ! isset($dtts[$datetime->ID()])) {
100 100
 						$this->_events[$id]['dtt_objs'][$datetime->ID()] = $datetime;
101 101
 						$dtts[$datetime->ID()]['datetime'] = $datetime;
102 102
 						$dtts[$datetime->ID()]['tkt_objs'][] = $ticket;
@@ -106,26 +106,26 @@  discard block
 block discarded – undo
106 106
 				}
107 107
 			}
108 108
 
109
-			$this->_events[$id]['total_attendees'] = count( $attendees );
109
+			$this->_events[$id]['total_attendees'] = count($attendees);
110 110
 			$this->_events[$id]['att_objs'] = $attendees;
111 111
 
112 112
 			//let's also setup the dummy attendees property!
113
-			foreach ( $attendees as $att_key => $attendee ) {
114
-				$this->_attendees[$att_key]['line_ref'][] = $id;  //so later it can be determined what events this attendee registered for!
113
+			foreach ($attendees as $att_key => $attendee) {
114
+				$this->_attendees[$att_key]['line_ref'][] = $id; //so later it can be determined what events this attendee registered for!
115 115
 				$this->_attendees[$att_key]['evt_objs'][] = $event;
116 116
 				$this->_attendees[$att_key]['att_obj'] = $attendee;
117 117
 				//$this->_attendees[$att_key]['registration_id'] = 0;
118 118
 				$this->_attendees[$att_key]['attendee_email'] = $attendee->email();
119 119
 				$this->_attendees[$att_key]['tkt_objs'] = $tickets;
120
-				if ( $att_key == 999999991 ) {
120
+				if ($att_key == 999999991) {
121 121
 					$this->_attendees[$att_key]['ans_objs'][999] = $answers_n_questions['answers'][999];
122 122
 					$this->_attendees[$att_key]['ans_objs'][1002] = $answers_n_questions['answers'][1002];
123 123
 					$this->_attendees[$att_key]['ans_objs'][1005] = $answers_n_questions['answers'][1005];
124
-				} elseif ( $att_key == 999999992 ) {
124
+				} elseif ($att_key == 999999992) {
125 125
 					$this->_attendees[$att_key]['ans_objs'][1000] = $answers_n_questions['answers'][1000];
126 126
 					$this->_attendees[$att_key]['ans_objs'][1003] = $answers_n_questions['answers'][1003];
127 127
 					$this->_attendees[$att_key]['ans_objs'][1006] = $answers_n_questions['answers'][1006];
128
-				} elseif ( $att_key == 999999993 ) {
128
+				} elseif ($att_key == 999999993) {
129 129
 					$this->_attendees[$att_key]['ans_objs'][1001] = $answers_n_questions['answers'][1001];
130 130
 					$this->_attendees[$att_key]['ans_objs'][1004] = $answers_n_questions['answers'][1004];
131 131
 					$this->_attendees[$att_key]['ans_objs'][1007] = $answers_n_questions['answers'][1007];
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
 
199 199
 		//let's generate the attendee objects
200 200
 		$attendees = array();
201
-		$var_array = array('fname','lname','email','address','address2','city','staid','cntry','zip','phone','deleted','attid');
201
+		$var_array = array('fname', 'lname', 'email', 'address', 'address2', 'city', 'staid', 'cntry', 'zip', 'phone', 'deleted', 'attid');
202 202
 
203
-		EE_Registry::instance()->load_class( 'Attendee', array(), FALSE, TRUE, TRUE );
204
-		foreach ( $dummy_attendees as $dummy ) {
205
-			$att = array_combine( $var_array, $dummy );
203
+		EE_Registry::instance()->load_class('Attendee', array(), FALSE, TRUE, TRUE);
204
+		foreach ($dummy_attendees as $dummy) {
205
+			$att = array_combine($var_array, $dummy);
206 206
 			extract($att);
207 207
 			$attendees[$attid] = EE_Attendee::new_instance(
208 208
 				array(
@@ -303,19 +303,19 @@  discard block
 block discarded – undo
303 303
 		$qst_columns = array('QST_ID', 'QST_display_text', 'QST_system');
304 304
 		$ans_columns = array('ANS_ID', 'QST_ID', 'ANS_value');
305 305
 
306
-		EE_Registry::instance()->load_class( 'Question', array(), FALSE, TRUE, TRUE );
307
-		EE_Registry::instance()->load_class( 'Answer', array(), FALSE, TRUE, TRUE );
306
+		EE_Registry::instance()->load_class('Question', array(), FALSE, TRUE, TRUE);
307
+		EE_Registry::instance()->load_class('Answer', array(), FALSE, TRUE, TRUE);
308 308
 
309 309
 		//first the questions
310
-		foreach ( $quests_array as $qst ) {
311
-			$qstobj = array_combine( $qst_columns, $qst );
310
+		foreach ($quests_array as $qst) {
311
+			$qstobj = array_combine($qst_columns, $qst);
312 312
 			$qsts[$qstobj['QST_ID']] = EE_Question::new_instance($qstobj);
313 313
 		}
314 314
 
315 315
 		//now the answers (and we'll setup our arrays)
316 316
 		$q_n_as = array();
317
-		foreach ( $ans_array as $ans ) {
318
-			$ansobj = array_combine( $ans_columns, $ans );
317
+		foreach ($ans_array as $ans) {
318
+			$ansobj = array_combine($ans_columns, $ans);
319 319
 			$ansobj = EE_Answer::new_instance($ansobj);
320 320
 			$q_n_as['answers'][$ansobj->ID()] = $ansobj;
321 321
 			$q_n_as['questions'][$ansobj->ID()] = $qsts[$ansobj->get('QST_ID')];
@@ -337,17 +337,17 @@  discard block
 block discarded – undo
337 337
 	 * @param  array  $event_ids if set, this will be an array of event ids to obtain events for.
338 338
 	 * @return array    An array of event objects from the db.
339 339
 	 */
340
-	private function _get_some_events( $event_ids = array() ) {
340
+	private function _get_some_events($event_ids = array()) {
341 341
 		global $wpdb;
342 342
 
343 343
 		//HEY, if we have an evt_id then we want to make sure we use that for the preview (because a specific event template is being viewed);
344
-		$event_ids = isset( $_REQUEST['evt_id'] ) && !empty($_REQUEST['evt_id'] ) ? array( $_REQUEST['evt_id'] ) : array();
344
+		$event_ids = isset($_REQUEST['evt_id']) && ! empty($_REQUEST['evt_id']) ? array($_REQUEST['evt_id']) : array();
345 345
 
346
-		$limit = !empty( $event_ids ) ? NULL : apply_filters( 'FHEE__EE_Messages_Preview_incoming_data___get_some_events__limit', '0,1' );
346
+		$limit = ! empty($event_ids) ? NULL : apply_filters('FHEE__EE_Messages_Preview_incoming_data___get_some_events__limit', '0,1');
347 347
 
348
-		$where = !empty($event_ids) ? array('EVT_ID' => array( 'IN', $event_ids ), 'Datetime.Ticket.TKT_ID' => array('>', 1) ) : array('Datetime.Ticket.TKT_ID' => array('>', 1) );
348
+		$where = ! empty($event_ids) ? array('EVT_ID' => array('IN', $event_ids), 'Datetime.Ticket.TKT_ID' => array('>', 1)) : array('Datetime.Ticket.TKT_ID' => array('>', 1));
349 349
 
350
-		$events = EE_Registry::instance()->load_model('Event')->get_all(array($where, 'limit' => $limit ) );
350
+		$events = EE_Registry::instance()->load_model('Event')->get_all(array($where, 'limit' => $limit));
351 351
 
352 352
 		return $events;
353 353
 	}
@@ -361,13 +361,13 @@  discard block
 block discarded – undo
361 361
 
362 362
 		//need to figure out the running total for test purposes so... we're going to create a temp cart and add the tickets to it!
363 363
 
364
-		EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
364
+		EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
365 365
 
366 366
 		$cart = EE_Cart::instance();
367 367
 
368 368
 
369 369
 		//add tickets to cart
370
-		foreach ( $this->tickets as $ticket ) {
370
+		foreach ($this->tickets as $ticket) {
371 371
 			$cart->add_ticket_to_cart($ticket['ticket']);
372 372
 		}
373 373
 
@@ -391,13 +391,13 @@  discard block
 block discarded – undo
391 391
 		//note we're setting up a reg object for each attendee in each event but ALSO adding to the reg_object array.
392 392
 		$this->reg_objs = array();
393 393
 		$regid = 9999990;
394
-		foreach ( $this->_attendees as $key => $attendee ) {
394
+		foreach ($this->_attendees as $key => $attendee) {
395 395
 			//note we need to setup reg_objects for each event this attendee belongs to
396 396
 			$regatt = $attendee['att_obj']->ID();
397 397
 			$regtxn = $this->txn->ID();
398 398
 			$regcnt = 1;
399
-			foreach ( $attendee['line_ref'] as $evtid ) {
400
-				foreach ( $this->_events[$evtid]['tkt_objs'] as $ticket ) {
399
+			foreach ($attendee['line_ref'] as $evtid) {
400
+				foreach ($this->_events[$evtid]['tkt_objs'] as $ticket) {
401 401
 					$reg_array = array(
402 402
 						'EVT_ID' => $evtid,
403 403
 						'ATT_ID' => $regatt,
@@ -407,14 +407,14 @@  discard block
 block discarded – undo
407 407
 						'REG_date' => current_time('mysql'),
408 408
 						'REG_final_price' => $ticket->get('TKT_price'),
409 409
 						'REG_session' => 'dummy_session_id',
410
-						'REG_code' => $regid . '-dummy-generated-code',
411
-						'REG_url_link' => $regcnt . '-daafpapasdlfakasdfpqasdfasdf',
410
+						'REG_code' => $regid.'-dummy-generated-code',
411
+						'REG_url_link' => $regcnt.'-daafpapasdlfakasdfpqasdfasdf',
412 412
 						'REG_count' => $regcnt,
413 413
 						'REG_group_size' => $this->_events[$evtid]['total_attendees'],
414 414
 						'REG_att_is_going' => TRUE,
415 415
 						'REG_ID' => $regid
416 416
 						);
417
-					$REG_OBJ =  EE_Registration::new_instance( $reg_array );
417
+					$REG_OBJ = EE_Registration::new_instance($reg_array);
418 418
 					$this->_attendees[$key]['reg_objs'][$regid] = $REG_OBJ;
419 419
 					$this->_events[$evtid]['reg_objs'][] = $REG_OBJ;
420 420
 					$this->reg_objs[] = $REG_OBJ;
@@ -430,35 +430,35 @@  discard block
 block discarded – undo
430 430
 
431 431
 		//setup line items!
432 432
 		EE_Registry::instance()->load_helper('Line_Item');
433
-		$line_item_total = EEH_Line_Item::create_default_total_line_item( $this->txn );
433
+		$line_item_total = EEH_Line_Item::create_default_total_line_item($this->txn);
434 434
 
435 435
 		//add tickets
436
-		foreach ( $this->tickets as $tktid => $item ) {
436
+		foreach ($this->tickets as $tktid => $item) {
437 437
 			$qty = $item['count'];
438 438
 			$ticket = $item['ticket'];
439
-			EEH_Line_Item::add_ticket_purchase( $line_item_total, $ticket, $qty );
439
+			EEH_Line_Item::add_ticket_purchase($line_item_total, $ticket, $qty);
440 440
 		}
441 441
 
442
-		$shipping_line_item = EE_Line_Item::new_instance( array(
443
-			'LIN_name' => __( 'Shipping Surcharge', 'event_espresso' ),
444
-			'LIN_desc' => __( 'Sent via Millenium Falcon', 'event_espresso' ),
442
+		$shipping_line_item = EE_Line_Item::new_instance(array(
443
+			'LIN_name' => __('Shipping Surcharge', 'event_espresso'),
444
+			'LIN_desc' => __('Sent via Millenium Falcon', 'event_espresso'),
445 445
 			'LIN_unit_price' => 20,
446 446
 			'LIN_quantity' => 1,
447 447
 			'LIN_is_taxable' => TRUE,
448 448
 			'LIN_total' => 20,
449 449
 			'LIN_type' => EEM_Line_Item::type_line_item
450 450
 		));
451
-		EEH_Line_Item::add_item($line_item_total, $shipping_line_item );
452
-		$this->additional_line_items = array( $shipping_line_item );
451
+		EEH_Line_Item::add_item($line_item_total, $shipping_line_item);
452
+		$this->additional_line_items = array($shipping_line_item);
453 453
 
454 454
 		//now let's add taxes
455
-		EEH_Line_Item::apply_taxes( $line_item_total );
455
+		EEH_Line_Item::apply_taxes($line_item_total);
456 456
 
457 457
 		//now we should be able to get the items we need from this object
458
-		$ticket_line_items = EEH_Line_Item::get_items_subtotal( $line_item_total )->children();
458
+		$ticket_line_items = EEH_Line_Item::get_items_subtotal($line_item_total)->children();
459 459
 
460
-		foreach ( $ticket_line_items as $line_id => $line_item ) {
461
-			if( $line_item->OBJ_ID() && $line_item->OBJ_type() ){
460
+		foreach ($ticket_line_items as $line_id => $line_item) {
461
+			if ($line_item->OBJ_ID() && $line_item->OBJ_type()) {
462 462
 				$this->tickets[$line_item->OBJ_ID()]['line_item'] = $line_item;
463 463
 				$this->tickets[$line_item->OBJ_ID()]['sub_line_items'] = $line_item->children();
464 464
 				$line_items[$line_item->ID()]['children'] = $line_item->children();
@@ -472,11 +472,11 @@  discard block
 block discarded – undo
472 472
 		//add proper total to transaction object.
473 473
 		$grand_total = $line_item_total->recalculate_total_including_taxes();
474 474
 		$this->grand_total_line_item = $line_item_total;
475
-		$this->txn->set_total( $grand_total );
475
+		$this->txn->set_total($grand_total);
476 476
 
477 477
 
478 478
 		//add additional details for each registration
479
-		foreach ( $this->reg_objs as $reg ) {
479
+		foreach ($this->reg_objs as $reg) {
480 480
 			$this->_registrations[$reg->ID()]['tkt_obj'] = $this->tickets[$reg->get('TKT_ID')]['ticket'];
481 481
 			$this->_registrations[$reg->ID()]['evt_obj'] = $this->_events[$reg->get('EVT_ID')]['event'];
482 482
 			$this->_registrations[$reg->ID()]['reg_obj'] = $reg;
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 		$this->reg_info = array();
508 508
 
509 509
 		//let's set a reg_obj for messengers expecting one.
510
-		$this->reg_obj = array_pop( $this->_attendees[999999991]['reg_objs'] );
510
+		$this->reg_obj = array_pop($this->_attendees[999999991]['reg_objs']);
511 511
 
512 512
 
513 513
 		//the below are just dummy items.
Please login to merge, or discard this patch.
core/libraries/messages/data_class/EE_Messages_REG_incoming_data.class.php 2 patches
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.
Spacing   +7 added lines, -7 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
 /**
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 *
45 45
 	 * @param EE_Registration $data
46 46
 	 */
47
-	public function __construct( EE_Registration $data ) {
47
+	public function __construct(EE_Registration $data) {
48 48
 
49 49
 		$this->reg_obj = $data;
50 50
 
@@ -69,16 +69,16 @@  discard block
 block discarded – undo
69 69
 
70 70
 		//possible session stuff?
71 71
 		$session = $this->txn->session_data();
72
-		$session_data =  $session instanceof EE_Session ? $session->get_session_data() : array();
72
+		$session_data = $session instanceof EE_Session ? $session->get_session_data() : array();
73 73
 
74 74
 		//other data from the session (if possible)
75
-		$this->user_id = isset( $session_data['user_id'] ) ? $session_data['user_id'] : '';
76
-		$this->ip_address = isset( $session_data['ip_address'] ) ? $session_data['ip_address'] : '';
77
-		$this->user_agent = isset( $session_data['user_agent'] ) ? $session_data['user_agent'] : '';
75
+		$this->user_id = isset($session_data['user_id']) ? $session_data['user_id'] : '';
76
+		$this->ip_address = isset($session_data['ip_address']) ? $session_data['ip_address'] : '';
77
+		$this->user_agent = isset($session_data['user_agent']) ? $session_data['user_agent'] : '';
78 78
 		$this->init_access = $this->last_access = '';
79 79
 
80 80
 		$this->payment = $this->txn->get_first_related('Payment');
81
-		$this->payment = empty( $this->payment ) ? EE_Payment::new_instance( array(
81
+		$this->payment = empty($this->payment) ? EE_Payment::new_instance(array(
82 82
 			'STS_ID' => EEM_Payment::status_id_pending,
83 83
 			'PAY_timestamp' => (int) current_time('timestamp'),
84 84
 			'PMD_ID' => $this->txn->payment_method_ID(),
Please login to merge, or discard this patch.
default/email_not_approved_registration_attendee_list_admin.template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <h4><a href="[EDIT_ATTENDEE_LINK]">[FNAME] [LNAME]</a></h4>
2 2
 <ul>
3 3
 	<li>
4
-		<strong><?php _e( 'Registration Code:', 'event_espresso' ); ?></strong>
4
+		<strong><?php _e('Registration Code:', 'event_espresso'); ?></strong>
5 5
 		<a href="[EDIT_ATTENDEE_LINK]">[REGISTRATION_CODE]</a>
6 6
 	</li>
7 7
 	<li>
8
-		<strong><?php _e( 'Tickets:', 'event_espresso' ); ?></strong>
8
+		<strong><?php _e('Tickets:', 'event_espresso'); ?></strong>
9 9
 		<ul>[TICKET_LIST]</ul>
10 10
 	</li>
11 11
 </ul>
Please login to merge, or discard this patch.