Completed
Branch FET-8162-relation-exists (8f4753)
by
unknown
64:03 queued 54:52
created
shortcodes/espresso_events/EES_Espresso_Events.shortcode.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -229,7 +229,7 @@
 block discarded – undo
229 229
 	 *
230 230
 	 * @access    public
231 231
 	 * @param string $event_list_css
232
-	 * @return    array
232
+	 * @return    string
233 233
 	 */
234 234
 	public function event_list_css( $event_list_css = '' ) {
235 235
 		$event_list_css .=  ! empty( $event_list_css ) ? ' ' : '';
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
 	 * @param WP $WP
51 51
 	 * @return    void
52 52
 	 */
53
-	public function run( WP $WP ) {
54
-		if ( ! did_action( 'pre_get_posts' )) {
53
+	public function run(WP $WP) {
54
+		if ( ! did_action('pre_get_posts')) {
55 55
 			// this will trigger the EED_Events_Archive module's event_list() method during the pre_get_posts hook point,
56 56
 			// this allows us to initialize things, enqueue assets, etc,
57 57
 			// as well, this saves an instantiation of the module in an array using 'espresso_events' as the key, so that we can retrieve it
58
-			add_action( 'pre_get_posts', array( EED_Events_Archive::instance(), 'event_list' ));
58
+			add_action('pre_get_posts', array(EED_Events_Archive::instance(), 'event_list'));
59 59
 		} else {
60 60
 			EED_Events_Archive::instance()->event_list();
61 61
 		}
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
 	 *  @param 	array 	$attributes
80 80
 	 *  @return 	string
81 81
 	 */
82
-	public function process_shortcode( $attributes = array() ) {
82
+	public function process_shortcode($attributes = array()) {
83 83
 		// make sure EED_Events_Archive is setup properly
84
-		if ( apply_filters( 'FHEE__fallback_shortcode_processor__EES_Espresso_Events', FALSE )) {
84
+		if (apply_filters('FHEE__fallback_shortcode_processor__EES_Espresso_Events', FALSE)) {
85 85
 			EED_Events_Archive::instance()->event_list();
86 86
 		}
87 87
 		// merge in any attributes passed via fallback shortcode processor
88
-		$attributes = array_merge( (array)$attributes, (array)$this->_attributes );
88
+		$attributes = array_merge((array) $attributes, (array) $this->_attributes);
89 89
 		//set default attributes
90 90
 		$default_espresso_events_shortcode_atts = array(
91 91
 			'title' => NULL,
@@ -99,26 +99,26 @@  discard block
 block discarded – undo
99 99
 			'fallback_shortcode_processor' => FALSE
100 100
 		);
101 101
 		// allow the defaults to be filtered
102
-		$default_espresso_events_shortcode_atts = apply_filters( 'EES_Espresso_Events__process_shortcode__default_espresso_events_shortcode_atts', $default_espresso_events_shortcode_atts );
102
+		$default_espresso_events_shortcode_atts = apply_filters('EES_Espresso_Events__process_shortcode__default_espresso_events_shortcode_atts', $default_espresso_events_shortcode_atts);
103 103
 		// grab attributes and merge with defaults, then extract
104
-		$attributes = array_merge( $default_espresso_events_shortcode_atts, $attributes );
104
+		$attributes = array_merge($default_espresso_events_shortcode_atts, $attributes);
105 105
 		// make sure we use the_excerpt()
106
-		add_filter( 'FHEE__EES_Espresso_Events__process_shortcode__true', '__return_true' );
106
+		add_filter('FHEE__EES_Espresso_Events__process_shortcode__true', '__return_true');
107 107
 		// apply query filters
108
-		add_filter( 'FHEE__EEH_Event_Query__apply_query_filters', '__return_true' );
108
+		add_filter('FHEE__EEH_Event_Query__apply_query_filters', '__return_true');
109 109
 		// run the query
110 110
 		global $wp_query;
111
-		$wp_query = new EE_Event_List_Query( $attributes );
111
+		$wp_query = new EE_Event_List_Query($attributes);
112 112
 		// check what template is loaded and load filters accordingly
113
-		EED_Events_Archive::instance()->template_include( 'loop-espresso_events.php' );
113
+		EED_Events_Archive::instance()->template_include('loop-espresso_events.php');
114 114
 		// load our template
115
-		$event_list = EEH_Template::locate_template( 'loop-espresso_events.php', array(), TRUE, TRUE );
115
+		$event_list = EEH_Template::locate_template('loop-espresso_events.php', array(), TRUE, TRUE);
116 116
 		// now reset the query and postdata
117 117
 		wp_reset_query();
118 118
 		wp_reset_postdata();
119 119
 		EED_Events_Archive::remove_all_events_archive_filters();
120 120
 		// remove query filters
121
-		remove_filter( 'FHEE__EEH_Event_Query__apply_query_filters', '__return_true' );
121
+		remove_filter('FHEE__EEH_Event_Query__apply_query_filters', '__return_true');
122 122
 		// pull our content from the output buffer and return it
123 123
 		return $event_list;
124 124
 	}
@@ -163,46 +163,46 @@  discard block
 block discarded – undo
163 163
 	 * @param array $args
164 164
 	 * @return \EE_Event_List_Query
165 165
 	 */
166
-	function __construct( $args = array() ) {
166
+	function __construct($args = array()) {
167 167
 //		EEH_Debug_Tools::printr( $args, '$args  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
168 168
 		// incoming args could be a mix of WP query args + EE shortcode args
169
-		foreach ( $args as $key =>$value ) {
170
-			$property = '_' . $key;
169
+		foreach ($args as $key =>$value) {
170
+			$property = '_'.$key;
171 171
 			// if the arg is a property of this class, then it's an EE shortcode arg
172
-			if ( property_exists( $this, $property )) {
172
+			if (property_exists($this, $property)) {
173 173
 				// set the property value
174 174
 				$this->$property = $value;
175 175
 				// then remove it from the array of args that will later be passed to WP_Query()
176
-				unset( $args[ $key ] );
176
+				unset($args[$key]);
177 177
 			}
178 178
 		}
179 179
 		// setup the events list query
180
-		EE_Registry::instance()->load_helper( 'Event_Query' );
180
+		EE_Registry::instance()->load_helper('Event_Query');
181 181
 		//add query filters
182 182
 		EEH_Event_Query::add_query_filters();
183 183
 		// set params that will get used by the filters
184
-		EEH_Event_Query::set_query_params( $this->_month, $this->_category_slug, $this->_show_expired, $this->_order_by, $this->_sort );
184
+		EEH_Event_Query::set_query_params($this->_month, $this->_category_slug, $this->_show_expired, $this->_order_by, $this->_sort);
185 185
 		// first off, let's remove any filters from previous queries
186
-		remove_filter( 'FHEE__archive_espresso_events_template__upcoming_events_h1', array( $this, 'event_list_title' ));
187
-		remove_all_filters( 'FHEE__content_espresso_events__event_class' );
186
+		remove_filter('FHEE__archive_espresso_events_template__upcoming_events_h1', array($this, 'event_list_title'));
187
+		remove_all_filters('FHEE__content_espresso_events__event_class');
188 188
 		// Event List Title ?
189
-		add_filter( 'FHEE__archive_espresso_events_template__upcoming_events_h1', array( $this, 'event_list_title' ), 10, 1 );
189
+		add_filter('FHEE__archive_espresso_events_template__upcoming_events_h1', array($this, 'event_list_title'), 10, 1);
190 190
 		// add the css class
191
-		add_filter( 'FHEE__content_espresso_events__event_class', array( $this, 'event_list_css' ), 10, 1 );
191
+		add_filter('FHEE__content_espresso_events__event_class', array($this, 'event_list_css'), 10, 1);
192 192
 		// the current "page" we are viewing
193
-		$paged = max( 1, get_query_var( 'paged' ));
193
+		$paged = max(1, get_query_var('paged'));
194 194
 		// Force these args
195
-		$args = array_merge( $args, array(
195
+		$args = array_merge($args, array(
196 196
 			'post_type' => 'espresso_events',
197 197
 			'posts_per_page' => $this->_limit,
198 198
 			'update_post_term_cache' => FALSE,
199 199
 			'update_post_meta_cache' => FALSE,
200 200
 			'paged' => $paged,
201
-			'offset' => ( $paged - 1 ) * $this->_limit
201
+			'offset' => ($paged - 1) * $this->_limit
202 202
 		));
203 203
 
204 204
 		// run the query
205
-		parent::__construct( $args );
205
+		parent::__construct($args);
206 206
 	}
207 207
 
208 208
 
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
 	 * @param string $event_list_title
216 216
 	 * @return    string
217 217
 	 */
218
-	public function event_list_title( $event_list_title = '' ) {
219
-		if ( ! empty( $this->_title )) {
218
+	public function event_list_title($event_list_title = '') {
219
+		if ( ! empty($this->_title)) {
220 220
 			return $this->_title;
221 221
 		}
222 222
 		return $event_list_title;
@@ -231,11 +231,11 @@  discard block
 block discarded – undo
231 231
 	 * @param string $event_list_css
232 232
 	 * @return    array
233 233
 	 */
234
-	public function event_list_css( $event_list_css = '' ) {
235
-		$event_list_css .=  ! empty( $event_list_css ) ? ' ' : '';
236
-		$event_list_css .=  ! empty( $this->_css_class ) ? $this->_css_class : '';
237
-		$event_list_css .=  ! empty( $event_list_css ) ? ' ' : '';
238
-		$event_list_css .=  ! empty( $this->_category_slug ) ? $this->_category_slug : '';
234
+	public function event_list_css($event_list_css = '') {
235
+		$event_list_css .= ! empty($event_list_css) ? ' ' : '';
236
+		$event_list_css .= ! empty($this->_css_class) ? $this->_css_class : '';
237
+		$event_list_css .= ! empty($event_list_css) ? ' ' : '';
238
+		$event_list_css .= ! empty($this->_category_slug) ? $this->_category_slug : '';
239 239
 		return $event_list_css;
240 240
 	}
241 241
 
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.
espresso_ticket_selector/EES_Espresso_Ticket_Selector.shortcode.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 	 * 
57 57
 	 *  @access 	public
58 58
 	 *  @param		array 	$attributes
59
-	 *  @return 	void
59
+	 *  @return 	string
60 60
 	 */
61 61
 	public function process_shortcode( $attributes = array() ) {
62 62
 		extract( $attributes );
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 *  @access 	public
49 49
 	 *  @return 	void
50 50
 	 */
51
-	public function run( WP $WP ) {
51
+	public function run(WP $WP) {
52 52
 	}
53 53
 
54 54
 	/**
@@ -58,13 +58,13 @@  discard block
 block discarded – undo
58 58
 	 *  @param		array 	$attributes
59 59
 	 *  @return 	void
60 60
 	 */
61
-	public function process_shortcode( $attributes = array() ) {
62
-		extract( $attributes );
63
-		$event = EE_Registry::instance()->load_model( 'Event' )->get_one_by_ID( $event_id );
61
+	public function process_shortcode($attributes = array()) {
62
+		extract($attributes);
63
+		$event = EE_Registry::instance()->load_model('Event')->get_one_by_ID($event_id);
64 64
 		ob_start();
65
-		do_action( 'AHEE_event_details_before_post', $event_id );
66
-		espresso_ticket_selector( $event );	
67
-		do_action( 'AHEE_event_details_after_post' );
65
+		do_action('AHEE_event_details_before_post', $event_id);
66
+		espresso_ticket_selector($event);	
67
+		do_action('AHEE_event_details_after_post');
68 68
 		return ob_get_clean();
69 69
 	}
70 70
 
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.
admin_pages/about/About_Admin_Page.core.php 2 patches
Spacing   +25 added lines, -25 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
 /**
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
 		//Copied from _whats_new()
118 118
 		$steps = EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ? $this->_get_started_steps() : FALSE;
119 119
 		$steps = $steps !== FALSE ? $steps : '';
120
-		$this->_admin_page_title = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION );
120
+		$this->_admin_page_title = sprintf(__('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION);
121 121
 		$settings_message = $steps;
122
-		$this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful, and free, Event Management plugin for WordPress.', 'event_espresso' ) . $settings_message;
123
-		$template = EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php';
124
-		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE );
122
+		$this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful, and free, Event Management plugin for WordPress.', 'event_espresso').$settings_message;
123
+		$template = EE_ABOUT_TEMPLATE_PATH.'ee4-overview.template.php';
124
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE);
125 125
 		$this->display_about_admin_page();
126 126
 	}
127 127
 
@@ -129,36 +129,36 @@  discard block
 block discarded – undo
129 129
 
130 130
 	protected function _get_started_steps() {
131 131
 		$steps = '<h3>'.__('Getting Started').'</h3>';
132
-		$step_one = '<p>'.sprintf( __('%sStep 1%s: Visit your %sOrganization Settings%s and add/update your details.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_general_settings">', '</a>') .'</strong></p>';
133
-		$step_two = '<p>'.sprintf( __('%sStep 2%s: Setup your %sPayment Methods%s.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_payment_settings">', '</a>') .'</strong></p>';
134
-		$step_three = '<p>'.sprintf( __('%sStep 3%s: Create your %sFirst Event%s.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_events&action=create_new">', '</a>') .'</strong></p>';
132
+		$step_one = '<p>'.sprintf(__('%sStep 1%s: Visit your %sOrganization Settings%s and add/update your details.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_general_settings">', '</a>').'</strong></p>';
133
+		$step_two = '<p>'.sprintf(__('%sStep 2%s: Setup your %sPayment Methods%s.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_payment_settings">', '</a>').'</strong></p>';
134
+		$step_three = '<p>'.sprintf(__('%sStep 3%s: Create your %sFirst Event%s.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_events&action=create_new">', '</a>').'</strong></p>';
135 135
 
136 136
 		//done?
137 137
 		$done_step_one = EE_Registry::instance()->CFG->organization->address_1 == '123 Onna Road' ? FALSE : TRUE;
138
-		$active_invoice_pm = EEM_Payment_Method::instance()->get_one_active( EEM_Payment_Method::scope_cart, array( array( 'PMD_type' => 'Invoice' ) ) );
139
-		$active_pms_count = EEM_Payment_Method::instance()->count_active( EEM_Payment_Method::scope_cart );
138
+		$active_invoice_pm = EEM_Payment_Method::instance()->get_one_active(EEM_Payment_Method::scope_cart, array(array('PMD_type' => 'Invoice')));
139
+		$active_pms_count = EEM_Payment_Method::instance()->count_active(EEM_Payment_Method::scope_cart);
140 140
 		//done step two if a non-invoice paymetn method is active; or there is more than one PM active, or
141 141
 		//if only teh invoice is active but it's clearly been updated
142
-		$done_step_two = $active_pms_count > 1  ||
143
-						 ( $active_pms_count === 1 && ! $active_invoice_pm )	||
144
-						 ( $active_invoice_pm instanceof EE_Payment_Method && (
145
-								 $active_invoice_pm->get_extra_meta( 'pdf_payee_name', TRUE, '' ) ||
146
-								 $active_invoice_pm->get_extra_meta( 'pdf_payee_email', TRUE, '' ) ||
147
-								 $active_invoice_pm->get_extra_meta( 'pdf_payee_tax_number', TRUE, '' ) ||
148
-								 $active_invoice_pm->get_extra_meta( 'pdf_payee_address', TRUE, '' ) ||
149
-								 $active_invoice_pm->get_extra_meta( 'page_extra_info', TRUE, '' )
142
+		$done_step_two = $active_pms_count > 1 ||
143
+						 ($active_pms_count === 1 && ! $active_invoice_pm) ||
144
+						 ($active_invoice_pm instanceof EE_Payment_Method && (
145
+								 $active_invoice_pm->get_extra_meta('pdf_payee_name', TRUE, '') ||
146
+								 $active_invoice_pm->get_extra_meta('pdf_payee_email', TRUE, '') ||
147
+								 $active_invoice_pm->get_extra_meta('pdf_payee_tax_number', TRUE, '') ||
148
+								 $active_invoice_pm->get_extra_meta('pdf_payee_address', TRUE, '') ||
149
+								 $active_invoice_pm->get_extra_meta('page_extra_info', TRUE, '')
150 150
 								)
151 151
 				);
152 152
 		$done_step_three = EE_Registry::instance()->load_model('Event')->count() > 0 ? TRUE : FALSE;
153 153
 
154 154
 		//if ALL steps are done, let's just return FALSE so we don't display anything
155
-		if ( $done_step_one && $done_step_two && $done_step_three )
155
+		if ($done_step_one && $done_step_two && $done_step_three)
156 156
 			return FALSE;
157 157
 
158 158
 		//now let's put it together
159
-		$steps .= sprintf( '%s' . $step_one . '%s', $done_step_one ? '<strike>' : '', $done_step_one ? '</strike>': '' );
160
-		$steps .= sprintf( '%s' . $step_two . '%s', $done_step_two ? '<strike>' : '', $done_step_two ? '</strike>': '' );
161
-		$steps .= sprintf( '%s' . $step_three . '%s', $done_step_three ? '<strike>' : '', $done_step_three ? '</strike>': '' );
159
+		$steps .= sprintf('%s'.$step_one.'%s', $done_step_one ? '<strike>' : '', $done_step_one ? '</strike>' : '');
160
+		$steps .= sprintf('%s'.$step_two.'%s', $done_step_two ? '<strike>' : '', $done_step_two ? '</strike>' : '');
161
+		$steps .= sprintf('%s'.$step_three.'%s', $done_step_three ? '<strike>' : '', $done_step_three ? '</strike>' : '');
162 162
 
163 163
 		return $steps;
164 164
 	}
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
 
167 167
 
168 168
 	protected function _credits() {
169
-		$this->_template_args['admin_page_title'] = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION );
169
+		$this->_template_args['admin_page_title'] = sprintf(__('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION);
170 170
 		$this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso Decaf, the most powerful, and free, Event Management plugin for WordPress.', 'event_espresso');
171
-		$template = EE_ABOUT_TEMPLATE_PATH . 'credits.template.php';
172
-		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE );
171
+		$template = EE_ABOUT_TEMPLATE_PATH.'credits.template.php';
172
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE);
173 173
 		$this->display_about_admin_page();
174 174
 	}
175 175
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  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 6
 /**
6 7
  *
@@ -152,8 +153,9 @@  discard block
 block discarded – undo
152 153
 		$done_step_three = EE_Registry::instance()->load_model('Event')->count() > 0 ? TRUE : FALSE;
153 154
 
154 155
 		//if ALL steps are done, let's just return FALSE so we don't display anything
155
-		if ( $done_step_one && $done_step_two && $done_step_three )
156
-			return FALSE;
156
+		if ( $done_step_one && $done_step_two && $done_step_three ) {
157
+					return FALSE;
158
+		}
157 159
 
158 160
 		//now let's put it together
159 161
 		$steps .= sprintf( '%s' . $step_one . '%s', $done_step_one ? '<strike>' : '', $done_step_one ? '</strike>': '' );
Please login to merge, or discard this patch.
admin_pages/about/About_Admin_Page_Init.core.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
 
31 31
 	public function __construct() {
32 32
 		//define some events related constants
33
-		define( 'EE_ABOUT_PG_SLUG', 'espresso_about' );
34
-		define( 'EE_ABOUT_LABEL', __('About', 'event_espresso'));
35
-		define( 'EE_ABOUT_ADMIN', EE_ADMIN_PAGES . 'about' . DS );
36
-		define( 'EE_ABOUT_ADMIN_URL', admin_url( 'admin.php?page=' . EE_ABOUT_PG_SLUG ));
37
-		define( 'EE_ABOUT_TEMPLATE_PATH', EE_ABOUT_ADMIN . 'templates' . DS );
38
-		define( 'EE_ABOUT_ASSETS_URL', EE_ADMIN_PAGES_URL . 'about/assets/' );
33
+		define('EE_ABOUT_PG_SLUG', 'espresso_about');
34
+		define('EE_ABOUT_LABEL', __('About', 'event_espresso'));
35
+		define('EE_ABOUT_ADMIN', EE_ADMIN_PAGES.'about'.DS);
36
+		define('EE_ABOUT_ADMIN_URL', admin_url('admin.php?page='.EE_ABOUT_PG_SLUG));
37
+		define('EE_ABOUT_TEMPLATE_PATH', EE_ABOUT_ADMIN.'templates'.DS);
38
+		define('EE_ABOUT_ASSETS_URL', EE_ADMIN_PAGES_URL.'about/assets/');
39 39
 		parent::__construct();
40 40
 	}
41 41
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	}
45 45
 
46 46
 	protected function _set_menu_map() {
47
-		$this->_menu_map = new EE_Admin_Page_Sub_Menu( array(
47
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(array(
48 48
 			'menu_group' => 'extras',
49 49
 			'menu_order' => 40,
50 50
 			'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_AND_NETWORK_ADMIN,
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.
admin_pages/about/templates/whats_new.template.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@
 block discarded – undo
1 1
 <div class="changelog point-releases">
2
-	<h3><?php echo _n( 'Minor Release Information', 'Minor Releases', 1 ); ?></h3>
3
-	<!-- <h3><?php echo _n( 'Major Release Information', 'Major Releases', 1 ); ?></h3>-->
2
+	<h3><?php echo _n('Minor Release Information', 'Minor Releases', 1); ?></h3>
3
+	<!-- <h3><?php echo _n('Major Release Information', 'Major Releases', 1); ?></h3>-->
4 4
 	<?php $type = 'minor'; ?>
5 5
 	<?php //$type = 'major'; ?>
6
-	<p><?php printf( __( '<strong>Version %1$s</strong> is a %2$s bug fix/enhancement release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type ); ?>
6
+	<p><?php printf(__('<strong>Version %1$s</strong> is a %2$s bug fix/enhancement release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type); ?>
7 7
 		<?php
8
-			$ver = explode( '.', EVENT_ESPRESSO_VERSION );
9
-			array_pop( $ver );
10
-			$ver = implode( '.', $ver );
8
+			$ver = explode('.', EVENT_ESPRESSO_VERSION);
9
+			array_pop($ver);
10
+			$ver = implode('.', $ver);
11 11
 		?>
12
-		<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://eventespresso.com/wiki/ee4-changelog/#' . $ver ); ?>
12
+		<?php printf(__('For more information, see <a href="%s">the release notes</a>.'), 'http://eventespresso.com/wiki/ee4-changelog/#'.$ver); ?>
13 13
  	</p>
14 14
 </div>
15 15
 
16 16
 <div class="changelog">
17 17
 	<?php
18 18
 	//maintenance mode on?
19
-	if ( EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ) {
19
+	if (EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) {
20 20
 		?>
21 21
 		<div class="ee-attention">
22
-			<h2 class="ee-maintenance-mode-callout"><?php  _e('Event Espresso is in full maintenance mode.' , 'event_espresso'); ?></h2>
22
+			<h2 class="ee-maintenance-mode-callout"><?php  _e('Event Espresso is in full maintenance mode.', 'event_espresso'); ?></h2>
23 23
 			<p>
24 24
 			<?php
25 25
 				printf(
Please login to merge, or discard this patch.
admin_pages/events/Event_Categories_Admin_List_Table.class.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 class Event_Categories_Admin_List_Table extends EE_Admin_List_Table {
33 33
 
34
-	public function __construct( $admin_page ) {
34
+	public function __construct($admin_page) {
35 35
 		parent::__construct($admin_page);
36 36
 	}
37 37
 
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 	protected function _setup_data() {
42
-		$this->_data = $this->_admin_page->get_categories( $this->_per_page, $this->_current_page);
43
-		$this->_all_data_count = EEM_Term_Taxonomy::instance()->count( array( array( 'taxonomy' => 'espresso_event_categories' ) ) );
42
+		$this->_data = $this->_admin_page->get_categories($this->_per_page, $this->_current_page);
43
+		$this->_all_data_count = EEM_Term_Taxonomy::instance()->count(array(array('taxonomy' => 'espresso_event_categories')));
44 44
 	}
45 45
 
46 46
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 
50 50
 	protected function _set_properties() {
51 51
 		$this->_wp_list_args = array(
52
-			'singular' => __('event category', 'event_espresso' ),
53
-			'plural' => __('event categories', 'event_espresso' ),
52
+			'singular' => __('event category', 'event_espresso'),
53
+			'plural' => __('event categories', 'event_espresso'),
54 54
 			'ajax' => TRUE, //for now,
55 55
 			'screen' => $this->_admin_page->get_current_screen()->id
56 56
 			);
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 			);
65 65
 
66 66
 		$this->_sortable_columns = array(
67
-			'id' => array( 'Term.term_id' => true ),
68
-			'name' => array( 'Term.slug' => false ),
69
-			'count' => array( 'term_count' => false )
67
+			'id' => array('Term.term_id' => true),
68
+			'name' => array('Term.slug' => false),
69
+			'count' => array('term_count' => false)
70 70
 			);
71 71
 
72 72
 		$this->_hidden_columns = array();
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
 
98 98
 	public function column_cb($item) {
99
-		return sprintf( '<input type="checkbox" name="EVT_CAT_ID[]" value="%s" />', $item->get('term_id') );
99
+		return sprintf('<input type="checkbox" name="EVT_CAT_ID[]" value="%s" />', $item->get('term_id'));
100 100
 	}
101 101
 
102 102
 
@@ -123,17 +123,17 @@  discard block
 block discarded – undo
123 123
 			'EVT_CAT_ID' => $item->get('term_id')
124 124
 		);
125 125
 
126
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
127
-		$delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EVENTS_ADMIN_URL );
126
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
127
+		$delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EVENTS_ADMIN_URL);
128 128
 
129 129
 		$actions = array(
130
-			'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Category', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>'
130
+			'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Category', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'
131 131
 			);
132 132
 
133 133
 
134
-		$actions['delete'] = '<a href="' . $delete_link . '" title="' . esc_attr__('Delete Category', 'event_espresso') . '">' . __('Delete', 'event_espresso') . '</a>';
134
+		$actions['delete'] = '<a href="'.$delete_link.'" title="'.esc_attr__('Delete Category', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>';
135 135
 
136
-		$content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->get_first_related('Term')->get('name') . '</a></strong>';
136
+		$content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->get_first_related('Term')->get('name').'</a></strong>';
137 137
 		$content .= $this->row_actions($actions);
138 138
 		return $content;
139 139
 	}
@@ -142,20 +142,20 @@  discard block
 block discarded – undo
142 142
 
143 143
 
144 144
 	public function column_shortcode($item) {
145
-		$content = '[ESPRESSO_EVENTS category_slug="' . $item->get_first_related('Term')->get('slug') . '"]';
145
+		$content = '[ESPRESSO_EVENTS category_slug="'.$item->get_first_related('Term')->get('slug').'"]';
146 146
 		return $content;
147 147
 	}
148 148
 
149 149
 
150 150
 
151 151
 
152
-	public function column_count( $item ) {
152
+	public function column_count($item) {
153 153
 		$e_args = array(
154 154
 			'action' => 'default',
155 155
 			'EVT_CAT' => $item->get_first_related('Term')->ID()
156 156
 			);
157
-		$e_link = EE_Admin_Page::add_query_args_and_nonce( $e_args, EVENTS_ADMIN_URL );
158
-		$content = '<a href="' . $e_link . '">' . $item->get('term_count') . '</a>';
157
+		$e_link = EE_Admin_Page::add_query_args_and_nonce($e_args, EVENTS_ADMIN_URL);
158
+		$content = '<a href="'.$e_link.'">'.$item->get('term_count').'</a>';
159 159
 		return $content;
160 160
 	}
161 161
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
admin_pages/events/Events_Admin_List_Table.class.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,8 +111,8 @@
 block discarded – undo
111 111
 		$regs = $item->count_related('Registration');
112 112
 		return $regs > 0 && $this->_view == 'trash' ? '<span class="ee-lock-icon"></span>' : sprintf(
113 113
 			'<input type="checkbox" name="EVT_IDs[]" value="%s" />', $item->ID()
114
-        );
115
-    }
114
+		);
115
+	}
116 116
 
117 117
 
118 118
 
Please login to merge, or discard this patch.
Spacing   +62 added lines, -62 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
 /**
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
 
34 34
 	private $_dtt;
35 35
 
36
-	public function __construct( $admin_page ) {
36
+	public function __construct($admin_page) {
37 37
 		parent::__construct($admin_page);
38
-		require_once( EE_HELPERS . 'EEH_DTT_Helper.helper.php' );
38
+		require_once(EE_HELPERS.'EEH_DTT_Helper.helper.php');
39 39
 	}
40 40
 
41 41
 	protected function _setup_data() {
42 42
 		$this->_data = $this->_admin_page->get_events($this->_per_page, $this->_current_page);
43
- 		$this->_all_data_count = $this->_admin_page->get_events(0,0, TRUE);
43
+ 		$this->_all_data_count = $this->_admin_page->get_events(0, 0, TRUE);
44 44
 	}
45 45
 
46 46
 	protected function _set_properties() {
@@ -68,15 +68,15 @@  discard block
 block discarded – undo
68 68
 
69 69
 
70 70
 		$this->_sortable_columns = array(
71
-			'id' => array( 'EVT_ID' => true ),
72
-			'name' => array( 'EVT_name' => false ),
73
-			'author' => array( 'EVT_wp_user' => false ),
74
-			'venue' => array( 'Venue.VNU_name' => false ),
71
+			'id' => array('EVT_ID' => true),
72
+			'name' => array('EVT_name' => false),
73
+			'author' => array('EVT_wp_user' => false),
74
+			'venue' => array('Venue.VNU_name' => false),
75 75
 			'start_date_time' => array('Datetime.DTT_EVT_start' => false),
76 76
 			'reg_begins' => array('Datetime.Ticket.TKT_start_date' => false),
77 77
 			);
78 78
 
79
-		$this->_hidden_columns = array( 'author' );
79
+		$this->_hidden_columns = array('author');
80 80
 	}
81 81
 
82 82
 
@@ -91,15 +91,15 @@  discard block
 block discarded – undo
91 91
 	protected function _add_view_counts() {
92 92
 		$this->_views['all']['count'] = $this->_admin_page->total_events();
93 93
 		$this->_views['draft']['count'] = $this->_admin_page->total_events_draft();
94
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) {
94
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
95 95
 			$this->_views['trash']['count'] = $this->_admin_page->total_trashed_events();
96 96
 		}
97 97
 	}
98 98
 
99 99
 
100 100
 
101
-	public function column_status( EE_Event $item ) {
102
-		return '<span class="ee-status-strip ee-status-strip-td event-status-' . $item->get_active_status() . '"></span>';
101
+	public function column_status(EE_Event $item) {
102
+		return '<span class="ee-status-strip ee-status-strip-td event-status-'.$item->get_active_status().'"></span>';
103 103
 	}/**/
104 104
 
105 105
 
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
 				'action' => 'edit',
129 129
 				'post' => $item->ID()
130 130
 			);
131
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
132
-		$actions = $this->_column_name_action_setup( $item );
131
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
132
+		$actions = $this->_column_name_action_setup($item);
133 133
 		$status = ''; //$item->status() !== 'publish' ? ' (' . $item->status() . ')' : '';
134
-		$content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>' . $status;
134
+		$content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->name().'</a></strong>'.$status;
135 135
 		$content .= $this->row_actions($actions);
136 136
 		return $content;
137 137
 
@@ -148,72 +148,72 @@  discard block
 block discarded – undo
148 148
 	 *
149 149
 	 * @return array array of actions
150 150
 	 */
151
-	protected function _column_name_action_setup( EE_Event $item ) {
151
+	protected function _column_name_action_setup(EE_Event $item) {
152 152
 		//todo: remove when attendees is active
153
-		if ( !defined('REG_ADMIN_URL') )
153
+		if ( ! defined('REG_ADMIN_URL'))
154 154
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
155 155
 
156 156
 		$actions = array();
157 157
 
158
-		if ( EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID() ) ) {
158
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID())) {
159 159
 			$edit_query_args = array(
160 160
 					'action' => 'edit',
161 161
 					'post' => $item->ID()
162 162
 				);
163
-			$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
164
-			$actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Event', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>';
163
+			$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
164
+			$actions['edit'] = '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Event', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>';
165 165
 
166 166
 		}
167 167
 
168
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ) {
168
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID())) {
169 169
 			$attendees_query_args = array(
170 170
 					'action' => 'default',
171 171
 					'event_id' => $item->ID()
172 172
 				);
173
-			$attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL );
174
-			$actions['attendees'] = '<a href="' . $attendees_link . '" title="' . esc_attr__('View Registrations', 'event_espresso') . '">' . __('Registrations', 'event_espresso') . '</a>';
173
+			$attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL);
174
+			$actions['attendees'] = '<a href="'.$attendees_link.'" title="'.esc_attr__('View Registrations', 'event_espresso').'">'.__('Registrations', 'event_espresso').'</a>';
175 175
 		}
176 176
 
177
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_trash_event', $item->ID() ) ) {
177
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_trash_event', $item->ID())) {
178 178
 			$trash_event_query_args = array(
179 179
 					'action' => 'trash_event',
180 180
 					'EVT_ID' => $item->ID()
181 181
 				);
182
-			$trash_event_link = EE_Admin_Page::add_query_args_and_nonce( $trash_event_query_args, EVENTS_ADMIN_URL );
182
+			$trash_event_link = EE_Admin_Page::add_query_args_and_nonce($trash_event_query_args, EVENTS_ADMIN_URL);
183 183
 		}
184 184
 
185
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_restore_event', $item->ID() ) ) {
185
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_restore_event', $item->ID())) {
186 186
 			$restore_event_query_args = array(
187 187
 					'action' => 'restore_event',
188 188
 					'EVT_ID' => $item->ID()
189 189
 				);
190
-			$restore_event_link = EE_Admin_Page::add_query_args_and_nonce( $restore_event_query_args, EVENTS_ADMIN_URL );
190
+			$restore_event_link = EE_Admin_Page::add_query_args_and_nonce($restore_event_query_args, EVENTS_ADMIN_URL);
191 191
 		}
192 192
 
193
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_delete_event', $item->ID() ) ) {
193
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_delete_event', $item->ID())) {
194 194
 			$delete_event_query_args = array(
195 195
 					'action' => 'delete_event',
196 196
 					'EVT_ID' => $item->ID()
197 197
 				);
198
-			$delete_event_link = EE_Admin_Page::add_query_args_and_nonce( $delete_event_query_args, EVENTS_ADMIN_URL );
198
+			$delete_event_link = EE_Admin_Page::add_query_args_and_nonce($delete_event_query_args, EVENTS_ADMIN_URL);
199 199
 		}
200 200
 
201 201
 		$view_link = get_permalink($item->ID());
202 202
 
203
-		$actions['view'] = '<a href="' . $view_link . '" title="' . esc_attr__('View Event', 'event_espresso') . '">' . __('View', 'event_espresso') . '</a>';
203
+		$actions['view'] = '<a href="'.$view_link.'" title="'.esc_attr__('View Event', 'event_espresso').'">'.__('View', 'event_espresso').'</a>';
204 204
 
205
-		switch ( $item->get( 'status' ) ) {
205
+		switch ($item->get('status')) {
206 206
 			case 'trash' :
207
-					if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_restore_event', $item->ID() ) ) {
208
-						$actions['restore_from_trash'] = '<a href="' . $restore_event_link . '" title="' . esc_attr__('Restore from Trash', 'event_espresso') . '">' . __('Restore from Trash', 'event_espresso') . '</a>';
207
+					if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_restore_event', $item->ID())) {
208
+						$actions['restore_from_trash'] = '<a href="'.$restore_event_link.'" title="'.esc_attr__('Restore from Trash', 'event_espresso').'">'.__('Restore from Trash', 'event_espresso').'</a>';
209 209
 					}
210
-					if ( $item->count_related('Registration') === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_delete_event', $item->ID() ) ) {
211
-						$actions['delete permanently'] = '<a href="' . $delete_event_link . '" title="' . esc_attr__('Delete Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
210
+					if ($item->count_related('Registration') === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_delete_event', $item->ID())) {
211
+						$actions['delete permanently'] = '<a href="'.$delete_event_link.'" title="'.esc_attr__('Delete Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
212 212
 					}
213 213
 				break;
214 214
 			default :
215
-					if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_trash_event', $item->ID() ) ) {
216
-						$actions['move to trash'] = '<a href="' . $trash_event_link . '" title="' . esc_attr__('Trash Event', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
215
+					if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_trash_event', $item->ID())) {
216
+						$actions['move to trash'] = '<a href="'.$trash_event_link.'" title="'.esc_attr__('Trash Event', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
217 217
 					}
218 218
 		}
219 219
 		return $actions;
@@ -222,34 +222,34 @@  discard block
 block discarded – undo
222 222
 
223 223
 
224 224
 
225
-	public function column_author( EE_Event $item ) {
225
+	public function column_author(EE_Event $item) {
226 226
 		//user author info
227
-		$event_author = get_userdata( $item->wp_user() );
228
-		$gravatar = get_avatar( $item->wp_user(), '15' );
227
+		$event_author = get_userdata($item->wp_user());
228
+		$gravatar = get_avatar($item->wp_user(), '15');
229 229
 		//filter link
230 230
 		$query_args = array(
231 231
 			'action' => 'default',
232 232
 			'EVT_wp_user' => $item->wp_user()
233 233
 			);
234
-		$filter_url = EE_Admin_Page::add_query_args_and_nonce( $query_args, EVENTS_ADMIN_URL );
235
-		return $gravatar . '  <a href="' . $filter_url . '" title="' . esc_attr__('Click to filter events by this author.', 'event_espresso') . '">' . $event_author->display_name . '</a>';
234
+		$filter_url = EE_Admin_Page::add_query_args_and_nonce($query_args, EVENTS_ADMIN_URL);
235
+		return $gravatar.'  <a href="'.$filter_url.'" title="'.esc_attr__('Click to filter events by this author.', 'event_espresso').'">'.$event_author->display_name.'</a>';
236 236
 	}
237 237
 
238 238
 
239 239
 
240 240
 
241 241
 	public function column_venue($item) {
242
-		$venue = $item->get_first_related( 'Venue' );
243
-		return !empty( $venue ) ? $venue->name() : '';
242
+		$venue = $item->get_first_related('Venue');
243
+		return ! empty($venue) ? $venue->name() : '';
244 244
 	}
245 245
 
246 246
 
247 247
 
248 248
 
249 249
 	public function column_start_date_time($item) {
250
-		echo !empty( $this->_dtt ) ?  $this->_dtt->get_i18n_datetime('DTT_EVT_start') : __('No Date was saved for this Event', 'event_espresso');
250
+		echo ! empty($this->_dtt) ? $this->_dtt->get_i18n_datetime('DTT_EVT_start') : __('No Date was saved for this Event', 'event_espresso');
251 251
 		//display in user's timezone?
252
-		echo !empty( $this->_dtt ) ? $this->_dtt->display_in_my_timezone('DTT_EVT_start', 'get_i18n_datetime', '', 'My Timezone: ' ) : '';
252
+		echo ! empty($this->_dtt) ? $this->_dtt->display_in_my_timezone('DTT_EVT_start', 'get_i18n_datetime', '', 'My Timezone: ') : '';
253 253
 
254 254
 	}
255 255
 
@@ -258,9 +258,9 @@  discard block
 block discarded – undo
258 258
 
259 259
 	public function column_reg_begins($item) {
260 260
 		$reg_start = $item->get_ticket_with_earliest_start_time();
261
-		echo !empty( $reg_start ) ? $reg_start->get_i18n_datetime('TKT_start_date') : __('No Tickets have been setup for this Event', 'event_espresso');
261
+		echo ! empty($reg_start) ? $reg_start->get_i18n_datetime('TKT_start_date') : __('No Tickets have been setup for this Event', 'event_espresso');
262 262
 		//display in user's timezone?
263
-		echo !empty( $reg_start ) ? $reg_start->display_in_my_timezone('TKT_start_date', 'get_i18n_datetime', '', 'My Timezone: ' ) : '';/**/
263
+		echo ! empty($reg_start) ? $reg_start->display_in_my_timezone('TKT_start_date', 'get_i18n_datetime', '', 'My Timezone: ') : ''; /**/
264 264
 	}
265 265
 
266 266
 
@@ -278,51 +278,51 @@  discard block
 block discarded – undo
278 278
 				'action' => 'default',
279 279
 				'event_id' => $item->ID()
280 280
 			);
281
-		$attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL );
282
-		$registered_attendees = EEM_Registration::instance()->get_event_registration_count( $item->ID() );
283
-		return  EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? '<a href="' . $attendees_link . '">' . $registered_attendees . '</a>' : $registered_attendees;
281
+		$attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL);
282
+		$registered_attendees = EEM_Registration::instance()->get_event_registration_count($item->ID());
283
+		return  EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? '<a href="'.$attendees_link.'">'.$registered_attendees.'</a>' : $registered_attendees;
284 284
 	}
285 285
 
286 286
 
287 287
 
288 288
 	public function column_tkts_sold($item) {
289
-		return EEM_Ticket::instance()->sum(array( array('Datetime.EVT_ID' => $item->ID() )), 'TKT_sold' );
289
+		return EEM_Ticket::instance()->sum(array(array('Datetime.EVT_ID' => $item->ID())), 'TKT_sold');
290 290
 	}
291 291
 
292 292
 
293 293
 
294 294
 	public function column_actions($item) {
295 295
 		//todo: remove when attendees is active
296
-		if ( !defined('REG_ADMIN_URL') )
296
+		if ( ! defined('REG_ADMIN_URL'))
297 297
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
298 298
 		$actionlinks = array();
299 299
 
300 300
 		$view_link = get_permalink($item->ID());
301 301
 
302
-		$actionlinks[] = '<a href="' .  $view_link . '" title="' . esc_attr__('View Event', 'event_espresso') . '" target="_blank">';
302
+		$actionlinks[] = '<a href="'.$view_link.'" title="'.esc_attr__('View Event', 'event_espresso').'" target="_blank">';
303 303
 		$actionlinks[] = '<div class="dashicons dashicons-search"></div></a>';
304 304
 
305
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'espresso_events_edit', $item->ID() ) ) {
305
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID())) {
306 306
 			$edit_query_args = array(
307 307
 					'action' => 'edit',
308 308
 					'post' => $item->ID()
309 309
 				);
310
-			$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
311
-			$actionlinks[] = '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Event', 'event_espresso') . '"><div class="ee-icon ee-icon-calendar-edit"></div></a>';
310
+			$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
311
+			$actionlinks[] = '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Event', 'event_espresso').'"><div class="ee-icon ee-icon-calendar-edit"></div></a>';
312 312
 		}
313 313
 
314
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ) {
314
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID())) {
315 315
 			$attendees_query_args = array(
316 316
 				'action' => 'default',
317 317
 				'event_id' => $item->ID()
318 318
 			);
319
-			$attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL );
320
-			$actionlinks[] = '<a href="' . $attendees_link . '" title="' . esc_attr__('View Registrants', 'event_espresso') . '"><div class="dashicons dashicons-groups"></div></a>';
319
+			$attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL);
320
+			$actionlinks[] = '<a href="'.$attendees_link.'" title="'.esc_attr__('View Registrants', 'event_espresso').'"><div class="dashicons dashicons-groups"></div></a>';
321 321
 		}
322 322
 
323
-		$actionlinks = apply_filters( 'FHEE__Events_Admin_List_Table__column_actions__action_links', $actionlinks, $item );
323
+		$actionlinks = apply_filters('FHEE__Events_Admin_List_Table__column_actions__action_links', $actionlinks, $item);
324 324
 
325
-		return $this->_action_string( implode( "\n\t", $actionlinks ), $item, 'div' );
325
+		return $this->_action_string(implode("\n\t", $actionlinks), $item, 'div');
326 326
 	}
327 327
 
328 328
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  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 6
 /**
6 7
  * Event Espresso
@@ -150,8 +151,9 @@  discard block
 block discarded – undo
150 151
 	 */
151 152
 	protected function _column_name_action_setup( EE_Event $item ) {
152 153
 		//todo: remove when attendees is active
153
-		if ( !defined('REG_ADMIN_URL') )
154
-			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
154
+		if ( !defined('REG_ADMIN_URL') ) {
155
+					define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
156
+		}
155 157
 
156 158
 		$actions = array();
157 159
 
@@ -293,8 +295,9 @@  discard block
 block discarded – undo
293 295
 
294 296
 	public function column_actions($item) {
295 297
 		//todo: remove when attendees is active
296
-		if ( !defined('REG_ADMIN_URL') )
297
-			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
298
+		if ( !defined('REG_ADMIN_URL') ) {
299
+					define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
300
+		}
298 301
 		$actionlinks = array();
299 302
 
300 303
 		$view_link = get_permalink($item->ID());
Please login to merge, or discard this patch.
admin_pages/events/Events_Admin_Page.core.php 3 patches
Braces   +23 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  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 6
 /**
6 7
  * Event Espresso
@@ -871,8 +872,9 @@  discard block
 block discarded – undo
871 872
 		$venue_id = !empty( $data['venue_id'] ) ? $data['venue_id'] : NULL;
872 873
 
873 874
 		//very important.  If we don't have a venue name then we'll get out because not necessary to create empty venue
874
-		if ( empty( $data['venue_title'] ) )
875
-			return;
875
+		if ( empty( $data['venue_title'] ) ) {
876
+					return;
877
+		}
876 878
 
877 879
 		$venue_array = array(
878 880
 				'VNU_wp_user' => $evtobj->get('EVT_wp_user'),
@@ -1194,7 +1196,9 @@  discard block
 block discarded – undo
1194 1196
 
1195 1197
 
1196 1198
 		//if no postid then get out cause we need it for stuff in here
1197
-		if ( empty( $postid ) ) return;
1199
+		if ( empty( $postid ) ) {
1200
+			return;
1201
+		}
1198 1202
 
1199 1203
 
1200 1204
 		//handle datetime saves
@@ -1436,10 +1440,11 @@  discard block
 block discarded – undo
1436 1440
 			//get the earliest datetime (if present);
1437 1441
 			$earliest_dtt = $this->_cpt_model_obj->ID() > 0 ? $this->_cpt_model_obj->get_first_related('Datetime', array('order_by'=> array('DTT_EVT_start' => 'ASC' ) ) ) : NULL;
1438 1442
 
1439
-			if ( !empty( $earliest_dtt ) )
1440
-				$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1441
-			else
1442
-				$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d")+7, date("Y") ) );
1443
+			if ( !empty( $earliest_dtt ) ) {
1444
+							$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1445
+			} else {
1446
+							$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d")+7, date("Y") ) );
1447
+			}
1443 1448
 		}
1444 1449
 
1445 1450
 		$template_args = array_merge( $template_args, $price_args );
@@ -1715,8 +1720,9 @@  discard block
 block discarded – undo
1715 1720
 		}
1716 1721
 		$action = $event_status == 'trash' ? 'moved to the trash' : 'restored from the trash';
1717 1722
 
1718
-		if ( $redirect_after )
1719
-			$this->_redirect_after_action($success, 'Event', $action, array('action' => 'default'));
1723
+		if ( $redirect_after ) {
1724
+					$this->_redirect_after_action($success, 'Event', $action, array('action' => 'default'));
1725
+		}
1720 1726
 	}
1721 1727
 
1722 1728
 	/**
@@ -1841,8 +1847,9 @@  discard block
 block discarded – undo
1841 1847
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1842 1848
 		}
1843 1849
 
1844
-		if ( $redirect_after )
1845
-			$this->_redirect_after_action($success, 'Event', 'deleted', array('action' => 'default', 'status' => 'trash'));
1850
+		if ( $redirect_after ) {
1851
+					$this->_redirect_after_action($success, 'Event', 'deleted', array('action' => 'default', 'status' => 'trash'));
1852
+		}
1846 1853
 	}
1847 1854
 
1848 1855
 	/**
@@ -2074,8 +2081,10 @@  discard block
 block discarded – undo
2074 2081
 	 * @return void
2075 2082
 	 */
2076 2083
 	private function _set_category_object() {
2077
-		if ( isset( $this->_category->id ) && !empty( $this->_category->id ) )
2078
-			return; //already have the category object so get out.
2084
+		if ( isset( $this->_category->id ) && !empty( $this->_category->id ) ) {
2085
+					return;
2086
+		}
2087
+		//already have the category object so get out.
2079 2088
 
2080 2089
 		//set default category object
2081 2090
 		$this->_set_empty_category_object();
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
 	 * Handles saving everything related to Tickets (datetimes, tickets, prices)
917 917
 	 * @param  EE_Event $evtobj The Event object we're attaching data to
918 918
 	 * @param  array    $data   The request data from the form
919
-	 * @return bool             success or fail
919
+	 * @return boolean|null             success or fail
920 920
 	 */
921 921
 	protected function _default_tickets_update( $evtobj, $data ) {
922 922
 		$success = TRUE;
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
 	 * This just returns whatever is set as the _event object property
1252 1252
 	 *
1253 1253
 	 * //todo this will become obsolete once the models are in place
1254
-	 * @return object
1254
+	 * @return EE_CPT_Base
1255 1255
 	 */
1256 1256
 	public function get_event_object() {
1257 1257
 		return $this->_cpt_model_obj;
@@ -1707,9 +1707,8 @@  discard block
 block discarded – undo
1707 1707
 	 * _trash_or_restore_events
1708 1708
 	 *
1709 1709
 	 * @access  private
1710
-	 * @param  int $event_id
1711 1710
 	 * @param  string $event_status
1712
-	 * @return void
1711
+	 * @return boolean
1713 1712
 	 */
1714 1713
 	private function _change_event_status($EVT_ID = FALSE, $event_status = FALSE) {
1715 1714
 		// grab event id
@@ -1829,7 +1828,7 @@  discard block
 block discarded – undo
1829 1828
 	 *
1830 1829
 	 * @access  private
1831 1830
 	 * @param  int $EVT_ID
1832
-	 * @return void
1831
+	 * @return boolean
1833 1832
 	 */
1834 1833
 	private function _permanently_delete_event($EVT_ID = FALSE) {
1835 1834
 		// grab event id
Please login to merge, or discard this patch.
Spacing   +347 added lines, -347 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
 /**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 			'espresso_events' => 'edit'
68 68
 			);
69 69
 
70
-		add_action('AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object', array( $this, 'verify_event_edit' ) );
70
+		add_action('AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object', array($this, 'verify_event_edit'));
71 71
 	}
72 72
 
73 73
 	protected function _ajax_hooks() {
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
 
100 100
 	protected function _set_page_routes() {
101 101
 		//load formatter helper
102
-		EE_Registry::instance()->load_helper( 'Formatter' );
102
+		EE_Registry::instance()->load_helper('Formatter');
103 103
 		//load field generator helper
104
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
104
+		EE_Registry::instance()->load_helper('Form_Fields');
105 105
 
106 106
 		//is there a evt_id in the request?
107
-		$evt_id = ! empty( $this->_req_data['EVT_ID'] ) && ! is_array( $this->_req_data['EVT_ID'] ) ? $this->_req_data['EVT_ID'] : 0;
108
-		$evt_id = ! empty( $this->_req_data['post'] ) ? $this->_req_data['post'] : $evt_id;
107
+		$evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : 0;
108
+		$evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
109 109
 
110 110
 
111 111
 		$this->_page_routes = array(
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 				'help_tour' => array(
316 316
 					'Event_Editor_Help_Tour'
317 317
 					),
318
-				'qtips' => array( 'EE_Event_Editor_Decaf_Tips' ),
318
+				'qtips' => array('EE_Event_Editor_Decaf_Tips'),
319 319
 				'require_nonce' => FALSE
320 320
 			),
321 321
 			'edit' => array(
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 				'help_tour' => array(
372 372
 					'Event_Edit_Help_Tour'
373 373
 				),
374
-				'qtips' => array( 'EE_Event_Editor_Decaf_Tips' ),
374
+				'qtips' => array('EE_Event_Editor_Decaf_Tips'),
375 375
 				'require_nonce' => FALSE
376 376
 			),
377 377
 			'default_event_settings' => array(
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 						'filename' => 'events_default_settings_status'
394 394
 					)
395 395
 				),
396
-				'help_tour' => array( 'Event_Default_Settings_Help_Tour'),
396
+				'help_tour' => array('Event_Default_Settings_Help_Tour'),
397 397
 				'require_nonce' => FALSE
398 398
 			),
399 399
 			//event category stuff
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 					'label' => __('Edit Category', 'event_espresso'),
418 418
 					'order' => 15,
419 419
 					'persistent' => FALSE,
420
-					'url' => isset($this->_req_data['EVT_CAT_ID']) ? add_query_arg(array('EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url
420
+					'url' => isset($this->_req_data['EVT_CAT_ID']) ? add_query_arg(array('EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID']), $this->_current_page_view_url) : $this->_admin_base_url
421 421
 					),
422 422
 				'help_tabs' => array(
423 423
 					'edit_category_help_tab' => array(
@@ -487,14 +487,14 @@  discard block
 block discarded – undo
487 487
 
488 488
 	public function load_scripts_styles() {
489 489
 
490
-		wp_register_style('events-admin-css', EVENTS_ASSETS_URL . 'events-admin-page.css', array(), EVENT_ESPRESSO_VERSION);
491
-		wp_register_style('ee-cat-admin', EVENTS_ASSETS_URL . 'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION );
490
+		wp_register_style('events-admin-css', EVENTS_ASSETS_URL.'events-admin-page.css', array(), EVENT_ESPRESSO_VERSION);
491
+		wp_register_style('ee-cat-admin', EVENTS_ASSETS_URL.'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION);
492 492
 		wp_enqueue_style('events-admin-css');
493 493
 		wp_enqueue_style('ee-cat-admin');
494 494
 		//todo note: we also need to load_scripts_styles per view (i.e. default/view_report/event_details
495 495
 		//registers for all views
496 496
 		//scripts
497
-		wp_register_script('event_editor_js', EVENTS_ASSETS_URL . 'event_editor.js', array('ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'), EVENT_ESPRESSO_VERSION, TRUE);
497
+		wp_register_script('event_editor_js', EVENTS_ASSETS_URL.'event_editor.js', array('ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'), EVENT_ESPRESSO_VERSION, TRUE);
498 498
 	}
499 499
 
500 500
 	/**
@@ -512,11 +512,11 @@  discard block
 block discarded – undo
512 512
 	public function load_scripts_styles_edit() {
513 513
 		//styles
514 514
 		wp_enqueue_style('espresso-ui-theme');
515
-		wp_register_style('event-editor-css', EVENTS_ASSETS_URL . 'event-editor.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
515
+		wp_register_style('event-editor-css', EVENTS_ASSETS_URL.'event-editor.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
516 516
 		wp_enqueue_style('event-editor-css');
517 517
 
518 518
 		//scripts
519
-		wp_register_script('event-datetime-metabox', EVENTS_ASSETS_URL . 'event-datetime-metabox.js', array('event_editor_js', 'ee-datepicker'), EVENT_ESPRESSO_VERSION );
519
+		wp_register_script('event-datetime-metabox', EVENTS_ASSETS_URL.'event-datetime-metabox.js', array('event_editor_js', 'ee-datepicker'), EVENT_ESPRESSO_VERSION);
520 520
 		wp_enqueue_script('event-datetime-metabox');
521 521
 
522 522
 		EE_Registry::$i18n_js_strings['image_confirm'] = __('Do you really want to delete this image? Please remember to update your event to complete the removal.', 'event_espresso');
@@ -569,35 +569,35 @@  discard block
 block discarded – undo
569 569
 	 */
570 570
 	public function verify_event_edit($event = NULL) {
571 571
 		// no event?
572
-		if ( empty( $event )) {
572
+		if (empty($event)) {
573 573
 			// set event
574 574
 			$event = $this->_cpt_model_obj;
575 575
 		}
576 576
 		// STILL no event?
577
-		if ( empty ( $event )) {
577
+		if (empty ($event)) {
578 578
 			return;
579 579
 		}
580 580
 		// first check if event is active.
581
-		if ( $event->is_expired() || $event->is_inactive() || $event->status() == EEM_Event::cancelled || $event->status() == EEM_Event::postponed ) {
581
+		if ($event->is_expired() || $event->is_inactive() || $event->status() == EEM_Event::cancelled || $event->status() == EEM_Event::postponed) {
582 582
 			return;
583 583
 		}
584 584
 		$orig_status = $event->status();
585 585
 		//made it here so it IS active... next check that any of the tickets are sold.
586
-		if ( $event->is_sold_out() || $event->is_sold_out(TRUE ) ) {
587
-			if ( $event->status() !== $orig_status && $orig_status !== EEM_Event::sold_out  ) {
588
-				EE_Error::add_attention( sprintf(
589
-					__( 'Please note that the Event Status has automaticallly been changed to %s because there are no more spaces available for this event.  However, this change is not permanent until you update the event.  You <em>can</em> change the status back to something else before updating if you wish.', 'event_espresso' ),
590
-					EEH_Template::pretty_status( EEM_Event::sold_out, FALSE, 'sentence' )
586
+		if ($event->is_sold_out() || $event->is_sold_out(TRUE)) {
587
+			if ($event->status() !== $orig_status && $orig_status !== EEM_Event::sold_out) {
588
+				EE_Error::add_attention(sprintf(
589
+					__('Please note that the Event Status has automaticallly been changed to %s because there are no more spaces available for this event.  However, this change is not permanent until you update the event.  You <em>can</em> change the status back to something else before updating if you wish.', 'event_espresso'),
590
+					EEH_Template::pretty_status(EEM_Event::sold_out, FALSE, 'sentence')
591 591
 				));
592 592
 			}
593 593
 			return;
594 594
 		}
595 595
 		//now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
596
-		if ( ! $event->tickets_on_sale() ) {
596
+		if ( ! $event->tickets_on_sale()) {
597 597
 			return;
598 598
 		}
599 599
 		//made it here so show warning
600
-		EE_Error::add_attention( $this->_edit_event_warning() );
600
+		EE_Error::add_attention($this->_edit_event_warning());
601 601
 	}
602 602
 
603 603
 
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 			),
638 638
 		);
639 639
 
640
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) {
640
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
641 641
 			$this->_views['trash'] = array(
642 642
 				'slug' => 'trash',
643 643
 				'label' => __('Trash', 'event_espresso'),
@@ -667,39 +667,39 @@  discard block
 block discarded – undo
667 667
 				'desc' => __('View Registrations for Event', 'event_espresso')
668 668
 			)
669 669
 		);
670
-		$items  = apply_filters( 'FHEE__Events_Admin_Page___event_legend_items__items', $items );
670
+		$items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
671 671
 		$statuses = array(
672 672
 			'sold_out_status' => array(
673
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
674
-				'desc' => EEH_Template::pretty_status( EE_Datetime::sold_out, FALSE, 'sentence' )
673
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::sold_out,
674
+				'desc' => EEH_Template::pretty_status(EE_Datetime::sold_out, FALSE, 'sentence')
675 675
 			),
676 676
 			'active_status' => array(
677
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
678
-				'desc' => EEH_Template::pretty_status( EE_Datetime::active, FALSE, 'sentence' )
677
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::active,
678
+				'desc' => EEH_Template::pretty_status(EE_Datetime::active, FALSE, 'sentence')
679 679
 			),
680 680
 			'upcoming_status' => array(
681
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
682
-				'desc' => EEH_Template::pretty_status( EE_Datetime::upcoming, FALSE, 'sentence' )
681
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::upcoming,
682
+				'desc' => EEH_Template::pretty_status(EE_Datetime::upcoming, FALSE, 'sentence')
683 683
 			),
684 684
 			'postponed_status' => array(
685
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
686
-				'desc' => EEH_Template::pretty_status( EE_Datetime::postponed, FALSE, 'sentence' )
685
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::postponed,
686
+				'desc' => EEH_Template::pretty_status(EE_Datetime::postponed, FALSE, 'sentence')
687 687
 			),
688 688
 			'cancelled_status' => array(
689
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
690
-				'desc' => EEH_Template::pretty_status( EE_Datetime::cancelled, FALSE, 'sentence' )
689
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::cancelled,
690
+				'desc' => EEH_Template::pretty_status(EE_Datetime::cancelled, FALSE, 'sentence')
691 691
 			),
692 692
 			'expired_status' => array(
693
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
694
-				'desc' => EEH_Template::pretty_status( EE_Datetime::expired, FALSE, 'sentence' )
693
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::expired,
694
+				'desc' => EEH_Template::pretty_status(EE_Datetime::expired, FALSE, 'sentence')
695 695
 			),
696 696
 			'inactive_status' => array(
697
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
698
-				'desc' => EEH_Template::pretty_status( EE_Datetime::inactive, FALSE, 'sentence' )
697
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::inactive,
698
+				'desc' => EEH_Template::pretty_status(EE_Datetime::inactive, FALSE, 'sentence')
699 699
 			)
700 700
 		);
701
-		$statuses = apply_filters( 'FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses );
702
-		return array_merge( $items, $statuses );
701
+		$statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses);
702
+		return array_merge($items, $statuses);
703 703
 	}
704 704
 
705 705
 
@@ -711,8 +711,8 @@  discard block
 block discarded – undo
711 711
 	 * @return EEM_Event
712 712
 	 */
713 713
 	private function _event_model() {
714
-		if ( ! $this->_event_model instanceof EEM_Event ) {
715
-			$this->_event_model = EE_Registry::instance()->load_model( 'Event' );
714
+		if ( ! $this->_event_model instanceof EEM_Event) {
715
+			$this->_event_model = EE_Registry::instance()->load_model('Event');
716 716
 		}
717 717
 		return $this->_event_model;
718 718
 	}
@@ -731,12 +731,12 @@  discard block
 block discarded – undo
731 731
 	 * @param  string $new_slug  what the slug is
732 732
 	 * @return string            The new html string for the permalink area
733 733
 	 */
734
-	public function extra_permalink_field_buttons( $return, $id, $new_title, $new_slug ) {
734
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug) {
735 735
 		//make sure this is only when editing
736
-		if ( !empty( $id ) ) {
737
-			$post = get_post( $id );
738
-			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">' . __('Shortcode', 'event_espresso') . '</a> ';
739
-			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id=\'' . $post->ID . '\']"">';
736
+		if ( ! empty($id)) {
737
+			$post = get_post($id);
738
+			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'.__('Shortcode', 'event_espresso').'</a> ';
739
+			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id=\''.$post->ID.'\']"">';
740 740
 		}
741 741
 		return $return;
742 742
 	}
@@ -752,8 +752,8 @@  discard block
 block discarded – undo
752 752
 	 * @return string html for generated table
753 753
 	 */
754 754
 	protected function _events_overview_list_table() {
755
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
756
-		$this->_template_args['after_list_table'] = EEH_Template::get_button_or_link( get_post_type_archive_link('espresso_events'), __("View Event Archive Page", "event_espresso"), 'button' ) .
755
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
756
+		$this->_template_args['after_list_table'] = EEH_Template::get_button_or_link(get_post_type_archive_link('espresso_events'), __("View Event Archive Page", "event_espresso"), 'button').
757 757
 		$this->_display_legend($this->_event_legend_items());
758 758
 		$this->_admin_page_title .= $this->get_action_link_or_button('create_new', 'add', array(), 'add-new-h2');
759 759
 		$this->display_admin_list_table_page_with_no_sidebar();
@@ -771,46 +771,46 @@  discard block
 block discarded – undo
771 771
 
772 772
 
773 773
 
774
-	protected function _insert_update_cpt_item( $post_id, $post ) {
774
+	protected function _insert_update_cpt_item($post_id, $post) {
775 775
 
776 776
 		$event_values = array(
777
-			'EVT_display_desc' => !empty( $this->_req_data['display_desc'] ) ? 1 : 0,
778
-			'EVT_display_ticket_selector' => !empty( $this->_req_data['display_ticket_selector'] ) ? 1 : 0,
777
+			'EVT_display_desc' => ! empty($this->_req_data['display_desc']) ? 1 : 0,
778
+			'EVT_display_ticket_selector' => ! empty($this->_req_data['display_ticket_selector']) ? 1 : 0,
779 779
 			'EVT_additional_limit' => min(
780
-					apply_filters( 'FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255 ),
781
-					!empty( $this->_req_data['additional_limit'] ) ? $this->_req_data['additional_limit'] : NULL ),
782
-			'EVT_default_registration_status' => !empty( $this->_req_data['EVT_default_registration_status'] ) ? $this->_req_data['EVT_default_registration_status'] : EE_Registry::instance()->CFG->registration->default_STS_ID,
783
-			'EVT_member_only' => !empty( $this->_req_data['member_only'] ) ? 1 : 0,
784
-			'EVT_allow_overflow' => !empty( $this->_req_data['EVT_allow_overflow'] ) ? 1 : 0,
785
-			'EVT_timezone_string' => !empty( $this->_req_data['timezone_string'] ) ? $this->_req_data['timezone_string'] : NULL,
786
-			'EVT_external_URL' => !empty( $this->_req_data['externalURL'] ) ? $this->_req_data['externalURL'] : NULL,
787
-			'EVT_phone' => !empty( $this->_req_data['event_phone'] ) ? $this->_req_data['event_phone'] : NULL
780
+					apply_filters('FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255),
781
+					! empty($this->_req_data['additional_limit']) ? $this->_req_data['additional_limit'] : NULL ),
782
+			'EVT_default_registration_status' => ! empty($this->_req_data['EVT_default_registration_status']) ? $this->_req_data['EVT_default_registration_status'] : EE_Registry::instance()->CFG->registration->default_STS_ID,
783
+			'EVT_member_only' => ! empty($this->_req_data['member_only']) ? 1 : 0,
784
+			'EVT_allow_overflow' => ! empty($this->_req_data['EVT_allow_overflow']) ? 1 : 0,
785
+			'EVT_timezone_string' => ! empty($this->_req_data['timezone_string']) ? $this->_req_data['timezone_string'] : NULL,
786
+			'EVT_external_URL' => ! empty($this->_req_data['externalURL']) ? $this->_req_data['externalURL'] : NULL,
787
+			'EVT_phone' => ! empty($this->_req_data['event_phone']) ? $this->_req_data['event_phone'] : NULL
788 788
 			);
789 789
 
790 790
 		//update event
791
-		$success = $this->_event_model()->update_by_ID( $event_values, $post_id );
791
+		$success = $this->_event_model()->update_by_ID($event_values, $post_id);
792 792
 
793 793
 
794 794
 		//get event_object for other metaboxes... though it would seem to make sense to just use $this->_event_model()->get_one_by_ID( $post_id ).. i have to setup where conditions to override the filters in the model that filter out autodraft and inherit statuses so we GET the inherit id!
795
-		$get_one_where = array( $this->_event_model()->primary_key_name() => $post_id, 'status' => $post->post_status );
796
-		$event = $this->_event_model()->get_one( array($get_one_where) );
795
+		$get_one_where = array($this->_event_model()->primary_key_name() => $post_id, 'status' => $post->post_status);
796
+		$event = $this->_event_model()->get_one(array($get_one_where));
797 797
 
798 798
 
799 799
 		//the following are default callbacks for event attachment updates that can be overridden by caffeinated functionality and/or addons.
800
-		$event_update_callbacks = apply_filters( 'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array( array($this, '_default_venue_update' ), array( $this, '_default_tickets_update') ) );
800
+		$event_update_callbacks = apply_filters('FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array(array($this, '_default_venue_update'), array($this, '_default_tickets_update')));
801 801
 
802 802
 		$att_success = TRUE;
803 803
 
804
-		foreach ( $event_update_callbacks as $e_callback ) {
805
-			$_succ = call_user_func_array( $e_callback, array( $event,  $this->_req_data ) );
806
-			$att_success = !$att_success ? $att_success : $_succ; //if ANY of these updates fail then we want the appropriate global error message
804
+		foreach ($event_update_callbacks as $e_callback) {
805
+			$_succ = call_user_func_array($e_callback, array($event, $this->_req_data));
806
+			$att_success = ! $att_success ? $att_success : $_succ; //if ANY of these updates fail then we want the appropriate global error message
807 807
 		}
808 808
 
809 809
 		//any errors?
810
-		if ( $success && FALSE === $att_success ) {
811
-			EE_Error::add_error( __('Event Details saved successfully but something went wrong with saving attachments.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
812
-		} else if ( $success === FALSE ) {
813
-			EE_Error::add_error( __('Event Details did not save successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
810
+		if ($success && FALSE === $att_success) {
811
+			EE_Error::add_error(__('Event Details saved successfully but something went wrong with saving attachments.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
812
+		} else if ($success === FALSE) {
813
+			EE_Error::add_error(__('Event Details did not save successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
814 814
 		}
815 815
 	}
816 816
 
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
 	/**
821 821
 	 * @see parent::restore_item()
822 822
 	 */
823
-	protected function _restore_cpt_item( $post_id, $revision_id ) {
823
+	protected function _restore_cpt_item($post_id, $revision_id) {
824 824
 		//copy existing event meta to new post
825 825
 		$post_evt = $this->_event_model()->get_one_by_ID($post_id);
826 826
 
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 		$post_evt->restore_revision($revision_id);
829 829
 
830 830
 		//related objs restore
831
-		$post_evt->restore_revision($revision_id, array( 'Venue', 'Datetime', 'Price' ) );
831
+		$post_evt->restore_revision($revision_id, array('Venue', 'Datetime', 'Price'));
832 832
 	}
833 833
 
834 834
 
@@ -840,50 +840,50 @@  discard block
 block discarded – undo
840 840
 	 * @param  array  $data   The request data from the form
841 841
 	 * @return bool           Success or fail.
842 842
 	 */
843
-	protected function _default_venue_update( $evtobj, $data ) {
844
-		require_once( EE_MODELS . 'EEM_Venue.model.php' );
843
+	protected function _default_venue_update($evtobj, $data) {
844
+		require_once(EE_MODELS.'EEM_Venue.model.php');
845 845
 		$venue_model = EE_Registry::instance()->load_model('Venue');
846 846
 		$rows_affected = NULL;
847
-		$venue_id = !empty( $data['venue_id'] ) ? $data['venue_id'] : NULL;
847
+		$venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : NULL;
848 848
 
849 849
 		//very important.  If we don't have a venue name then we'll get out because not necessary to create empty venue
850
-		if ( empty( $data['venue_title'] ) )
850
+		if (empty($data['venue_title']))
851 851
 			return;
852 852
 
853 853
 		$venue_array = array(
854 854
 				'VNU_wp_user' => $evtobj->get('EVT_wp_user'),
855
-				'VNU_name' => !empty( $data['venue_title'] ) ? $data['venue_title'] : NULL,
856
-				'VNU_desc' => !empty( $data['venue_description'] ) ? $data['venue_description'] : NULL,
857
-				'VNU_identifier' => !empty( $data['venue_identifier'] ) ? $data['venue_identifier'] : NULL,
858
-				'VNU_short_desc' => !empty( $data['venue_short_description'] ) ? $data['venue_short_description'] : NULL,
859
-				'VNU_address' => !empty( $data['address'] ) ? $data['address'] : NULL,
860
-				'VNU_address2' => !empty( $data['address2'] ) ? $data['address2'] : NULL,
861
-				'VNU_city' => !empty( $data['city'] ) ? $data['city'] : NULL,
862
-				'STA_ID' => !empty( $data['state'] ) ? $data['state'] : NULL,
863
-				'CNT_ISO' => !empty( $data['countries'] ) ? $data['countries'] : NULL,
864
-				'VNU_zip' => !empty( $data['zip'] ) ? $data['zip'] : NULL,
865
-				'VNU_phone' => !empty( $data['venue_phone'] ) ? $data['venue_phone'] : NULL,
866
-				'VNU_capacity' => !empty( $data['venue_capacity'] ) ? $data['venue_capacity'] : NULL,
867
-				'VNU_url' => !empty($data['venue_url'] ) ? $data['venue_url'] : NULL,
868
-				'VNU_virtual_phone' => !empty($data['virtual_phone']) ? $data['virtual_phone'] : NULL,
869
-				'VNU_virtual_url' => !empty( $data['virtual_url'] ) ? $data['virtual_url'] : NULL,
870
-				'VNU_enable_for_gmap' => isset( $data['enable_for_gmap'] ) ? 1 : 0,
855
+				'VNU_name' => ! empty($data['venue_title']) ? $data['venue_title'] : NULL,
856
+				'VNU_desc' => ! empty($data['venue_description']) ? $data['venue_description'] : NULL,
857
+				'VNU_identifier' => ! empty($data['venue_identifier']) ? $data['venue_identifier'] : NULL,
858
+				'VNU_short_desc' => ! empty($data['venue_short_description']) ? $data['venue_short_description'] : NULL,
859
+				'VNU_address' => ! empty($data['address']) ? $data['address'] : NULL,
860
+				'VNU_address2' => ! empty($data['address2']) ? $data['address2'] : NULL,
861
+				'VNU_city' => ! empty($data['city']) ? $data['city'] : NULL,
862
+				'STA_ID' => ! empty($data['state']) ? $data['state'] : NULL,
863
+				'CNT_ISO' => ! empty($data['countries']) ? $data['countries'] : NULL,
864
+				'VNU_zip' => ! empty($data['zip']) ? $data['zip'] : NULL,
865
+				'VNU_phone' => ! empty($data['venue_phone']) ? $data['venue_phone'] : NULL,
866
+				'VNU_capacity' => ! empty($data['venue_capacity']) ? $data['venue_capacity'] : NULL,
867
+				'VNU_url' => ! empty($data['venue_url']) ? $data['venue_url'] : NULL,
868
+				'VNU_virtual_phone' => ! empty($data['virtual_phone']) ? $data['virtual_phone'] : NULL,
869
+				'VNU_virtual_url' => ! empty($data['virtual_url']) ? $data['virtual_url'] : NULL,
870
+				'VNU_enable_for_gmap' => isset($data['enable_for_gmap']) ? 1 : 0,
871 871
 				'status' => 'publish'
872 872
 			);
873 873
 
874 874
 
875 875
 		//if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
876
-		if ( !empty( $venue_id ) ) {
877
-			$update_where = array( $venue_model->primary_key_name() => $venue_id );
878
-			$rows_affected = $venue_model->update( $venue_array, array( $update_where ) );
876
+		if ( ! empty($venue_id)) {
877
+			$update_where = array($venue_model->primary_key_name() => $venue_id);
878
+			$rows_affected = $venue_model->update($venue_array, array($update_where));
879 879
 			//we've gotta make sure that the venue is always attached to a revision.. add_relation_to should take care of making sure that the relation is already present.
880
-			$evtobj->_add_relation_to( $venue_id, 'Venue' );
880
+			$evtobj->_add_relation_to($venue_id, 'Venue');
881 881
 			return $rows_affected > 0 ? TRUE : FALSE;
882 882
 		} else {
883 883
 			//we insert the venue
884
-			$venue_id = $venue_model->insert( $venue_array );
885
-			$evtobj->_add_relation_to( $venue_id, 'Venue' );
886
-			return !empty( $venue_id ) ? TRUE : FALSE;
884
+			$venue_id = $venue_model->insert($venue_array);
885
+			$evtobj->_add_relation_to($venue_id, 'Venue');
886
+			return ! empty($venue_id) ? TRUE : FALSE;
887 887
 		}
888 888
 		return TRUE; //when we have the ancestor come in it's already been handled by the revision save.
889 889
 	}
@@ -897,41 +897,41 @@  discard block
 block discarded – undo
897 897
 	 * @param  array    $data   The request data from the form
898 898
 	 * @return bool             success or fail
899 899
 	 */
900
-	protected function _default_tickets_update( $evtobj, $data ) {
900
+	protected function _default_tickets_update($evtobj, $data) {
901 901
 		$success = TRUE;
902
-		foreach ( $data['edit_event_datetimes'] as $row => $dtt ) {
903
-			$dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty( $dtt['DTT_EVT_end'] ) ? $dtt['DTT_EVT_end'] : $dtt['DTT_EVT_start'];
902
+		foreach ($data['edit_event_datetimes'] as $row => $dtt) {
903
+			$dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty($dtt['DTT_EVT_end']) ? $dtt['DTT_EVT_end'] : $dtt['DTT_EVT_start'];
904 904
 			$datetime_values = array(
905
-				'DTT_ID' => !empty( $dtt['DTT_ID'] ) ? $dtt['DTT_ID'] : NULL,
905
+				'DTT_ID' => ! empty($dtt['DTT_ID']) ? $dtt['DTT_ID'] : NULL,
906 906
 				'DTT_EVT_start' => $dtt['DTT_EVT_start'],
907 907
 				'DTT_EVT_end' => $dtt['DTT_EVT_end'],
908
-				'DTT_reg_limit' => empty( $dtt['DTT_reg_limit'] ) ? INF : $dtt['DTT_reg_limit'],
908
+				'DTT_reg_limit' => empty($dtt['DTT_reg_limit']) ? INF : $dtt['DTT_reg_limit'],
909 909
 				'DTT_order' => $row,
910 910
 				);
911 911
 
912 912
 			//if we have an id then let's get existing object first and then set the new values.  Otherwise we instantiate a new object for save.
913 913
 
914
-			if ( !empty( $dtt['DTT_ID'] ) ) {
915
-				$DTM = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($dtt['DTT_ID'] );
916
-				foreach ( $datetime_values as $field => $value ) {
917
-					$DTM->set( $field, $value );
914
+			if ( ! empty($dtt['DTT_ID'])) {
915
+				$DTM = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($dtt['DTT_ID']);
916
+				foreach ($datetime_values as $field => $value) {
917
+					$DTM->set($field, $value);
918 918
 				}
919 919
 
920 920
 				$DTM->save();
921 921
 				//make sure the $dtt_id here is saved just in case after the add_relation_to() the autosave replaces it.  We need to do this so we dont' TRASH the parent DTT.
922 922
 				$saved_dtts[$DTM->ID()] = $DTM;
923 923
 			} else {
924
-				$DTM = EE_Registry::instance()->load_class('Datetime', array( $datetime_values ), FALSE, FALSE );
924
+				$DTM = EE_Registry::instance()->load_class('Datetime', array($datetime_values), FALSE, FALSE);
925 925
 			}
926 926
 
927
-			$DTT = $evtobj->_add_relation_to( $DTM, 'Datetime' );
927
+			$DTT = $evtobj->_add_relation_to($DTM, 'Datetime');
928 928
 
929 929
 			//load DTT helper
930 930
 			EE_Registry::instance()->load_helper('DTT_Helper');
931 931
 
932 932
 			//before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
933
-			if( $DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end') ) {
934
-				$DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start') );
933
+			if ($DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end')) {
934
+				$DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start'));
935 935
 				$DTT = EEH_DTT_Helper::date_time_add($DTT, 'DTT_EVT_end', 'days');
936 936
 				$DTT->save();
937 937
 			}
@@ -939,29 +939,29 @@  discard block
 block discarded – undo
939 939
 			//now we got to make sure we add the new DTT_ID to the $saved_dtts array  because it is possible there was a new one created for the autosave.
940 940
 			$saved_dtt = $DTT;
941 941
 
942
-			$success = !$success ? $success : $DTT; //if ANY of these updates fail then we want the appropriate global error message. //todod this is actually sucky we need a better error message but this is what it is for now.
942
+			$success = ! $success ? $success : $DTT; //if ANY of these updates fail then we want the appropriate global error message. //todod this is actually sucky we need a better error message but this is what it is for now.
943 943
 		}
944 944
 
945 945
 		//no dtts get deleted so we don't do any of that logic here.
946 946
 		//update tickets next
947
-		$old_tickets = isset( $data['ticket_IDs'] ) ? explode(',', $data['ticket_IDs'] ) : array();
948
-		foreach ( $data['edit_tickets'] as $row => $tkt ) {
947
+		$old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : array();
948
+		foreach ($data['edit_tickets'] as $row => $tkt) {
949 949
 			$update_prices = false;
950
-			$ticket_price = isset( $data['edit_prices'][$row][1]['PRC_amount'] ) ? $data['edit_prices'][$row][1]['PRC_amount'] : 0;
950
+			$ticket_price = isset($data['edit_prices'][$row][1]['PRC_amount']) ? $data['edit_prices'][$row][1]['PRC_amount'] : 0;
951 951
 
952 952
 			$TKT_values = array(
953
-				'TKT_ID' => !empty( $tkt['TKT_ID'] ) ? $tkt['TKT_ID'] : NULL,
954
-				'TTM_ID' => !empty( $tkt['TTM_ID'] ) ? $tkt['TTM_ID'] : 0,
955
-				'TKT_name' => !empty( $tkt['TKT_name'] ) ? $tkt['TKT_name'] : '',
956
-				'TKT_description' => !empty( $tkt['TKT_description'] ) ? $tkt['TKT_description'] : '',
957
-				'TKT_start_date' => isset( $tkt['TKT_start_date'] ) ? $tkt['TKT_start_date'] : current_time('mysql'),
958
-				'TKT_end_date' => isset( $tkt['TKT_end_date'] ) ? $tkt['TKT_end_date'] : current_time('mysql'),
959
-				'TKT_qty' => empty( $tkt['TKT_qty'] ) ? INF : $tkt['TKT_qty'],
960
-				'TKT_uses' => empty( $tkt['TKT_uses'] ) ? INF : $tkt['TKT_uses'],
961
-				'TKT_min' => empty( $tkt['TKT_min'] ) ? 0 : $tkt['TKT_min'],
962
-				'TKT_max' => empty( $tkt['TKT_max'] ) ? INF : $tkt['TKT_max'],
953
+				'TKT_ID' => ! empty($tkt['TKT_ID']) ? $tkt['TKT_ID'] : NULL,
954
+				'TTM_ID' => ! empty($tkt['TTM_ID']) ? $tkt['TTM_ID'] : 0,
955
+				'TKT_name' => ! empty($tkt['TKT_name']) ? $tkt['TKT_name'] : '',
956
+				'TKT_description' => ! empty($tkt['TKT_description']) ? $tkt['TKT_description'] : '',
957
+				'TKT_start_date' => isset($tkt['TKT_start_date']) ? $tkt['TKT_start_date'] : current_time('mysql'),
958
+				'TKT_end_date' => isset($tkt['TKT_end_date']) ? $tkt['TKT_end_date'] : current_time('mysql'),
959
+				'TKT_qty' => empty($tkt['TKT_qty']) ? INF : $tkt['TKT_qty'],
960
+				'TKT_uses' => empty($tkt['TKT_uses']) ? INF : $tkt['TKT_uses'],
961
+				'TKT_min' => empty($tkt['TKT_min']) ? 0 : $tkt['TKT_min'],
962
+				'TKT_max' => empty($tkt['TKT_max']) ? INF : $tkt['TKT_max'],
963 963
 				'TKT_row' => $row,
964
-				'TKT_order' => isset( $tkt['TKT_order'] ) ? $tkt['TKT_order'] : $row,
964
+				'TKT_order' => isset($tkt['TKT_order']) ? $tkt['TKT_order'] : $row,
965 965
 				'TKT_price' => $ticket_price
966 966
 				);
967 967
 
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 
970 970
 
971 971
 			//if this is a default TKT, then we need to set the TKT_ID to 0 and update accordingly, which means in turn that the prices will become new prices as well.
972
-			if ( isset( $tkt['TKT_is_default'] ) && $tkt['TKT_is_default'] ) {
972
+			if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
973 973
 				$TKT_values['TKT_ID'] = 0;
974 974
 				$TKT_values['TKT_is_default'] = 0;
975 975
 				$TKT_values['TKT_price'] = $ticket_price;
@@ -980,22 +980,22 @@  discard block
 block discarded – undo
980 980
 			//we actually do our saves a head of doing any add_relations to because its entirely possible that this ticket didn't removed or added to any datetime in the session but DID have it's items modified.
981 981
 			//keep in mind that if the TKT has been sold (and we have changed pricing information), then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
982 982
 
983
-			if ( !empty( $tkt['TKT_ID'] ) ) {
984
-				$TKT = EE_Registry::instance()->load_model( 'Ticket')->get_one_by_ID( $tkt['TKT_ID'] );
983
+			if ( ! empty($tkt['TKT_ID'])) {
984
+				$TKT = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($tkt['TKT_ID']);
985 985
 
986 986
 
987
-				$ticket_sold = $TKT->count_related('Registration', array( array( 'STS_ID' => array( 'NOT IN', array( EEM_Registration::status_id_incomplete ) ) ) ) ) > 0 ? true : false;
987
+				$ticket_sold = $TKT->count_related('Registration', array(array('STS_ID' => array('NOT IN', array(EEM_Registration::status_id_incomplete))))) > 0 ? true : false;
988 988
 
989 989
 				//let's just check the total price for the existing ticket and determine if it matches the new total price.  if they are different then we create a new ticket (if tkts sold) if they aren't different then we go ahead and modify existing ticket.
990
-				$create_new_TKT = $ticket_sold && $ticket_price != $TKT->get('TKT_price') && !$TKT->get('TKT_deleted') ? TRUE : FALSE;
990
+				$create_new_TKT = $ticket_sold && $ticket_price != $TKT->get('TKT_price') && ! $TKT->get('TKT_deleted') ? TRUE : FALSE;
991 991
 
992 992
 				//set new values
993
-				foreach ( $TKT_values as $field => $value ) {
994
-					$TKT->set( $field, $value );
993
+				foreach ($TKT_values as $field => $value) {
994
+					$TKT->set($field, $value);
995 995
 				}
996 996
 
997 997
 				//if $create_new_TKT is false then we can safely update the existing ticket.  Otherwise we have to create a new ticket.
998
-				if ( $create_new_TKT ) {
998
+				if ($create_new_TKT) {
999 999
 					//archive the old ticket first
1000 1000
 					$TKT->set('TKT_deleted', 1);
1001 1001
 					$TKT->save();
@@ -1006,22 +1006,22 @@  discard block
 block discarded – undo
1006 1006
 
1007 1007
 					//create new ticket that's a copy of the existing except a new id of course (and not archived) AND has the new TKT_price associated with it.
1008 1008
 					$TKT = clone $TKT;
1009
-					$TKT->set( 'TKT_ID', 0 );
1010
-					$TKT->set( 'TKT_deleted', 0 );
1011
-					$TKT->set( 'TKT_price', $ticket_price );
1012
-					$TKT->set( 'TKT_sold', 0 );
1009
+					$TKT->set('TKT_ID', 0);
1010
+					$TKT->set('TKT_deleted', 0);
1011
+					$TKT->set('TKT_price', $ticket_price);
1012
+					$TKT->set('TKT_sold', 0);
1013 1013
 
1014 1014
 					//now we need to make sure that $new prices are created as well and attached to new ticket.
1015 1015
 					$update_prices = TRUE;
1016 1016
 				}
1017 1017
 
1018 1018
 				//make sure price is set if it hasn't been already
1019
-				$TKT->set( 'TKT_price', $ticket_price );
1019
+				$TKT->set('TKT_price', $ticket_price);
1020 1020
 
1021 1021
 			} else {
1022 1022
 				//no TKT_id so a new TKT
1023 1023
 				$TKT_values['TKT_price'] = $ticket_price;
1024
-				$TKT = EE_Registry::instance()->load_class('Ticket', array( $TKT_values ), FALSE, FALSE );
1024
+				$TKT = EE_Registry::instance()->load_class('Ticket', array($TKT_values), FALSE, FALSE);
1025 1025
 				$update_prices = TRUE;
1026 1026
 			}
1027 1027
 
@@ -1029,27 +1029,27 @@  discard block
 block discarded – undo
1029 1029
 			$TKT->save();
1030 1030
 
1031 1031
 			//before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1032
-			if( $TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date') ) {
1033
-				$TKT->set('TKT_end_date', $TKT->get('TKT_start_date') );
1032
+			if ($TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date')) {
1033
+				$TKT->set('TKT_end_date', $TKT->get('TKT_start_date'));
1034 1034
 				EE_Registry::instance()->load_helper('DTT_Helper');
1035 1035
 				$TKT = EEH_DTT_Helper::date_time_add($TKT, 'TKT_end_date', 'days');
1036 1036
 				$TKT->save();
1037 1037
 			}
1038 1038
 
1039 1039
 			//initially let's add the ticket to the dtt
1040
-			$saved_dtt->_add_relation_to( $TKT, 'Ticket' );
1040
+			$saved_dtt->_add_relation_to($TKT, 'Ticket');
1041 1041
 
1042 1042
 			$saved_tickets[$TKT->ID()] = $TKT;
1043 1043
 
1044 1044
 			//add prices to ticket
1045
-			$this->_add_prices_to_ticket( $data['edit_prices'][$row], $TKT, $update_prices );
1045
+			$this->_add_prices_to_ticket($data['edit_prices'][$row], $TKT, $update_prices);
1046 1046
 		}
1047 1047
 		//however now we need to handle permanantly deleting tickets via the ui.  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.  However, it does allow for deleting tickets that have no tickets sold, in which case we want to get rid of permanantely because there is no need to save in db.
1048
-		$old_tickets = isset( $old_tickets[0] ) && $old_tickets[0] == '' ? array() : $old_tickets;
1049
-		$tickets_removed = array_diff( $old_tickets, array_keys( $saved_tickets ) );
1048
+		$old_tickets = isset($old_tickets[0]) && $old_tickets[0] == '' ? array() : $old_tickets;
1049
+		$tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
1050 1050
 
1051
-		foreach ( $tickets_removed as $id ) {
1052
-			$id = absint( $id );
1051
+		foreach ($tickets_removed as $id) {
1052
+			$id = absint($id);
1053 1053
 
1054 1054
 			//get the ticket for this id
1055 1055
 			$tkt_to_remove = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($id);
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
 			//need to get all the related datetimes on this ticket and remove from every single one of them (remember this process can ONLY kick off if there are NO tkts_sold)
1058 1058
 			$dtts = $tkt_to_remove->get_many_related('Datetime');
1059 1059
 
1060
-			foreach( $dtts as $dtt ) {
1060
+			foreach ($dtts as $dtt) {
1061 1061
 				$tkt_to_remove->_remove_relation_to($dtt, 'Datetime');
1062 1062
 			}
1063 1063
 
@@ -1082,31 +1082,31 @@  discard block
 block discarded – undo
1082 1082
 	 * @param bool 		$new_prices Whether attach existing incoming prices or create new ones.
1083 1083
 	 * @return  void
1084 1084
 	 */
1085
-	private function  _add_prices_to_ticket( $prices, EE_Ticket $ticket, $new_prices = FALSE ) {
1086
-		foreach ( $prices as $row => $prc ) {
1085
+	private function  _add_prices_to_ticket($prices, EE_Ticket $ticket, $new_prices = FALSE) {
1086
+		foreach ($prices as $row => $prc) {
1087 1087
 			$PRC_values = array(
1088
-				'PRC_ID' => !empty( $prc['PRC_ID'] ) ? $prc['PRC_ID'] : NULL,
1089
-				'PRT_ID' => !empty( $prc['PRT_ID'] ) ? $prc['PRT_ID'] : NULL,
1090
-				'PRC_amount' => !empty( $prc['PRC_amount'] ) ? $prc['PRC_amount'] : 0,
1091
-				'PRC_name' => !empty( $prc['PRC_name'] ) ? $prc['PRC_name'] : '',
1092
-				'PRC_desc' => !empty( $prc['PRC_desc'] ) ? $prc['PRC_desc'] : '',
1088
+				'PRC_ID' => ! empty($prc['PRC_ID']) ? $prc['PRC_ID'] : NULL,
1089
+				'PRT_ID' => ! empty($prc['PRT_ID']) ? $prc['PRT_ID'] : NULL,
1090
+				'PRC_amount' => ! empty($prc['PRC_amount']) ? $prc['PRC_amount'] : 0,
1091
+				'PRC_name' => ! empty($prc['PRC_name']) ? $prc['PRC_name'] : '',
1092
+				'PRC_desc' => ! empty($prc['PRC_desc']) ? $prc['PRC_desc'] : '',
1093 1093
 				'PRC_is_default' => 0, //make sure prices are NOT set as default from this context
1094 1094
 				'PRC_order' => $row
1095 1095
 				);
1096 1096
 
1097
-			if ( $new_prices || empty( $PRC_values['PRC_ID'] ) ) {
1097
+			if ($new_prices || empty($PRC_values['PRC_ID'])) {
1098 1098
 				$PRC_values['PRC_ID'] = 0;
1099
-				$PRC = EE_Registry::instance()->load_class('Price', array( $PRC_values ), FALSE, FALSE);
1099
+				$PRC = EE_Registry::instance()->load_class('Price', array($PRC_values), FALSE, FALSE);
1100 1100
 			} else {
1101
-				$PRC = EE_Registry::instance()->load_model( 'Price' )->get_one_by_ID( $prc['PRC_ID'] );
1101
+				$PRC = EE_Registry::instance()->load_model('Price')->get_one_by_ID($prc['PRC_ID']);
1102 1102
 				//update this price with new values
1103
-				foreach ( $PRC_values as $field => $newprc ) {
1104
-					$PRC->set( $field, $newprc );
1103
+				foreach ($PRC_values as $field => $newprc) {
1104
+					$PRC->set($field, $newprc);
1105 1105
 				}
1106 1106
 				$PRC->save();
1107 1107
 			}
1108 1108
 
1109
-			$PRC = $ticket->_add_relation_to( $PRC, 'Price' );
1109
+			$PRC = $ticket->_add_relation_to($PRC, 'Price');
1110 1110
 		}
1111 1111
 	}
1112 1112
 
@@ -1129,33 +1129,33 @@  discard block
 block discarded – undo
1129 1129
 
1130 1130
 		return; //TEMPORARILY EXITING CAUSE THIS IS A TODO
1131 1131
 
1132
-		$postid = isset( $this->_req_data['post_ID'] ) ? $this->_req_data['post_ID'] : NULL;
1132
+		$postid = isset($this->_req_data['post_ID']) ? $this->_req_data['post_ID'] : NULL;
1133 1133
 
1134 1134
 
1135 1135
 		//if no postid then get out cause we need it for stuff in here
1136
-		if ( empty( $postid ) ) return;
1136
+		if (empty($postid)) return;
1137 1137
 
1138 1138
 
1139 1139
 		//handle datetime saves
1140 1140
 		$items = array();
1141 1141
 
1142
-		$get_one_where = array( $this->_event_model()->primary_key_name() => $postid );
1143
-		$event = $this->_event_model()->get_one( array($get_one_where) );
1142
+		$get_one_where = array($this->_event_model()->primary_key_name() => $postid);
1143
+		$event = $this->_event_model()->get_one(array($get_one_where));
1144 1144
 
1145 1145
 		//now let's get the attached datetimes from the most recent autosave
1146 1146
 		$dtts = $event->get_many_related('Datetime');
1147 1147
 
1148 1148
 		$dtt_ids = array();
1149
-		foreach( $dtts as $dtt ) {
1149
+		foreach ($dtts as $dtt) {
1150 1150
 			$dtt_ids[] = $dtt->ID();
1151 1151
 			$order = $dtt->order();
1152 1152
 			$this->_template_args['data']['items']['ID-'.$order] = $dtt->ID();
1153 1153
 		}
1154
-		$this->_template_args['data']['items']['datetime_IDS'] = serialize( $dtt_ids );
1154
+		$this->_template_args['data']['items']['datetime_IDS'] = serialize($dtt_ids);
1155 1155
 
1156 1156
 		//handle DECAF venues
1157 1157
 		//we need to make sure that the venue_id gets updated in the form so that future autosaves will properly conntect that venue to the event.
1158
-		if ( $do_venue_autosaves = apply_filters( 'FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', TRUE ) ) {
1158
+		if ($do_venue_autosaves = apply_filters('FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', TRUE)) {
1159 1159
 			$venue = $event->get_first_related('Venue');
1160 1160
 			$this->_template_args['data']['items']['venue-id'] = $venue->ID();
1161 1161
 		}
@@ -1166,23 +1166,23 @@  discard block
 block discarded – undo
1166 1166
 
1167 1167
 		$ticket_ids = array();
1168 1168
 		$price_ids = array();
1169
-		foreach ( $tickets as $ticket ) {
1169
+		foreach ($tickets as $ticket) {
1170 1170
 			$ticket_ids[] = $price->ID();
1171 1171
 			$ticket_order = $price->get('TKT_order');
1172
-			$this->_template_args['data']['items']['edit-ticket-id-' . $ticket_order] = $ticket->ID();
1173
-			$this->_template_args['data']['items']['edit-ticket-event-id-' . $order] = $event->ID();
1172
+			$this->_template_args['data']['items']['edit-ticket-id-'.$ticket_order] = $ticket->ID();
1173
+			$this->_template_args['data']['items']['edit-ticket-event-id-'.$order] = $event->ID();
1174 1174
 
1175 1175
 			//now we have to make sure the prices are updated appropriately
1176 1176
 			$prices = $ticket->get_many_related('Prices');
1177 1177
 
1178
-			foreach ( $prices as $price ) {
1178
+			foreach ($prices as $price) {
1179 1179
 				$price_ids[] = $price->ID();
1180 1180
 				$price_order = $price->get('PRC_order');
1181
-				$this->_template_args['data']['items']['quick-edit-ticket-price-id-ticketrow-' . $ticket_order . '-' . $price_order] = $price->ID();
1182
-				$this->_template_args['data']['items']['edit-ticket-price-id-ticketrow-' . $ticket_row . '-' . $price_row] = $price->ID();
1183
-				$this->_template_args['data']['items']['edit-ticket-price-is-default-ticketrow-' . $ticket_row . '-' . $price_row] = $price->get('PRC_is_default');
1181
+				$this->_template_args['data']['items']['quick-edit-ticket-price-id-ticketrow-'.$ticket_order.'-'.$price_order] = $price->ID();
1182
+				$this->_template_args['data']['items']['edit-ticket-price-id-ticketrow-'.$ticket_row.'-'.$price_row] = $price->ID();
1183
+				$this->_template_args['data']['items']['edit-ticket-price-is-default-ticketrow-'.$ticket_row.'-'.$price_row] = $price->get('PRC_is_default');
1184 1184
 			}
1185
-			$this->_template_args['data']['items']['price-IDs-ticketrow-' . $ticket_row] = implode(',', $price_ids);
1185
+			$this->_template_args['data']['items']['price-IDs-ticketrow-'.$ticket_row] = implode(',', $price_ids);
1186 1186
 		}
1187 1187
 		$this->_template_args['data']['items']['ticket-IDs'] = implode(',', $ticket_ids);
1188 1188
 	}
@@ -1200,26 +1200,26 @@  discard block
 block discarded – undo
1200 1200
 	private function _generate_publish_box_extra_content() {
1201 1201
 
1202 1202
 		//load formatter helper
1203
-  		EE_Registry::instance()->load_helper( 'Formatter' );
1203
+  		EE_Registry::instance()->load_helper('Formatter');
1204 1204
 
1205 1205
   		//args for getting related registrations
1206
-  		$approved_query_args = array( array( 'REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_approved ) );
1207
-  		$not_approved_query_args = array( array( 'REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_not_approved ) );
1208
-  		$pending_payment_query_args = array( array( 'REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_pending_payment ) );
1206
+  		$approved_query_args = array(array('REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_approved));
1207
+  		$not_approved_query_args = array(array('REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_not_approved));
1208
+  		$pending_payment_query_args = array(array('REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_pending_payment));
1209 1209
 
1210 1210
 
1211 1211
 		// publish box
1212
-		$publish_box_extra_args['view_approved_reg_url'] = add_query_arg(array('action' => 'default', 'event_id' => $this->_cpt_model_obj->ID(), '_reg_status' => EEM_Registration::status_id_approved ), REG_ADMIN_URL);
1213
-		$publish_box_extra_args['view_not_approved_reg_url'] = add_query_arg(array('action' => 'default', 'event_id' => $this->_cpt_model_obj->ID(), '_reg_status' => EEM_Registration::status_id_not_approved ), REG_ADMIN_URL);
1214
-		$publish_box_extra_args['view_pending_payment_reg_url'] = add_query_arg(array('action' => 'default', 'event_id' => $this->_cpt_model_obj->ID(), '_reg_status' => EEM_Registration::status_id_pending_payment ), REG_ADMIN_URL);
1212
+		$publish_box_extra_args['view_approved_reg_url'] = add_query_arg(array('action' => 'default', 'event_id' => $this->_cpt_model_obj->ID(), '_reg_status' => EEM_Registration::status_id_approved), REG_ADMIN_URL);
1213
+		$publish_box_extra_args['view_not_approved_reg_url'] = add_query_arg(array('action' => 'default', 'event_id' => $this->_cpt_model_obj->ID(), '_reg_status' => EEM_Registration::status_id_not_approved), REG_ADMIN_URL);
1214
+		$publish_box_extra_args['view_pending_payment_reg_url'] = add_query_arg(array('action' => 'default', 'event_id' => $this->_cpt_model_obj->ID(), '_reg_status' => EEM_Registration::status_id_pending_payment), REG_ADMIN_URL);
1215 1215
 		$publish_box_extra_args['approved_regs'] = $this->_cpt_model_obj->count_related('Registration', $approved_query_args);
1216 1216
 		$publish_box_extra_args['not_approved_regs'] = $this->_cpt_model_obj->count_related('Registration', $not_approved_query_args);
1217 1217
 		$publish_box_extra_args['pending_payment_regs'] = $this->_cpt_model_obj->count_related('Registration', $pending_payment_query_args);
1218
-		$publish_box_extra_args['misc_pub_section_class'] = apply_filters( 'FHEE_Events_Admin_Page___generate_publish_box_extra_content__misc_pub_section_class', 'misc-pub-section');
1218
+		$publish_box_extra_args['misc_pub_section_class'] = apply_filters('FHEE_Events_Admin_Page___generate_publish_box_extra_content__misc_pub_section_class', 'misc-pub-section');
1219 1219
 		//$publish_box_extra_args['email_attendees_url'] = add_query_arg(array('event_admin_reports' => 'event_newsletter', 'event_id' => $this->_cpt_model_obj->id), 'admin.php?page=espresso_registrations');
1220
-		$publish_box_extra_args['event_editor_overview_add'] = do_action( 'AHEE__Events_Admin_Page___generate_publish_box_extra_content__event_editor_overview_add', $this->_cpt_model_obj );
1220
+		$publish_box_extra_args['event_editor_overview_add'] = do_action('AHEE__Events_Admin_Page___generate_publish_box_extra_content__event_editor_overview_add', $this->_cpt_model_obj);
1221 1221
 		// load template
1222
-		EEH_Template::display_template( EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php', $publish_box_extra_args );
1222
+		EEH_Template::display_template(EVENTS_TEMPLATE_PATH.'event_publish_box_extras.template.php', $publish_box_extra_args);
1223 1223
 	}
1224 1224
 
1225 1225
 
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
 		$this->verify_cpt_object();
1252 1252
 		add_meta_box('espresso_event_editor_tickets', __('Event Datetime & Ticket', 'event_espresso'), array($this, 'ticket_metabox'), $this->page_slug, 'normal', 'high');
1253 1253
 		add_meta_box('espresso_event_editor_event_options', __('Event Registration Options', 'event_espresso'), array($this, 'registration_options_meta_box'), $this->page_slug, 'side', 'default');
1254
-		add_meta_box('espresso_event_editor_venue', __('Venue Details', 'event_espresso'), array( $this, 'venue_metabox' ), $this->page_slug, 'normal', 'core');
1254
+		add_meta_box('espresso_event_editor_venue', __('Venue Details', 'event_espresso'), array($this, 'venue_metabox'), $this->page_slug, 'normal', 'core');
1255 1255
 		//note if you're looking for other metaboxes in here, where a metabox has a related management page in the admin you will find it setup in the related management page's "_Hooks" file.  i.e. messages metabox is found in "espresso_events_Messages_Hooks.class.php".
1256 1256
 	}
1257 1257
 
@@ -1276,53 +1276,53 @@  discard block
 block discarded – undo
1276 1276
 			'disabled' => ''
1277 1277
 			);
1278 1278
 
1279
-		$event_id = is_object( $this->_cpt_model_obj ) ? $this->_cpt_model_obj->ID() : NULL;
1279
+		$event_id = is_object($this->_cpt_model_obj) ? $this->_cpt_model_obj->ID() : NULL;
1280 1280
 
1281
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1281
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1282 1282
 
1283 1283
 		/**
1284 1284
 		 * 1. Start with retrieving Datetimes
1285 1285
 		 * 2. Fore each datetime get related tickets
1286 1286
 		 * 3. For each ticket get related prices
1287 1287
 		 */
1288
-		$times = EE_Registry::instance()->load_model('Datetime' )->get_all_event_dates( $event_id );
1289
-		EE_Registry::instance()->load_helper('DTT_Helper' );
1288
+		$times = EE_Registry::instance()->load_model('Datetime')->get_all_event_dates($event_id);
1289
+		EE_Registry::instance()->load_helper('DTT_Helper');
1290 1290
 
1291 1291
 		$firstdtt = array_slice($times, 0, 1);
1292 1292
 		//do we get related tickets?
1293
-		if ( $firstdtt[0]->get('DTT_ID') !== 0 ) {
1294
-			foreach ( $times as $time ) {
1293
+		if ($firstdtt[0]->get('DTT_ID') !== 0) {
1294
+			foreach ($times as $time) {
1295 1295
 				$existing_datetime_ids[] = $time->get('DTT_ID');
1296 1296
 				$template_args['time'] = $time;
1297
-				$related_tickets = $time->get_many_related('Ticket', array( array( 'OR' => array( 'TKT_deleted' => 1, 'TKT_deleted*' => 0 ) ), 'default_where_conditions' => 'none' ) );
1297
+				$related_tickets = $time->get_many_related('Ticket', array(array('OR' => array('TKT_deleted' => 1, 'TKT_deleted*' => 0)), 'default_where_conditions' => 'none'));
1298 1298
 
1299
-				if ( !empty($related_tickets) ) {
1299
+				if ( ! empty($related_tickets)) {
1300 1300
 					$template_args['total_ticket_rows'] = count($related_tickets);
1301 1301
 					$row = 0;
1302
-					foreach ( $related_tickets as $ticket ) {
1302
+					foreach ($related_tickets as $ticket) {
1303 1303
 						$existing_ticket_ids[] = $ticket->get('TKT_ID');
1304
-						$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, FALSE, $row );
1304
+						$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, FALSE, $row);
1305 1305
 
1306 1306
 						$row++;
1307 1307
 					}
1308 1308
 				} else {
1309 1309
 					$template_args['total_ticket_rows'] = 1;
1310 1310
 					$ticket = EE_Registry::instance()->load_model('Ticket')->create_default_object();
1311
-					$template_args['ticket_rows'] .= $this->_get_ticket_row( $ticket );
1311
+					$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket);
1312 1312
 				}
1313 1313
 			}
1314 1314
 		} else {
1315 1315
 			$template_args['time'] = $times[0];
1316 1316
 			$ticket = EE_Registry::instance()->load_model('Ticket')->get_all_default_tickets();
1317
-			$template_args['ticket_rows'] .= $this->_get_ticket_row( $ticket[1] ); //note we're just sending the first default row (decaf can't manage default tickets so this should be sufficent);
1317
+			$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket[1]); //note we're just sending the first default row (decaf can't manage default tickets so this should be sufficent);
1318 1318
 		}
1319 1319
 
1320 1320
 		$template_args['event_datetime_help_link'] = $this->_get_help_tab_link('event_editor_event_datetimes_help_tab');
1321 1321
 		$template_args['ticket_options_help_link'] = $this->_get_help_tab_link('ticket_options_info');
1322 1322
 		$template_args['existing_datetime_ids'] = implode(',', $existing_datetime_ids);
1323 1323
 		$template_args['existing_ticket_ids'] = implode(',', $existing_ticket_ids);
1324
-		$template_args['ticket_js_structure'] = $this->_get_ticket_row( EE_Registry::instance()->load_model('Ticket')->create_default_object(), TRUE );
1325
-		$template = apply_filters( 'FHEE__Events_Admin_Page__ticket_metabox__template', EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php' );
1324
+		$template_args['ticket_js_structure'] = $this->_get_ticket_row(EE_Registry::instance()->load_model('Ticket')->create_default_object(), TRUE);
1325
+		$template = apply_filters('FHEE__Events_Admin_Page__ticket_metabox__template', EVENTS_TEMPLATE_PATH.'event_tickets_metabox_main.template.php');
1326 1326
 		EEH_Template::display_template($template, $template_args);
1327 1327
 	}
1328 1328
 
@@ -1336,21 +1336,21 @@  discard block
 block discarded – undo
1336 1336
 	 * @param  boolean    $skeleton whether we're generating a skeleton for js manipulation
1337 1337
 	 * @return string               generated html for the ticket row.
1338 1338
 	 */
1339
-	private function _get_ticket_row( $ticket, $skeleton = FALSE, $row = 0 ) {
1339
+	private function _get_ticket_row($ticket, $skeleton = FALSE, $row = 0) {
1340 1340
 		$template_args = array(
1341
-			'tkt_status_class' => ' tkt-status-' . $ticket->ticket_status(),
1342
-			'tkt_archive_class' => $ticket->ticket_status() === EE_Ticket::archived && !$skeleton ? ' tkt-archived' : '',
1341
+			'tkt_status_class' => ' tkt-status-'.$ticket->ticket_status(),
1342
+			'tkt_archive_class' => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived' : '',
1343 1343
 			'ticketrow' => $skeleton ? 'TICKETNUM' : $row,
1344 1344
 			'TKT_ID' => $ticket->get('TKT_ID'),
1345 1345
 			'TKT_name' => $ticket->get('TKT_name'),
1346 1346
 			'TKT_start_date' => $skeleton ? '' : $ticket->get_date('TKT_start_date', 'Y-m-d h:i a'),
1347 1347
 			'TKT_end_date' => $skeleton ? '' : $ticket->get_date('TKT_end_date', 'Y-m-d h:i a'),
1348 1348
 			'TKT_is_default' => $ticket->get('TKT_is_default'),
1349
-			'TKT_qty' => $ticket->get_pretty('TKT_qty','input'),
1349
+			'TKT_qty' => $ticket->get_pretty('TKT_qty', 'input'),
1350 1350
 			'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1351 1351
 			'TKT_sold' => $skeleton ? 0 : $ticket->get('TKT_sold'),
1352
-			'trash_icon' => ( $skeleton || ( !empty( $ticket ) && ! $ticket->get('TKT_deleted') ) ) && ( !empty( $ticket ) && $ticket->get('TKT_sold') === 0 ) ? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1353
-			'disabled' => $skeleton || ( !empty( $ticket ) && ! $ticket->get('TKT_deleted' ) ) ? '' : ' disabled=disabled'
1352
+			'trash_icon' => ($skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted'))) && ( ! empty($ticket) && $ticket->get('TKT_sold') === 0) ? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1353
+			'disabled' => $skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted')) ? '' : ' disabled=disabled'
1354 1354
 			);
1355 1355
 
1356 1356
 		$price = $ticket->ID() !== 0 ? $ticket->get_first_related('Price', array('default_where_conditions' => 'none')) : EE_Registry::instance()->load_model('Price')->create_default_object();
@@ -1366,23 +1366,23 @@  discard block
 block discarded – undo
1366 1366
 
1367 1367
 		//make sure we have default start and end dates if skeleton
1368 1368
 		//handle rows that should NOT be empty
1369
-		if ( empty( $template_args['TKT_start_date'] ) ) {
1369
+		if (empty($template_args['TKT_start_date'])) {
1370 1370
 			//if empty then the start date will be now.
1371 1371
 			$template_args['TKT_start_date'] = date('Y-m-d h:i a', current_time('timestamp'));
1372 1372
 		}
1373 1373
 
1374
-		if ( empty( $template_args['TKT_end_date'] ) ) {
1374
+		if (empty($template_args['TKT_end_date'])) {
1375 1375
 			//get the earliest datetime (if present);
1376
-			$earliest_dtt = $this->_cpt_model_obj->ID() > 0 ? $this->_cpt_model_obj->get_first_related('Datetime', array('order_by'=> array('DTT_EVT_start' => 'ASC' ) ) ) : NULL;
1376
+			$earliest_dtt = $this->_cpt_model_obj->ID() > 0 ? $this->_cpt_model_obj->get_first_related('Datetime', array('order_by'=> array('DTT_EVT_start' => 'ASC'))) : NULL;
1377 1377
 
1378
-			if ( !empty( $earliest_dtt ) )
1378
+			if ( ! empty($earliest_dtt))
1379 1379
 				$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1380 1380
 			else
1381
-				$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d")+7, date("Y") ) );
1381
+				$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d") + 7, date("Y")));
1382 1382
 		}
1383 1383
 
1384
-		$template_args = array_merge( $template_args, $price_args );
1385
-		$template = apply_filters( 'FHEE__Events_Admin_Page__get_ticket_row__template', EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php', $ticket);
1384
+		$template_args = array_merge($template_args, $price_args);
1385
+		$template = apply_filters('FHEE__Events_Admin_Page__get_ticket_row__template', EVENTS_TEMPLATE_PATH.'event_tickets_metabox_ticket_row.template.php', $ticket);
1386 1386
 		return EEH_Template::display_template($template, $template_args, TRUE);
1387 1387
 	}
1388 1388
 
@@ -1395,7 +1395,7 @@  discard block
 block discarded – undo
1395 1395
 			array('id' => false, 'text' => __('No', 'event_espresso'))
1396 1396
 		);
1397 1397
 
1398
-		$default_reg_status_values = EEM_Registration::reg_status_array(array(EEM_Registration::status_id_cancelled, EEM_Registration::status_id_declined, EEM_Registration::status_id_incomplete ), TRUE);
1398
+		$default_reg_status_values = EEM_Registration::reg_status_array(array(EEM_Registration::status_id_cancelled, EEM_Registration::status_id_declined, EEM_Registration::status_id_incomplete), TRUE);
1399 1399
 
1400 1400
 		//$template_args['is_active_select'] = EEH_Form_Fields::select_input('is_active', $yes_no_values, $this->_cpt_model_obj->is_active());
1401 1401
 		$template_args['_event'] = $this->_cpt_model_obj;
@@ -1404,8 +1404,8 @@  discard block
 block discarded – undo
1404 1404
 		$template_args['default_registration_status'] = EEH_Form_Fields::select_input('default_reg_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status());
1405 1405
 		$template_args['display_description'] = EEH_Form_Fields::select_input('display_desc', $yes_no_values, $this->_cpt_model_obj->display_description());
1406 1406
 		$template_args['display_ticket_selector'] = EEH_Form_Fields::select_input('display_ticket_selector', $yes_no_values, $this->_cpt_model_obj->display_ticket_selector(), '', '', false);
1407
-		$template_args['additional_registration_options'] = apply_filters( 'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options', '', $template_args, $yes_no_values, $default_reg_status_values );
1408
-		$templatepath = EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php';
1407
+		$template_args['additional_registration_options'] = apply_filters('FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options', '', $template_args, $yes_no_values, $default_reg_status_values);
1408
+		$templatepath = EVENTS_TEMPLATE_PATH.'event_registration_options.template.php';
1409 1409
 		EEH_Template::display_template($templatepath, $template_args);
1410 1410
 	}
1411 1411
 
@@ -1419,14 +1419,14 @@  discard block
 block discarded – undo
1419 1419
 
1420 1420
 		//first let's see if we have a venue already
1421 1421
 		$event_id = $this->_cpt_model_obj->ID();
1422
-		$venue = !empty( $event_id ) ? $this->_cpt_model_obj->venues() : NULL;
1423
-		$venue = empty( $venue ) ? EE_Registry::instance()->load_model('Venue')->create_default_object() : array_shift( $venue );
1422
+		$venue = ! empty($event_id) ? $this->_cpt_model_obj->venues() : NULL;
1423
+		$venue = empty($venue) ? EE_Registry::instance()->load_model('Venue')->create_default_object() : array_shift($venue);
1424 1424
 		$template_args['_venue'] = $venue;
1425 1425
 
1426 1426
 		$template_args['states_dropdown'] = EEH_Form_Fields::generate_form_input(
1427 1427
 			$QFI = new EE_Question_Form_Input(
1428
-				EE_Question::new_instance( array( 'QST_display_text' => 'State', 'QST_system' => 'state' )),
1429
-				EE_Answer::new_instance( array(  'ANS_value'=> $venue->state_ID() )),
1428
+				EE_Question::new_instance(array('QST_display_text' => 'State', 'QST_system' => 'state')),
1429
+				EE_Answer::new_instance(array('ANS_value'=> $venue->state_ID())),
1430 1430
 				array(
1431 1431
 					'input_name' =>  'state',
1432 1432
 					'input_id' => 'phys-state',
@@ -1438,8 +1438,8 @@  discard block
 block discarded – undo
1438 1438
 		);
1439 1439
 		$template_args['countries_dropdown'] = EEH_Form_Fields::generate_form_input(
1440 1440
 			$QFI = new EE_Question_Form_Input(
1441
-				EE_Question::new_instance( array( 'QST_display_text' => 'Country', 'QST_system' => 'country' )),
1442
-				EE_Answer::new_instance( array(  'ANS_value'=> $venue->country_ID() )),
1441
+				EE_Question::new_instance(array('QST_display_text' => 'Country', 'QST_system' => 'country')),
1442
+				EE_Answer::new_instance(array('ANS_value'=> $venue->country_ID())),
1443 1443
 				array(
1444 1444
 					'input_name' =>  'countries',
1445 1445
 					'input_id' => 'phys-country',
@@ -1450,8 +1450,8 @@  discard block
 block discarded – undo
1450 1450
 			)
1451 1451
 		);
1452 1452
 
1453
-		$template_path = EVENTS_TEMPLATE_PATH . 'event_venues_metabox_content.template.php';
1454
-		EEH_Template::display_template( $template_path, $template_args );
1453
+		$template_path = EVENTS_TEMPLATE_PATH.'event_venues_metabox_content.template.php';
1454
+		EEH_Template::display_template($template_path, $template_args);
1455 1455
 	}
1456 1456
 
1457 1457
 
@@ -1478,21 +1478,21 @@  discard block
 block discarded – undo
1478 1478
 		$EEME = $this->_event_model();
1479 1479
 
1480 1480
 		$offset = ($current_page - 1) * $per_page;
1481
-		$limit = $count ? NULL : $offset . ',' . $per_page;
1481
+		$limit = $count ? NULL : $offset.','.$per_page;
1482 1482
 		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1483 1483
 		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : "DESC";
1484 1484
 
1485 1485
 		if (isset($this->_req_data['month_range'])) {
1486 1486
 			$pieces = explode(' ', $this->_req_data['month_range'], 3);
1487
-			$month_r = !empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
1488
-			$year_r = !empty($pieces[1]) ? $pieces[1] : '';
1487
+			$month_r = ! empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
1488
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1489 1489
 		}
1490 1490
 
1491 1491
 		$where = array();
1492 1492
 
1493
-		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL;
1493
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : NULL;
1494 1494
 		//determine what post_status our condition will have for the query.
1495
-		switch ( $status ) {
1495
+		switch ($status) {
1496 1496
 			case 'month' :
1497 1497
 			case 'today' :
1498 1498
 			case NULL :
@@ -1500,7 +1500,7 @@  discard block
 block discarded – undo
1500 1500
 				break;
1501 1501
 
1502 1502
 			case 'draft' :
1503
-				$where['status'] = array( 'IN', array('draft', 'auto-draft') );
1503
+				$where['status'] = array('IN', array('draft', 'auto-draft'));
1504 1504
 				break;
1505 1505
 
1506 1506
 			default :
@@ -1508,46 +1508,46 @@  discard block
 block discarded – undo
1508 1508
 		}
1509 1509
 
1510 1510
 		//categories?
1511
-		$category = isset( $this->_req_data['EVT_CAT'] ) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
1511
+		$category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
1512 1512
 
1513
-		if ( !empty ( $category ) ) {
1513
+		if ( ! empty ($category)) {
1514 1514
 			$where['Term_Taxonomy.taxonomy'] = 'espresso_event_categories';
1515 1515
 			$where['Term_Taxonomy.term_id'] = $category;
1516 1516
 		}
1517 1517
 
1518 1518
 		//date where conditions
1519 1519
 		if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] != '') {
1520
-			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array( strtotime($year_r . '-' . $month_r . '-01 00:00:00'), strtotime($year_r . '-' . $month_r . '-31 23:59:59' ) ) );
1520
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array(strtotime($year_r.'-'.$month_r.'-01 00:00:00'), strtotime($year_r.'-'.$month_r.'-31 23:59:59')));
1521 1521
 		} else if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'today') {
1522
-			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array( strtotime(date('Y-m-d') . ' 0:00:00'), strtotime(date('Y-m-d') . ' 23:59:59') ) );
1523
-		} else if ( isset($this->_req_data['status']) && $this->_req_data['status'] == 'month' ) {
1522
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array(strtotime(date('Y-m-d').' 0:00:00'), strtotime(date('Y-m-d').' 23:59:59')));
1523
+		} else if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'month') {
1524 1524
 			$this_year_r = date('Y');
1525 1525
 			$this_month_r = date('m');
1526 1526
 			$days_this_month = date('t');
1527 1527
 			$start = ' 00:00:00';
1528 1528
 			$end = ' 23:59:59';
1529
-			$where['Datetime.DTT_EVT_start'] = array( 'BETWEEN', array( strtotime($this_year_r . '-' . $this_month_r . '-01' . $start), strtotime($this_year_r . '-' . $this_month_r . '-' . $days_this_month . $end) ) );
1529
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array(strtotime($this_year_r.'-'.$this_month_r.'-01'.$start), strtotime($this_year_r.'-'.$this_month_r.'-'.$days_this_month.$end)));
1530 1530
 		}
1531 1531
 
1532 1532
 		//possible conditions for capability checks
1533
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_events', 'get_events') ) {
1534
-			$where['status**'] = array( '!=', 'private' );
1533
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
1534
+			$where['status**'] = array('!=', 'private');
1535 1535
 		}
1536 1536
 
1537
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {
1538
-			$where['EVT_wp_user'] =  get_current_user_id();
1537
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1538
+			$where['EVT_wp_user'] = get_current_user_id();
1539 1539
 		}
1540 1540
 
1541
-		if ( isset( $this->_req_data['EVT_wp_user'] ) ) {
1542
-			if ( $this->_req_data['EVT_wp_user'] != get_current_user_id() && EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {
1541
+		if (isset($this->_req_data['EVT_wp_user'])) {
1542
+			if ($this->_req_data['EVT_wp_user'] != get_current_user_id() && EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1543 1543
 				$where['EVT_wp_user'] = $this->_req_data['EVT_wp_user'];
1544 1544
 			}
1545 1545
 		}
1546 1546
 
1547 1547
 
1548 1548
 		//search query handling
1549
-		if ( isset( $this->_req_data['s'] ) ) {
1550
-			$search_string = '%' . $this->_req_data['s'] . '%';
1549
+		if (isset($this->_req_data['s'])) {
1550
+			$search_string = '%'.$this->_req_data['s'].'%';
1551 1551
 			$where['OR'] = array(
1552 1552
 				'EVT_name' => array('LIKE', $search_string),
1553 1553
 				'EVT_desc' => array('LIKE', $search_string),
@@ -1556,32 +1556,32 @@  discard block
 block discarded – undo
1556 1556
 		}
1557 1557
 
1558 1558
 
1559
-		$where = apply_filters( 'FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data );
1560
-		$query_params = apply_filters( 'FHEE__Events_Admin_Page__get_events__query_params', array($where, 'limit' => $limit, 'order_by' => $orderby, 'order' => $order, 'group_by' => 'EVT_ID' ), $this->_req_data );
1559
+		$where = apply_filters('FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data);
1560
+		$query_params = apply_filters('FHEE__Events_Admin_Page__get_events__query_params', array($where, 'limit' => $limit, 'order_by' => $orderby, 'order' => $order, 'group_by' => 'EVT_ID'), $this->_req_data);
1561 1561
 
1562 1562
 
1563 1563
 		//let's first check if we have special requests coming in.
1564
-		if ( isset( $this->_req_data['active_status'] ) ) {
1565
-			switch ( $this->_req_data['active_status'] ) {
1564
+		if (isset($this->_req_data['active_status'])) {
1565
+			switch ($this->_req_data['active_status']) {
1566 1566
 				case 'upcoming' :
1567
-					return $EEME->get_upcoming_events( $query_params, $count );
1567
+					return $EEME->get_upcoming_events($query_params, $count);
1568 1568
 					break;
1569 1569
 
1570 1570
 				case 'expired' :
1571
-					return $EEME->get_expired_events( $query_params, $count );
1571
+					return $EEME->get_expired_events($query_params, $count);
1572 1572
 					break;
1573 1573
 
1574 1574
 				case 'active' :
1575
-					return $EEME->get_active_events( $query_params, $count );
1575
+					return $EEME->get_active_events($query_params, $count);
1576 1576
 					break;
1577 1577
 
1578 1578
 				case 'inactive' :
1579
-					return $EEME->get_inactive_events( $query_params, $count );
1579
+					return $EEME->get_inactive_events($query_params, $count);
1580 1580
 					break;
1581 1581
 			}
1582 1582
 		}
1583 1583
 
1584
-		$events = $count ? $EEME->count( array( $where ), 'EVT_ID' ) : $EEME->get_all( $query_params );
1584
+		$events = $count ? $EEME->count(array($where), 'EVT_ID') : $EEME->get_all($query_params);
1585 1585
 
1586 1586
 		return $events;
1587 1587
 	}
@@ -1590,23 +1590,23 @@  discard block
 block discarded – undo
1590 1590
 
1591 1591
 
1592 1592
 	//handling for WordPress CPT actions (trash, restore, delete)
1593
-	public function trash_cpt_item( $post_id ) {
1593
+	public function trash_cpt_item($post_id) {
1594 1594
 		$this->_req_data['EVT_ID'] = $post_id;
1595
-		$this->_trash_or_restore_event( 'trash', FALSE );
1595
+		$this->_trash_or_restore_event('trash', FALSE);
1596 1596
 	}
1597 1597
 
1598 1598
 
1599 1599
 
1600 1600
 
1601
-	public function restore_cpt_item( $post_id ) {
1601
+	public function restore_cpt_item($post_id) {
1602 1602
 		$this->_req_data['EVT_ID'] = $post_id;
1603
-		$this->_trash_or_restore_event( 'draft', FALSE );
1603
+		$this->_trash_or_restore_event('draft', FALSE);
1604 1604
 	}
1605 1605
 
1606 1606
 
1607
-	public function delete_cpt_item( $post_id ) {
1607
+	public function delete_cpt_item($post_id) {
1608 1608
 		$this->_req_data['EVT_ID'] = $post_id;
1609
-		$this->_delete_event( FALSE );
1609
+		$this->_delete_event(FALSE);
1610 1610
 	}
1611 1611
 
1612 1612
 
@@ -1618,7 +1618,7 @@  discard block
 block discarded – undo
1618 1618
 	 * @param  string $event_status
1619 1619
 	 * @return void
1620 1620
 	 */
1621
-	protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = TRUE ) {
1621
+	protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = TRUE) {
1622 1622
 		//determine the event id and set to array.
1623 1623
 		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : FALSE;
1624 1624
 		// loop thru events
@@ -1626,7 +1626,7 @@  discard block
 block discarded – undo
1626 1626
 			// clean status
1627 1627
 			$event_status = sanitize_key($event_status);
1628 1628
 			// grab status
1629
-			if (!empty($event_status)) {
1629
+			if ( ! empty($event_status)) {
1630 1630
 				$success = $this->_change_event_status($EVT_ID, $event_status);
1631 1631
 			} else {
1632 1632
 				$success = FALSE;
@@ -1640,7 +1640,7 @@  discard block
 block discarded – undo
1640 1640
 		}
1641 1641
 		$action = $event_status == 'trash' ? 'moved to the trash' : 'restored from the trash';
1642 1642
 
1643
-		if ( $redirect_after )
1643
+		if ($redirect_after)
1644 1644
 			$this->_redirect_after_action($success, 'Event', $action, array('action' => 'default'));
1645 1645
 	}
1646 1646
 
@@ -1655,7 +1655,7 @@  discard block
 block discarded – undo
1655 1655
 		// clean status
1656 1656
 		$event_status = sanitize_key($event_status);
1657 1657
 		// grab status
1658
-		if (!empty($event_status)) {
1658
+		if ( ! empty($event_status)) {
1659 1659
 			$success = TRUE;
1660 1660
 			//determine the event id and set to array.
1661 1661
 			$EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : array();
@@ -1692,13 +1692,13 @@  discard block
 block discarded – undo
1692 1692
 	 */
1693 1693
 	private function _change_event_status($EVT_ID = FALSE, $event_status = FALSE) {
1694 1694
 		// grab event id
1695
-		if (!$EVT_ID) {
1695
+		if ( ! $EVT_ID) {
1696 1696
 			$msg = __('An error occurred. No Event ID or an invalid Event ID was received.', 'event_espresso');
1697 1697
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1698 1698
 			return FALSE;
1699 1699
 		}
1700 1700
 
1701
-		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID( $EVT_ID );
1701
+		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
1702 1702
 
1703 1703
 		// clean status
1704 1704
 		$event_status = sanitize_key($event_status);
@@ -1724,7 +1724,7 @@  discard block
 block discarded – undo
1724 1724
 				$hook = FALSE;
1725 1725
 		}
1726 1726
 		//use class to change status
1727
-		$this->_cpt_model_obj->set_status( $event_status );
1727
+		$this->_cpt_model_obj->set_status($event_status);
1728 1728
 		$success = $this->_cpt_model_obj->save();
1729 1729
 
1730 1730
 		if ($success === FALSE) {
@@ -1744,15 +1744,15 @@  discard block
 block discarded – undo
1744 1744
 	 * @access protected
1745 1745
 	 * @return void
1746 1746
 	 */
1747
-	protected function _delete_event( $redirect_after = TRUE ) {
1747
+	protected function _delete_event($redirect_after = TRUE) {
1748 1748
 		//determine the event id and set to array.
1749 1749
 		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : NULL;
1750
-		$EVT_ID = isset( $this->_req_data['post'] ) ? absint( $this->_req_data['post'] ) : $EVT_ID;
1750
+		$EVT_ID = isset($this->_req_data['post']) ? absint($this->_req_data['post']) : $EVT_ID;
1751 1751
 
1752 1752
 
1753 1753
 		// loop thru events
1754 1754
 		if ($EVT_ID) {
1755
-			$success = $this->_permanently_delete_event( $EVT_ID );
1755
+			$success = $this->_permanently_delete_event($EVT_ID);
1756 1756
 			// get list of events with no prices
1757 1757
 			$espresso_no_ticket_prices = get_option('ee_no_ticket_prices', array());
1758 1758
 			// remove this event from the list of events with no prices
@@ -1766,7 +1766,7 @@  discard block
 block discarded – undo
1766 1766
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1767 1767
 		}
1768 1768
 
1769
-		if ( $redirect_after )
1769
+		if ($redirect_after)
1770 1770
 			$this->_redirect_after_action($success, 'Event', 'deleted', array('action' => 'default', 'status' => 'trash'));
1771 1771
 	}
1772 1772
 
@@ -1812,7 +1812,7 @@  discard block
 block discarded – undo
1812 1812
 	 */
1813 1813
 	private function _permanently_delete_event($EVT_ID = FALSE) {
1814 1814
 		// grab event id
1815
-		if (!$EVT_ID = absint($EVT_ID)) {
1815
+		if ( ! $EVT_ID = absint($EVT_ID)) {
1816 1816
 			$msg = __('An error occurred. No Event ID or an invalid Event ID was received.', 'event_espresso');
1817 1817
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1818 1818
 			return FALSE;
@@ -1823,10 +1823,10 @@  discard block
 block discarded – undo
1823 1823
 
1824 1824
 		//need to delete related tickets and prices first.
1825 1825
 		$datetimes = $this->_cpt_model_obj->get_many_related('Datetime');
1826
-		foreach ( $datetimes as $datetime ) {
1826
+		foreach ($datetimes as $datetime) {
1827 1827
 			$this->_cpt_model_obj->_remove_relation_to($datetime, 'Datetime');
1828 1828
 			$tickets = $datetime->get_many_related('Ticket');
1829
-			foreach ( $tickets as $ticket ) {
1829
+			foreach ($tickets as $ticket) {
1830 1830
 				$ticket->_remove_relation_to($datetime, 'Datetime');
1831 1831
 				$ticket->delete_related_permanently('Price');
1832 1832
 				$ticket->delete_permanently();
@@ -1836,14 +1836,14 @@  discard block
 block discarded – undo
1836 1836
 
1837 1837
 		//what about related venues or terms?
1838 1838
 		$venues = $this->_cpt_model_obj->get_many_related('Venue');
1839
-		foreach ( $venues as $venue ) {
1839
+		foreach ($venues as $venue) {
1840 1840
 			$this->_cpt_model_obj->_remove_relation_to($venue, 'Venue');
1841 1841
 		}
1842 1842
 
1843 1843
 		//any attached question groups?
1844 1844
 		$question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
1845
-		if ( !empty( $question_groups ) ) {
1846
-			foreach ( $question_groups as $question_group ) {
1845
+		if ( ! empty($question_groups)) {
1846
+			foreach ($question_groups as $question_group) {
1847 1847
 				$this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
1848 1848
 			}
1849 1849
 		}
@@ -1852,13 +1852,13 @@  discard block
 block discarded – undo
1852 1852
 
1853 1853
 
1854 1854
 		//Message Template Groups
1855
-		$this->_cpt_model_obj->_remove_relations( 'Message_Template_Group' );
1855
+		$this->_cpt_model_obj->_remove_relations('Message_Template_Group');
1856 1856
 
1857 1857
 
1858 1858
 		//term taxonomies
1859 1859
 		$term_taxonomies = $this->_cpt_model_obj->term_taxonomies();
1860 1860
 
1861
-		foreach ( $term_taxonomies as $term_taxonomy ) {
1861
+		foreach ($term_taxonomies as $term_taxonomy) {
1862 1862
 			$this->_cpt_model_obj->remove_relation_to_term_taxonomy($term_taxonomy);
1863 1863
 		}
1864 1864
 
@@ -1872,7 +1872,7 @@  discard block
 block discarded – undo
1872 1872
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1873 1873
 			return FALSE;
1874 1874
 		}
1875
-		do_action( 'AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted' );
1875
+		do_action('AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted');
1876 1876
 		return TRUE;
1877 1877
 	}
1878 1878
 
@@ -1889,7 +1889,7 @@  discard block
 block discarded – undo
1889 1889
 	 */
1890 1890
 	public function total_events() {
1891 1891
 
1892
-		$count = EEM_Event::instance()->count( array(), 'EVT_ID' );
1892
+		$count = EEM_Event::instance()->count(array(), 'EVT_ID');
1893 1893
 		return $count;
1894 1894
 	}
1895 1895
 
@@ -1904,10 +1904,10 @@  discard block
 block discarded – undo
1904 1904
 	 */
1905 1905
 	public function total_events_draft() {
1906 1906
 		$where = array(
1907
-			'status' => array( 'IN', array('draft', 'auto-draft' ) )
1907
+			'status' => array('IN', array('draft', 'auto-draft'))
1908 1908
 			);
1909 1909
 
1910
-		$count = EEM_Event::instance()->count( array( $where ), 'EVT_ID' );
1910
+		$count = EEM_Event::instance()->count(array($where), 'EVT_ID');
1911 1911
 		return $count;
1912 1912
 	}
1913 1913
 
@@ -1926,7 +1926,7 @@  discard block
 block discarded – undo
1926 1926
 			'status' => 'trash'
1927 1927
 			);
1928 1928
 
1929
-		$count = EEM_Event::instance()->count( array( $where ), 'EVT_ID' );
1929
+		$count = EEM_Event::instance()->count(array($where), 'EVT_ID');
1930 1930
 		return $count;
1931 1931
 	}
1932 1932
 
@@ -1954,11 +1954,11 @@  discard block
 block discarded – undo
1954 1954
 			// translated
1955 1955
 			TRUE
1956 1956
 		);
1957
-		$this->_template_args['default_reg_status'] = isset( EE_Registry::instance()->CFG->registration->default_STS_ID ) ? sanitize_text_field( EE_Registry::instance()->CFG->registration->default_STS_ID ) : EEM_Registration::status_id_pending_payment;
1957
+		$this->_template_args['default_reg_status'] = isset(EE_Registry::instance()->CFG->registration->default_STS_ID) ? sanitize_text_field(EE_Registry::instance()->CFG->registration->default_STS_ID) : EEM_Registration::status_id_pending_payment;
1958 1958
 
1959 1959
 		$this->_set_add_edit_form_tags('update_default_event_settings');
1960 1960
 		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
1961
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template(EVENTS_TEMPLATE_PATH . 'event_settings.template.php', $this->_template_args, TRUE);
1961
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(EVENTS_TEMPLATE_PATH.'event_settings.template.php', $this->_template_args, TRUE);
1962 1962
 		$this->display_admin_page_with_sidebar();
1963 1963
 	}
1964 1964
 
@@ -1986,22 +1986,22 @@  discard block
 block discarded – undo
1986 1986
 	 * @return void
1987 1987
 	 */
1988 1988
 	private function _set_category_object() {
1989
-		if ( isset( $this->_category->id ) && !empty( $this->_category->id ) )
1989
+		if (isset($this->_category->id) && ! empty($this->_category->id))
1990 1990
 			return; //already have the category object so get out.
1991 1991
 
1992 1992
 		//set default category object
1993 1993
 		$this->_set_empty_category_object();
1994 1994
 
1995 1995
 		//only set if we've got an id
1996
-		if ( !isset($this->_req_data['EVT_CAT_ID'] ) ) {
1996
+		if ( ! isset($this->_req_data['EVT_CAT_ID'])) {
1997 1997
 			return;
1998 1998
 		}
1999 1999
 
2000 2000
 		$category_id = absint($this->_req_data['EVT_CAT_ID']);
2001 2001
 
2002
-		$term = get_term( $category_id, 'espresso_event_categories' );
2002
+		$term = get_term($category_id, 'espresso_event_categories');
2003 2003
 
2004
-		if ( !empty( $term ) ) {
2004
+		if ( ! empty($term)) {
2005 2005
 			$this->_category->category_name = $term->name;
2006 2006
 			$this->_category->category_identifier = $term->slug;
2007 2007
 			$this->_category->category_desc = $term->description;
@@ -2015,13 +2015,13 @@  discard block
 block discarded – undo
2015 2015
 
2016 2016
 	private function _set_empty_category_object() {
2017 2017
 		$this->_category = new stdClass();
2018
-		$this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc  = '';
2018
+		$this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = '';
2019 2019
 		$this->_category->id = $this->_category->parent = 0;
2020 2020
 	}
2021 2021
 
2022 2022
 
2023 2023
 	protected function _category_list_table() {
2024
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2024
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2025 2025
 		$this->_search_btn_label = __('Categories', 'event_espresso');
2026 2026
 		$this->_admin_page_title .= $this->get_action_link_or_button('add_category', 'add_category', array(), 'add-new-h2');
2027 2027
 		$this->display_admin_list_table_page_with_sidebar();
@@ -2031,22 +2031,22 @@  discard block
 block discarded – undo
2031 2031
 	protected function _category_details($view) {
2032 2032
 
2033 2033
 		//load formatter helper
2034
-		EE_Registry::instance()->load_helper( 'Formatter' );
2034
+		EE_Registry::instance()->load_helper('Formatter');
2035 2035
 		//load field generator helper
2036
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
2036
+		EE_Registry::instance()->load_helper('Form_Fields');
2037 2037
 
2038 2038
 		$route = $view == 'edit' ? 'update_category' : 'insert_category';
2039 2039
 		$this->_set_add_edit_form_tags($route);
2040 2040
 
2041 2041
 		$this->_set_category_object();
2042
-		$id = !empty($this->_category->id) ? $this->_category->id : '';
2042
+		$id = ! empty($this->_category->id) ? $this->_category->id : '';
2043 2043
 
2044 2044
 		$delete_action = 'delete_category';
2045 2045
 
2046 2046
 		//custom redirect
2047
-		$redirect = EE_Admin_Page::add_query_args_and_nonce( array('action' => 'category_list'), $this->_admin_base_url );
2047
+		$redirect = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'category_list'), $this->_admin_base_url);
2048 2048
 
2049
-		$this->_set_publish_post_box_vars( 'EVT_CAT_ID', $id, $delete_action, $redirect );
2049
+		$this->_set_publish_post_box_vars('EVT_CAT_ID', $id, $delete_action, $redirect);
2050 2050
 
2051 2051
 		//take care of contents
2052 2052
 		$this->_template_args['admin_page_content'] = $this->_category_details_content();
@@ -2060,25 +2060,25 @@  discard block
 block discarded – undo
2060 2060
 			'type' => 'wp_editor',
2061 2061
 			'value' => EEH_Formatter::admin_format_content($this->_category->category_desc),
2062 2062
 			'class' => 'my_editor_custom',
2063
-			'wpeditor_args' => array('media_buttons' => FALSE )
2063
+			'wpeditor_args' => array('media_buttons' => FALSE)
2064 2064
 		);
2065
-		$_wp_editor = $this->_generate_admin_form_fields( $editor_args, 'array' );
2065
+		$_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array');
2066 2066
 
2067
-		$all_terms = get_terms( array('espresso_event_categories' ), array( 'hide_empty' => 0, 'exclude' => array( $this->_category->id ) ) );
2067
+		$all_terms = get_terms(array('espresso_event_categories'), array('hide_empty' => 0, 'exclude' => array($this->_category->id)));
2068 2068
 
2069 2069
 		//setup category select for term parents.
2070 2070
 		$category_select_values[] = array(
2071 2071
 			'text' => __('No Parent', 'event_espresso'),
2072 2072
 			'id' => 0
2073 2073
 			);
2074
-		foreach ( $all_terms as $term ) {
2074
+		foreach ($all_terms as $term) {
2075 2075
 			$category_select_values[] = array(
2076 2076
 				'text' => $term->name,
2077 2077
 				'id' => $term->term_id
2078 2078
 				);
2079 2079
 		}
2080 2080
 
2081
-		$category_select = EEH_Form_Fields::select_input( 'category_parent', $category_select_values, $this->_category->parent );
2081
+		$category_select = EEH_Form_Fields::select_input('category_parent', $category_select_values, $this->_category->parent);
2082 2082
 
2083 2083
 		$template_args = array(
2084 2084
 			'category' => $this->_category,
@@ -2088,15 +2088,15 @@  discard block
 block discarded – undo
2088 2088
 			'disable' => '',
2089 2089
 			'disabled_message' => FALSE
2090 2090
 			);
2091
-		$template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2092
-		return EEH_Template::display_template($template, $template_args, TRUE );
2091
+		$template = EVENTS_TEMPLATE_PATH.'event_category_details.template.php';
2092
+		return EEH_Template::display_template($template, $template_args, TRUE);
2093 2093
 	}
2094 2094
 
2095 2095
 
2096 2096
 	protected function _delete_categories() {
2097
-		$cat_ids = isset( $this->_req_data['EVT_CAT_ID'] ) ? (array) $this->_req_data['EVT_CAT_ID'] : (array) $this->_req_data['category_id'];
2097
+		$cat_ids = isset($this->_req_data['EVT_CAT_ID']) ? (array) $this->_req_data['EVT_CAT_ID'] : (array) $this->_req_data['category_id'];
2098 2098
 
2099
-		foreach ( $cat_ids as $cat_id ) {
2099
+		foreach ($cat_ids as $cat_id) {
2100 2100
 			$this->_delete_category($cat_id);
2101 2101
 		}
2102 2102
 
@@ -2104,7 +2104,7 @@  discard block
 block discarded – undo
2104 2104
 		$query_args = array(
2105 2105
 			'action' => 'category_list'
2106 2106
 			);
2107
-		$this->_redirect_after_action(0,'','',$query_args);
2107
+		$this->_redirect_after_action(0, '', '', $query_args);
2108 2108
 
2109 2109
 	}
2110 2110
 
@@ -2114,61 +2114,61 @@  discard block
 block discarded – undo
2114 2114
 
2115 2115
 	protected function _delete_category($cat_id) {
2116 2116
 		global $wpdb;
2117
-		$cat_id = absint( $cat_id );
2118
-		wp_delete_term( $cat_id, 'espresso_event_categories' );
2117
+		$cat_id = absint($cat_id);
2118
+		wp_delete_term($cat_id, 'espresso_event_categories');
2119 2119
 	}
2120 2120
 
2121 2121
 
2122 2122
 
2123 2123
 	protected function _insert_or_update_category($new_category) {
2124 2124
 
2125
-		$cat_id = $new_category ? $this->_insert_category() : $this->_insert_category( TRUE );
2125
+		$cat_id = $new_category ? $this->_insert_category() : $this->_insert_category(TRUE);
2126 2126
 		$success = 0; //we already have a success message so lets not send another.
2127 2127
 
2128
-		if ( $cat_id ) {
2128
+		if ($cat_id) {
2129 2129
 			$query_args = array(
2130 2130
 				'action'     => 'edit_category',
2131 2131
 				'EVT_CAT_ID' => $cat_id
2132 2132
 			);
2133 2133
 		} else {
2134
-			$query_args = array( 'action' => 'add_category' );
2134
+			$query_args = array('action' => 'add_category');
2135 2135
 		}
2136
-		$this->_redirect_after_action( $success, '','', $query_args, TRUE );
2136
+		$this->_redirect_after_action($success, '', '', $query_args, TRUE);
2137 2137
 
2138 2138
 	}
2139 2139
 
2140 2140
 
2141 2141
 
2142
-	private function _insert_category( $update = FALSE ) {
2142
+	private function _insert_category($update = FALSE) {
2143 2143
 		$cat_id = $update ? $this->_req_data['EVT_CAT_ID'] : '';
2144
-		$category_name= isset( $this->_req_data['category_name'] ) ? $this->_req_data['category_name'] : '';
2145
-		$category_desc= isset( $this->_req_data['category_desc'] ) ? $this->_req_data['category_desc'] : '';
2146
-		$category_parent = isset( $this->_req_data['category_parent'] ) ? $this->_req_data['category_parent'] : 0;
2144
+		$category_name = isset($this->_req_data['category_name']) ? $this->_req_data['category_name'] : '';
2145
+		$category_desc = isset($this->_req_data['category_desc']) ? $this->_req_data['category_desc'] : '';
2146
+		$category_parent = isset($this->_req_data['category_parent']) ? $this->_req_data['category_parent'] : 0;
2147 2147
 
2148
-		if ( empty( $category_name ) ) {
2149
-			$msg = __( 'You must add a name for the category.', 'event_espresso' );
2150
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2148
+		if (empty($category_name)) {
2149
+			$msg = __('You must add a name for the category.', 'event_espresso');
2150
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2151 2151
 			return false;
2152 2152
 		}
2153 2153
 
2154
-		$term_args=array(
2154
+		$term_args = array(
2155 2155
 			'name'=>$category_name,
2156 2156
 			'description'=>$category_desc,
2157 2157
 			'parent'=>$category_parent
2158 2158
 		);
2159 2159
 		//was the category_identifier input disabled?
2160
-		if(isset($this->_req_data['category_identifier'])){
2160
+		if (isset($this->_req_data['category_identifier'])) {
2161 2161
 			$term_args['slug'] = $this->_req_data['category_identifier'];
2162 2162
 		}
2163
-		$insert_ids = $update ? wp_update_term( $cat_id, 'espresso_event_categories', $term_args ) :wp_insert_term( $category_name, 'espresso_event_categories', $term_args );
2163
+		$insert_ids = $update ? wp_update_term($cat_id, 'espresso_event_categories', $term_args) : wp_insert_term($category_name, 'espresso_event_categories', $term_args);
2164 2164
 
2165
-		if ( !is_array( $insert_ids ) ) {
2166
-			$msg = __( 'An error occurred and the category has not been saved to the database.', 'event_espresso' );
2167
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2165
+		if ( ! is_array($insert_ids)) {
2166
+			$msg = __('An error occurred and the category has not been saved to the database.', 'event_espresso');
2167
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2168 2168
 		} else {
2169 2169
 			$cat_id = $insert_ids['term_id'];
2170
-			$msg = sprintf ( __('The category %s was successfuly saved', 'event_espresso'), $category_name );
2171
-			EE_Error::add_success( $msg );
2170
+			$msg = sprintf(__('The category %s was successfuly saved', 'event_espresso'), $category_name);
2171
+			EE_Error::add_success($msg);
2172 2172
 		}
2173 2173
 
2174 2174
 		return $cat_id;
@@ -2177,32 +2177,32 @@  discard block
 block discarded – undo
2177 2177
 
2178 2178
 
2179 2179
 
2180
-	public function get_categories( $per_page = 10, $current_page = 1, $count = FALSE ) {
2180
+	public function get_categories($per_page = 10, $current_page = 1, $count = FALSE) {
2181 2181
 		global $wpdb;
2182 2182
 
2183 2183
 		//testing term stuff
2184
-		$orderby = isset( $this->_req_data['orderby'] ) ? $this->_req_data['orderby'] : 'Term.term_id';
2185
-		$order = isset( $this->_req_data['order'] ) ? $this->_req_data['order'] : 'DESC';
2186
-		$limit = ($current_page-1)*$per_page;
2184
+		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'Term.term_id';
2185
+		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
2186
+		$limit = ($current_page - 1) * $per_page;
2187 2187
 
2188
-		$where = array( 'taxonomy' => 'espresso_event_categories' );
2188
+		$where = array('taxonomy' => 'espresso_event_categories');
2189 2189
 
2190
-		if ( isset( $this->_req_data['s'] ) ) {
2191
-			$sstr = '%' . $this->_req_data['s'] . '%';
2190
+		if (isset($this->_req_data['s'])) {
2191
+			$sstr = '%'.$this->_req_data['s'].'%';
2192 2192
 			$where['OR'] = array(
2193
-				'Term.name' => array( 'LIKE', $sstr),
2194
-				'description' => array( 'LIKE', $sstr )
2193
+				'Term.name' => array('LIKE', $sstr),
2194
+				'description' => array('LIKE', $sstr)
2195 2195
 				);
2196 2196
 		}
2197 2197
 
2198 2198
 		$query_params = array(
2199
-			$where ,
2200
-			'order_by' => array( $orderby => $order ),
2201
-			'limit' => $limit . ',' . $per_page,
2199
+			$where,
2200
+			'order_by' => array($orderby => $order),
2201
+			'limit' => $limit.','.$per_page,
2202 2202
 			'force_join' => array('Term')
2203 2203
 			);
2204 2204
 
2205
-		$categories = $count ? EEM_Term_Taxonomy::instance()->count( $query_params, 'term_id' ) :EEM_Term_Taxonomy::instance()->get_all( $query_params );
2205
+		$categories = $count ? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id') : EEM_Term_Taxonomy::instance()->get_all($query_params);
2206 2206
 
2207 2207
 		return $categories;
2208 2208
 	}
Please login to merge, or discard this patch.
admin_pages/events/help_tabs/event_editor_venue_details.help_tab.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,5 +3,5 @@
 block discarded – undo
3 3
 <?php _e('A venue is the place or location that is hosting your event. This setting is optional which means that you are not required to select a venue for your event.', 'event_espresso'); ?>
4 4
 </p>
5 5
 <p>
6
-<?php echo sprintf(__('Venues can be managed through the %sVenues page%s. This feature is only available in the caffeinated version of Event Espresso.', 'event_espresso'),'<a href="admin.php?page=espresso_venues">','</a>'); ?>
6
+<?php echo sprintf(__('Venues can be managed through the %sVenues page%s. This feature is only available in the caffeinated version of Event Espresso.', 'event_espresso'), '<a href="admin.php?page=espresso_venues">', '</a>'); ?>
7 7
 </p>
8 8
\ No newline at end of file
Please login to merge, or discard this patch.