Completed
Branch BUG-7514-7935-7936-price-order (518ae6)
by
unknown
13:10 queued 44s
created
core/libraries/shortcodes/EE_Ticket_List_Shortcodes.lib.php 2 patches
Braces   +12 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
4 4
 	exit('NO direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -68,18 +69,18 @@  discard block
 block discarded – undo
68 69
 		$this->_set_shortcode_helper();
69 70
 
70 71
 
71
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
72
-			return $this->_get_ticket_list_for_main();
73
-
74
-		else if ( $this->_data['data'] instanceof EE_Registration )
75
-			return $this->_get_ticket_list_for_attendee();
76
-
77
-		else if ( $this->_data['data'] instanceof EE_Event )
78
-			return $this->_get_ticket_list_for_event();
72
+		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
73
+					return $this->_get_ticket_list_for_main();
74
+		} else if ( $this->_data['data'] instanceof EE_Registration ) {
75
+					return $this->_get_ticket_list_for_attendee();
76
+		} else if ( $this->_data['data'] instanceof EE_Event ) {
77
+					return $this->_get_ticket_list_for_event();
78
+		}
79 79
 
80 80
 		//prevent recursive loop
81
-		else
82
-			return '';
81
+		else {
82
+					return '';
83
+		}
83 84
 	}
84 85
 
85 86
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 
49 49
 
50 50
 
