Completed
Branch BUG-9179-default-price-please (cae472)
by
unknown
85:30 queued 68:14
created
core/helpers/EEH_Template.helper.php 4 patches
Braces   +19 added lines, -16 removed lines patch added patch discarded remove patch
@@ -160,8 +160,9 @@  discard block
 block discarded – undo
160 160
 		// first use WP locate_template to check for template in the current theme folder
161 161
 		$template_path = locate_template( $templates );
162 162
 
163
-		if ( $check_if_custom && !empty( $template_path ) )
164
-			return TRUE;
163
+		if ( $check_if_custom && !empty( $template_path ) ) {
164
+					return TRUE;
165
+		}
165 166
 
166 167
 		// not in the theme
167 168
 		if ( empty( $template_path )) {
@@ -364,11 +365,11 @@  discard block
 block discarded – undo
364 365
 				if( $mny->sign_b4 ){
365 366
 					if( $amount >= 0 ){
366 367
 						$amount_formatted = $mny->sign . $amount_formatted;
367
-					}else{
368
+					} else{
368 369
 						$amount_formatted = '-' . $mny->sign . str_replace( '-', '', $amount_formatted );
369 370
 					}
370 371
 
371
-				}else{
372
+				} else{
372 373
 					$amount_formatted =  $amount_formatted . $mny->sign;
373 374
 				}
374 375
 
@@ -432,11 +433,13 @@  discard block
 block discarded – undo
432 433
 	 */
433 434
 	public static function get_help_tab_link( $help_tab_id, $page = FALSE, $action = FALSE, $icon_style = FALSE, $help_text = FALSE ) {
434 435
 
435
-		if ( ! $page )
436
-			$page = isset( $_REQUEST['page'] ) && ! empty( $_REQUEST['page'] ) ? sanitize_key( $_REQUEST['page'] ) : $page;
436
+		if ( ! $page ) {
437
+					$page = isset( $_REQUEST['page'] ) && ! empty( $_REQUEST['page'] ) ? sanitize_key( $_REQUEST['page'] ) : $page;
438
+		}
437 439
 
438
-		if ( ! $action )
439
-			$action = isset( $_REQUEST['action'] ) && ! empty( $_REQUEST['action'] ) ? sanitize_key( $_REQUEST['action'] ) : $action;
440
+		if ( ! $action ) {
441
+					$action = isset( $_REQUEST['action'] ) && ! empty( $_REQUEST['action'] ) ? sanitize_key( $_REQUEST['action'] ) : $action;
442
+		}
440 443
 
441 444
 		$action = empty($action) ? 'default' : $action;
442 445
 
@@ -510,8 +513,9 @@  discard block
 block discarded – undo
510 513
 	 * @return string               html structure for status.
511 514
 	 */
512 515
 	public static function status_legend( $status_array, $active_status = '' ) {
513
-		if ( !is_array( $status_array ) )
514
-			throw new EE_Error( __('The EEH_Template::status_legend helper required the incoming status_array argument to be an array!', 'event_espresso') );
516
+		if ( !is_array( $status_array ) ) {
517
+					throw new EE_Error( __('The EEH_Template::status_legend helper required the incoming status_array argument to be an array!', 'event_espresso') );
518
+		}
515 519
 
516 520
 		$setup_array = array();
517 521
 		foreach ( $status_array as $item => $status ) {
@@ -572,8 +576,7 @@  discard block
 block discarded – undo
572 576
 				</tbody>
573 577
 			</table>
574 578
 			<?php
575
-		}
576
-		else {
579
+		} else {
577 580
 			?>
578 581
 			<ul>
579 582
 				<?php
@@ -583,8 +586,7 @@  discard block
 block discarded – undo
583 586
 			</ul>
584 587
 			<?php
585 588
 		}
586
-	}
587
-	else {
589
+	} else {
588 590
 		//simple value
589 591
 		echo $data;
590 592
 	}
@@ -664,8 +666,9 @@  discard block
 block discarded – undo
664 666
 
665 667
 		$total_pages = ceil( $total_items / $per_page );
666 668
 
667
-		if ( $total_pages <= 1 )
668
-			return '';
669
+		if ( $total_pages <= 1 ) {
670
+					return '';
671
+		}
669 672
 
670 673
 		$item_label = $total_items > 1 ? sprintf( $items_label['plural'], $total_items ) : $items_label['single'];
671 674
 
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	 *
283 283
 	 * given two paths, this determines if there is a common base path between the two
284 284
 	 *
285
-	 * @param array $paths
285
+	 * @param string[] $paths
286 286
 	 * @return string
287 287
 	 */
288 288
 	protected static function _find_common_base_path( $paths ) {
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 	 * @param bool|string $template_path server path to the file to be loaded, including file name and extension
310 310
 	 * @param  array      $template_args an array of arguments to be extracted for use in the template
311 311
 	 * @param  boolean    $return_string whether to send output immediately to screen, or capture and return as a string
312
-	 * @return mixed string
312
+	 * @return string string
313 313
 	 */
314 314
 	public static function display_template( $template_path = FALSE, $template_args = array(), $return_string = FALSE ) {
315 315
 		//require the template validator for verifying variables are set according to how the template requires
Please login to merge, or discard this patch.
Spacing   +196 added lines, -196 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 
17 17
 
18
-if ( ! function_exists( 'espresso_get_template_part' )) {
18
+if ( ! function_exists('espresso_get_template_part')) {
19 19
 	/**
20 20
 	 * espresso_get_template_part
21 21
 	 * basically a copy of the WordPress get_template_part() function but uses EEH_Template::locate_template() instead, and doesn't add base versions of files
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
 	 * @param string $name The name of the specialised template.
26 26
 	 * @return string        the html output for the formatted money value
27 27
 	 */
28
-	function espresso_get_template_part( $slug = NULL, $name = NULL ) {
29
-		EEH_Template::get_template_part( $slug, $name );
28
+	function espresso_get_template_part($slug = NULL, $name = NULL) {
29
+		EEH_Template::get_template_part($slug, $name);
30 30
 	}
31 31
 }
32 32
 
33 33
 
34 34
 
35
-if ( ! function_exists( 'espresso_get_object_css_class' )) {
35
+if ( ! function_exists('espresso_get_object_css_class')) {
36 36
 	/**
37 37
 	 * espresso_get_object_css_class - attempts to generate a css class based on the type of EE object passed
38 38
 	 *
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	 * @param  string $suffix added to the end of the generated class
43 43
 	 * @return string
44 44
 	 */
45
-	function espresso_get_object_css_class( $object = NULL, $prefix = '', $suffix = '' ) {
46
-		return EEH_Template::get_object_css_class( $object, $prefix, $suffix );
45
+	function espresso_get_object_css_class($object = NULL, $prefix = '', $suffix = '') {
46
+		return EEH_Template::get_object_css_class($object, $prefix, $suffix);
47 47
 	}
48 48
 }
49 49
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 * 	@return boolean
71 71
 	 */
72 72
 	public static function is_espresso_theme() {
73
-		return wp_get_theme()->get( 'TextDomain' ) == 'event_espresso' ? TRUE : FALSE;
73
+		return wp_get_theme()->get('TextDomain') == 'event_espresso' ? TRUE : FALSE;
74 74
 	}
75 75
 
76 76
 	/**
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
 	 * 	@return void
80 80
 	 */
81 81
 	public static function load_espresso_theme_functions() {
82
-		if ( ! defined( 'EE_THEME_FUNCTIONS_LOADED' )) {
83
-			if ( is_readable( EE_PUBLIC . EE_Config::get_current_theme() . DS . 'functions.php' )) {
84
-				require_once( EE_PUBLIC . EE_Config::get_current_theme() . DS . 'functions.php' );
82
+		if ( ! defined('EE_THEME_FUNCTIONS_LOADED')) {
83
+			if (is_readable(EE_PUBLIC.EE_Config::get_current_theme().DS.'functions.php')) {
84
+				require_once(EE_PUBLIC.EE_Config::get_current_theme().DS.'functions.php');
85 85
 			}
86 86
 		}
87 87
 	}
@@ -93,17 +93,17 @@  discard block
 block discarded – undo
93 93
 	 * 	@return array
94 94
 	 */
95 95
 	public static function get_espresso_themes() {
96
-		if ( empty( EEH_Template::$_espresso_themes )) {
97
-			$espresso_themes =  glob( EE_PUBLIC . '*', GLOB_ONLYDIR );
98
-			if ( empty( $espresso_themes ) ) {
96
+		if (empty(EEH_Template::$_espresso_themes)) {
97
+			$espresso_themes = glob(EE_PUBLIC.'*', GLOB_ONLYDIR);
98
+			if (empty($espresso_themes)) {
99 99
 				return array();
100 100
 			}
101
-			if (( $key = array_search( 'global_assets', $espresso_themes )) !== FALSE ) {
102
-			    unset( $espresso_themes[ $key ] );
101
+			if (($key = array_search('global_assets', $espresso_themes)) !== FALSE) {
102
+			    unset($espresso_themes[$key]);
103 103
 			}
104 104
 			EEH_Template::$_espresso_themes = array();
105
-			foreach ( $espresso_themes as $espresso_theme ) {
106
-				EEH_Template::$_espresso_themes[ basename( $espresso_theme ) ] = $espresso_theme;
105
+			foreach ($espresso_themes as $espresso_theme) {
106
+				EEH_Template::$_espresso_themes[basename($espresso_theme)] = $espresso_theme;
107 107
 			}
108 108
 		}
109 109
 		return EEH_Template::$_espresso_themes;
@@ -122,16 +122,16 @@  discard block
 block discarded – undo
122 122
 	 * @param bool   $return_string
123 123
 	 * @return string        the html output for the formatted money value
124 124
 	 */
125
-	public static function get_template_part( $slug = NULL, $name = NULL, $template_args = array(), $return_string = FALSE  ) {
126
-		do_action( "get_template_part_{$slug}-{$name}", $slug, $name );
125
+	public static function get_template_part($slug = NULL, $name = NULL, $template_args = array(), $return_string = FALSE) {
126
+		do_action("get_template_part_{$slug}-{$name}", $slug, $name);
127 127
 		$templates = array();
128 128
 		$name = (string) $name;
129
-		if ( $name != '' ) {
129
+		if ($name != '') {
130 130
 			$templates[] = "{$slug}-{$name}.php";
131 131
 		}
132 132
 		// allow template parts to be turned off via something like: add_filter( 'FHEE__content_espresso_events_tickets_template__display_datetimes', '__return_false' );
133
-		if ( apply_filters( "FHEE__EEH_Template__get_template_part__display__{$slug}_{$name}", TRUE )) {
134
-			EEH_Template::locate_template( $templates, $template_args, TRUE, $return_string );
133
+		if (apply_filters("FHEE__EEH_Template__get_template_part__display__{$slug}_{$name}", TRUE)) {
134
+			EEH_Template::locate_template($templates, $template_args, TRUE, $return_string);
135 135
 		}
136 136
 	}
137 137
 
@@ -171,26 +171,26 @@  discard block
 block discarded – undo
171 171
 	 * 				Used in places where you don't actually load the template, you just want to know if there's a custom version of it.
172 172
 	 * @return mixed
173 173
 	 */
174
-	public static function locate_template( $templates = array(), $template_args = array(), $load = TRUE, $return_string = TRUE, $check_if_custom = FALSE ) {
174
+	public static function locate_template($templates = array(), $template_args = array(), $load = TRUE, $return_string = TRUE, $check_if_custom = FALSE) {
175 175
 		// first use WP locate_template to check for template in the current theme folder
176
-		$template_path = locate_template( $templates );
176
+		$template_path = locate_template($templates);
177 177
 
178
-		if ( $check_if_custom && !empty( $template_path ) )
178
+		if ($check_if_custom && ! empty($template_path))
179 179
 			return TRUE;
180 180
 
181 181
 		// not in the theme
182
-		if ( empty( $template_path )) {
182
+		if (empty($template_path)) {
183 183
 			// not even a template to look for ?
184
-			if ( empty( $templates )) {
184
+			if (empty($templates)) {
185 185
 				// get post_type
186
-				$post_type = EE_Registry::instance()->REQ->get( 'post_type' );
186
+				$post_type = EE_Registry::instance()->REQ->get('post_type');
187 187
 				// get array of EE Custom Post Types
188 188
 				$EE_CPTs = EE_Register_CPTs::get_CPTs();
189 189
 				// build template name based on request
190
-				if ( isset( $EE_CPTs[ $post_type ] )) {
191
-					$archive_or_single =  is_archive() ? 'archive' : '';
192
-					$archive_or_single =  is_single() ? 'single' : $archive_or_single;
193
-					$templates = $archive_or_single . '-' . $post_type . '.php';
190
+				if (isset($EE_CPTs[$post_type])) {
191
+					$archive_or_single = is_archive() ? 'archive' : '';
192
+					$archive_or_single = is_single() ? 'single' : $archive_or_single;
193
+					$templates = $archive_or_single.'-'.$post_type.'.php';
194 194
 				}
195 195
 			}
196 196
 			// currently active EE template theme
@@ -199,80 +199,80 @@  discard block
 block discarded – undo
199 199
 			// array of paths to folders that may contain templates
200 200
 			$template_folder_paths = array(
201 201
 				// first check the /wp-content/uploads/espresso/templates/(current EE theme)/  folder for an EE theme template file
202
-				EVENT_ESPRESSO_TEMPLATE_DIR . $current_theme,
202
+				EVENT_ESPRESSO_TEMPLATE_DIR.$current_theme,
203 203
 				// then in the root of the /wp-content/uploads/espresso/templates/ folder
204 204
 				EVENT_ESPRESSO_TEMPLATE_DIR
205 205
 			);
206 206
 
207 207
 			//add core plugin folders for checking only if we're not $check_if_custom
208
-			if ( ! $check_if_custom ) {
208
+			if ( ! $check_if_custom) {
209 209
 				$core_paths = array(
210 210
 					// in the  /wp-content/plugins/(EE4 folder)/public/(current EE theme)/ folder within the plugin
211
-					EE_PUBLIC . $current_theme,
211
+					EE_PUBLIC.$current_theme,
212 212
 					// in the  /wp-content/plugins/(EE4 folder)/core/templates/(current EE theme)/ folder within the plugin
213
-					EE_TEMPLATES . $current_theme,
213
+					EE_TEMPLATES.$current_theme,
214 214
 					// or maybe relative from the plugin root: /wp-content/plugins/(EE4 folder)/
215 215
 					EE_PLUGIN_DIR_PATH
216 216
 					);
217
-				$template_folder_paths = array_merge( $template_folder_paths, $core_paths );
217
+				$template_folder_paths = array_merge($template_folder_paths, $core_paths);
218 218
 			}
219 219
 
220 220
 			// now filter that array
221
-			$template_folder_paths = apply_filters( 'FHEE__EEH_Template__locate_template__template_folder_paths', $template_folder_paths );
222
-			$templates = is_array( $templates ) ? $templates : array( $templates );
223
-			$template_folder_paths = is_array( $template_folder_paths ) ? $template_folder_paths : array( $template_folder_paths );
221
+			$template_folder_paths = apply_filters('FHEE__EEH_Template__locate_template__template_folder_paths', $template_folder_paths);
222
+			$templates = is_array($templates) ? $templates : array($templates);
223
+			$template_folder_paths = is_array($template_folder_paths) ? $template_folder_paths : array($template_folder_paths);
224 224
 			// array to hold all possible template paths
225 225
 			$full_template_paths = array();
226 226
 
227 227
 			EE_Registry::instance()->load_helper('File');
228 228
 			// loop through $templates
229
-			foreach ( $templates as $template ) {
229
+			foreach ($templates as $template) {
230 230
 				// normalize directory separators
231
-				$template = EEH_File::standardise_directory_separators( $template );
232
-				$file_name = basename( $template );
233
-				$template_path_minus_file_name = substr( $template, 0, ( strlen( $file_name ) * -1 ) );
231
+				$template = EEH_File::standardise_directory_separators($template);
232
+				$file_name = basename($template);
233
+				$template_path_minus_file_name = substr($template, 0, (strlen($file_name) * -1));
234 234
 				// while looping through all template folder paths
235
-				foreach ( $template_folder_paths as $template_folder_path ) {
235
+				foreach ($template_folder_paths as $template_folder_path) {
236 236
 					// normalize directory separators
237
-					$template_folder_path = EEH_File::standardise_directory_separators( $template_folder_path );
237
+					$template_folder_path = EEH_File::standardise_directory_separators($template_folder_path);
238 238
 					// determine if any common base path exists between the two paths
239 239
 					$common_base_path = EEH_Template::_find_common_base_path(
240
-						array( $template_folder_path, $template_path_minus_file_name )
240
+						array($template_folder_path, $template_path_minus_file_name)
241 241
 					);
242
-					if ( $common_base_path !== '' ) {
242
+					if ($common_base_path !== '') {
243 243
 						// both paths have a common base, so just tack the filename onto our search path
244
-						$resolved_path = EEH_File::end_with_directory_separator( $template_folder_path ) . $file_name;
244
+						$resolved_path = EEH_File::end_with_directory_separator($template_folder_path).$file_name;
245 245
 					} else {
246 246
 						// no common base path, so let's just concatenate
247
-						$resolved_path = EEH_File::end_with_directory_separator( $template_folder_path ) . $template;
247
+						$resolved_path = EEH_File::end_with_directory_separator($template_folder_path).$template;
248 248
 					}
249 249
 					// build up our template locations array by adding our resolved paths
250 250
 					$full_template_paths[] = $resolved_path;
251 251
 				}
252 252
 				// if $template is an absolute path, then we'll tack it onto the start of our array so that it gets searched first
253
-				array_unshift( $full_template_paths, $template );
253
+				array_unshift($full_template_paths, $template);
254 254
 				// path to the directory of the current theme: /wp-content/themes/(current WP theme)/
255
-				array_unshift( $full_template_paths, get_template_directory() . DS . $file_name );
255
+				array_unshift($full_template_paths, get_template_directory().DS.$file_name);
256 256
 			}
257 257
 			// filter final array of full template paths
258
-			$full_template_paths = apply_filters( 'FHEE__EEH_Template__locate_template__full_template_paths', $full_template_paths );
258
+			$full_template_paths = apply_filters('FHEE__EEH_Template__locate_template__full_template_paths', $full_template_paths);
259 259
 			// now loop through our final array of template location paths and check each location
260
-			foreach ( (array)$full_template_paths as $full_template_path ) {
261
-				if ( is_readable( $full_template_path )) {
262
-					$template_path = str_replace( array( '\\', '/' ), DIRECTORY_SEPARATOR, $full_template_path );
260
+			foreach ((array) $full_template_paths as $full_template_path) {
261
+				if (is_readable($full_template_path)) {
262
+					$template_path = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $full_template_path);
263 263
 					break;
264 264
 				}
265 265
 			}
266 266
 		}
267 267
 		// if we got it and you want to see it...
268
-		if ( $template_path && $load && ! $check_if_custom  ) {
269
-			if ( $return_string ) {
270
-				return EEH_Template::display_template( $template_path, $template_args, TRUE );
268
+		if ($template_path && $load && ! $check_if_custom) {
269
+			if ($return_string) {
270
+				return EEH_Template::display_template($template_path, $template_args, TRUE);
271 271
 			} else {
272
-				EEH_Template::display_template( $template_path, $template_args, FALSE );
272
+				EEH_Template::display_template($template_path, $template_args, FALSE);
273 273
 			}
274 274
 		}
275
-		return $check_if_custom && ! empty( $template_path ) ? TRUE : $template_path;
275
+		return $check_if_custom && ! empty($template_path) ? TRUE : $template_path;
276 276
 	}
277 277
 
278 278
 
@@ -285,21 +285,21 @@  discard block
 block discarded – undo
285 285
 	 * @param array $paths
286 286
 	 * @return string
287 287
 	 */
288
-	protected static function _find_common_base_path( $paths ) {
288
+	protected static function _find_common_base_path($paths) {
289 289
 		$last_offset = 0;
290 290
 		$common_base_path = '';
291
-		while ( ( $index = strpos( $paths[ 0 ], DS, $last_offset ) ) !== false ) {
291
+		while (($index = strpos($paths[0], DS, $last_offset)) !== false) {
292 292
 			$dir_length = $index - $last_offset + 1;
293
-			$directory = substr( $paths[ 0 ], $last_offset, $dir_length );
294
-			foreach ( $paths as $path ) {
295
-				if ( substr( $path, $last_offset, $dir_length ) != $directory ) {
293
+			$directory = substr($paths[0], $last_offset, $dir_length);
294
+			foreach ($paths as $path) {
295
+				if (substr($path, $last_offset, $dir_length) != $directory) {
296 296
 					return $common_base_path;
297 297
 				}
298 298
 			}
299 299
 			$common_base_path .= $directory;
300 300
 			$last_offset = $index + 1;
301 301
 		}
302
-		return substr( $common_base_path, 0, -1 );
302
+		return substr($common_base_path, 0, -1);
303 303
 	}
304 304
 
305 305
 
@@ -311,9 +311,9 @@  discard block
 block discarded – undo
311 311
 	 * @param  boolean    $return_string whether to send output immediately to screen, or capture and return as a string
312 312
 	 * @return mixed string
313 313
 	 */
314
-	public static function display_template( $template_path = FALSE, $template_args = array(), $return_string = FALSE ) {
314
+	public static function display_template($template_path = FALSE, $template_args = array(), $return_string = FALSE) {
315 315
 		//require the template validator for verifying variables are set according to how the template requires
316
-		EE_Registry::instance()->load_helper( 'Template_Validator' );
316
+		EE_Registry::instance()->load_helper('Template_Validator');
317 317
 
318 318
 		/**
319 319
 		 * These two filters are intended for last minute changes to templates being loaded and/or template arg
@@ -324,26 +324,26 @@  discard block
 block discarded – undo
324 324
 		 *
325 325
 		 * @since 4.6.0
326 326
 		 */
327
-		$template_path = apply_filters( 'FHEE__EEH_Template__display_template__template_path', $template_path );
328
-		$template_args = apply_filters( 'FHEE__EEH_Template__display_template__template_args', $template_args );
327
+		$template_path = apply_filters('FHEE__EEH_Template__display_template__template_path', $template_path);
328
+		$template_args = apply_filters('FHEE__EEH_Template__display_template__template_args', $template_args);
329 329
 
330 330
 		// you gimme nuttin - YOU GET NUTTIN !!
331
-		if ( ! $template_path || ! is_readable( $template_path )) {
331
+		if ( ! $template_path || ! is_readable($template_path)) {
332 332
 			return '';
333 333
 		}
334 334
 		// if $template_args are not in an array, then make it so
335
-		if ( ! is_array( $template_args ) && ! is_object( $template_args )) {
336
-			$template_args = array( $template_args );
335
+		if ( ! is_array($template_args) && ! is_object($template_args)) {
336
+			$template_args = array($template_args);
337 337
 		}
338
-		extract( (array) $template_args);
338
+		extract((array) $template_args);
339 339
 
340
-		if ( $return_string ) {
340
+		if ($return_string) {
341 341
 			// because we want to return a string, we are going to capture the output
342 342
 			ob_start();
343
-			include( $template_path );
343
+			include($template_path);
344 344
 			return ob_get_clean();
345 345
 		} else {
346
-			include( $template_path );
346
+			include($template_path);
347 347
 		}
348 348
 		return '';
349 349
 	}
@@ -361,27 +361,27 @@  discard block
 block discarded – undo
361 361
 	 * @param  string $suffix added to the end of the generated class
362 362
 	 * @return string
363 363
 	 */
364
-	public static function get_object_css_class( $object = NULL, $prefix = '', $suffix = '' ) {
364
+	public static function get_object_css_class($object = NULL, $prefix = '', $suffix = '') {
365 365
 		// in the beginning...
366
-		$prefix = ! empty( $prefix ) ? rtrim( $prefix, '-' ) . '-' : '';
366
+		$prefix = ! empty($prefix) ? rtrim($prefix, '-').'-' : '';
367 367
 		// da muddle
368 368
 		$class = '';
369 369
 		// the end
370
-		$suffix = ! empty( $suffix ) ? '-' . ltrim( $suffix, '-' ) : '';
370
+		$suffix = ! empty($suffix) ? '-'.ltrim($suffix, '-') : '';
371 371
 		// is the passed object an EE object ?
372
-		if ( $object instanceof EE_Base_Class ) {
372
+		if ($object instanceof EE_Base_Class) {
373 373
 			// grab the exact type of object
374
-			$obj_class = get_class( $object );
374
+			$obj_class = get_class($object);
375 375
 			// depending on the type of object...
376
-			switch ( $obj_class ) {
376
+			switch ($obj_class) {
377 377
 				// no specifics just yet...
378 378
 				default :
379
-					$class = strtolower( str_replace( '_', '-', $obj_class ));
380
-					$class .= method_exists( $obj_class, 'name' ) ? '-' . sanitize_title( $object->name() ) : '';
379
+					$class = strtolower(str_replace('_', '-', $obj_class));
380
+					$class .= method_exists($obj_class, 'name') ? '-'.sanitize_title($object->name()) : '';
381 381
 
382 382
 			}
383 383
 		}
384
-		return $prefix . $class . $suffix;
384
+		return $prefix.$class.$suffix;
385 385
 	}
386 386
 
387 387
 
@@ -397,50 +397,50 @@  discard block
 block discarded – undo
397 397
 	 * @param string      $cur_code_span_class
398 398
 	 * @return string        the html output for the formatted money value
399 399
 	 */
400
-	public static function format_currency( $amount = NULL, $return_raw = FALSE, $display_code = TRUE, $CNT_ISO = '', $cur_code_span_class = 'currency-code' ) {
400
+	public static function format_currency($amount = NULL, $return_raw = FALSE, $display_code = TRUE, $CNT_ISO = '', $cur_code_span_class = 'currency-code') {
401 401
 		// ensure amount was received
402
-		if ( is_null( $amount ) ) {
403
-			$msg = __( 'In order to format currency, an amount needs to be passed.', 'event_espresso' );
404
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
402
+		if (is_null($amount)) {
403
+			$msg = __('In order to format currency, an amount needs to be passed.', 'event_espresso');
404
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
405 405
 			return '';
406 406
 		}
407 407
 		//ensure amount is float
408 408
 		$amount = (float) $amount;
409 409
 		// filter raw amount (allows 0.00 to be changed to "free" for example)
410
-		$amount_formatted = apply_filters( 'FHEE__EEH_Template__format_currency__amount', $amount, $return_raw );
410
+		$amount_formatted = apply_filters('FHEE__EEH_Template__format_currency__amount', $amount, $return_raw);
411 411
 		// still a number or was amount converted to a string like "free" ?
412
-		if ( is_float( $amount_formatted )) {
412
+		if (is_float($amount_formatted)) {
413 413
 			// was a country ISO code passed ? if so generate currency config object for that country
414
-			$mny = $CNT_ISO !== '' ? new EE_Currency_Config( $CNT_ISO ) : NULL;
414
+			$mny = $CNT_ISO !== '' ? new EE_Currency_Config($CNT_ISO) : NULL;
415 415
 			// verify results
416
-			if ( ! $mny instanceof EE_Currency_Config ) {
416
+			if ( ! $mny instanceof EE_Currency_Config) {
417 417
 				// set default config country currency settings
418 418
 				$mny = EE_Registry::instance()->CFG->currency instanceof EE_Currency_Config ? EE_Registry::instance()->CFG->currency : new EE_Currency_Config();
419 419
 			}
420 420
 			// format float
421
-			$amount_formatted = number_format( $amount, $mny->dec_plc, $mny->dec_mrk, $mny->thsnds );
421
+			$amount_formatted = number_format($amount, $mny->dec_plc, $mny->dec_mrk, $mny->thsnds);
422 422
 			// add formatting ?
423
-			if ( ! $return_raw ) {
423
+			if ( ! $return_raw) {
424 424
 				// add currency sign
425
-				if( $mny->sign_b4 ){
426
-					if( $amount >= 0 ){
427
-						$amount_formatted = $mny->sign . $amount_formatted;
428
-					}else{
429
-						$amount_formatted = '-' . $mny->sign . str_replace( '-', '', $amount_formatted );
425
+				if ($mny->sign_b4) {
426
+					if ($amount >= 0) {
427
+						$amount_formatted = $mny->sign.$amount_formatted;
428
+					} else {
429
+						$amount_formatted = '-'.$mny->sign.str_replace('-', '', $amount_formatted);
430 430
 					}
431 431
 
432
-				}else{
433
-					$amount_formatted =  $amount_formatted . $mny->sign;
432
+				} else {
433
+					$amount_formatted = $amount_formatted.$mny->sign;
434 434
 				}
435 435
 
436 436
 				// add currency code ?
437
-				$amount_formatted = $display_code ? $amount_formatted . ' <span class="' . $cur_code_span_class . '">(' . $mny->code . ')</span>' : $amount_formatted;
437
+				$amount_formatted = $display_code ? $amount_formatted.' <span class="'.$cur_code_span_class.'">('.$mny->code.')</span>' : $amount_formatted;
438 438
 			}
439 439
 			// filter results
440
-			$amount_formatted = apply_filters( 'FHEE__EEH_Template__format_currency__amount_formatted', $amount_formatted, $mny, $return_raw );
440
+			$amount_formatted = apply_filters('FHEE__EEH_Template__format_currency__amount_formatted', $amount_formatted, $mny, $return_raw);
441 441
 		}
442 442
 		// clean up vars
443
-		unset( $mny );
443
+		unset($mny);
444 444
 		// return formatted currency amount
445 445
 		return $amount_formatted;
446 446
 	}
@@ -455,11 +455,11 @@  discard block
 block discarded – undo
455 455
 	 * @param  string  $schema    'UPPER', 'lower', or 'Sentence'
456 456
 	 * @return string             The localized label for the status id.
457 457
 	 */
458
-	public static function pretty_status( $status_id, $plural = FALSE, $schema = 'upper' ) {
458
+	public static function pretty_status($status_id, $plural = FALSE, $schema = 'upper') {
459 459
 		/** @type EEM_Status $EEM_Status */
460
-		$EEM_Status = EE_Registry::instance()->load_model( 'Status' );
461
-		$status = $EEM_Status->localized_status( array( $status_id => __( 'unknown', 'event_espresso' )), $plural, $schema );
462
-		return $status[ $status_id ];
460
+		$EEM_Status = EE_Registry::instance()->load_model('Status');
461
+		$status = $EEM_Status->localized_status(array($status_id => __('unknown', 'event_espresso')), $plural, $schema);
462
+		return $status[$status_id];
463 463
 	}
464 464
 
465 465
 
@@ -472,9 +472,9 @@  discard block
 block discarded – undo
472 472
 	 * @param string  $icon
473 473
 	 * @return string 	the html output for the button
474 474
 	 */
475
-	public static function get_button_or_link( $url, $label, $class = 'button-primary', $icon = '' ) {
476
-		$label = ! empty( $icon ) ? '<span class="' . $icon . '"></span>' . $label : $label;
477
-		$button = '<a id="' . sanitize_title_with_dashes($label) . '" href="' . $url . '" class="' . $class . '">' . $label . '</a>';
475
+	public static function get_button_or_link($url, $label, $class = 'button-primary', $icon = '') {
476
+		$label = ! empty($icon) ? '<span class="'.$icon.'"></span>'.$label : $label;
477
+		$button = '<a id="'.sanitize_title_with_dashes($label).'" href="'.$url.'" class="'.$class.'">'.$label.'</a>';
478 478
 		return $button;
479 479
 	}
480 480
 
@@ -491,21 +491,21 @@  discard block
 block discarded – undo
491 491
 	 * @param bool|string $help_text   (optional) send help text you want to use for the link if default not to be used
492 492
 	 * @return string              generated link
493 493
 	 */
494
-	public static function get_help_tab_link( $help_tab_id, $page = FALSE, $action = FALSE, $icon_style = FALSE, $help_text = FALSE ) {
494
+	public static function get_help_tab_link($help_tab_id, $page = FALSE, $action = FALSE, $icon_style = FALSE, $help_text = FALSE) {
495 495
 
496
-		if ( ! $page )
497
-			$page = isset( $_REQUEST['page'] ) && ! empty( $_REQUEST['page'] ) ? sanitize_key( $_REQUEST['page'] ) : $page;
496
+		if ( ! $page)
497
+			$page = isset($_REQUEST['page']) && ! empty($_REQUEST['page']) ? sanitize_key($_REQUEST['page']) : $page;
498 498
 
499
-		if ( ! $action )
500
-			$action = isset( $_REQUEST['action'] ) && ! empty( $_REQUEST['action'] ) ? sanitize_key( $_REQUEST['action'] ) : $action;
499
+		if ( ! $action)
500
+			$action = isset($_REQUEST['action']) && ! empty($_REQUEST['action']) ? sanitize_key($_REQUEST['action']) : $action;
501 501
 
502 502
 		$action = empty($action) ? 'default' : $action;
503 503
 
504 504
 
505
-		$help_tab_lnk = $page . '-' . $action . '-' . $help_tab_id;
506
-		$icon = !$icon_style ? ' dashicons-editor-help' : $icon_style;
507
-		$help_text = !$help_text ? '' : $help_text;
508
-		return '<a id="' . $help_tab_lnk . '" class="ee-clickable dashicons espresso-help-tab-lnk ee-icon-size-22' . $icon . '" title="' . esc_attr__('Click to open the \'Help\' tab for more information about this feature.', 'event_espresso') . '" > ' . $help_text . ' </a>';
505
+		$help_tab_lnk = $page.'-'.$action.'-'.$help_tab_id;
506
+		$icon = ! $icon_style ? ' dashicons-editor-help' : $icon_style;
507
+		$help_text = ! $help_text ? '' : $help_text;
508
+		return '<a id="'.$help_tab_lnk.'" class="ee-clickable dashicons espresso-help-tab-lnk ee-icon-size-22'.$icon.'" title="'.esc_attr__('Click to open the \'Help\' tab for more information about this feature.', 'event_espresso').'" > '.$help_text.' </a>';
509 509
 	}
510 510
 
511 511
 
@@ -517,31 +517,31 @@  discard block
 block discarded – undo
517 517
 	 * @param EE_Help_Tour
518 518
 	 * @return string         html
519 519
 	 */
520
-	public static function help_tour_stops_generator( EE_Help_Tour $tour ) {
520
+	public static function help_tour_stops_generator(EE_Help_Tour $tour) {
521 521
 		$id = $tour->get_slug();
522 522
 		$stops = $tour->get_stops();
523 523
 
524
-		$content = '<ol style="display:none" id="' . $id . '">';
524
+		$content = '<ol style="display:none" id="'.$id.'">';
525 525
 
526
-		foreach ( $stops as $stop ) {
527
-			$data_id = !empty( $stop['id'] ) ? ' data-id="' . $stop['id'] . '"' : '';
528
-			$data_class = empty( $data_id ) && !empty( $stop['class'] ) ? ' data-class="' . $stop['class'] . '"' : '';
526
+		foreach ($stops as $stop) {
527
+			$data_id = ! empty($stop['id']) ? ' data-id="'.$stop['id'].'"' : '';
528
+			$data_class = empty($data_id) && ! empty($stop['class']) ? ' data-class="'.$stop['class'].'"' : '';
529 529
 
530 530
 			//if container is set to modal then let's make sure we set the options accordingly
531
-			if ( empty( $data_id ) && empty( $data_class ) ) {
531
+			if (empty($data_id) && empty($data_class)) {
532 532
 				$stop['options']['modal'] = true;
533 533
 				$stop['options']['expose'] = true;
534 534
 			}
535 535
 
536
-			$custom_class = !empty( $stop['custom_class'] ) ? ' class="' . $stop['custom_class'] . '"' : '';
537
-			$button_text = !empty( $stop['button_text'] ) ? ' data-button="' . $stop['button_text'] . '"' : '';
536
+			$custom_class = ! empty($stop['custom_class']) ? ' class="'.$stop['custom_class'].'"' : '';
537
+			$button_text = ! empty($stop['button_text']) ? ' data-button="'.$stop['button_text'].'"' : '';
538 538
 			$inner_content = isset($stop['content']) ? $stop['content'] : '';
539 539
 
540 540
 			//options
541
-			if ( isset( $stop['options'] ) && is_array( $stop['options'] ) ) {
541
+			if (isset($stop['options']) && is_array($stop['options'])) {
542 542
 				$options = ' data-options="';
543
-				foreach ( $stop['options'] as $option => $value ) {
544
-					$options .= $option . ':' . $value . ';';
543
+				foreach ($stop['options'] as $option => $value) {
544
+					$options .= $option.':'.$value.';';
545 545
 				}
546 546
 				$options .= '"';
547 547
 			} else {
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 			}
550 550
 
551 551
 			//let's put all together
552
-			$content .= '<li' . $data_id . $data_class . $custom_class . $button_text . $options . '>' . $inner_content . '</li>';
552
+			$content .= '<li'.$data_id.$data_class.$custom_class.$button_text.$options.'>'.$inner_content.'</li>';
553 553
 		}
554 554
 
555 555
 		$content .= '</ol>';
@@ -570,31 +570,31 @@  discard block
 block discarded – undo
570 570
 	 * @throws EE_Error
571 571
 	 * @return string               html structure for status.
572 572
 	 */
573
-	public static function status_legend( $status_array, $active_status = '' ) {
574
-		if ( !is_array( $status_array ) )
575
-			throw new EE_Error( __('The EEH_Template::status_legend helper required the incoming status_array argument to be an array!', 'event_espresso') );
573
+	public static function status_legend($status_array, $active_status = '') {
574
+		if ( ! is_array($status_array))
575
+			throw new EE_Error(__('The EEH_Template::status_legend helper required the incoming status_array argument to be an array!', 'event_espresso'));
576 576
 
577 577
 		$setup_array = array();
578
-		foreach ( $status_array as $item => $status ) {
578
+		foreach ($status_array as $item => $status) {
579 579
 			$setup_array[$item] = array(
580
-					'class' => 'ee-status-legend ee-status-legend-' . $status,
581
-					'desc' => EEH_Template::pretty_status( $status, FALSE, 'sentence' ),
580
+					'class' => 'ee-status-legend ee-status-legend-'.$status,
581
+					'desc' => EEH_Template::pretty_status($status, FALSE, 'sentence'),
582 582
 					'status' => $status
583 583
 				);
584 584
 		}
585 585
 
586
-		$content = '<div class="ee-list-table-legend-container">' . "\n";
587
-		$content .= '<h4>' . __('Status Legend', 'event_espresso') . '</h4>' . "\n";
588
-		$content .= '<dl class="ee-list-table-legend">' . "\n\t";
589
-		foreach ( $setup_array as $item => $details ) {
586
+		$content = '<div class="ee-list-table-legend-container">'."\n";
587
+		$content .= '<h4>'.__('Status Legend', 'event_espresso').'</h4>'."\n";
588
+		$content .= '<dl class="ee-list-table-legend">'."\n\t";
589
+		foreach ($setup_array as $item => $details) {
590 590
 			$active_class = $active_status == $details['status'] ? ' class="ee-is-active-status"' : '';
591
-			$content .= '<dt id="ee-legend-item-tooltip-' . $item . '"' . $active_class . '>' . "\n\t\t";
592
-			$content .= '<span class="' . $details['class'] . '"></span>' . "\n\t\t";
593
-			$content .= '<span class="ee-legend-description">' . $details['desc'] . '</span>' . "\n\t";
594
-			$content .= '</dt>' . "\n";
591
+			$content .= '<dt id="ee-legend-item-tooltip-'.$item.'"'.$active_class.'>'."\n\t\t";
592
+			$content .= '<span class="'.$details['class'].'"></span>'."\n\t\t";
593
+			$content .= '<span class="ee-legend-description">'.$details['desc'].'</span>'."\n\t";
594
+			$content .= '</dt>'."\n";
595 595
 		}
596
-		$content .= '</dl>' . "\n";
597
-		$content .= '</div>' . "\n";
596
+		$content .= '</dl>'."\n";
597
+		$content .= '</div>'."\n";
598 598
 		return $content;
599 599
 	}
600 600
 
@@ -607,8 +607,8 @@  discard block
 block discarded – undo
607 607
 	 * @return string
608 608
 	 */
609 609
 	public static function layout_array_as_table($data) {
610
-	if (is_object($data) || $data instanceof __PHP_Incomplete_Class ) {
611
-		$data = (array)$data;
610
+	if (is_object($data) || $data instanceof __PHP_Incomplete_Class) {
611
+		$data = (array) $data;
612 612
 	}
613 613
 	EE_Registry::instance()->load_helper('Array');
614 614
 	ob_start();
@@ -622,10 +622,10 @@  discard block
 block discarded – undo
622 622
 						?>
623 623
 						<tr>
624 624
 							<td>
625
-								<?php echo $data_key;?>
625
+								<?php echo $data_key; ?>
626 626
 							</td>
627 627
 							<td>
628
-								<?php echo self::layout_array_as_table($data_values);?>
628
+								<?php echo self::layout_array_as_table($data_values); ?>
629 629
 							</td>
630 630
 						</tr>
631 631
 						<?php
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 			<ul>
640 640
 				<?php
641 641
 				foreach ($data as $datum) {
642
-					echo "<li>"; echo self::layout_array_as_table($datum);echo "</li>";
642
+					echo "<li>"; echo self::layout_array_as_table($datum); echo "</li>";
643 643
 				}?>
644 644
 			</ul>
645 645
 			<?php
@@ -669,8 +669,8 @@  discard block
 block discarded – undo
669 669
 	 *
670 670
 	 * @return string
671 671
 	 */
672
-	public static function paging_html( $total_items, $current, $per_page, $url, $show_num_field = TRUE, $paged_arg_name = 'paged', $items_label = array() ) {
673
-		echo self::get_paging_html( $total_items, $current, $per_page, $url, $show_num_field, $paged_arg_name, $items_label );
672
+	public static function paging_html($total_items, $current, $per_page, $url, $show_num_field = TRUE, $paged_arg_name = 'paged', $items_label = array()) {
673
+		echo self::get_paging_html($total_items, $current, $per_page, $url, $show_num_field, $paged_arg_name, $items_label);
674 674
 	}
675 675
 
676 676
 
@@ -694,13 +694,13 @@  discard block
 block discarded – undo
694 694
 	 *                                 )
695 695
 	 * @return  string
696 696
 	 */
697
-	public static function get_paging_html( $total_items, $current, $per_page, $url, $show_num_field = TRUE, $paged_arg_name = 'paged', $items_label = array() ) {
697
+	public static function get_paging_html($total_items, $current, $per_page, $url, $show_num_field = TRUE, $paged_arg_name = 'paged', $items_label = array()) {
698 698
 		$page_links = array();
699 699
 		$disable_first = $disable_last = '';
700 700
 		$total_items = (int) $total_items;
701 701
 		$per_page = (int) $per_page;
702 702
 		$current = (int) $current;
703
-		$paged_arg_name = empty( $paged_arg_name ) ? 'paged' : sanitize_key( $paged_arg_name );
703
+		$paged_arg_name = empty($paged_arg_name) ? 'paged' : sanitize_key($paged_arg_name);
704 704
 
705 705
 		//filter items_label
706 706
 		$items_label = apply_filters(
@@ -708,68 +708,68 @@  discard block
 block discarded – undo
708 708
 			$items_label
709 709
 		);
710 710
 
711
-		if ( empty( $items_label )
712
-		     || ! is_array( $items_label )
713
-		     || ! isset( $items_label['single'] )
714
-		     || ! isset( $items_label['plural'] ) ) {
711
+		if (empty($items_label)
712
+		     || ! is_array($items_label)
713
+		     || ! isset($items_label['single'])
714
+		     || ! isset($items_label['plural'])) {
715 715
 			$items_label = array(
716
-				'single' => __( '1 item', 'event_espresso' ),
717
-				'plural' => __( '%s items', 'event_espresso' )
716
+				'single' => __('1 item', 'event_espresso'),
717
+				'plural' => __('%s items', 'event_espresso')
718 718
 			);
719 719
 		} else {
720 720
 			$items_label = array(
721
-				'single' => '1 ' . esc_html( $items_label['single'] ),
722
-				'plural' => '%s ' . esc_html( $items_label['plural'] )
721
+				'single' => '1 '.esc_html($items_label['single']),
722
+				'plural' => '%s '.esc_html($items_label['plural'])
723 723
 			);
724 724
 		}
725 725
 
726
-		$total_pages = ceil( $total_items / $per_page );
726
+		$total_pages = ceil($total_items / $per_page);
727 727
 
728
-		if ( $total_pages <= 1 )
728
+		if ($total_pages <= 1)
729 729
 			return '';
730 730
 
731
-		$item_label = $total_items > 1 ? sprintf( $items_label['plural'], $total_items ) : $items_label['single'];
731
+		$item_label = $total_items > 1 ? sprintf($items_label['plural'], $total_items) : $items_label['single'];
732 732
 
733
-		$output = '<span class="displaying-num">' . $item_label . '</span>';
733
+		$output = '<span class="displaying-num">'.$item_label.'</span>';
734 734
 
735
-		if ( $current === 1 ) {
735
+		if ($current === 1) {
736 736
 			$disable_first = ' disabled';
737 737
 		}
738
-		if ( $current == $total_pages ) {
738
+		if ($current == $total_pages) {
739 739
 			$disable_last = ' disabled';
740 740
 		}
741 741
 
742
-		$page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
743
-			'first-page' . $disable_first,
744
-			esc_attr__( 'Go to the first page' ),
745
-			esc_url( remove_query_arg( $paged_arg_name, $url ) ),
742
+		$page_links[] = sprintf("<a class='%s' title='%s' href='%s'>%s</a>",
743
+			'first-page'.$disable_first,
744
+			esc_attr__('Go to the first page'),
745
+			esc_url(remove_query_arg($paged_arg_name, $url)),
746 746
 			'&laquo;'
747 747
 		);
748 748
 
749 749
 		$page_links[] = sprintf(
750 750
 			'<a class="%s" title="%s" href="%s">%s</a>',
751
-			'prev-page' . $disable_first,
752
-			esc_attr__( 'Go to the previous page' ),
753
-			esc_url( add_query_arg( $paged_arg_name, max( 1, $current-1 ), $url ) ),
751
+			'prev-page'.$disable_first,
752
+			esc_attr__('Go to the previous page'),
753
+			esc_url(add_query_arg($paged_arg_name, max(1, $current - 1), $url)),
754 754
 			'&lsaquo;'
755 755
 		);
756 756
 
757
-		if ( ! $show_num_field ) {
757
+		if ( ! $show_num_field) {
758 758
 			$html_current_page = $current;
759 759
 		} else {
760
-			$html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name=$paged_arg_name value='%s' size='%d' />",
761
-				esc_attr__( 'Current page' ),
760
+			$html_current_page = sprintf("<input class='current-page' title='%s' type='text' name=$paged_arg_name value='%s' size='%d' />",
761
+				esc_attr__('Current page'),
762 762
 				$current,
763
-				strlen( $total_pages )
763
+				strlen($total_pages)
764 764
 			);
765 765
 		}
766 766
 
767 767
 		$html_total_pages = sprintf(
768 768
 			'<span class="total-pages">%s</span>',
769
-			number_format_i18n( $total_pages )
769
+			number_format_i18n($total_pages)
770 770
 		);
771 771
 		$page_links[] = sprintf(
772
-			_x( '%3$s%1$s of %2$s%4$s', 'paging' ),
772
+			_x('%3$s%1$s of %2$s%4$s', 'paging'),
773 773
 			$html_current_page,
774 774
 			$html_total_pages,
775 775
 			'<span class="paging-input">',
@@ -778,29 +778,29 @@  discard block
 block discarded – undo
778 778
 
779 779
 		$page_links[] = sprintf(
780 780
 			'<a class="%s" title="%s" href="%s">%s</a>',
781
-			'next-page' . $disable_last,
782
-			esc_attr__( 'Go to the next page' ),
783
-			esc_url( add_query_arg( $paged_arg_name, min( $total_pages, $current+1 ), $url ) ),
781
+			'next-page'.$disable_last,
782
+			esc_attr__('Go to the next page'),
783
+			esc_url(add_query_arg($paged_arg_name, min($total_pages, $current + 1), $url)),
784 784
 			'&rsaquo;'
785 785
 		);
786 786
 
787 787
 		$page_links[] = sprintf(
788 788
 			'<a class="%s" title="%s" href="%s">%s</a>',
789
-			'last-page' . $disable_last,
790
-			esc_attr__( 'Go to the last page' ),
791
-			esc_url( add_query_arg( $paged_arg_name, $total_pages, $url ) ),
789
+			'last-page'.$disable_last,
790
+			esc_attr__('Go to the last page'),
791
+			esc_url(add_query_arg($paged_arg_name, $total_pages, $url)),
792 792
 			'&raquo;'
793 793
 		);
794 794
 
795
-		$output .= "\n" . '<span class="pagination-links">' . join( "\n", $page_links ) . '</span>';
795
+		$output .= "\n".'<span class="pagination-links">'.join("\n", $page_links).'</span>';
796 796
 		// set page class
797
-		if ( $total_pages ) {
797
+		if ($total_pages) {
798 798
 			$page_class = $total_pages < 2 ? ' one-page' : '';
799 799
 		} else {
800 800
 			$page_class = ' no-pages';
801 801
 		}
802 802
 
803
-		return '<div class="tablenav"><div class="tablenav-pages' . $page_class . '">' . $output . '</div></div>';
803
+		return '<div class="tablenav"><div class="tablenav-pages'.$page_class.'">'.$output.'</div></div>';
804 804
 	}
805 805
 
806 806
 
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 				return array();
100 100
 			}
101 101
 			if (( $key = array_search( 'global_assets', $espresso_themes )) !== FALSE ) {
102
-			    unset( $espresso_themes[ $key ] );
102
+				unset( $espresso_themes[ $key ] );
103 103
 			}
104 104
 			EEH_Template::$_espresso_themes = array();
105 105
 			foreach ( $espresso_themes as $espresso_theme ) {
@@ -709,9 +709,9 @@  discard block
 block discarded – undo
709 709
 		);
710 710
 
711 711
 		if ( empty( $items_label )
712
-		     || ! is_array( $items_label )
713
-		     || ! isset( $items_label['single'] )
714
-		     || ! isset( $items_label['plural'] ) ) {
712
+			 || ! is_array( $items_label )
713
+			 || ! isset( $items_label['single'] )
714
+			 || ! isset( $items_label['plural'] ) ) {
715 715
 			$items_label = array(
716 716
 				'single' => __( '1 item', 'event_espresso' ),
717 717
 				'plural' => __( '%s items', 'event_espresso' )
Please login to merge, or discard this patch.
core/helpers/EEH_Venue_View.helper.php 2 patches
Spacing   +109 added lines, -109 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,31 +282,31 @@  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 );
296
+			$venue_name = EEH_Schema::name($venue_name);
297 297
 
298 298
 			//if venue is trashed then ignore the "link to" setting because the venue is trashed.
299
-			if ( $venue->get('status') == 'trash' ) {
299
+			if ($venue->get('status') == 'trash') {
300 300
 				$link_to = '';
301 301
 			}
302
-			switch( $link_to ) {
302
+			switch ($link_to) {
303 303
 
304 304
 				case 'details' :
305
-					return EEH_Venue_View::venue_details_link( $venue->ID(), $venue_name );
305
+					return EEH_Venue_View::venue_details_link($venue->ID(), $venue_name);
306 306
 				break;
307 307
 
308 308
 				case 'website' :
309
-					return EEH_Venue_View::venue_website_link( $venue->ID(), $venue_name );
309
+					return EEH_Venue_View::venue_website_link($venue->ID(), $venue_name);
310 310
 				break;
311 311
 
312 312
 				default :
@@ -326,10 +326,10 @@  discard block
 block discarded – undo
326 326
 	 * @param    string $text
327 327
 	 * @return string
328 328
 	 */
329
-	public static function venue_details_link( $VNU_ID = 0, $text = '' ) {
330
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
331
-		if ( $venue instanceof EE_Venue ) {
332
-			return EEH_Schema::url( get_permalink( $venue->ID() ), $text );
329
+	public static function venue_details_link($VNU_ID = 0, $text = '') {
330
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
331
+		if ($venue instanceof EE_Venue) {
332
+			return EEH_Schema::url(get_permalink($venue->ID()), $text);
333 333
 		}
334 334
 		return '';
335 335
 	}
@@ -344,13 +344,13 @@  discard block
 block discarded – undo
344 344
 	 * @param    string $text
345 345
 	 * @return string
346 346
 	 */
347
-	public static function venue_website_link( $VNU_ID = 0, $text = '' ) {
348
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
349
-		if ( $venue instanceof EE_Venue ) {
350
-			EE_Registry::instance()->load_helper( 'Formatter' );
347
+	public static function venue_website_link($VNU_ID = 0, $text = '') {
348
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
349
+		if ($venue instanceof EE_Venue) {
350
+			EE_Registry::instance()->load_helper('Formatter');
351 351
 			$url = $venue->venue_url();
352
-			$text = ! empty( $text ) ? $text : $url;
353
-			return ! empty( $url ) ? EEH_Schema::url( $url, $text ) : '';
352
+			$text = ! empty($text) ? $text : $url;
353
+			return ! empty($url) ? EEH_Schema::url($url, $text) : '';
354 354
 		}
355 355
 		return '';
356 356
 	}
@@ -364,11 +364,11 @@  discard block
 block discarded – undo
364 364
 	 * @param int $VNU_ID
365 365
 	 * @return string
366 366
 	 */
367
-	public static function venue_phone( $VNU_ID = 0) {
368
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
369
-		if ( $venue instanceof EE_Venue ) {
370
-			EE_Registry::instance()->load_helper( 'Formatter' );
371
-			return EEH_Schema::telephone( $venue->phone() );
367
+	public static function venue_phone($VNU_ID = 0) {
368
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
369
+		if ($venue instanceof EE_Venue) {
370
+			EE_Registry::instance()->load_helper('Formatter');
371
+			return EEH_Schema::telephone($venue->phone());
372 372
 		}
373 373
 		return '';
374 374
 	}
@@ -384,51 +384,51 @@  discard block
 block discarded – undo
384 384
 	 * @param    array $gmap map options
385 385
 	 * @return string
386 386
 	 */
387
-	public static function venue_gmap( $VNU_ID = 0, $map_ID = FALSE, $gmap = array() ) {
387
+	public static function venue_gmap($VNU_ID = 0, $map_ID = FALSE, $gmap = array()) {
388 388
 
389
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
390
-		if ( $venue instanceof EE_Venue ) {
389
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
390
+		if ($venue instanceof EE_Venue) {
391 391
 			// check for global espresso_events post and use it's ID if no map_ID is set
392 392
 			global $post;
393
-			$map_ID = empty( $map_ID ) && $post->post_type == 'espresso_events' ? $post->ID : $map_ID;
393
+			$map_ID = empty($map_ID) && $post->post_type == 'espresso_events' ? $post->ID : $map_ID;
394 394
 			// grab map settings
395 395
 			$map_cfg = EE_Registry::instance()->CFG->map_settings;
396 396
 			// are maps enabled ?
397
-			if ( $map_cfg->use_google_maps && $venue->enable_for_gmap() ) {
397
+			if ($map_cfg->use_google_maps && $venue->enable_for_gmap()) {
398 398
 
399
-				EE_Registry::instance()->load_helper( 'Maps' );
400
-				EE_Registry::instance()->load_helper( 'Formatter' );
399
+				EE_Registry::instance()->load_helper('Maps');
400
+				EE_Registry::instance()->load_helper('Formatter');
401 401
 
402 402
 				$details_page = is_single();
403 403
 				$options = array();
404
-				$options['map_ID'] = $map_ID && $map_ID != $venue->ID() ? $map_ID . '-' . $venue->ID()/* . '-' . $static_map_id*/ : $venue->ID()/* . '-' . $static_map_id*/;
404
+				$options['map_ID'] = $map_ID && $map_ID != $venue->ID() ? $map_ID.'-'.$venue->ID()/* . '-' . $static_map_id*/ : $venue->ID()/* . '-' . $static_map_id*/;
405 405
 
406
-				$options['location'] = EEH_Address::format( $venue, 'inline', FALSE, FALSE );
406
+				$options['location'] = EEH_Address::format($venue, 'inline', FALSE, FALSE);
407 407
 
408 408
 				$options['ee_map_width'] = $details_page ? $map_cfg->event_details_map_width : $map_cfg->event_list_map_width;
409
-				$options['ee_map_width'] = isset( $gmap['ee_map_width'] ) && ! empty( $gmap['ee_map_width'] ) ? $gmap['ee_map_width'] : $options['ee_map_width'];
409
+				$options['ee_map_width'] = isset($gmap['ee_map_width']) && ! empty($gmap['ee_map_width']) ? $gmap['ee_map_width'] : $options['ee_map_width'];
410 410
 
411 411
 				$options['ee_map_height'] = $details_page ? $map_cfg->event_details_map_height : $map_cfg->event_list_map_height;
412
-				$options['ee_map_height'] = isset( $gmap['ee_map_height'] ) && ! empty( $gmap['ee_map_height'] ) ? $gmap['ee_map_height'] : $options['ee_map_height'];
412
+				$options['ee_map_height'] = isset($gmap['ee_map_height']) && ! empty($gmap['ee_map_height']) ? $gmap['ee_map_height'] : $options['ee_map_height'];
413 413
 
414 414
 				$options['ee_map_zoom'] = $details_page ? $map_cfg->event_details_map_zoom : $map_cfg->event_list_map_zoom;
415
-				$options['ee_map_zoom'] = isset( $gmap['ee_map_zoom'] ) && ! empty( $gmap['ee_map_zoom'] ) ? $gmap['ee_map_zoom'] : $options['ee_map_zoom'];
415
+				$options['ee_map_zoom'] = isset($gmap['ee_map_zoom']) && ! empty($gmap['ee_map_zoom']) ? $gmap['ee_map_zoom'] : $options['ee_map_zoom'];
416 416
 
417 417
 				$options['ee_map_nav_display'] = $details_page ? $map_cfg->event_details_display_nav : $map_cfg->event_list_display_nav;
418
-				$options['ee_map_nav_display'] = isset( $gmap['ee_map_nav_display'] ) && ! empty( $gmap['ee_map_nav_display'] ) ? 'true' : $options['ee_map_nav_display'];;
418
+				$options['ee_map_nav_display'] = isset($gmap['ee_map_nav_display']) && ! empty($gmap['ee_map_nav_display']) ? 'true' : $options['ee_map_nav_display']; ;
419 419
 
420 420
 				$options['ee_map_nav_size'] = $details_page ? $map_cfg->event_details_nav_size : $map_cfg->event_list_nav_size;
421
-				$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'];
421
+				$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'];
422 422
 
423 423
 				$options['ee_map_type_control'] = $details_page ? $map_cfg->event_details_control_type : $map_cfg->event_list_control_type;
424
-				$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'];
424
+				$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'];
425 425
 
426 426
 				$options['ee_map_align'] = $details_page ? $map_cfg->event_details_map_align : $map_cfg->event_list_map_align;
427
-				$options['ee_map_align'] =  isset( $gmap['ee_map_align'] ) && ! empty( $gmap['ee_map_align'] )? $gmap['ee_map_align'] : $options['ee_map_align'];
427
+				$options['ee_map_align'] = isset($gmap['ee_map_align']) && ! empty($gmap['ee_map_align']) ? $gmap['ee_map_align'] : $options['ee_map_align'];
428 428
 
429
-				$options['ee_static_url'] =  isset( $gmap['ee_static_url'] ) && ! empty( $gmap['ee_static_url'] ) ? (bool)absint( $gmap['ee_static_url'] ) : $venue->google_map_link();
429
+				$options['ee_static_url'] = isset($gmap['ee_static_url']) && ! empty($gmap['ee_static_url']) ? (bool) absint($gmap['ee_static_url']) : $venue->google_map_link();
430 430
 
431
-				return EEH_Maps::google_map( $options );
431
+				return EEH_Maps::google_map($options);
432 432
 
433 433
 			}
434 434
 		}
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 	 * @param array $atts like EEH_Maps::google_map_link
444 444
 	 * @return string
445 445
 	 */
446
-	public static function espresso_google_static_map( EE_Venue $venue, $atts = array() ){
446
+	public static function espresso_google_static_map(EE_Venue $venue, $atts = array()) {
447 447
 		EE_Registry::instance()->load_helper('Maps');
448 448
 		$state = $venue->state_obj();
449 449
 		$country = $venue->country_obj();
@@ -475,23 +475,23 @@  discard block
 block discarded – undo
475 475
 	 * @param string $after
476 476
 	 * @return string
477 477
 	 */
478
-	public static function edit_venue_link( $VNU_ID = 0, $link = '', $before = '<p class="edit-venue-lnk small-txt">', $after = '</p>' ) {
479
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
480
-		if ( $venue instanceof EE_Venue ) {
478
+	public static function edit_venue_link($VNU_ID = 0, $link = '', $before = '<p class="edit-venue-lnk small-txt">', $after = '</p>') {
479
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
480
+		if ($venue instanceof EE_Venue) {
481 481
 			// can the user edit this post ?
482
-			if ( current_user_can( 'edit_post', $venue->ID() )) {
482
+			if (current_user_can('edit_post', $venue->ID())) {
483 483
 				// set link text
484
-				$link = ! empty( $link ) ? $link : __('edit this venue');
484
+				$link = ! empty($link) ? $link : __('edit this venue');
485 485
 				// generate nonce
486
-				$nonce = wp_create_nonce( 'edit_nonce' );
486
+				$nonce = wp_create_nonce('edit_nonce');
487 487
 				// generate url to venue editor for this venue
488
-				$url = add_query_arg( array( 'page' => 'espresso_venues', 'action' => 'edit', 'post' => $venue->ID(), 'edit_nonce' => $nonce ), admin_url( 'admin.php' ) );
488
+				$url = add_query_arg(array('page' => 'espresso_venues', 'action' => 'edit', 'post' => $venue->ID(), 'edit_nonce' => $nonce), admin_url('admin.php'));
489 489
 				// get edit CPT text
490
-				$post_type_obj = get_post_type_object( 'espresso_venues' );
490
+				$post_type_obj = get_post_type_object('espresso_venues');
491 491
 				// build final link html
492
-				$link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( $post_type_obj->labels->edit_item ) . '">' . $link . '</a>';
492
+				$link = '<a class="post-edit-link" href="'.$url.'" title="'.esc_attr($post_type_obj->labels->edit_item).'">'.$link.'</a>';
493 493
 				// put it all together
494
-				return $before . apply_filters( 'edit_post_link', $link, $venue->ID() ) . $after;
494
+				return $before.apply_filters('edit_post_link', $link, $venue->ID()).$after;
495 495
 			}
496 496
 		}
497 497
 		return '';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
core/interfaces/EEI_Collection.interface.php 1 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
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 
6 6
 /**
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * @param mixed  $info
26 26
 	 * @return bool
27 27
 	 */
28
-	public function add( $object, $info = null );
28
+	public function add($object, $info = null);
29 29
 
30 30
 
31 31
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 * @param mixed  $info
40 40
 	 * @return bool
41 41
 	 */
42
-	public function set_info( $object, $info = null );
42
+	public function set_info($object, $info = null);
43 43
 
44 44
 
45 45
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 * @param mixed
53 53
 	 * @return null | object
54 54
 	 */
55
-	public function get_by_info( $info );
55
+	public function get_by_info($info);
56 56
 
57 57
 
58 58
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 * @param object $object
66 66
 	 * @return bool
67 67
 	 */
68
-	public function has( $object );
68
+	public function has($object);
69 69
 
70 70
 
71 71
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 * @param $object
79 79
 	 * @return void
80 80
 	 */
81
-	public function remove( $object );
81
+	public function remove($object);
82 82
 
83 83
 
84 84
 
Please login to merge, or discard this patch.
core/interfaces/EEI_Repository.interface.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 
6 6
 /**
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @return bool | int
31 31
 	 * @throws \EE_Error
32 32
 	 */
33
-	public function persist( $persistence_callback = '', $persistence_arguments = array() );
33
+	public function persist($persistence_callback = '', $persistence_arguments = array());
34 34
 
35 35
 
36 36
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @param string $persistence_callback name of method found on object that can be used for persisting it
44 44
 	 * @return bool | int
45 45
 	 */
46
-	public function persist_all( $persistence_callback = '' );
46
+	public function persist_all($persistence_callback = '');
47 47
 
48 48
 	}
49 49
 // End of file EEI_Repository.interface.php
Please login to merge, or discard this patch.
core/interfaces/line_items/EEI_Line_Item.interface.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@
 block discarded – undo
3 3
 	exit( 'No direct script access allowed' );
4 4
 }
5 5
 /**
6
- * Class EEI_Line_Item
7
- *
8
- * @package 			Event Espresso
9
- * @subpackage 	core
10
- * @author 				Mike Nelson / Brent Christensen
11
- *
12
- */
6
+	 * Class EEI_Line_Item
7
+	 *
8
+	 * @package 			Event Espresso
9
+	 * @subpackage 	core
10
+	 * @author 				Mike Nelson / Brent Christensen
11
+	 *
12
+	 */
13 13
 interface EEI_Line_Item {
14 14
 
15 15
 	/**
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 /**
6 6
  * Class EEI_Line_Item
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 * @param    mixed  $field_value
19 19
 	 * @param bool      $use_default
20 20
 	 */
21
-	public function set( $field_name, $field_value, $use_default = false );
21
+	public function set($field_name, $field_value, $use_default = false);
22 22
 
23 23
 
24 24
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 * Sets quantity
57 57
 	 * @param int $quantity
58 58
 	 */
59
-	function set_quantity( $quantity );
59
+	function set_quantity($quantity);
60 60
 
61 61
 
62 62
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 * @param int $txn_id if none is provided, assumes $this->TXN_ID()
116 116
 	 * @return int count of items saved
117 117
 	 */
118
-	function save_this_and_descendants_to_txn( $txn_id = null );
118
+	function save_this_and_descendants_to_txn($txn_id = null);
119 119
 
120 120
 
121 121
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 * @param bool         $set_order
143 143
 	 * @return bool true for success, false for fail
144 144
 	 */
145
-	function add_child_line_item( EEI_Line_Item $line_item, $set_order = true );
145
+	function add_child_line_item(EEI_Line_Item $line_item, $set_order = true);
146 146
 
147 147
 
148 148
 
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
 	 * @param float $total
198 198
 	 * @return boolean
199 199
 	 */
200
-	function set_total( $total );
200
+	function set_total($total);
201 201
 
202 202
 	/**
203 203
 	 * Sets unit_price
204 204
 	 * @param float $unit_price
205 205
 	 * @return boolean
206 206
 	 */
207
-	function set_unit_price( $unit_price );
207
+	function set_unit_price($unit_price);
208 208
 
209 209
 	/**
210 210
 	 * If this line item has been saved to the DB, deletes its child with LIN_code == $code. If this line
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	 * @param bool $stop_search_once_found
216 216
 	 * @return int count of items deleted (or simply removed from the line item's cache, if not has not been saved to the DB yet)
217 217
 	 */
218
-	function delete_child_line_item( $code, $stop_search_once_found = true );
218
+	function delete_child_line_item($code, $stop_search_once_found = true);
219 219
 
220 220
 	/**
221 221
 	 * Forgets the cached model of the given relation Name. So the next time we request it,
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 	 * @param boolean $allow_persist
239 239
 	 * @return boolean
240 240
 	 */
241
-	function set_allow_persist( $allow_persist );
241
+	function set_allow_persist($allow_persist);
242 242
 
243 243
 
244 244
 }
Please login to merge, or discard this patch.
core/interfaces/line_items/EEI_Line_Item_Filter.interface.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 
6 6
 /**
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @param \EEI_Line_Item $line_item
27 27
 	 * @return \EEI_Line_Item
28 28
 	 */
29
-	public function process( EEI_Line_Item $line_item );
29
+	public function process(EEI_Line_Item $line_item);
30 30
 
31 31
 
32 32
 
Please login to merge, or discard this patch.
core/libraries/form_sections/EE_Sample_Form.form.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 <?php
2
-class EE_Sample_Form extends EE_Form_Section_Proper{
3
-	function __construct(){
2
+class EE_Sample_Form extends EE_Form_Section_Proper {
3
+	function __construct() {
4 4
 		$this->_subsections = array(
5 5
 			'h1'=>new EE_Form_Section_HTML('hello wordl'),
6
-			'name'=>new EE_Text_Input(array('required'=>true,'default'=>'your name here')),
6
+			'name'=>new EE_Text_Input(array('required'=>true, 'default'=>'your name here')),
7 7
 			'email'=>new EE_Email_Input(array('required'=>false)),
8
-			'shirt_size'=>new EE_Select_Input(array(''=>'Please select...', 's'=>  __("Small", "event_espresso"),'m'=>  __("Medium", "event_espresso"),'l'=>  __("Large", "event_espresso")),array('required'=>true,'default'=>'s')),
8
+			'shirt_size'=>new EE_Select_Input(array(''=>'Please select...', 's'=>  __("Small", "event_espresso"), 'm'=>  __("Medium", "event_espresso"), 'l'=>  __("Large", "event_espresso")), array('required'=>true, 'default'=>'s')),
9 9
 			'month_normal'=>new EE_Month_Input(),
10 10
 			'month_leading_zero'=>new EE_Month_Input(true),
11 11
 			'year_2'=>new EE_Year_Input(false, 1, 1),
12
-			'year_4'=>new EE_Year_Input(true, 0,10,array('default'=>'2017')),
12
+			'year_4'=>new EE_Year_Input(true, 0, 10, array('default'=>'2017')),
13 13
 			'yes_no'=>new EE_Yes_No_Input(array('html_label_text'=>  __("Yes or No", "event_espresso"))),
14 14
 			'credit_card'=>new EE_Credit_Card_Input(),
15 15
 			'image_1'=>new EE_Admin_File_Uploader_Input(),
16 16
 			'image_2'=>new EE_Admin_File_Uploader_Input(),
17
-			'skillz'=>new EE_Checkbox_Multi_Input(array('php'=>'PHP','mysql'=>'MYSQL'),array('default'=>array('php'))),
17
+			'skillz'=>new EE_Checkbox_Multi_Input(array('php'=>'PHP', 'mysql'=>'MYSQL'), array('default'=>array('php'))),
18 18
 			'float'=>new EE_Float_Input(),
19 19
 			'essay'=>new EE_Text_Area_Input(),
20 20
 			'amenities'=>new EE_Select_Multiple_Input(
@@ -40,16 +40,16 @@  discard block
 block discarded – undo
40 40
 	 * Extra validation for the 'name' input.
41 41
 	 * @param EE_Text_Input $form_input
42 42
 	 */
43
-	function _validate_name($form_input){
44
-		if($form_input->raw_value() != 'Mike'){
43
+	function _validate_name($form_input) {
44
+		if ($form_input->raw_value() != 'Mike') {
45 45
 			$form_input->add_validation_error(__("You are not mike. You must be brent or darren. Thats ok, I guess", 'event_espresso'), 'not-mike');
46 46
 		}
47 47
 	}
48 48
 
49
-	function _validate(){
49
+	function _validate() {
50 50
 		parent::_validate();
51
-		if($this->_subsections['shirt_size']->normalized_value() =='s'
52
-				&& $this->_subsections['year_4']->normalized_value() < 2010){
51
+		if ($this->_subsections['shirt_size']->normalized_value() == 's'
52
+				&& $this->_subsections['year_4']->normalized_value() < 2010) {
53 53
 			$this->add_validation_error(__("If you want a small shirt, you should be born after 2010. Otherwise theyre just too big", 'event_espresso'), 'too-old');
54 54
 		}
55 55
 	}
Please login to merge, or discard this patch.
core/libraries/form_sections/base/EE_Form_Section_HTML.form.php 3 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2,16 +2,16 @@
 block discarded – undo
2 2
 if (!defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('No direct script access allowed');
4 4
 /**
5
- * EE_Form_Section_HTML
6
- * HTML to be laid out like a proper subsection
7
- *
8
- *
9
- * @package			Event Espresso
10
- * @subpackage
11
- * @author				Mike Nelson
12
- *
13
- * ------------------------------------------------------------------------
14
- */
5
+	 * EE_Form_Section_HTML
6
+	 * HTML to be laid out like a proper subsection
7
+	 *
8
+	 *
9
+	 * @package			Event Espresso
10
+	 * @subpackage
11
+	 * @author				Mike Nelson
12
+	 *
13
+	 * ------------------------------------------------------------------------
14
+	 */
15 15
 class EE_Form_Section_HTML extends EE_Form_Section_Base{
16 16
 
17 17
 	protected $_html = '';
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('No direct script access allowed');
4 4
 /**
5 5
  * EE_Form_Section_HTML
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  *
13 13
  * ------------------------------------------------------------------------
14 14
  */
15
-class EE_Form_Section_HTML extends EE_Form_Section_Base{
15
+class EE_Form_Section_HTML extends EE_Form_Section_Base {
16 16
 
17 17
 	protected $_html = '';
18 18
 
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 	 * @param string $html
23 23
 	 * @param array $options_array
24 24
 	 */
25
-	public function __construct( $html = '', $options_array = array() ) {
25
+	public function __construct($html = '', $options_array = array()) {
26 26
 		$this->_html = $html;
27
-		parent::__construct( $options_array );
27
+		parent::__construct($options_array);
28 28
 	}
29 29
 
30 30
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if (!defined('EVENT_ESPRESSO_VERSION')) {
4 4
 	exit('No direct script access allowed');
5
+}
5 6
 /**
6 7
  * Event Espresso
7 8
  *
Please login to merge, or discard this patch.
libraries/form_sections/base/EE_Form_Section_HTML_From_Template.form.php 2 patches
Spacing   +4 added lines, -4 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
 /**
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * ------------------------------------------------------------------------
27 27
  */
28
-class EE_Form_Section_HTML_From_Template extends EE_Form_Section_HTML{
29
-	public function __construct($template_file,$args = array(), $options_array = array()) {
28
+class EE_Form_Section_HTML_From_Template extends EE_Form_Section_HTML {
29
+	public function __construct($template_file, $args = array(), $options_array = array()) {
30 30
 		EE_Registry::instance()->load_helper('Template');
31
-		$html = EEH_Template::locate_template( $template_file, $args );
31
+		$html = EEH_Template::locate_template($template_file, $args);
32 32
 
33 33
 //		echo " filepath:$template_file html $html";
34 34
 		parent::__construct($html, $options_array);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if (!defined('EVENT_ESPRESSO_VERSION')) {
4 4
 	exit('No direct script access allowed');
5
+}
5 6
 /**
6 7
  * Event Espresso
7 8
  *
Please login to merge, or discard this patch.