51
-	protected function _parser( $shortcode ) {
52
-		switch ( $shortcode ) {
51
+	protected function _parser($shortcode) {
52
+		switch ($shortcode) {
53 53
 			case '[TICKET_LIST]' :
54 54
 				return $this->_get_ticket_list();
55 55
 				break;
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
 		$this->_set_shortcode_helper();
69 69
 
70 70
 
71
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
71
+		if ($this->_data['data'] instanceof EE_Messages_Addressee)
72 72
 			return $this->_get_ticket_list_for_main();
73 73
 
74
-		else if ( $this->_data['data'] instanceof EE_Registration )
74
+		else if ($this->_data['data'] instanceof EE_Registration)
75 75
 			return $this->_get_ticket_list_for_attendee();
76 76
 
77
-		else if ( $this->_data['data'] instanceof EE_Event )
77
+		else if ($this->_data['data'] instanceof EE_Event)
78 78
 			return $this->_get_ticket_list_for_event();
79 79
 
80 80
 		//prevent recursive loop
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
 	 * This returns the parsed ticket list for main template;
92 92
 	 */
93 93
 	private function _get_ticket_list_for_main() {
94
-		$valid_shortcodes = array('ticket', 'event_list', 'attendee_list','datetime_list', 'attendee', 'line_item_list', 'primary_registration_details');
94
+		$valid_shortcodes = array('ticket', 'event_list', 'attendee_list', 'datetime_list', 'attendee', 'line_item_list', 'primary_registration_details');
95 95
 		$template = $this->_data['template'];
96 96
 		$data = $this->_data['data'];
97 97
 		$tktparsed = '';
98 98
 
99 99
 
100 100
 		//now we need to loop through the ticket list and send data to the EE_Parser helper.
101
-		foreach ( $data->tickets as $ticket ) {
101
+		foreach ($data->tickets as $ticket) {
102 102
 			$tktparsed .= $this->_shortcode_helper->parse_ticket_list_template($template, $ticket['ticket'], $valid_shortcodes, $this->_extra_data);
103 103
 		}
104 104
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 */
114 114
 	private function _get_ticket_list_for_event() {
115 115
 		$valid_shortcodes = array('ticket', 'attendee_list', 'datetime_list', 'attendee', 'venue', 'line_item_list', 'primary_registration_details');
116
-		$template = is_array($this->_data['template'] ) && isset($this->_data['template']['ticket_list']) ? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
116
+		$template = is_array($this->_data['template']) && isset($this->_data['template']['ticket_list']) ? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
117 117
 		$event = $this->_data['data'];
118 118
 
119 119
 		//let's remove any existing [EVENT_LIST] shortcodes from the ticket list template so that we don't get recursion.
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		$tickets = $this->_get_tickets_from_event($event);
125 125
 
126 126
 		//each ticket in this case should be an ticket object.
127
-		foreach ( $tickets as $ticket ) {
127
+		foreach ($tickets as $ticket) {
128 128
 			$tkt_parsed .= $this->_shortcode_helper->parse_ticket_list_template($template, $ticket, $valid_shortcodes, $this->_extra_data);
129 129
 		}
130 130
 
@@ -151,18 +151,18 @@  discard block
 block discarded – undo
151 151
 		$tickets = $this->_get_ticket_list_from_registration($registration);
152 152
 
153 153
 		//each ticket in this case should be an ticket object.
154
-		foreach ( $tickets as $ticket ) {
154
+		foreach ($tickets as $ticket) {
155 155
 			$tkt_parsed .= $this->_shortcode_helper->parse_ticket_list_template($template, $ticket, $valid_shortcodes, $this->_extra_data);
156 156
 		}
157 157
 
158 158
 		return $tkt_parsed;
159 159
 	}
160 160
 
161
-	private function _get_tickets_from_event( EE_Event $event ) {
161
+	private function _get_tickets_from_event(EE_Event $event) {
162 162
 		return isset($this->_extra_data['data']->events) ? $this->_extra_data['data']->events[$event->ID()]['tkt_objs'] : array();
163 163
 	}
164 164
 
165
-	private function _get_ticket_list_from_registration( EE_Registration $registration, $att = NULL ) {
165
+	private function _get_ticket_list_from_registration(EE_Registration $registration, $att = NULL) {
166 166
 		return isset($this->_extra_data['data']->registrations) ? array($this->_extra_data['data']->registrations[$registration->ID()]['tkt_obj']) : array();
167 167
 	}
168 168
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Ticket_Shortcodes.lib.php 2 patches
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
4 4
 	exit('NO direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -80,8 +81,9 @@  discard block
 block discarded – undo
80 81
 
81 82
 
82 83
 		//If there is no event object by now then get out.
83
-		if ( ! $this->_ticket instanceof EE_Ticket )
84
-			return '';
84
+		if ( ! $this->_ticket instanceof EE_Ticket ) {
85
+					return '';
86
+		}
85 87
 
86 88
 		switch ( $shortcode ) {
87 89
 
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -49,40 +49,40 @@  discard block
 block discarded – undo
49 49
 			'[TICKET_DESCRIPTION]' => __('The description of the ticket', 'event_espresso'),
50 50
 			'[TICKET_PRICE]' => __('The price of the ticket', 'event_espresso'),
51 51
 			'[TKT_QTY_PURCHASED]' => __('The total quantity of the current ticket in the list that has been purchased in this transaction', 'event_espresso'),
52
-			'[TKT_USES_*]' => __( 'This attribute based shortcode parses to show the number of uses the ticket has.  The optional "schema" attribute can be used to indicate what schema is used when the uses is infinite.  Options are:', 'event_espresso' ) .
53
-				'<p><ul>' .
54
-				'<li><strong>symbol</strong>:' . __('This returns the &infin; symbol.', 'event_espresso') . '</li>' .
55
-				'<li><strong>text</strong>:' . __('This returns the word, "Unlimited". This is also the default if the "schema" attribute is not used.', 'event_espresso' ) . '</li>' .
56
-				'<li><strong>{custom}</strong>:' . __('You can put anything you want as a string instead and that will be used.  So you could have the world "any" and whenever uses for a ticket is infinity, this shortcode will parse to "any".', 'event_espresso' ) . '</li>' .
52
+			'[TKT_USES_*]' => __('This attribute based shortcode parses to show the number of uses the ticket has.  The optional "schema" attribute can be used to indicate what schema is used when the uses is infinite.  Options are:', 'event_espresso').
53
+				'<p><ul>'.
54
+				'<li><strong>symbol</strong>:'.__('This returns the &infin; symbol.', 'event_espresso').'</li>'.
55
+				'<li><strong>text</strong>:'.__('This returns the word, "Unlimited". This is also the default if the "schema" attribute is not used.', 'event_espresso').'</li>'.
56
+				'<li><strong>{custom}</strong>:'.__('You can put anything you want as a string instead and that will be used.  So you could have the world "any" and whenever uses for a ticket is infinity, this shortcode will parse to "any".', 'event_espresso').'</li>'.
57 57
 				'</ul></p>'
58 58
 			);
59 59
 	}
60 60
 
61 61
 
62
-	protected function _parser( $shortcode ) {
62
+	protected function _parser($shortcode) {
63 63
 
64
-		EE_Registry::instance()->load_helper( 'Template' );
64
+		EE_Registry::instance()->load_helper('Template');
65 65
 
66 66
 		$this->_ticket = $this->_data instanceof EE_Ticket ? $this->_data : null;
67 67
 
68 68
 		$aee = $this->_data instanceof EE_Messages_Addressee ? $this->_data : null;
69
-		$aee = ! $aee instanceof EE_Messages_Addressee && is_array( $this->_extra_data ) && isset( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $aee;
69
+		$aee = ! $aee instanceof EE_Messages_Addressee && is_array($this->_extra_data) && isset($this->_extra_data['data']) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $aee;
70 70
 
71 71
 
72 72
 		//possible EE_Line_Item may be incoming data
73
-		$this->_ticket = empty( $this->_ticket ) && $this->_data instanceof EE_Line_Item && $aee instanceof EE_Messages_Addressee && ! empty( $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] ) && $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] instanceof EE_Ticket ? $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] : $this->_ticket;
73
+		$this->_ticket = empty($this->_ticket) && $this->_data instanceof EE_Line_Item && $aee instanceof EE_Messages_Addressee && ! empty($aee->line_items_with_children[$this->_data->ID()]['EE_Ticket']) && $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] instanceof EE_Ticket ? $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] : $this->_ticket;
74 74
 
75 75
 		//if still no ticket, then let's see if there is a reg_obj.  If there IS, then we'll try and grab the ticket from the reg_obj instead.
76
-		if ( empty( $this->_ticket ) ) {
76
+		if (empty($this->_ticket)) {
77 77
 			$this->_ticket = $aee instanceof EE_Messages_Addressee && $aee->reg_obj instanceof EE_Registration ? $aee->reg_obj->ticket() : NULL;
78 78
 		}
79 79
 
80 80
 
81 81
 		//If there is no event object by now then get out.
82
-		if ( ! $this->_ticket instanceof EE_Ticket )
82
+		if ( ! $this->_ticket instanceof EE_Ticket)
83 83
 			return '';
84 84
 
85
-		switch ( $shortcode ) {
85
+		switch ($shortcode) {
86 86
 
87 87
 			case '[TICKET_ID]' :
88 88
 				return $this->_ticket->ID();
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 				break;
98 98
 
99 99
 			case '[TICKET_PRICE]' :
100
-				return EEH_Template::format_currency( $this->_ticket->get('TKT_price') );
100
+				return EEH_Template::format_currency($this->_ticket->get('TKT_price'));
101 101
 				break;
102 102
 
103 103
 			case '[TKT_QTY_PURCHASED]' :
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
 				break;
106 106
 		}
107 107
 
108
-		if ( strpos( $shortcode, '[TKT_USES_*') !== FALSE  ) {
109
-			$attrs = $this->_get_shortcode_attrs( $shortcode );
110
-			$schema = empty( $attrs['schema'] ) ? null : $attrs['schema'];
111
-			return $this->_ticket->get_pretty( 'TKT_uses', $schema );
108
+		if (strpos($shortcode, '[TKT_USES_*') !== FALSE) {
109
+			$attrs = $this->_get_shortcode_attrs($shortcode);
110
+			$schema = empty($attrs['schema']) ? null : $attrs['schema'];
111
+			return $this->_ticket->get_pretty('TKT_uses', $schema);
112 112
 		}
113 113
 		return '';
114 114
 
Please login to merge, or discard this patch.
core/templates/maintenance_mode.template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@
 block discarded – undo
20 20
 		<div id="ee-maintenance-mode-dv" class="" role="main">
21 21
 			<article id="ee-maintenance-mode">
22 22
 				<header class="event-header">
23
-					<h1  id="ee-maintenance-mode-h1"><?php _e( 'Maintenance Mode', 'event_espresso' ); ?></h1>
23
+					<h1  id="ee-maintenance-mode-h1"><?php _e('Maintenance Mode', 'event_espresso'); ?></h1>
24 24
 				</header>
25 25
 				<div class="ee-maintenance-mode-dv">
26
-					<p><?php _e( 'Event Registration has been temporarily closed while system maintenance is being performed. We\'re sorry for any inconveniences this may have caused. Please try back again later.	', 'event_espresso' ); ?></p>
26
+					<p><?php _e('Event Registration has been temporarily closed while system maintenance is being performed. We\'re sorry for any inconveniences this may have caused. Please try back again later.	', 'event_espresso'); ?></p>
27 27
 				</div>
28 28
 			</article>
29 29
 		</div>
Please login to merge, or discard this patch.
espresso.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('ABSPATH')) exit('No direct script access allowed');
1
+<?php if ( ! defined('ABSPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /*
3 5
   Plugin Name:		Event Espresso
4 6
   Plugin URI:  		http://eventespresso.com/pricing/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=wordpress_plugins_page&utm_content=support_link
Please login to merge, or discard this patch.
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
  */
41 41
 
42 42
 //Returns the plugin version
43
-if ( ! function_exists( 'espresso_version' )) {
43
+if ( ! function_exists('espresso_version')) {
44 44
 	/**
45 45
 	 * espresso_version
46 46
 	 * @return string
@@ -49,92 +49,92 @@  discard block
 block discarded – undo
49 49
 		return '4.6.23.rc.001';
50 50
 	}
51 51
 } else {
52
-	unset( $_GET['activate'] );
53
-	add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 );
52
+	unset($_GET['activate']);
53
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
54 54
 }
55 55
 // define versions
56
-define( 'EVENT_ESPRESSO_VERSION', espresso_version());
57
-define( 'EE_MIN_WP_VER_REQUIRED', '4.0' );
58
-define( 'EE_MIN_WP_VER_RECOMMENDED', '4.1' );
59
-define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' );
60
-define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.33' );
61
-define( 'EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - ' . EVENT_ESPRESSO_VERSION );
62
-define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ );
56
+define('EVENT_ESPRESSO_VERSION', espresso_version());
57
+define('EE_MIN_WP_VER_REQUIRED', '4.0');
58
+define('EE_MIN_WP_VER_RECOMMENDED', '4.1');
59
+define('EE_MIN_PHP_VER_REQUIRED', '5.3.0');
60
+define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.33');
61
+define('EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - '.EVENT_ESPRESSO_VERSION);
62
+define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
63 63
 
64 64
 //used to be DIRECTORY_SEPARATOR, but that caused issues on windows
65
-if ( ! defined( 'DS' )) {
66
-	define( 'DS', '/' );
65
+if ( ! defined('DS')) {
66
+	define('DS', '/');
67 67
 }
68
-if ( ! defined( 'PS' )) {
69
-	define( 'PS', PATH_SEPARATOR );
68
+if ( ! defined('PS')) {
69
+	define('PS', PATH_SEPARATOR);
70 70
 }
71
-if( ! defined( 'SP' )){
72
-	define( 'SP', ' ' );
71
+if ( ! defined('SP')) {
72
+	define('SP', ' ');
73 73
 }
74
-if( ! defined( 'EENL' )){
75
-	define( 'EENL', "\n" );
74
+if ( ! defined('EENL')) {
75
+	define('EENL', "\n");
76 76
 }
77 77
 
78 78
 
79
-define( 'EE_SUPPORT_EMAIL', '[email protected]');
79
+define('EE_SUPPORT_EMAIL', '[email protected]');
80 80
 // define the plugin directory and URL
81
-define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE ));
82
-define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE ));
83
-define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE ));
81
+define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE));
82
+define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE));
83
+define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE));
84 84
 // main root folder paths
85
-define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS );
86
-define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS );
87
-define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS );
88
-define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS );
89
-define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS );
90
-define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS );
91
-define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS);
92
-define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS );
85
+define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS);
86
+define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS);
87
+define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS);
88
+define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS);
89
+define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS);
90
+define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS);
91
+define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS);
92
+define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS);
93 93
 // core system paths
94
-define( 'EE_ADMIN', EE_CORE . 'admin' . DS );
95
-define( 'EE_CPTS', EE_CORE . 'CPTs' . DS );
96
-define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS );
97
-define( 'EE_BUSINESS', EE_CORE . 'business' . DS );
98
-define( 'EE_MODELS', EE_CORE . 'db_models' . DS );
99
-define( 'EE_HELPERS', EE_CORE . 'helpers' . DS );
100
-define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS );
101
-define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS );
102
-define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS );
103
-define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS );
104
-define( 'EE_FORM_SECTIONS', EE_LIBRARIES  .'form_sections' . DS );
94
+define('EE_ADMIN', EE_CORE.'admin'.DS);
95
+define('EE_CPTS', EE_CORE.'CPTs'.DS);
96
+define('EE_CLASSES', EE_CORE.'db_classes'.DS);
97
+define('EE_BUSINESS', EE_CORE.'business'.DS);
98
+define('EE_MODELS', EE_CORE.'db_models'.DS);
99
+define('EE_HELPERS', EE_CORE.'helpers'.DS);
100
+define('EE_LIBRARIES', EE_CORE.'libraries'.DS);
101
+define('EE_TEMPLATES', EE_CORE.'templates'.DS);
102
+define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS);
103
+define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS);
104
+define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS);
105 105
 // gateways
106
-define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS );
107
-define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS );
106
+define('EE_GATEWAYS', EE_MODULES.'gateways'.DS);
107
+define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS);
108 108
 // asset URL paths
109
-define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS );
110
-define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS );
111
-define( 'EE_IMAGES_URL',  EE_GLOBAL_ASSETS_URL . 'images' . DS );
112
-define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS );
113
-define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' );
114
-define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/');
109
+define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS);
110
+define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS);
111
+define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS);
112
+define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS);
113
+define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/');
114
+define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/');
115 115
 
116 116
 // define upload paths
117 117
 $uploads = wp_upload_dir();
118 118
 // define the uploads directory and URL
119
-define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'] . DS . 'espresso' . DS );
120
-define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'] . DS . 'espresso' . DS );
119
+define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS);
120
+define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS);
121 121
 // define the templates directory and URL
122
-define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'templates' . DS );
123
-define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'templates' . DS );
122
+define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS);
123
+define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS);
124 124
 // define the gateway directory and URL
125
-define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'gateways' . DS );
126
-define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'gateways' . DS );
125
+define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS);
126
+define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS);
127 127
 // languages folder/path
128
-define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS );
129
-define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS );
128
+define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS);
129
+define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS);
130 130
 //check for dompdf fonts in uploads
131
-if( file_exists(EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ){
132
-	define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS  );
131
+if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) {
132
+	define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS);
133 133
 }
134 134
 
135 135
 //ajax constants
136
-define( 'EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset( $_REQUEST['data']['ee_front_ajax'] ) ? TRUE : FALSE );
137
-define( 'EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset( $_REQUEST['data']['ee_admin_ajax'] ) ? TRUE : FALSE );
136
+define('EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? TRUE : FALSE);
137
+define('EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? TRUE : FALSE);
138 138
 //just a handy constant occasionally needed for finding values representing infinity in the DB
139 139
 //you're better to use this than its straight value (currently -1) in case you ever
140 140
 //want to change its default value! or find when -1 means infinity
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
 function espresso_duplicate_plugin_error() {
150 150
 	?>
151 151
 	<div class="error">
152
-	<p><?php _e( 'Can not run multiple versions of Event Espresso! Please deactivate one of the versions.', 'event_espresso' ); ?></p>
152
+	<p><?php _e('Can not run multiple versions of Event Espresso! Please deactivate one of the versions.', 'event_espresso'); ?></p>
153 153
 	</div>
154 154
 	<?php
155
-	EE_System::deactivate_plugin( EE_PLUGIN_BASENAME );
155
+	EE_System::deactivate_plugin(EE_PLUGIN_BASENAME);
156 156
 }
157 157
 
158 158
 
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
  * 	adds a wp-option to indicate that EE has been activated via the WP admin plugins page
163 163
  */
164 164
 function espresso_plugin_activation() {
165
-	update_option( 'ee_espresso_activation', TRUE );
165
+	update_option('ee_espresso_activation', TRUE);
166 166
 }
167
-register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' );
167
+register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
168 168
 
169 169
 
170 170
 
@@ -172,10 +172,10 @@  discard block
 block discarded – undo
172 172
  * 	espresso_plugin_deactivation
173 173
  */
174 174
 function espresso_plugin_deactivation() {
175
-	espresso_load_required( 'EEH_Activation', EE_HELPERS . 'EEH_Activation.helper.php' );
175
+	espresso_load_required('EEH_Activation', EE_HELPERS.'EEH_Activation.helper.php');
176 176
 	EEH_Activation::plugin_deactivation();
177 177
 }
178
-register_deactivation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation' );
178
+register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation');
179 179
 
180 180
 
181 181
 
@@ -185,15 +185,15 @@  discard block
 block discarded – undo
185 185
  */
186 186
 function espresso_load_error_handling() {
187 187
 	// load debugging tools
188
-	if ( WP_DEBUG === TRUE ) {
189
-		require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' );
188
+	if (WP_DEBUG === TRUE) {
189
+		require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php');
190 190
 		EEH_Debug_Tools::instance();
191 191
 	}
192 192
 	// load error handling
193
-	if ( is_readable( EE_CORE . 'EE_Error.core.php' )) {
194
-		 require_once( EE_CORE . 'EE_Error.core.php' );
193
+	if (is_readable(EE_CORE.'EE_Error.core.php')) {
194
+		 require_once(EE_CORE.'EE_Error.core.php');
195 195
 	} else {
196
-		wp_die( __( 'The EE_Error core class could not be loaded.', 'event_espresso' ));
196
+		wp_die(__('The EE_Error core class could not be loaded.', 'event_espresso'));
197 197
 	}
198 198
 }
199 199
 
@@ -203,13 +203,13 @@  discard block
 block discarded – undo
203 203
  * 	espresso_load_required
204 204
  * 	given a class name and path, this function will load that file or throw an exception
205 205
  */
206
-function espresso_load_required( $classname, $full_path_to_file ) {
206
+function espresso_load_required($classname, $full_path_to_file) {
207 207
 	espresso_load_error_handling();
208
-	if ( is_readable( $full_path_to_file )) {
209
-		require_once( $full_path_to_file );
208
+	if (is_readable($full_path_to_file)) {
209
+		require_once($full_path_to_file);
210 210
 	} else {
211
-		throw new EE_Error ( sprintf (
212
-			__( 'The %s class file could not be located or is not readable due to file permissions.', 'event_espresso' ),
211
+		throw new EE_Error(sprintf(
212
+			__('The %s class file could not be located or is not readable due to file permissions.', 'event_espresso'),
213 213
 			$classname
214 214
 		));
215 215
 	}
@@ -217,5 +217,5 @@  discard block
 block discarded – undo
217 217
 
218 218
 
219 219
 
220
-espresso_load_required( 'EE_System', EE_CORE . 'EE_System.core.php' );
220
+espresso_load_required('EE_System', EE_CORE.'EE_System.core.php');
221 221
 EE_System::instance();
Please login to merge, or discard this patch.
modules/csv/EED_Csv.module.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @return EED_Csv
30 30
 	 */
31 31
 	public static function instance() {
32
-		return parent::get_instance( __CLASS__ );
32
+		return parent::get_instance(__CLASS__);
33 33
 	}
34 34
 
35 35
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 *  @access 	public
61 61
 	 *  @return 	void
62 62
 	 */
63
-	public function run( $WP ) {
63
+	public function run($WP) {
64 64
 //		add_filter( 'FHEE_load_ee_config', '__return_true' );
65 65
 //		add_filter( 'FHEE_run_EE_wp', '__return_true' );
66 66
 //		add_filter( 'FHEE_load_EE_Session', '__return_true' );
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 *  @return 	void
80 80
 	 */
81 81
 	public function export() {
82
-		$Export = EE_Registry::instance()->load_class( 'Export' );
82
+		$Export = EE_Registry::instance()->load_class('Export');
83 83
 		$Export->export();
84 84
 	}
85 85
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 *  @return 	void
94 94
 	 */
95 95
 	public function import() {
96
-		$Import = EE_Registry::instance()->load_class( 'Import' );
96
+		$Import = EE_Registry::instance()->load_class('Import');
97 97
 		$Import->import();
98 98
 	}
99 99
 
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.
modules/event_single/EED_Event_Single.module.php 2 patches
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @return EED_Event_Single
30 30
 	 */
31 31
 	public static function instance() {
32
-		return parent::get_instance( __CLASS__ );
32
+		return parent::get_instance(__CLASS__);
33 33
 	}
34 34
 
35 35
 
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 	 *  @return 	void
42 42
 	 */
43 43
 	public static function set_hooks() {
44
-		add_filter( 'FHEE_run_EE_wp', '__return_true' );
45
-		add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 );
46
-		EE_Config::register_route( __( 'event', 'event_espresso' ), 'Event_Single', 'run' );
44
+		add_filter('FHEE_run_EE_wp', '__return_true');
45
+		add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2);
46
+		EE_Config::register_route(__('event', 'event_espresso'), 'Event_Single', 'run');
47 47
 	}
48 48
 
49 49
 	/**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 *  @return 	void
54 54
 	 */
55 55
 	public static function set_hooks_admin() {
56
-		add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 );
56
+		add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2);
57 57
 	}
58 58
 
59 59
 
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
 	 * @return void
68 68
 	 */
69 69
 	public static function set_definitions() {
70
-		define( 'EVENT_SINGLE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS );
71
-		define( 'EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) . 'templates' . DS );
70
+		define('EVENT_SINGLE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS);
71
+		define('EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path(__FILE__).'templates'.DS);
72 72
 	}
73 73
 
74 74
 
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 	 *
79 79
 	 * @return \EE_Events_Archive_Config
80 80
 	 */
81
-	protected function set_config(){
82
-		$this->set_config_section( 'template_settings' );
83
-		$this->set_config_class( 'EE_Event_Single_Config' );
84
-		$this->set_config_name( 'EED_Event_Single' );
81
+	protected function set_config() {
82
+		$this->set_config_section('template_settings');
83
+		$this->set_config_class('EE_Event_Single_Config');
84
+		$this->set_config_name('EED_Event_Single');
85 85
 	}
86 86
 
87 87
 
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
 	 * @param WP $WP
94 94
 	 * @return    void
95 95
 	 */
96
-	public function run( $WP ) {
96
+	public function run($WP) {
97 97
 		// ensure valid EE_Events_Archive_Config() object exists
98 98
 		$this->set_config();
99 99
 		// check what template is loaded
100
-		add_filter( 'template_include',  array( $this, 'template_include' ), 999, 1 );
101
-		add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' );
100
+		add_filter('template_include', array($this, 'template_include'), 999, 1);
101
+		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true');
102 102
 		// load css
103
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 );
104
-		EE_Registry::instance()->load_helper( 'Venue_View' );
103
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
104
+		EE_Registry::instance()->load_helper('Venue_View');
105 105
 	}
106 106
 
107 107
 
@@ -113,20 +113,20 @@  discard block
 block discarded – undo
113 113
 	 * @param 	string $template
114 114
 	 * @return 	string
115 115
 	 */
116
-	public function template_include( $template ) {
116
+	public function template_include($template) {
117 117
 		global $post;
118
-		if ( $this->config()->display_status_banner_single ) {
119
-			add_filter( 'the_title', array( 'EED_Event_Single', 'the_title' ), 100, 2 );
118
+		if ($this->config()->display_status_banner_single) {
119
+			add_filter('the_title', array('EED_Event_Single', 'the_title'), 100, 2);
120 120
 		}
121 121
 		// not a custom template?
122
-		if ( EE_Front_Controller::instance()->get_selected_template() != 'single-espresso_events.php' && ! post_password_required( $post ) ) {
122
+		if (EE_Front_Controller::instance()->get_selected_template() != 'single-espresso_events.php' && ! post_password_required($post)) {
123 123
 			EEH_Template::load_espresso_theme_functions();
124 124
 			// then add extra event data via hooks
125
-			add_action( 'loop_start', array( 'EED_Event_Single', 'loop_start' ));
126
-			add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
127
-			add_action( 'loop_end', array( 'EED_Event_Single', 'loop_end' ));
125
+			add_action('loop_start', array('EED_Event_Single', 'loop_start'));
126
+			add_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
127
+			add_action('loop_end', array('EED_Event_Single', 'loop_end'));
128 128
 			// don't display entry meta because the existing theme will take car of that
129
-			add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' );
129
+			add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false');
130 130
 		}
131 131
 		return $template;
132 132
 	}
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
 	 * 	@param		array 	$wp_query_array an array containing the WP_Query object
141 141
 	 *  	@return 		void
142 142
 	 */
143
-	public static function loop_start( $wp_query_array ) {
143
+	public static function loop_start($wp_query_array) {
144 144
 		global $post;
145
-		do_action( 'AHEE_event_details_before_post', $post, $wp_query_array );
145
+		do_action('AHEE_event_details_before_post', $post, $wp_query_array);
146 146
 	}
147 147
 
148 148
 
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
 	 * @param 	int 	$id
156 156
 	 * @return 	string
157 157
 	 */
158
-	public static function the_title( $title = '', $id = 0 ) {
158
+	public static function the_title($title = '', $id = 0) {
159 159
 		global $post;
160
-		return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title :  $title;
160
+		return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title;
161 161
 	}
162 162
 
163 163
 
@@ -168,28 +168,28 @@  discard block
 block discarded – undo
168 168
 	 * 	@param 	string 	$content
169 169
 	 * 	@return 	string
170 170
 	 */
171
-	public static function event_details( $content ) {
171
+	public static function event_details($content) {
172 172
 		global $post;
173
-		if ( $post->post_type == 'espresso_events' && ! post_password_required() ) {
173
+		if ($post->post_type == 'espresso_events' && ! post_password_required()) {
174 174
 			// since the 'content-espresso_events-details.php' template might be used directly from within a theme,
175 175
 			// it uses the_content() for displaying the $post->post_content
176 176
 			// so in order to load a template that uses the_content() from within a callback being used to filter the_content(),
177 177
 			// we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb)
178
-			remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
178
+			remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
179 179
 			//now add additional content
180
-			add_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110, 1 );
181
-			add_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120, 1 );
182
-			add_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130, 1 );
180
+			add_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110, 1);
181
+			add_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120, 1);
182
+			add_filter('the_content', array('EED_Event_Single', 'event_venues'), 130, 1);
183 183
 			// now load our template
184
-			$template = EEH_Template::locate_template( 'content-espresso_events-details.php' );
184
+			$template = EEH_Template::locate_template('content-espresso_events-details.php');
185 185
 			//now add our filter back in, plus some others
186
-			add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
187
-			remove_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110 );
188
-			remove_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120 );
189
-			remove_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130 );
186
+			add_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
187
+			remove_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110);
188
+			remove_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120);
189
+			remove_filter('the_content', array('EED_Event_Single', 'event_venues'), 130);
190 190
 		}
191 191
 		// we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt)
192
-		return ! empty( $template ) ? $template : $content;
192
+		return ! empty($template) ? $template : $content;
193 193
 	}
194 194
 
195 195
 
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
 	 * 	@param		string 	$content
202 202
 	 *  	@return 		string
203 203
 	 */
204
-	public static function event_datetimes( $content ) {
205
-		return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content;
204
+	public static function event_datetimes($content) {
205
+		return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content;
206 206
 	}
207 207
 
208 208
 	/**
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
 	 * 	@param		string 	$content
213 213
 	 *  	@return 		string
214 214
 	 */
215
-	public static function event_tickets( $content ) {
216
-		return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content;
215
+	public static function event_tickets($content) {
216
+		return EEH_Template::locate_template('content-espresso_events-tickets.php').$content;
217 217
 	}
218 218
 
219 219
 	/**
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
 	 * 	@param		string 	$content
224 224
 	 *  	@return 		string
225 225
 	 */
226
-	public static function event_venues( $content ) {
227
-		return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' );
226
+	public static function event_venues($content) {
227
+		return $content.EEH_Template::locate_template('content-espresso_events-venues.php');
228 228
 	}
229 229
 
230 230
 
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
 	 * 	@param		array 	$wp_query_array an array containing the WP_Query object
237 237
 	 *  	@return 		void
238 238
 	 */
239
-	public static function loop_end( $wp_query_array ) {
239
+	public static function loop_end($wp_query_array) {
240 240
 		global $post;
241
-		do_action( 'AHEE_event_details_after_post', $post, $wp_query_array );
241
+		do_action('AHEE_event_details_after_post', $post, $wp_query_array);
242 242
 	}
243 243
 
244 244
 
@@ -251,18 +251,18 @@  discard block
 block discarded – undo
251 251
 	 */
252 252
 	public function wp_enqueue_scripts() {
253 253
 		// get some style
254
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && apply_filters( 'FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE )) {
255
-			EE_Registry::instance()->load_helper( 'File' );
254
+		if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && apply_filters('FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE)) {
255
+			EE_Registry::instance()->load_helper('File');
256 256
 			// first check uploads folder
257
-			if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) {
258
-				wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ));
257
+			if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) {
258
+				wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
259 259
 			} else {
260
-				wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ));
260
+				wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
261 261
 			}
262
-			wp_enqueue_script( $this->theme );
263
-			if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) {
264
-				EE_Registry::instance()->load_helper( 'Maps' );
265
-				add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 );
262
+			wp_enqueue_script($this->theme);
263
+			if (EE_Registry::instance()->CFG->map_settings->use_google_maps) {
264
+				EE_Registry::instance()->load_helper('Maps');
265
+				add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11);
266 266
 			}
267 267
 		}
268 268
 	}
@@ -281,11 +281,11 @@  discard block
 block discarded – undo
281 281
 	 *  @return 	bool
282 282
 	 */
283 283
 	public static function display_venue() {
284
-		EE_Registry::instance()->load_helper( 'Venue_View' );
284
+		EE_Registry::instance()->load_helper('Venue_View');
285 285
 		/** @type EE_Event_Single_Config EED_Event_Single::instance()->config() */
286
-		$display_venue= isset( EED_Event_Single::instance()->config()->display_venue ) ? EED_Event_Single::instance()->config()->display_venue : TRUE;
286
+		$display_venue = isset(EED_Event_Single::instance()->config()->display_venue) ? EED_Event_Single::instance()->config()->display_venue : TRUE;
287 287
 		$venue_name = EEH_Venue_View::venue_name();
288
-		return $display_venue && ! empty( $venue_name ) ? TRUE : FALSE;
288
+		return $display_venue && ! empty($venue_name) ? TRUE : FALSE;
289 289
 	}
290 290
 
291 291
 
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.
modules/feeds/templates/espresso_events_feed.template.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@
 block discarded – undo
10 10
  * @ version		4+
11 11
  */
12 12
  ?>
13
-<p><?php  _e( 'Event Organizer: ', 'event_espresso' ) . espresso_organization_name( $EVT_ID ); ?><br/>
14
-<?php  _e( 'Organizer Email: ', 'event_espresso' ) . espresso_organization_email( $EVT_ID ); ?><br/>
15
-<?php  _e( 'Event Phone: ', 'event_espresso' ) . espresso_event_phone( $EVT_ID ); ?></p>
16
-<p><?php  _e( 'Event Status: ', 'event_espresso' ) . espresso_event_status( $EVT_ID );?></p>
17
-<p><?php  _e( 'Categories: ', 'event_espresso' ) . espresso_event_categories( $EVT_ID );?></p>
18
-<?php  _e( 'Dates and Times: ', 'event_espresso' ) . espresso_list_of_event_dates( $EVT_ID );?>
19
-<?php  _e( 'Available Tickets: ', 'event_espresso' ) . espresso_event_tickets_available( $EVT_ID );?>
20
-<p><?php  _e( 'Event Venue: ', 'event_espresso' ) . espresso_venue_name( NULL, FALSE ); ?></p>
21
-<p><?php  echo __( 'Description: ', 'event_espresso' ) . $event_description; ?></p><br/>
13
+<p><?php  _e('Event Organizer: ', 'event_espresso').espresso_organization_name($EVT_ID); ?><br/>
14
+<?php  _e('Organizer Email: ', 'event_espresso').espresso_organization_email($EVT_ID); ?><br/>
15
+<?php  _e('Event Phone: ', 'event_espresso').espresso_event_phone($EVT_ID); ?></p>
16
+<p><?php  _e('Event Status: ', 'event_espresso').espresso_event_status($EVT_ID); ?></p>
17
+<p><?php  _e('Categories: ', 'event_espresso').espresso_event_categories($EVT_ID); ?></p>
18
+<?php  _e('Dates and Times: ', 'event_espresso').espresso_list_of_event_dates($EVT_ID); ?>
19
+<?php  _e('Available Tickets: ', 'event_espresso').espresso_event_tickets_available($EVT_ID); ?>
20
+<p><?php  _e('Event Venue: ', 'event_espresso').espresso_venue_name(NULL, FALSE); ?></p>
21
+<p><?php  echo __('Description: ', 'event_espresso').$event_description; ?></p><br/>
22 22
  
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
modules/feeds/templates/espresso_venues_feed.template.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@
 block discarded – undo
10 10
  * @ version		4+
11 11
  */
12 12
  ?>
13
-<p><?php  _e( 'Organizer Name: ', 'event_espresso' ) . espresso_organization_name( $VNU_ID ); ?><br/>
14
-<?php  _e( 'Organizer Email: ', 'event_espresso' ) . espresso_organization_email( $VNU_ID ); ?><br/>
15
-<?php  _e( 'Venue Phone: ', 'event_espresso' ) . espresso_venue_phone( $VNU_ID ); ?></p>
16
-<p><?php  _e( 'Categories: ', 'event_espresso' ) . espresso_venue_categories( $VNU_ID );?></p>
17
-<p><?php  _e( 'Address: ', 'event_espresso' ) . espresso_venue_address( $VNU_ID );?></p>
18
-<p><?php  _e( 'Website: ', 'event_espresso' ) . espresso_venue_website( $VNU_ID );?></p>
19
-<p><?php  echo __( 'Description: ', 'event_espresso' )  . $venue_description; ?></p><br/>
13
+<p><?php  _e('Organizer Name: ', 'event_espresso').espresso_organization_name($VNU_ID); ?><br/>
14
+<?php  _e('Organizer Email: ', 'event_espresso').espresso_organization_email($VNU_ID); ?><br/>
15
+<?php  _e('Venue Phone: ', 'event_espresso').espresso_venue_phone($VNU_ID); ?></p>
16
+<p><?php  _e('Categories: ', 'event_espresso').espresso_venue_categories($VNU_ID); ?></p>
17
+<p><?php  _e('Address: ', 'event_espresso').espresso_venue_address($VNU_ID); ?></p>
18
+<p><?php  _e('Website: ', 'event_espresso').espresso_venue_website($VNU_ID); ?></p>
19
+<p><?php  echo __('Description: ', 'event_espresso').$venue_description; ?></p><br/>
20 20
  
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
modules/gateways/Invoice/lib/Invoice.class.php 2 patches
Braces   +10 added lines, -9 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		//Get the CSS file
51 51
 		if( isset( $themes[ $theme_requested ] ) ) {
52 52
 			$template_args['invoice_css'] = $themes[ $theme_requested ];
53
-		}else{
53
+		} else{
54 54
 			$template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta( 'legacy_invoice_css', TRUE, 'simple.css' );
55 55
 		}
56 56
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		$attendee_state = $primary_attendee->state_obj();
79 79
 		if($attendee_state){
80 80
 			$attendee_state_name = $attendee_state->name();
81
-		}else{
81
+		} else{
82 82
 			$attendee_state_name = '';
83 83
 		}
84 84
 		$template_args['attendee_state'] = $attendee_state_name;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			$EE->load_helper( 'Venue_View' );
150 150
 //			d($template_args);
151 151
 			$template_args['download_link'] = $this->registration->receipt_url('download');
152
-		}else{
152
+		} else{
153 153
 			//it's just an invoice we're accessing
154 154
 			$template_args['download_link'] = $this->registration->invoice_url('download');
155 155
 		}
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		$template_header = EEH_Template::locate_template( $templates_relative_path . 'invoice_header.template.php', $template_args, TRUE, TRUE );
166 166
 		if(isset($_GET['receipt'])){
167 167
 			$template_body = EEH_Template::locate_template( $templates_relative_path . 'receipt_body.template.php', $template_args, TRUE, TRUE );
168
-		}else{
168
+		} else{
169 169
 			$template_body = EEH_Template::locate_template( $templates_relative_path . 'invoice_body.template.php', $template_args, TRUE, TRUE );
170 170
 		}
171 171
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		//Create the PDF
191 191
 		if(array_key_exists('html',$_GET)){
192 192
 			echo $content;
193
-		}else{
193
+		} else{
194 194
 			//only load dompdf if nobody else has yet...
195 195
 			if( ! defined('DOMPDF_DIR')){
196 196
 				define('DOMPDF_ENABLE_REMOTE', TRUE);
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	function check_if_any_line_items_have_a_description(EE_Line_Item $line_item){
215 215
 		if($line_item->desc()){
216 216
 			return true;
217
-		}else{
217
+		} else{
218 218
 			foreach($line_item->children() as $child_line_item){
219 219
 				if($this->check_if_any_line_items_have_a_description($child_line_item)){
220 220
 					return true;
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 		$org_state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID );
259 259
 		if($org_state){
260 260
 			$org_state_name = $org_state->name();
261
-		}else{
261
+		} else{
262 262
 			$org_state_name = '';
263 263
 		}
264 264
 		$ReplaceValues = array(
@@ -285,8 +285,9 @@  discard block
 block discarded – undo
285 285
 	public function espressoLoadData($items) {
286 286
 		$lines = $items;
287 287
 		$data = array();
288
-		foreach ($lines as $line)
289
-			$data[] = explode(';', chop($line));
288
+		foreach ($lines as $line) {
289
+					$data[] = explode(';', chop($line));
290
+		}
290 291
 
291 292
 		return $data;
292 293
 	}
Please login to merge, or discard this patch.
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -21,23 +21,23 @@  discard block
 block discarded – undo
21 21
 	private $EE;
22 22
 	public function __construct($url_link = 0) {
23 23
 
24
-		if ( $this->registration = EE_Registry::instance()->load_model( 'Registration' )->get_registration_for_reg_url_link( $url_link)) {
24
+		if ($this->registration = EE_Registry::instance()->load_model('Registration')->get_registration_for_reg_url_link($url_link)) {
25 25
 			$this->transaction = $this->registration->transaction();
26 26
 
27
-			$payment_settings = EE_Config::instance()->gateway->payment_settings;//get_user_meta(EE_Registry::instance()->CFG->wp_user, 'payment_settings', TRUE);
28
-			$this->invoice_payment_method = EEM_Payment_Method::instance()->get_one_of_type( 'Invoice' );
27
+			$payment_settings = EE_Config::instance()->gateway->payment_settings; //get_user_meta(EE_Registry::instance()->CFG->wp_user, 'payment_settings', TRUE);
28
+			$this->invoice_payment_method = EEM_Payment_Method::instance()->get_one_of_type('Invoice');
29 29
 		} else {
30
-			EE_Error::add_error( __( 'Your request appears to be missing some required data, and no information for your transaction could be retrieved.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
30
+			EE_Error::add_error(__('Your request appears to be missing some required data, and no information for your transaction could be retrieved.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
31 31
 		}
32 32
 
33 33
 	}
34 34
 
35
-	public function send_invoice( $download = FALSE ) {
35
+	public function send_invoice($download = FALSE) {
36 36
 		$template_args = array();
37 37
 		$EE = EE_Registry::instance();
38 38
 
39 39
 		//allow the request to override the default theme defined in the invoice settings
40
-		$theme_requested = ( isset( $_REQUEST['theme'] ) && $_REQUEST['theme'] > 0 && $_REQUEST['theme'] < 8 ) ? absint( $_REQUEST['theme'] ) : null;
40
+		$theme_requested = (isset($_REQUEST['theme']) && $_REQUEST['theme'] > 0 && $_REQUEST['theme'] < 8) ? absint($_REQUEST['theme']) : null;
41 41
 		$themes = array(
42 42
 										1 => "simple.css",
43 43
 										2 => "bauhaus.css",
@@ -48,26 +48,26 @@  discard block
 block discarded – undo
48 48
 										7 => "union.css"
49 49
 									);
50 50
 		//Get the CSS file
51
-		if( isset( $themes[ $theme_requested ] ) ) {
52
-			$template_args['invoice_css'] = $themes[ $theme_requested ];
53
-		}else{
54
-			$template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta( 'legacy_invoice_css', TRUE, 'simple.css' );
51
+		if (isset($themes[$theme_requested])) {
52
+			$template_args['invoice_css'] = $themes[$theme_requested];
53
+		} else {
54
+			$template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta('legacy_invoice_css', TRUE, 'simple.css');
55 55
 		}
56 56
 
57
-		if (is_dir(EVENT_ESPRESSO_GATEWAY_DIR . '/invoice')) {
58
-			$template_args['base_url'] = EVENT_ESPRESSO_GATEWAY_URL . 'Invoice/lib/templates/';
57
+		if (is_dir(EVENT_ESPRESSO_GATEWAY_DIR.'/invoice')) {
58
+			$template_args['base_url'] = EVENT_ESPRESSO_GATEWAY_URL.'Invoice/lib/templates/';
59 59
 		} else {
60
-			$template_args['base_url'] = EE_GATEWAYS . '/Invoice/lib/templates/';
60
+			$template_args['base_url'] = EE_GATEWAYS.'/Invoice/lib/templates/';
61 61
 		}
62 62
 		$primary_attendee = $this->transaction->primary_registration()->attendee();
63 63
 
64
-		$template_args['organization'] = $EE->CFG->organization->get_pretty( 'name' );
65
-		$template_args['street'] = empty( $EE->CFG->organization->address_2 ) ? $EE->CFG->organization->get_pretty( 'address_1' ) : $EE->CFG->organization->get_pretty( 'address_1' ) . '<br>' . $EE->CFG->organization->get_pretty( 'address_2' );
66
-		$template_args['city'] = $EE->CFG->organization->get_pretty( 'city' );
67
-		$template_args['state'] = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID );
68
-		$template_args['country'] = EE_Registry::instance()->load_model( 'Country' )->get_one_by_ID( $EE->CFG->organization->CNT_ISO );
69
-		$template_args['zip'] = $EE->CFG->organization->get_pretty( 'zip' );
70
-		$template_args['email'] = $EE->CFG->organization->get_pretty( 'email' );
64
+		$template_args['organization'] = $EE->CFG->organization->get_pretty('name');
65
+		$template_args['street'] = empty($EE->CFG->organization->address_2) ? $EE->CFG->organization->get_pretty('address_1') : $EE->CFG->organization->get_pretty('address_1').'<br>'.$EE->CFG->organization->get_pretty('address_2');
66
+		$template_args['city'] = $EE->CFG->organization->get_pretty('city');
67
+		$template_args['state'] = EE_Registry::instance()->load_model('State')->get_one_by_ID($EE->CFG->organization->STA_ID);
68
+		$template_args['country'] = EE_Registry::instance()->load_model('Country')->get_one_by_ID($EE->CFG->organization->CNT_ISO);
69
+		$template_args['zip'] = $EE->CFG->organization->get_pretty('zip');
70
+		$template_args['email'] = $EE->CFG->organization->get_pretty('email');
71 71
 
72 72
 		$template_args['registration_code'] = $this->registration->reg_code();
73 73
 		$template_args['registration_date'] = $this->registration->date();
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 		$template_args['attendee_address2'] = $primary_attendee->address2();
77 77
 		$template_args['attendee_city'] = $primary_attendee->city();
78 78
 		$attendee_state = $primary_attendee->state_obj();
79
-		if($attendee_state){
79
+		if ($attendee_state) {
80 80
 			$attendee_state_name = $attendee_state->name();
81
-		}else{
81
+		} else {
82 82
 			$attendee_state_name = '';
83 83
 		}
84 84
 		$template_args['attendee_state'] = $attendee_state_name;
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 		if ($template_args['amount_pd'] != $template_args['total_cost']) {
103 103
 			//$template_args['net_total'] = $this->espressoInvoiceTotals( __('SubTotal', 'event_espresso'), $this->transaction->total());//$this->session_data['cart']['REG']['sub_total']);
104 104
 			$tax_items = $this->transaction->tax_items();
105
-			if(!empty($tax_items) ){
105
+			if ( ! empty($tax_items)) {
106 106
 				foreach ($tax_items as $tax) {
107
-					$template_args['net_total'] .= $this->espressoInvoiceTotals( $tax->name(), $tax->total());
107
+					$template_args['net_total'] .= $this->espressoInvoiceTotals($tax->name(), $tax->total());
108 108
 				}
109 109
 			}
110 110
 
@@ -114,30 +114,30 @@  discard block
 block discarded – undo
114 114
 			} else {
115 115
 				$text = __('Extra', 'event_espresso');
116 116
 			}
117
-			$template_args['discount'] = $this->espressoInvoiceTotals( $text, $difference );
117
+			$template_args['discount'] = $this->espressoInvoiceTotals($text, $difference);
118 118
 		}
119 119
 
120 120
 		$template_args['currency_symbol'] = $EE->CFG->currency->sign;
121
-		$template_args['template_payment_instructions'] = wpautop(stripslashes_deep(html_entity_decode($this->invoice_payment_method->get_extra_meta( 'pdf_instructions', TRUE ), ENT_QUOTES)));
122
-		$template_args['shameless_plug'] = apply_filters( 'FHEE_Invoice__send_invoice__shameless_plug',true );
123
-		if(isset($_GET['receipt'])){
121
+		$template_args['template_payment_instructions'] = wpautop(stripslashes_deep(html_entity_decode($this->invoice_payment_method->get_extra_meta('pdf_instructions', TRUE), ENT_QUOTES)));
122
+		$template_args['shameless_plug'] = apply_filters('FHEE_Invoice__send_invoice__shameless_plug', true);
123
+		if (isset($_GET['receipt'])) {
124 124
 			//receipt-specific stuff
125 125
 			$events_for_txn = EEM_Event::instance()->get_all(array(array('Registration.TXN_ID'=>$this->transaction->ID())));
126 126
 			$ticket_line_items_per_event = array();
127 127
 			$registrations_per_line_item = array();
128 128
 			$venues_for_events = array();
129
-			foreach($events_for_txn as $event_id => $event){
130
-				$line_items_for_this_event = EEM_Line_Item::instance()->get_all(array(array('Ticket.Datetime.EVT_ID'=>$event_id,'TXN_ID'=>$this->transaction->ID())));
129
+			foreach ($events_for_txn as $event_id => $event) {
130
+				$line_items_for_this_event = EEM_Line_Item::instance()->get_all(array(array('Ticket.Datetime.EVT_ID'=>$event_id, 'TXN_ID'=>$this->transaction->ID())));
131 131
 				$ticket_line_items_per_event[$event_id] = $line_items_for_this_event;
132
-				foreach($line_items_for_this_event as $line_item_id => $line_item){
132
+				foreach ($line_items_for_this_event as $line_item_id => $line_item) {
133 133
 					$ticket = $line_item->ticket();
134
-					$registrations_for_this_ticket = EEM_Registration::instance()->get_all(array(array('TKT_ID'=>$ticket->ID(),'TXN_ID'=>$this->transaction->ID())));
134
+					$registrations_for_this_ticket = EEM_Registration::instance()->get_all(array(array('TKT_ID'=>$ticket->ID(), 'TXN_ID'=>$this->transaction->ID())));
135 135
 					$registrations_per_line_item[$line_item_id] = $registrations_for_this_ticket;
136 136
 				}
137 137
 				$venues_for_events = array_merge($venues_for_events, $event->venues());
138 138
 			}
139
-			$tax_total_line_item = EEM_Line_Item::instance()->get_one(array(array('TXN_ID'=>$this->transaction->ID(),'LIN_type'=>  EEM_Line_Item::type_tax_sub_total)));
140
-			$questions_to_skip = array(EEM_Attendee::fname_question_id,EEM_Attendee::lname_question_id,  EEM_Attendee::email_question_id);
139
+			$tax_total_line_item = EEM_Line_Item::instance()->get_one(array(array('TXN_ID'=>$this->transaction->ID(), 'LIN_type'=>  EEM_Line_Item::type_tax_sub_total)));
140
+			$questions_to_skip = array(EEM_Attendee::fname_question_id, EEM_Attendee::lname_question_id, EEM_Attendee::email_question_id);
141 141
 
142 142
 
143 143
 			$template_args['events_for_txn'] = $events_for_txn;
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
 			$template_args['venues_for_events'] = $venues_for_events;
147 147
 			$template_args['tax_total_line_item'] = $tax_total_line_item;
148 148
 			$template_args['questions_to_skip'] = $questions_to_skip;
149
-			$EE->load_helper( 'Venue_View' );
149
+			$EE->load_helper('Venue_View');
150 150
 //			d($template_args);
151 151
 			$template_args['download_link'] = $this->registration->receipt_url('download');
152
-		}else{
152
+		} else {
153 153
 			//it's just an invoice we're accessing
154 154
 			$template_args['download_link'] = $this->registration->invoice_url('download');
155 155
 		}
@@ -157,51 +157,51 @@  discard block
 block discarded – undo
157 157
 
158 158
 
159 159
 		//require helpers
160
-		$EE->load_helper( 'Formatter' );
160
+		$EE->load_helper('Formatter');
161 161
 
162 162
 		//Get the HTML as an object
163 163
 		EE_Registry::instance()->load_helper('Template');
164 164
 		$templates_relative_path = 'modules/gateways/Invoice/lib/templates/';
165
-		$template_header = EEH_Template::locate_template( $templates_relative_path . 'invoice_header.template.php', $template_args, TRUE, TRUE );
166
-		if(isset($_GET['receipt'])){
167
-			$template_body = EEH_Template::locate_template( $templates_relative_path . 'receipt_body.template.php', $template_args, TRUE, TRUE );
168
-		}else{
169
-			$template_body = EEH_Template::locate_template( $templates_relative_path . 'invoice_body.template.php', $template_args, TRUE, TRUE );
165
+		$template_header = EEH_Template::locate_template($templates_relative_path.'invoice_header.template.php', $template_args, TRUE, TRUE);
166
+		if (isset($_GET['receipt'])) {
167
+			$template_body = EEH_Template::locate_template($templates_relative_path.'receipt_body.template.php', $template_args, TRUE, TRUE);
168
+		} else {
169
+			$template_body = EEH_Template::locate_template($templates_relative_path.'invoice_body.template.php', $template_args, TRUE, TRUE);
170 170
 		}
171 171
 
172 172
 
173
-		$template_footer = EEH_Template::locate_template( $templates_relative_path . 'invoice_footer.template.php', $template_args, TRUE, TRUE );
173
+		$template_footer = EEH_Template::locate_template($templates_relative_path.'invoice_footer.template.php', $template_args, TRUE, TRUE);
174 174
 
175
-		$copies =  ! empty( $_REQUEST['copies'] ) ? $_REQUEST['copies'] : 1;
175
+		$copies = ! empty($_REQUEST['copies']) ? $_REQUEST['copies'] : 1;
176 176
 
177 177
 		$content = $this->espresso_replace_invoice_shortcodes($template_header);
178
-		for( $x = 1; $x <= $copies; $x++ ) {
178
+		for ($x = 1; $x <= $copies; $x++) {
179 179
 			$content .= $this->espresso_replace_invoice_shortcodes($template_body);
180 180
 		}
181 181
 		$content .= $this->espresso_replace_invoice_shortcodes($template_footer);
182 182
 
183 183
 		//Check if debugging or mobile is set
184
-		if (!empty($_REQUEST['html'])) {
184
+		if ( ! empty($_REQUEST['html'])) {
185 185
 			echo $content;
186 186
 			exit(0);
187 187
 		}
188
-		$invoice_name = $template_args['organization'] . ' ' . __('Invoice #', 'event_espresso') . $template_args['registration_code'] . __(' for ', 'event_espresso') . $template_args['name'];
189
-		$invoice_name = str_replace( ' ', '_', $invoice_name );
188
+		$invoice_name = $template_args['organization'].' '.__('Invoice #', 'event_espresso').$template_args['registration_code'].__(' for ', 'event_espresso').$template_args['name'];
189
+		$invoice_name = str_replace(' ', '_', $invoice_name);
190 190
 		//Create the PDF
191
-		if(array_key_exists('html',$_GET)){
191
+		if (array_key_exists('html', $_GET)) {
192 192
 			echo $content;
193
-		}else{
193
+		} else {
194 194
 			//only load dompdf if nobody else has yet...
195
-			if( ! defined('DOMPDF_DIR')){
195
+			if ( ! defined('DOMPDF_DIR')) {
196 196
 				define('DOMPDF_ENABLE_REMOTE', TRUE);
197 197
 				define('DOMPDF_ENABLE_JAVASCRIPT', FALSE);
198 198
 				define('DOMPDF_ENABLE_CSS_FLOAT', TRUE);
199
-				require_once(EE_THIRD_PARTY . 'dompdf/dompdf_config.inc.php');
199
+				require_once(EE_THIRD_PARTY.'dompdf/dompdf_config.inc.php');
200 200
 			}
201 201
 			$dompdf = new DOMPDF();
202 202
 			$dompdf->load_html($content);
203 203
 			$dompdf->render();
204
-			$dompdf->stream($invoice_name . ".pdf", array( 'Attachment' => $download ));
204
+			$dompdf->stream($invoice_name.".pdf", array('Attachment' => $download));
205 205
 		}
206 206
 		exit(0);
207 207
 	}
@@ -211,12 +211,12 @@  discard block
 block discarded – undo
211 211
 	 * @param EE_Line_Item $line_item
212 212
 	 * @return boolean
213 213
 	 */
214
-	function check_if_any_line_items_have_a_description(EE_Line_Item $line_item){
215
-		if($line_item->desc()){
214
+	function check_if_any_line_items_have_a_description(EE_Line_Item $line_item) {
215
+		if ($line_item->desc()) {
216 216
 			return true;
217
-		}else{
218
-			foreach($line_item->children() as $child_line_item){
219
-				if($this->check_if_any_line_items_have_a_description($child_line_item)){
217
+		} else {
218
+			foreach ($line_item->children() as $child_line_item) {
219
+				if ($this->check_if_any_line_items_have_a_description($child_line_item)) {
220 220
 					return true;
221 221
 				}
222 222
 			}
@@ -226,14 +226,14 @@  discard block
 block discarded – undo
226 226
 	}
227 227
 
228 228
 //Perform the shortcode replacement
229
-	function espresso_replace_invoice_shortcodes( $content ) {
229
+	function espresso_replace_invoice_shortcodes($content) {
230 230
 
231 231
 		$EE = EE_Registry::instance();
232 232
 		//Create the logo
233
-		$invoice_logo_url = $this->invoice_payment_method->get_extra_meta('pdf_logo_image', TRUE,  $EE->CFG->organization->logo_url );
234
-		if (!empty($invoice_logo_url)) {
233
+		$invoice_logo_url = $this->invoice_payment_method->get_extra_meta('pdf_logo_image', TRUE, $EE->CFG->organization->logo_url);
234
+		if ( ! empty($invoice_logo_url)) {
235 235
 			$image_size = getimagesize($invoice_logo_url);
236
-			$invoice_logo_image = '<img class="logo screen" src="' . $invoice_logo_url . '" ' . $image_size[3] . ' alt="logo" /> ';
236
+			$invoice_logo_image = '<img class="logo screen" src="'.$invoice_logo_url.'" '.$image_size[3].' alt="logo" /> ';
237 237
 		} else {
238 238
 			$invoice_logo_image = '';
239 239
 		}
@@ -255,28 +255,28 @@  discard block
 block discarded – undo
255 255
 				"[instructions]",
256 256
 		);
257 257
 		$primary_attendee = $this->transaction->primary_registration()->attendee();
258
-		$org_state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID );
259
-		if($org_state){
258
+		$org_state = EE_Registry::instance()->load_model('State')->get_one_by_ID($EE->CFG->organization->STA_ID);
259
+		if ($org_state) {
260 260
 			$org_state_name = $org_state->name();
261
-		}else{
261
+		} else {
262 262
 			$org_state_name = '';
263 263
 		}
264 264
 		$ReplaceValues = array(
265
-				$EE->CFG->organization->get_pretty( 'name' ),
265
+				$EE->CFG->organization->get_pretty('name'),
266 266
 				$this->registration->reg_code(),
267 267
 				$this->transaction->ID(),
268 268
 				$primary_attendee->full_name(),
269
-				(is_dir(EVENT_ESPRESSO_GATEWAY_DIR . '/invoice')) ? EVENT_ESPRESSO_GATEWAY_URL . 'Invoice/lib/templates/' : EE_GATEWAYS_URL . 'Invoice/lib/templates/',
270
-				$this->registration->invoice_url(),//home_url() . '/?download_invoice=true&amp;id=' . $this->registration->reg_url_link(),
269
+				(is_dir(EVENT_ESPRESSO_GATEWAY_DIR.'/invoice')) ? EVENT_ESPRESSO_GATEWAY_URL.'Invoice/lib/templates/' : EE_GATEWAYS_URL.'Invoice/lib/templates/',
270
+				$this->registration->invoice_url(), //home_url() . '/?download_invoice=true&amp;id=' . $this->registration->reg_url_link(),
271 271
 				$invoice_logo_image,
272
-				empty( $EE->CFG->organization->address_2 ) ? $EE->CFG->organization->get_pretty( 'address_1' ) : $EE->CFG->organization->get_pretty( 'address_1' ) . '<br>' . $EE->CFG->organization->get_pretty( 'address_2' ),
273
-				$EE->CFG->organization->get_pretty( 'city' ),
272
+				empty($EE->CFG->organization->address_2) ? $EE->CFG->organization->get_pretty('address_1') : $EE->CFG->organization->get_pretty('address_1').'<br>'.$EE->CFG->organization->get_pretty('address_2'),
273
+				$EE->CFG->organization->get_pretty('city'),
274 274
 				$org_state_name,
275
-				$EE->CFG->organization->get_pretty( 'zip' ),
276
-				$EE->CFG->organization->get_pretty( 'email' ),
275
+				$EE->CFG->organization->get_pretty('zip'),
276
+				$EE->CFG->organization->get_pretty('email'),
277 277
 				$EE->CFG->organization->vat,
278
-				date_i18n( get_option( 'date_format' ), strtotime( $this->registration->date() )),
279
-				$this->invoice_payment_method->get_extra_meta( 'pdf_instructions', TRUE ),
278
+				date_i18n(get_option('date_format'), strtotime($this->registration->date())),
279
+				$this->invoice_payment_method->get_extra_meta('pdf_instructions', TRUE),
280 280
 		);
281 281
 
282 282
 		return str_replace($SearchValues, $ReplaceValues, $content);
@@ -299,12 +299,12 @@  discard block
 block discarded – undo
299 299
 		if ($total_cost < 0) {
300 300
 			$total_cost = (-1) * $total_cost;
301 301
 		}
302
-		$find = array( ' ' );
303
-		$replace = array( '-' );
304
-		$row_id = strtolower( str_replace( $find, $replace, $text ));
302
+		$find = array(' ');
303
+		$replace = array('-');
304
+		$row_id = strtolower(str_replace($find, $replace, $text));
305 305
 		$html .= '<tr id="'.$row_id.'-tr"><td colspan="4">&nbsp;</td>';
306
-		$html .= '<td class="item_r">' . $text . '</td>';
307
-		$html .= '<td class="item_r">' . $total_cost . '</td>';
306
+		$html .= '<td class="item_r">'.$text.'</td>';
307
+		$html .= '<td class="item_r">'.$total_cost.'</td>';
308 308
 		$html .= '</tr>';
309 309
 		return $html;
310 310
 	}
Please login to merge, or discard this patch.