Completed
Branch old/BUG-7514-7935-7936-price-o... (518ae6)
by
unknown
02:21
created
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 2 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.
Spacing   +342 added lines, -342 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(
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 				'help_tour' => array(
317 317
 					'Event_Editor_Help_Tour'
318 318
 					),
319
-				'qtips' => array( 'EE_Event_Editor_Decaf_Tips' ),
319
+				'qtips' => array('EE_Event_Editor_Decaf_Tips'),
320 320
 				'require_nonce' => FALSE
321 321
 			),
322 322
 			'edit' => array(
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 				'help_tour' => array(
373 373
 					'Event_Edit_Help_Tour'
374 374
 				),
375
-				'qtips' => array( 'EE_Event_Editor_Decaf_Tips' ),
375
+				'qtips' => array('EE_Event_Editor_Decaf_Tips'),
376 376
 				'require_nonce' => FALSE
377 377
 			),
378 378
 			'default_event_settings' => array(
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 						'filename' => 'events_default_settings_status'
395 395
 					)
396 396
 				),
397
-				'help_tour' => array( 'Event_Default_Settings_Help_Tour'),
397
+				'help_tour' => array('Event_Default_Settings_Help_Tour'),
398 398
 				'require_nonce' => FALSE
399 399
 			),
400 400
 			//event category stuff
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 					'label' => __('Edit Category', 'event_espresso'),
419 419
 					'order' => 15,
420 420
 					'persistent' => FALSE,
421
-					'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
+					'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
422 422
 					),
423 423
 				'help_tabs' => array(
424 424
 					'edit_category_help_tab' => array(
@@ -488,14 +488,14 @@  discard block
 block discarded – undo
488 488
 
489 489
 	public function load_scripts_styles() {
490 490
 
491
-		wp_register_style('events-admin-css', EVENTS_ASSETS_URL . 'events-admin-page.css', array(), EVENT_ESPRESSO_VERSION);
492
-		wp_register_style('ee-cat-admin', EVENTS_ASSETS_URL . 'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION );
491
+		wp_register_style('events-admin-css', EVENTS_ASSETS_URL.'events-admin-page.css', array(), EVENT_ESPRESSO_VERSION);
492
+		wp_register_style('ee-cat-admin', EVENTS_ASSETS_URL.'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION);
493 493
 		wp_enqueue_style('events-admin-css');
494 494
 		wp_enqueue_style('ee-cat-admin');
495 495
 		//todo note: we also need to load_scripts_styles per view (i.e. default/view_report/event_details
496 496
 		//registers for all views
497 497
 		//scripts
498
-		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
+		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);
499 499
 	}
500 500
 
501 501
 	/**
@@ -513,11 +513,11 @@  discard block
 block discarded – undo
513 513
 	public function load_scripts_styles_edit() {
514 514
 		//styles
515 515
 		wp_enqueue_style('espresso-ui-theme');
516
-		wp_register_style('event-editor-css', EVENTS_ASSETS_URL . 'event-editor.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
516
+		wp_register_style('event-editor-css', EVENTS_ASSETS_URL.'event-editor.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
517 517
 		wp_enqueue_style('event-editor-css');
518 518
 
519 519
 		//scripts
520
-		wp_register_script('event-datetime-metabox', EVENTS_ASSETS_URL . 'event-datetime-metabox.js', array('event_editor_js', 'ee-datepicker'), EVENT_ESPRESSO_VERSION );
520
+		wp_register_script('event-datetime-metabox', EVENTS_ASSETS_URL.'event-datetime-metabox.js', array('event_editor_js', 'ee-datepicker'), EVENT_ESPRESSO_VERSION);
521 521
 		wp_enqueue_script('event-datetime-metabox');
522 522
 
523 523
 		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');
@@ -570,35 +570,35 @@  discard block
 block discarded – undo
570 570
 	 */
571 571
 	public function verify_event_edit($event = NULL) {
572 572
 		// no event?
573
-		if ( empty( $event )) {
573
+		if (empty($event)) {
574 574
 			// set event
575 575
 			$event = $this->_cpt_model_obj;
576 576
 		}
577 577
 		// STILL no event?
578
-		if ( empty ( $event )) {
578
+		if (empty ($event)) {
579 579
 			return;
580 580
 		}
581 581
 		// first check if event is active.
582
-		if ( $event->is_expired() || $event->is_inactive() || $event->status() == EEM_Event::cancelled || $event->status() == EEM_Event::postponed ) {
582
+		if ($event->is_expired() || $event->is_inactive() || $event->status() == EEM_Event::cancelled || $event->status() == EEM_Event::postponed) {
583 583
 			return;
584 584
 		}
585 585
 		$orig_status = $event->status();
586 586
 		//made it here so it IS active... next check that any of the tickets are sold.
587
-		if ( $event->is_sold_out() || $event->is_sold_out(TRUE ) ) {
588
-			if ( $event->status() !== $orig_status && $orig_status !== EEM_Event::sold_out  ) {
589
-				EE_Error::add_attention( sprintf(
590
-					__( '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' ),
591
-					EEH_Template::pretty_status( EEM_Event::sold_out, FALSE, 'sentence' )
587
+		if ($event->is_sold_out() || $event->is_sold_out(TRUE)) {
588
+			if ($event->status() !== $orig_status && $orig_status !== EEM_Event::sold_out) {
589
+				EE_Error::add_attention(sprintf(
590
+					__('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'),
591
+					EEH_Template::pretty_status(EEM_Event::sold_out, FALSE, 'sentence')
592 592
 				));
593 593
 			}
594 594
 			return;
595 595
 		}
596 596
 		//now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
597
-		if ( ! $event->tickets_on_sale() ) {
597
+		if ( ! $event->tickets_on_sale()) {
598 598
 			return;
599 599
 		}
600 600
 		//made it here so show warning
601
-		EE_Error::add_attention( $this->_edit_event_warning() );
601
+		EE_Error::add_attention($this->_edit_event_warning());
602 602
 	}
603 603
 
604 604
 
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 			),
639 639
 		);
640 640
 
641
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) {
641
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
642 642
 			$this->_views['trash'] = array(
643 643
 				'slug' => 'trash',
644 644
 				'label' => __('Trash', 'event_espresso'),
@@ -668,39 +668,39 @@  discard block
 block discarded – undo
668 668
 				'desc' => __('View Registrations for Event', 'event_espresso')
669 669
 			)
670 670
 		);
671
-		$items  = apply_filters( 'FHEE__Events_Admin_Page___event_legend_items__items', $items );
671
+		$items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
672 672
 		$statuses = array(
673 673
 			'sold_out_status' => array(
674
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
675
-				'desc' => EEH_Template::pretty_status( EE_Datetime::sold_out, FALSE, 'sentence' )
674
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::sold_out,
675
+				'desc' => EEH_Template::pretty_status(EE_Datetime::sold_out, FALSE, 'sentence')
676 676
 			),
677 677
 			'active_status' => array(
678
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
679
-				'desc' => EEH_Template::pretty_status( EE_Datetime::active, FALSE, 'sentence' )
678
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::active,
679
+				'desc' => EEH_Template::pretty_status(EE_Datetime::active, FALSE, 'sentence')
680 680
 			),
681 681
 			'upcoming_status' => array(
682
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
683
-				'desc' => EEH_Template::pretty_status( EE_Datetime::upcoming, FALSE, 'sentence' )
682
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::upcoming,
683
+				'desc' => EEH_Template::pretty_status(EE_Datetime::upcoming, FALSE, 'sentence')
684 684
 			),
685 685
 			'postponed_status' => array(
686
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
687
-				'desc' => EEH_Template::pretty_status( EE_Datetime::postponed, FALSE, 'sentence' )
686
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::postponed,
687
+				'desc' => EEH_Template::pretty_status(EE_Datetime::postponed, FALSE, 'sentence')
688 688
 			),
689 689
 			'cancelled_status' => array(
690
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
691
-				'desc' => EEH_Template::pretty_status( EE_Datetime::cancelled, FALSE, 'sentence' )
690
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::cancelled,
691
+				'desc' => EEH_Template::pretty_status(EE_Datetime::cancelled, FALSE, 'sentence')
692 692
 			),
693 693
 			'expired_status' => array(
694
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
695
-				'desc' => EEH_Template::pretty_status( EE_Datetime::expired, FALSE, 'sentence' )
694
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::expired,
695
+				'desc' => EEH_Template::pretty_status(EE_Datetime::expired, FALSE, 'sentence')
696 696
 			),
697 697
 			'inactive_status' => array(
698
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
699
-				'desc' => EEH_Template::pretty_status( EE_Datetime::inactive, FALSE, 'sentence' )
698
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::inactive,
699
+				'desc' => EEH_Template::pretty_status(EE_Datetime::inactive, FALSE, 'sentence')
700 700
 			)
701 701
 		);
702
-		$statuses = apply_filters( 'FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses );
703
-		return array_merge( $items, $statuses );
702
+		$statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses);
703
+		return array_merge($items, $statuses);
704 704
 	}
705 705
 
706 706
 
@@ -712,8 +712,8 @@  discard block
 block discarded – undo
712 712
 	 * @return EEM_Event
713 713
 	 */
714 714
 	private function _event_model() {
715
-		if ( ! $this->_event_model instanceof EEM_Event ) {
716
-			$this->_event_model = EE_Registry::instance()->load_model( 'Event' );
715
+		if ( ! $this->_event_model instanceof EEM_Event) {
716
+			$this->_event_model = EE_Registry::instance()->load_model('Event');
717 717
 		}
718 718
 		return $this->_event_model;
719 719
 	}
@@ -732,12 +732,12 @@  discard block
 block discarded – undo
732 732
 	 * @param  string $new_slug  what the slug is
733 733
 	 * @return string            The new html string for the permalink area
734 734
 	 */
735
-	public function extra_permalink_field_buttons( $return, $id, $new_title, $new_slug ) {
735
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug) {
736 736
 		//make sure this is only when editing
737
-		if ( !empty( $id ) ) {
738
-			$post = get_post( $id );
739
-			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">' . __('Shortcode', 'event_espresso') . '</a> ';
740
-			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id=\'' . $post->ID . '\']"">';
737
+		if ( ! empty($id)) {
738
+			$post = get_post($id);
739
+			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'.__('Shortcode', 'event_espresso').'</a> ';
740
+			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id=\''.$post->ID.'\']"">';
741 741
 		}
742 742
 		return $return;
743 743
 	}
@@ -753,8 +753,8 @@  discard block
 block discarded – undo
753 753
 	 * @return string html for generated table
754 754
 	 */
755 755
 	protected function _events_overview_list_table() {
756
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
757
-		$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' ) .
756
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
757
+		$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').
758 758
 		$this->_display_legend($this->_event_legend_items());
759 759
 		$this->_admin_page_title .= $this->get_action_link_or_button('create_new', 'add', array(), 'add-new-h2');
760 760
 		$this->display_admin_list_table_page_with_no_sidebar();
@@ -772,46 +772,46 @@  discard block
 block discarded – undo
772 772
 
773 773
 
774 774
 
775
-	protected function _insert_update_cpt_item( $post_id, $post ) {
775
+	protected function _insert_update_cpt_item($post_id, $post) {
776 776
 
777 777
 		$event_values = array(
778
-			'EVT_display_desc' => !empty( $this->_req_data['display_desc'] ) ? 1 : 0,
779
-			'EVT_display_ticket_selector' => !empty( $this->_req_data['display_ticket_selector'] ) ? 1 : 0,
778
+			'EVT_display_desc' => ! empty($this->_req_data['display_desc']) ? 1 : 0,
779
+			'EVT_display_ticket_selector' => ! empty($this->_req_data['display_ticket_selector']) ? 1 : 0,
780 780
 			'EVT_additional_limit' => min(
781
-					apply_filters( 'FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255 ),
782
-					!empty( $this->_req_data['additional_limit'] ) ? $this->_req_data['additional_limit'] : NULL ),
783
-			'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,
784
-			'EVT_member_only' => !empty( $this->_req_data['member_only'] ) ? 1 : 0,
785
-			'EVT_allow_overflow' => !empty( $this->_req_data['EVT_allow_overflow'] ) ? 1 : 0,
786
-			'EVT_timezone_string' => !empty( $this->_req_data['timezone_string'] ) ? $this->_req_data['timezone_string'] : NULL,
787
-			'EVT_external_URL' => !empty( $this->_req_data['externalURL'] ) ? $this->_req_data['externalURL'] : NULL,
788
-			'EVT_phone' => !empty( $this->_req_data['event_phone'] ) ? $this->_req_data['event_phone'] : NULL
781
+					apply_filters('FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255),
782
+					! empty($this->_req_data['additional_limit']) ? $this->_req_data['additional_limit'] : NULL ),
783
+			'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,
784
+			'EVT_member_only' => ! empty($this->_req_data['member_only']) ? 1 : 0,
785
+			'EVT_allow_overflow' => ! empty($this->_req_data['EVT_allow_overflow']) ? 1 : 0,
786
+			'EVT_timezone_string' => ! empty($this->_req_data['timezone_string']) ? $this->_req_data['timezone_string'] : NULL,
787
+			'EVT_external_URL' => ! empty($this->_req_data['externalURL']) ? $this->_req_data['externalURL'] : NULL,
788
+			'EVT_phone' => ! empty($this->_req_data['event_phone']) ? $this->_req_data['event_phone'] : NULL
789 789
 			);
790 790
 
791 791
 		//update event
792
-		$success = $this->_event_model()->update_by_ID( $event_values, $post_id );
792
+		$success = $this->_event_model()->update_by_ID($event_values, $post_id);
793 793
 
794 794
 
795 795
 		//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!
796
-		$get_one_where = array( $this->_event_model()->primary_key_name() => $post_id, 'status' => $post->post_status );
797
-		$event = $this->_event_model()->get_one( array($get_one_where) );
796
+		$get_one_where = array($this->_event_model()->primary_key_name() => $post_id, 'status' => $post->post_status);
797
+		$event = $this->_event_model()->get_one(array($get_one_where));
798 798
 
799 799
 
800 800
 		//the following are default callbacks for event attachment updates that can be overridden by caffeinated functionality and/or addons.
801
-		$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
+		$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')));
802 802
 
803 803
 		$att_success = TRUE;
804 804
 
805
-		foreach ( $event_update_callbacks as $e_callback ) {
806
-			$_succ = call_user_func_array( $e_callback, array( $event,  $this->_req_data ) );
807
-			$att_success = !$att_success ? $att_success : $_succ; //if ANY of these updates fail then we want the appropriate global error message
805
+		foreach ($event_update_callbacks as $e_callback) {
806
+			$_succ = call_user_func_array($e_callback, array($event, $this->_req_data));
807
+			$att_success = ! $att_success ? $att_success : $_succ; //if ANY of these updates fail then we want the appropriate global error message
808 808
 		}
809 809
 
810 810
 		//any errors?
811
-		if ( $success && FALSE === $att_success ) {
812
-			EE_Error::add_error( __('Event Details saved successfully but something went wrong with saving attachments.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
813
-		} else if ( $success === FALSE ) {
814
-			EE_Error::add_error( __('Event Details did not save successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
811
+		if ($success && FALSE === $att_success) {
812
+			EE_Error::add_error(__('Event Details saved successfully but something went wrong with saving attachments.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
813
+		} else if ($success === FALSE) {
814
+			EE_Error::add_error(__('Event Details did not save successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
815 815
 		}
816 816
 	}
817 817
 
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 	/**
822 822
 	 * @see parent::restore_item()
823 823
 	 */
824
-	protected function _restore_cpt_item( $post_id, $revision_id ) {
824
+	protected function _restore_cpt_item($post_id, $revision_id) {
825 825
 		//copy existing event meta to new post
826 826
 		$post_evt = $this->_event_model()->get_one_by_ID($post_id);
827 827
 
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 		$post_evt->restore_revision($revision_id);
830 830
 
831 831
 		//related objs restore
832
-		$post_evt->restore_revision($revision_id, array( 'Venue', 'Datetime', 'Price' ) );
832
+		$post_evt->restore_revision($revision_id, array('Venue', 'Datetime', 'Price'));
833 833
 	}
834 834
 
835 835
 
@@ -841,50 +841,50 @@  discard block
 block discarded – undo
841 841
 	 * @param  array  $data   The request data from the form
842 842
 	 * @return bool           Success or fail.
843 843
 	 */
844
-	protected function _default_venue_update( $evtobj, $data ) {
845
-		require_once( EE_MODELS . 'EEM_Venue.model.php' );
844
+	protected function _default_venue_update($evtobj, $data) {
845
+		require_once(EE_MODELS.'EEM_Venue.model.php');
846 846
 		$venue_model = EE_Registry::instance()->load_model('Venue');
847 847
 		$rows_affected = NULL;
848
-		$venue_id = !empty( $data['venue_id'] ) ? $data['venue_id'] : NULL;
848
+		$venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : NULL;
849 849
 
850 850
 		//very important.  If we don't have a venue name then we'll get out because not necessary to create empty venue
851
-		if ( empty( $data['venue_title'] ) )
851
+		if (empty($data['venue_title']))
852 852
 			return;
853 853
 
854 854
 		$venue_array = array(
855 855
 				'VNU_wp_user' => $evtobj->get('EVT_wp_user'),
856
-				'VNU_name' => !empty( $data['venue_title'] ) ? $data['venue_title'] : NULL,
857
-				'VNU_desc' => !empty( $data['venue_description'] ) ? $data['venue_description'] : NULL,
858
-				'VNU_identifier' => !empty( $data['venue_identifier'] ) ? $data['venue_identifier'] : NULL,
859
-				'VNU_short_desc' => !empty( $data['venue_short_description'] ) ? $data['venue_short_description'] : NULL,
860
-				'VNU_address' => !empty( $data['address'] ) ? $data['address'] : NULL,
861
-				'VNU_address2' => !empty( $data['address2'] ) ? $data['address2'] : NULL,
862
-				'VNU_city' => !empty( $data['city'] ) ? $data['city'] : NULL,
863
-				'STA_ID' => !empty( $data['state'] ) ? $data['state'] : NULL,
864
-				'CNT_ISO' => !empty( $data['countries'] ) ? $data['countries'] : NULL,
865
-				'VNU_zip' => !empty( $data['zip'] ) ? $data['zip'] : NULL,
866
-				'VNU_phone' => !empty( $data['venue_phone'] ) ? $data['venue_phone'] : NULL,
867
-				'VNU_capacity' => !empty( $data['venue_capacity'] ) ? $data['venue_capacity'] : NULL,
868
-				'VNU_url' => !empty($data['venue_url'] ) ? $data['venue_url'] : NULL,
869
-				'VNU_virtual_phone' => !empty($data['virtual_phone']) ? $data['virtual_phone'] : NULL,
870
-				'VNU_virtual_url' => !empty( $data['virtual_url'] ) ? $data['virtual_url'] : NULL,
871
-				'VNU_enable_for_gmap' => isset( $data['enable_for_gmap'] ) ? 1 : 0,
856
+				'VNU_name' => ! empty($data['venue_title']) ? $data['venue_title'] : NULL,
857
+				'VNU_desc' => ! empty($data['venue_description']) ? $data['venue_description'] : NULL,
858
+				'VNU_identifier' => ! empty($data['venue_identifier']) ? $data['venue_identifier'] : NULL,
859
+				'VNU_short_desc' => ! empty($data['venue_short_description']) ? $data['venue_short_description'] : NULL,
860
+				'VNU_address' => ! empty($data['address']) ? $data['address'] : NULL,
861
+				'VNU_address2' => ! empty($data['address2']) ? $data['address2'] : NULL,
862
+				'VNU_city' => ! empty($data['city']) ? $data['city'] : NULL,
863
+				'STA_ID' => ! empty($data['state']) ? $data['state'] : NULL,
864
+				'CNT_ISO' => ! empty($data['countries']) ? $data['countries'] : NULL,
865
+				'VNU_zip' => ! empty($data['zip']) ? $data['zip'] : NULL,
866
+				'VNU_phone' => ! empty($data['venue_phone']) ? $data['venue_phone'] : NULL,
867
+				'VNU_capacity' => ! empty($data['venue_capacity']) ? $data['venue_capacity'] : NULL,
868
+				'VNU_url' => ! empty($data['venue_url']) ? $data['venue_url'] : NULL,
869
+				'VNU_virtual_phone' => ! empty($data['virtual_phone']) ? $data['virtual_phone'] : NULL,
870
+				'VNU_virtual_url' => ! empty($data['virtual_url']) ? $data['virtual_url'] : NULL,
871
+				'VNU_enable_for_gmap' => isset($data['enable_for_gmap']) ? 1 : 0,
872 872
 				'status' => 'publish'
873 873
 			);
874 874
 
875 875
 
876 876
 		//if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
877
-		if ( !empty( $venue_id ) ) {
878
-			$update_where = array( $venue_model->primary_key_name() => $venue_id );
879
-			$rows_affected = $venue_model->update( $venue_array, array( $update_where ) );
877
+		if ( ! empty($venue_id)) {
878
+			$update_where = array($venue_model->primary_key_name() => $venue_id);
879
+			$rows_affected = $venue_model->update($venue_array, array($update_where));
880 880
 			//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.
881
-			$evtobj->_add_relation_to( $venue_id, 'Venue' );
881
+			$evtobj->_add_relation_to($venue_id, 'Venue');
882 882
 			return $rows_affected > 0 ? TRUE : FALSE;
883 883
 		} else {
884 884
 			//we insert the venue
885
-			$venue_id = $venue_model->insert( $venue_array );
886
-			$evtobj->_add_relation_to( $venue_id, 'Venue' );
887
-			return !empty( $venue_id ) ? TRUE : FALSE;
885
+			$venue_id = $venue_model->insert($venue_array);
886
+			$evtobj->_add_relation_to($venue_id, 'Venue');
887
+			return ! empty($venue_id) ? TRUE : FALSE;
888 888
 		}
889 889
 		return TRUE; //when we have the ancestor come in it's already been handled by the revision save.
890 890
 	}
@@ -898,41 +898,41 @@  discard block
 block discarded – undo
898 898
 	 * @param  array    $data   The request data from the form
899 899
 	 * @return bool             success or fail
900 900
 	 */
901
-	protected function _default_tickets_update( $evtobj, $data ) {
901
+	protected function _default_tickets_update($evtobj, $data) {
902 902
 		$success = TRUE;
903
-		foreach ( $data['edit_event_datetimes'] as $row => $dtt ) {
904
-			$dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty( $dtt['DTT_EVT_end'] ) ? $dtt['DTT_EVT_end'] : $dtt['DTT_EVT_start'];
903
+		foreach ($data['edit_event_datetimes'] as $row => $dtt) {
904
+			$dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty($dtt['DTT_EVT_end']) ? $dtt['DTT_EVT_end'] : $dtt['DTT_EVT_start'];
905 905
 			$datetime_values = array(
906
-				'DTT_ID' => !empty( $dtt['DTT_ID'] ) ? $dtt['DTT_ID'] : NULL,
906
+				'DTT_ID' => ! empty($dtt['DTT_ID']) ? $dtt['DTT_ID'] : NULL,
907 907
 				'DTT_EVT_start' => $dtt['DTT_EVT_start'],
908 908
 				'DTT_EVT_end' => $dtt['DTT_EVT_end'],
909
-				'DTT_reg_limit' => empty( $dtt['DTT_reg_limit'] ) ? INF : $dtt['DTT_reg_limit'],
909
+				'DTT_reg_limit' => empty($dtt['DTT_reg_limit']) ? INF : $dtt['DTT_reg_limit'],
910 910
 				'DTT_order' => $row,
911 911
 				);
912 912
 
913 913
 			//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.
914 914
 
915
-			if ( !empty( $dtt['DTT_ID'] ) ) {
916
-				$DTM = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($dtt['DTT_ID'] );
917
-				foreach ( $datetime_values as $field => $value ) {
918
-					$DTM->set( $field, $value );
915
+			if ( ! empty($dtt['DTT_ID'])) {
916
+				$DTM = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($dtt['DTT_ID']);
917
+				foreach ($datetime_values as $field => $value) {
918
+					$DTM->set($field, $value);
919 919
 				}
920 920
 
921 921
 				$DTM->save();
922 922
 				//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.
923 923
 				$saved_dtts[$DTM->ID()] = $DTM;
924 924
 			} else {
925
-				$DTM = EE_Registry::instance()->load_class('Datetime', array( $datetime_values ), FALSE, FALSE );
925
+				$DTM = EE_Registry::instance()->load_class('Datetime', array($datetime_values), FALSE, FALSE);
926 926
 			}
927 927
 
928
-			$DTT = $evtobj->_add_relation_to( $DTM, 'Datetime' );
928
+			$DTT = $evtobj->_add_relation_to($DTM, 'Datetime');
929 929
 
930 930
 			//load DTT helper
931 931
 			EE_Registry::instance()->load_helper('DTT_Helper');
932 932
 
933 933
 			//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.
934
-			if( $DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end') ) {
935
-				$DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start') );
934
+			if ($DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end')) {
935
+				$DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start'));
936 936
 				$DTT = EEH_DTT_Helper::date_time_add($DTT, 'DTT_EVT_end', 'days');
937 937
 				$DTT->save();
938 938
 			}
@@ -940,29 +940,29 @@  discard block
 block discarded – undo
940 940
 			//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.
941 941
 			$saved_dtt = $DTT;
942 942
 
943
-			$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
+			$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.
944 944
 		}
945 945
 
946 946
 		//no dtts get deleted so we don't do any of that logic here.
947 947
 		//update tickets next
948
-		$old_tickets = isset( $data['ticket_IDs'] ) ? explode(',', $data['ticket_IDs'] ) : array();
949
-		foreach ( $data['edit_tickets'] as $row => $tkt ) {
948
+		$old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : array();
949
+		foreach ($data['edit_tickets'] as $row => $tkt) {
950 950
 			$update_prices = false;
951
-			$ticket_price = isset( $data['edit_prices'][$row][1]['PRC_amount'] ) ? $data['edit_prices'][$row][1]['PRC_amount'] : 0;
951
+			$ticket_price = isset($data['edit_prices'][$row][1]['PRC_amount']) ? $data['edit_prices'][$row][1]['PRC_amount'] : 0;
952 952
 
953 953
 			$TKT_values = array(
954
-				'TKT_ID' => !empty( $tkt['TKT_ID'] ) ? $tkt['TKT_ID'] : NULL,
955
-				'TTM_ID' => !empty( $tkt['TTM_ID'] ) ? $tkt['TTM_ID'] : 0,
956
-				'TKT_name' => !empty( $tkt['TKT_name'] ) ? $tkt['TKT_name'] : '',
957
-				'TKT_description' => !empty( $tkt['TKT_description'] ) ? $tkt['TKT_description'] : '',
958
-				'TKT_start_date' => isset( $tkt['TKT_start_date'] ) ? $tkt['TKT_start_date'] : current_time('mysql'),
959
-				'TKT_end_date' => isset( $tkt['TKT_end_date'] ) ? $tkt['TKT_end_date'] : current_time('mysql'),
960
-				'TKT_qty' => empty( $tkt['TKT_qty'] ) ? INF : $tkt['TKT_qty'],
961
-				'TKT_uses' => empty( $tkt['TKT_uses'] ) ? INF : $tkt['TKT_uses'],
962
-				'TKT_min' => empty( $tkt['TKT_min'] ) ? 0 : $tkt['TKT_min'],
963
-				'TKT_max' => empty( $tkt['TKT_max'] ) ? INF : $tkt['TKT_max'],
954
+				'TKT_ID' => ! empty($tkt['TKT_ID']) ? $tkt['TKT_ID'] : NULL,
955
+				'TTM_ID' => ! empty($tkt['TTM_ID']) ? $tkt['TTM_ID'] : 0,
956
+				'TKT_name' => ! empty($tkt['TKT_name']) ? $tkt['TKT_name'] : '',
957
+				'TKT_description' => ! empty($tkt['TKT_description']) ? $tkt['TKT_description'] : '',
958
+				'TKT_start_date' => isset($tkt['TKT_start_date']) ? $tkt['TKT_start_date'] : current_time('mysql'),
959
+				'TKT_end_date' => isset($tkt['TKT_end_date']) ? $tkt['TKT_end_date'] : current_time('mysql'),
960
+				'TKT_qty' => empty($tkt['TKT_qty']) ? INF : $tkt['TKT_qty'],
961
+				'TKT_uses' => empty($tkt['TKT_uses']) ? INF : $tkt['TKT_uses'],
962
+				'TKT_min' => empty($tkt['TKT_min']) ? 0 : $tkt['TKT_min'],
963
+				'TKT_max' => empty($tkt['TKT_max']) ? INF : $tkt['TKT_max'],
964 964
 				'TKT_row' => $row,
965
-				'TKT_order' => isset( $tkt['TKT_order'] ) ? $tkt['TKT_order'] : 0,
965
+				'TKT_order' => isset($tkt['TKT_order']) ? $tkt['TKT_order'] : 0,
966 966
 				'TKT_price' => $ticket_price
967 967
 				);
968 968
 
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
 
971 971
 
972 972
 			//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.
973
-			if ( isset( $tkt['TKT_is_default'] ) && $tkt['TKT_is_default'] ) {
973
+			if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
974 974
 				$TKT_values['TKT_ID'] = 0;
975 975
 				$TKT_values['TKT_is_default'] = 0;
976 976
 				$TKT_values['TKT_price'] = $ticket_price;
@@ -981,22 +981,22 @@  discard block
 block discarded – undo
981 981
 			//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.
982 982
 			//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.
983 983
 
984
-			if ( !empty( $tkt['TKT_ID'] ) ) {
985
-				$TKT = EE_Registry::instance()->load_model( 'Ticket')->get_one_by_ID( $tkt['TKT_ID'] );
984
+			if ( ! empty($tkt['TKT_ID'])) {
985
+				$TKT = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($tkt['TKT_ID']);
986 986
 
987 987
 
988
-				$ticket_sold = $TKT->count_related('Registration', array( array( 'STS_ID' => array( 'NOT IN', array( EEM_Registration::status_id_incomplete ) ) ) ) ) > 0 ? true : false;
988
+				$ticket_sold = $TKT->count_related('Registration', array(array('STS_ID' => array('NOT IN', array(EEM_Registration::status_id_incomplete))))) > 0 ? true : false;
989 989
 
990 990
 				//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.
991
-				$create_new_TKT = $ticket_sold && $ticket_price !== $TKT->get('TKT_price') && !$TKT->get('TKT_deleted') ? TRUE : FALSE;
991
+				$create_new_TKT = $ticket_sold && $ticket_price !== $TKT->get('TKT_price') && ! $TKT->get('TKT_deleted') ? TRUE : FALSE;
992 992
 
993 993
 				//set new values
994
-				foreach ( $TKT_values as $field => $value ) {
995
-					$TKT->set( $field, $value );
994
+				foreach ($TKT_values as $field => $value) {
995
+					$TKT->set($field, $value);
996 996
 				}
997 997
 
998 998
 				//if $create_new_TKT is false then we can safely update the existing ticket.  Otherwise we have to create a new ticket.
999
-				if ( $create_new_TKT ) {
999
+				if ($create_new_TKT) {
1000 1000
 					//archive the old ticket first
1001 1001
 					$TKT->set('TKT_deleted', 1);
1002 1002
 					$TKT->save();
@@ -1007,22 +1007,22 @@  discard block
 block discarded – undo
1007 1007
 
1008 1008
 					//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.
1009 1009
 					$TKT = clone $TKT;
1010
-					$TKT->set( 'TKT_ID', 0 );
1011
-					$TKT->set( 'TKT_deleted', 0 );
1012
-					$TKT->set( 'TKT_price', $ticket_price );
1013
-					$TKT->set( 'TKT_sold', 0 );
1010
+					$TKT->set('TKT_ID', 0);
1011
+					$TKT->set('TKT_deleted', 0);
1012
+					$TKT->set('TKT_price', $ticket_price);
1013
+					$TKT->set('TKT_sold', 0);
1014 1014
 
1015 1015
 					//now we need to make sure that $new prices are created as well and attached to new ticket.
1016 1016
 					$update_prices = TRUE;
1017 1017
 				}
1018 1018
 
1019 1019
 				//make sure price is set if it hasn't been already
1020
-				$TKT->set( 'TKT_price', $ticket_price );
1020
+				$TKT->set('TKT_price', $ticket_price);
1021 1021
 
1022 1022
 			} else {
1023 1023
 				//no TKT_id so a new TKT
1024 1024
 				$TKT_values['TKT_price'] = $ticket_price;
1025
-				$TKT = EE_Registry::instance()->load_class('Ticket', array( $TKT_values ), FALSE, FALSE );
1025
+				$TKT = EE_Registry::instance()->load_class('Ticket', array($TKT_values), FALSE, FALSE);
1026 1026
 				$update_prices = TRUE;
1027 1027
 			}
1028 1028
 
@@ -1030,27 +1030,27 @@  discard block
 block discarded – undo
1030 1030
 			$TKT->save();
1031 1031
 
1032 1032
 			//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.
1033
-			if( $TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date') ) {
1034
-				$TKT->set('TKT_end_date', $TKT->get('TKT_start_date') );
1033
+			if ($TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date')) {
1034
+				$TKT->set('TKT_end_date', $TKT->get('TKT_start_date'));
1035 1035
 				EE_Registry::instance()->load_helper('DTT_Helper');
1036 1036
 				$TKT = EEH_DTT_Helper::date_time_add($TKT, 'TKT_end_date', 'days');
1037 1037
 				$TKT->save();
1038 1038
 			}
1039 1039
 
1040 1040
 			//initially let's add the ticket to the dtt
1041
-			$saved_dtt->_add_relation_to( $TKT, 'Ticket' );
1041
+			$saved_dtt->_add_relation_to($TKT, 'Ticket');
1042 1042
 
1043 1043
 			$saved_tickets[$TKT->ID()] = $TKT;
1044 1044
 
1045 1045
 			//add prices to ticket
1046
-			$this->_add_prices_to_ticket( $data['edit_prices'][$row], $TKT, $update_prices );
1046
+			$this->_add_prices_to_ticket($data['edit_prices'][$row], $TKT, $update_prices);
1047 1047
 		}
1048 1048
 		//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.
1049
-		$old_tickets = isset( $old_tickets[0] ) && $old_tickets[0] == '' ? array() : $old_tickets;
1050
-		$tickets_removed = array_diff( $old_tickets, array_keys( $saved_tickets ) );
1049
+		$old_tickets = isset($old_tickets[0]) && $old_tickets[0] == '' ? array() : $old_tickets;
1050
+		$tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
1051 1051
 
1052
-		foreach ( $tickets_removed as $id ) {
1053
-			$id = absint( $id );
1052
+		foreach ($tickets_removed as $id) {
1053
+			$id = absint($id);
1054 1054
 
1055 1055
 			//get the ticket for this id
1056 1056
 			$tkt_to_remove = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($id);
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
 			//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)
1059 1059
 			$dtts = $tkt_to_remove->get_many_related('Datetime');
1060 1060
 
1061
-			foreach( $dtts as $dtt ) {
1061
+			foreach ($dtts as $dtt) {
1062 1062
 				$tkt_to_remove->_remove_relation_to($dtt, 'Datetime');
1063 1063
 			}
1064 1064
 
@@ -1083,31 +1083,31 @@  discard block
 block discarded – undo
1083 1083
 	 * @param bool 		$new_prices Whether attach existing incoming prices or create new ones.
1084 1084
 	 * @return  void
1085 1085
 	 */
1086
-	private function  _add_prices_to_ticket( $prices, EE_Ticket $ticket, $new_prices = FALSE ) {
1087
-		foreach ( $prices as $row => $prc ) {
1086
+	private function  _add_prices_to_ticket($prices, EE_Ticket $ticket, $new_prices = FALSE) {
1087
+		foreach ($prices as $row => $prc) {
1088 1088
 			$PRC_values = array(
1089
-				'PRC_ID' => !empty( $prc['PRC_ID'] ) ? $prc['PRC_ID'] : NULL,
1090
-				'PRT_ID' => !empty( $prc['PRT_ID'] ) ? $prc['PRT_ID'] : NULL,
1091
-				'PRC_amount' => !empty( $prc['PRC_amount'] ) ? $prc['PRC_amount'] : 0,
1092
-				'PRC_name' => !empty( $prc['PRC_name'] ) ? $prc['PRC_name'] : '',
1093
-				'PRC_desc' => !empty( $prc['PRC_desc'] ) ? $prc['PRC_desc'] : '',
1089
+				'PRC_ID' => ! empty($prc['PRC_ID']) ? $prc['PRC_ID'] : NULL,
1090
+				'PRT_ID' => ! empty($prc['PRT_ID']) ? $prc['PRT_ID'] : NULL,
1091
+				'PRC_amount' => ! empty($prc['PRC_amount']) ? $prc['PRC_amount'] : 0,
1092
+				'PRC_name' => ! empty($prc['PRC_name']) ? $prc['PRC_name'] : '',
1093
+				'PRC_desc' => ! empty($prc['PRC_desc']) ? $prc['PRC_desc'] : '',
1094 1094
 				'PRC_is_default' => 0, //make sure prices are NOT set as default from this context
1095 1095
 				'PRC_order' => $row
1096 1096
 				);
1097 1097
 
1098
-			if ( $new_prices || empty( $PRC_values['PRC_ID'] ) ) {
1098
+			if ($new_prices || empty($PRC_values['PRC_ID'])) {
1099 1099
 				$PRC_values['PRC_ID'] = 0;
1100
-				$PRC = EE_Registry::instance()->load_class('Price', array( $PRC_values ), FALSE, FALSE);
1100
+				$PRC = EE_Registry::instance()->load_class('Price', array($PRC_values), FALSE, FALSE);
1101 1101
 			} else {
1102
-				$PRC = EE_Registry::instance()->load_model( 'Price' )->get_one_by_ID( $prc['PRC_ID'] );
1102
+				$PRC = EE_Registry::instance()->load_model('Price')->get_one_by_ID($prc['PRC_ID']);
1103 1103
 				//update this price with new values
1104
-				foreach ( $PRC_values as $field => $newprc ) {
1105
-					$PRC->set( $field, $newprc );
1104
+				foreach ($PRC_values as $field => $newprc) {
1105
+					$PRC->set($field, $newprc);
1106 1106
 				}
1107 1107
 				$PRC->save();
1108 1108
 			}
1109 1109
 
1110
-			$PRC = $ticket->_add_relation_to( $PRC, 'Price' );
1110
+			$PRC = $ticket->_add_relation_to($PRC, 'Price');
1111 1111
 		}
1112 1112
 	}
1113 1113
 
@@ -1130,33 +1130,33 @@  discard block
 block discarded – undo
1130 1130
 
1131 1131
 		return; //TEMPORARILY EXITING CAUSE THIS IS A TODO
1132 1132
 
1133
-		$postid = isset( $this->_req_data['post_ID'] ) ? $this->_req_data['post_ID'] : NULL;
1133
+		$postid = isset($this->_req_data['post_ID']) ? $this->_req_data['post_ID'] : NULL;
1134 1134
 
1135 1135
 
1136 1136
 		//if no postid then get out cause we need it for stuff in here
1137
-		if ( empty( $postid ) ) return;
1137
+		if (empty($postid)) return;
1138 1138
 
1139 1139
 
1140 1140
 		//handle datetime saves
1141 1141
 		$items = array();
1142 1142
 
1143
-		$get_one_where = array( $this->_event_model()->primary_key_name() => $postid );
1144
-		$event = $this->_event_model()->get_one( array($get_one_where) );
1143
+		$get_one_where = array($this->_event_model()->primary_key_name() => $postid);
1144
+		$event = $this->_event_model()->get_one(array($get_one_where));
1145 1145
 
1146 1146
 		//now let's get the attached datetimes from the most recent autosave
1147 1147
 		$dtts = $event->get_many_related('Datetime');
1148 1148
 
1149 1149
 		$dtt_ids = array();
1150
-		foreach( $dtts as $dtt ) {
1150
+		foreach ($dtts as $dtt) {
1151 1151
 			$dtt_ids[] = $dtt->ID();
1152 1152
 			$order = $dtt->order();
1153 1153
 			$this->_template_args['data']['items']['ID-'.$order] = $dtt->ID();
1154 1154
 		}
1155
-		$this->_template_args['data']['items']['datetime_IDS'] = serialize( $dtt_ids );
1155
+		$this->_template_args['data']['items']['datetime_IDS'] = serialize($dtt_ids);
1156 1156
 
1157 1157
 		//handle DECAF venues
1158 1158
 		//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.
1159
-		if ( $do_venue_autosaves = apply_filters( 'FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', TRUE ) ) {
1159
+		if ($do_venue_autosaves = apply_filters('FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', TRUE)) {
1160 1160
 			$venue = $event->get_first_related('Venue');
1161 1161
 			$this->_template_args['data']['items']['venue-id'] = $venue->ID();
1162 1162
 		}
@@ -1167,23 +1167,23 @@  discard block
 block discarded – undo
1167 1167
 
1168 1168
 		$ticket_ids = array();
1169 1169
 		$price_ids = array();
1170
-		foreach ( $tickets as $ticket ) {
1170
+		foreach ($tickets as $ticket) {
1171 1171
 			$ticket_ids[] = $price->ID();
1172 1172
 			$ticket_order = $price->get('TKT_order');
1173
-			$this->_template_args['data']['items']['edit-ticket-id-' . $ticket_order] = $ticket->ID();
1174
-			$this->_template_args['data']['items']['edit-ticket-event-id-' . $order] = $event->ID();
1173
+			$this->_template_args['data']['items']['edit-ticket-id-'.$ticket_order] = $ticket->ID();
1174
+			$this->_template_args['data']['items']['edit-ticket-event-id-'.$order] = $event->ID();
1175 1175
 
1176 1176
 			//now we have to make sure the prices are updated appropriately
1177 1177
 			$prices = $ticket->get_many_related('Prices');
1178 1178
 
1179
-			foreach ( $prices as $price ) {
1179
+			foreach ($prices as $price) {
1180 1180
 				$price_ids[] = $price->ID();
1181 1181
 				$price_order = $price->get('PRC_order');
1182
-				$this->_template_args['data']['items']['quick-edit-ticket-price-id-ticketrow-' . $ticket_order . '-' . $price_order] = $price->ID();
1183
-				$this->_template_args['data']['items']['edit-ticket-price-id-ticketrow-' . $ticket_row . '-' . $price_row] = $price->ID();
1184
-				$this->_template_args['data']['items']['edit-ticket-price-is-default-ticketrow-' . $ticket_row . '-' . $price_row] = $price->get('PRC_is_default');
1182
+				$this->_template_args['data']['items']['quick-edit-ticket-price-id-ticketrow-'.$ticket_order.'-'.$price_order] = $price->ID();
1183
+				$this->_template_args['data']['items']['edit-ticket-price-id-ticketrow-'.$ticket_row.'-'.$price_row] = $price->ID();
1184
+				$this->_template_args['data']['items']['edit-ticket-price-is-default-ticketrow-'.$ticket_row.'-'.$price_row] = $price->get('PRC_is_default');
1185 1185
 			}
1186
-			$this->_template_args['data']['items']['price-IDs-ticketrow-' . $ticket_row] = implode(',', $price_ids);
1186
+			$this->_template_args['data']['items']['price-IDs-ticketrow-'.$ticket_row] = implode(',', $price_ids);
1187 1187
 		}
1188 1188
 		$this->_template_args['data']['items']['ticket-IDs'] = implode(',', $ticket_ids);
1189 1189
 	}
@@ -1201,26 +1201,26 @@  discard block
 block discarded – undo
1201 1201
 	private function _generate_publish_box_extra_content() {
1202 1202
 
1203 1203
 		//load formatter helper
1204
-  		EE_Registry::instance()->load_helper( 'Formatter' );
1204
+  		EE_Registry::instance()->load_helper('Formatter');
1205 1205
 
1206 1206
   		//args for getting related registrations
1207
-  		$approved_query_args = array( array( 'REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_approved ) );
1208
-  		$not_approved_query_args = array( array( 'REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_not_approved ) );
1209
-  		$pending_payment_query_args = array( array( 'REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_pending_payment ) );
1207
+  		$approved_query_args = array(array('REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_approved));
1208
+  		$not_approved_query_args = array(array('REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_not_approved));
1209
+  		$pending_payment_query_args = array(array('REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_pending_payment));
1210 1210
 
1211 1211
 
1212 1212
 		// publish box
1213
-		$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);
1214
-		$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);
1215
-		$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);
1213
+		$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);
1214
+		$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);
1215
+		$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);
1216 1216
 		$publish_box_extra_args['approved_regs'] = $this->_cpt_model_obj->count_related('Registration', $approved_query_args);
1217 1217
 		$publish_box_extra_args['not_approved_regs'] = $this->_cpt_model_obj->count_related('Registration', $not_approved_query_args);
1218 1218
 		$publish_box_extra_args['pending_payment_regs'] = $this->_cpt_model_obj->count_related('Registration', $pending_payment_query_args);
1219
-		$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
+		$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');
1220 1220
 		//$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');
1221
-		$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
+		$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);
1222 1222
 		// load template
1223
-		EEH_Template::display_template( EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php', $publish_box_extra_args );
1223
+		EEH_Template::display_template(EVENTS_TEMPLATE_PATH.'event_publish_box_extras.template.php', $publish_box_extra_args);
1224 1224
 	}
1225 1225
 
1226 1226
 
@@ -1252,7 +1252,7 @@  discard block
 block discarded – undo
1252 1252
 		$this->verify_cpt_object();
1253 1253
 		add_meta_box('espresso_event_editor_tickets', __('Event Datetime & Ticket', 'event_espresso'), array($this, 'ticket_metabox'), $this->page_slug, 'normal', 'high');
1254 1254
 		add_meta_box('espresso_event_editor_event_options', __('Event Registration Options', 'event_espresso'), array($this, 'registration_options_meta_box'), $this->page_slug, 'side', 'default');
1255
-		add_meta_box('espresso_event_editor_venue', __('Venue Details', 'event_espresso'), array( $this, 'venue_metabox' ), $this->page_slug, 'normal', 'core');
1255
+		add_meta_box('espresso_event_editor_venue', __('Venue Details', 'event_espresso'), array($this, 'venue_metabox'), $this->page_slug, 'normal', 'core');
1256 1256
 		//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".
1257 1257
 	}
1258 1258
 
@@ -1277,53 +1277,53 @@  discard block
 block discarded – undo
1277 1277
 			'disabled' => ''
1278 1278
 			);
1279 1279
 
1280
-		$event_id = is_object( $this->_cpt_model_obj ) ? $this->_cpt_model_obj->ID() : NULL;
1280
+		$event_id = is_object($this->_cpt_model_obj) ? $this->_cpt_model_obj->ID() : NULL;
1281 1281
 
1282
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1282
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1283 1283
 
1284 1284
 		/**
1285 1285
 		 * 1. Start with retrieving Datetimes
1286 1286
 		 * 2. Fore each datetime get related tickets
1287 1287
 		 * 3. For each ticket get related prices
1288 1288
 		 */
1289
-		$times = EE_Registry::instance()->load_model('Datetime' )->get_all_event_dates( $event_id );
1290
-		EE_Registry::instance()->load_helper('DTT_Helper' );
1289
+		$times = EE_Registry::instance()->load_model('Datetime')->get_all_event_dates($event_id);
1290
+		EE_Registry::instance()->load_helper('DTT_Helper');
1291 1291
 
1292 1292
 		$firstdtt = array_slice($times, 0, 1);
1293 1293
 		//do we get related tickets?
1294
-		if ( $firstdtt[0]->get('DTT_ID') !== 0 ) {
1295
-			foreach ( $times as $time ) {
1294
+		if ($firstdtt[0]->get('DTT_ID') !== 0) {
1295
+			foreach ($times as $time) {
1296 1296
 				$existing_datetime_ids[] = $time->get('DTT_ID');
1297 1297
 				$template_args['time'] = $time;
1298
-				$related_tickets = $time->get_many_related('Ticket', array( array( 'OR' => array( 'TKT_deleted' => 1, 'TKT_deleted*' => 0 ) ), 'default_where_conditions' => 'none' ) );
1298
+				$related_tickets = $time->get_many_related('Ticket', array(array('OR' => array('TKT_deleted' => 1, 'TKT_deleted*' => 0)), 'default_where_conditions' => 'none'));
1299 1299
 
1300
-				if ( !empty($related_tickets) ) {
1300
+				if ( ! empty($related_tickets)) {
1301 1301
 					$template_args['total_ticket_rows'] = count($related_tickets);
1302 1302
 					$row = 0;
1303
-					foreach ( $related_tickets as $ticket ) {
1303
+					foreach ($related_tickets as $ticket) {
1304 1304
 						$existing_ticket_ids[] = $ticket->get('TKT_ID');
1305
-						$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, FALSE, $row );
1305
+						$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, FALSE, $row);
1306 1306
 
1307 1307
 						$row++;
1308 1308
 					}
1309 1309
 				} else {
1310 1310
 					$template_args['total_ticket_rows'] = 1;
1311 1311
 					$ticket = EE_Registry::instance()->load_model('Ticket')->create_default_object();
1312
-					$template_args['ticket_rows'] .= $this->_get_ticket_row( $ticket );
1312
+					$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket);
1313 1313
 				}
1314 1314
 			}
1315 1315
 		} else {
1316 1316
 			$template_args['time'] = $times[0];
1317 1317
 			$ticket = EE_Registry::instance()->load_model('Ticket')->get_all_default_tickets();
1318
-			$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
+			$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);
1319 1319
 		}
1320 1320
 
1321 1321
 		$template_args['event_datetime_help_link'] = $this->_get_help_tab_link('event_editor_event_datetimes_help_tab');
1322 1322
 		$template_args['ticket_options_help_link'] = $this->_get_help_tab_link('ticket_options_info');
1323 1323
 		$template_args['existing_datetime_ids'] = implode(',', $existing_datetime_ids);
1324 1324
 		$template_args['existing_ticket_ids'] = implode(',', $existing_ticket_ids);
1325
-		$template_args['ticket_js_structure'] = $this->_get_ticket_row( EE_Registry::instance()->load_model('Ticket')->create_default_object(), TRUE );
1326
-		$template = apply_filters( 'FHEE__Events_Admin_Page__ticket_metabox__template', EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php' );
1325
+		$template_args['ticket_js_structure'] = $this->_get_ticket_row(EE_Registry::instance()->load_model('Ticket')->create_default_object(), TRUE);
1326
+		$template = apply_filters('FHEE__Events_Admin_Page__ticket_metabox__template', EVENTS_TEMPLATE_PATH.'event_tickets_metabox_main.template.php');
1327 1327
 		EEH_Template::display_template($template, $template_args);
1328 1328
 	}
1329 1329
 
@@ -1337,21 +1337,21 @@  discard block
 block discarded – undo
1337 1337
 	 * @param  boolean    $skeleton whether we're generating a skeleton for js manipulation
1338 1338
 	 * @return string               generated html for the ticket row.
1339 1339
 	 */
1340
-	private function _get_ticket_row( $ticket, $skeleton = FALSE, $row = 0 ) {
1340
+	private function _get_ticket_row($ticket, $skeleton = FALSE, $row = 0) {
1341 1341
 		$template_args = array(
1342
-			'tkt_status_class' => ' tkt-status-' . $ticket->ticket_status(),
1343
-			'tkt_archive_class' => $ticket->ticket_status() === EE_Ticket::archived && !$skeleton ? ' tkt-archived' : '',
1342
+			'tkt_status_class' => ' tkt-status-'.$ticket->ticket_status(),
1343
+			'tkt_archive_class' => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived' : '',
1344 1344
 			'ticketrow' => $skeleton ? 'TICKETNUM' : $row,
1345 1345
 			'TKT_ID' => $ticket->get('TKT_ID'),
1346 1346
 			'TKT_name' => $ticket->get('TKT_name'),
1347 1347
 			'TKT_start_date' => $skeleton ? '' : $ticket->get_date('TKT_start_date', 'Y-m-d h:i a'),
1348 1348
 			'TKT_end_date' => $skeleton ? '' : $ticket->get_date('TKT_end_date', 'Y-m-d h:i a'),
1349 1349
 			'TKT_is_default' => $ticket->get('TKT_is_default'),
1350
-			'TKT_qty' => $ticket->get_pretty('TKT_qty','input'),
1350
+			'TKT_qty' => $ticket->get_pretty('TKT_qty', 'input'),
1351 1351
 			'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1352 1352
 			'TKT_sold' => $skeleton ? 0 : $ticket->get('TKT_sold'),
1353
-			'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',
1354
-			'disabled' => $skeleton || ( !empty( $ticket ) && ! $ticket->get('TKT_deleted' ) ) ? '' : ' disabled=disabled'
1353
+			'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',
1354
+			'disabled' => $skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted')) ? '' : ' disabled=disabled'
1355 1355
 			);
1356 1356
 
1357 1357
 		$price = $ticket->ID() !== 0 ? $ticket->get_first_related('Price', array('default_where_conditions' => 'none')) : EE_Registry::instance()->load_model('Price')->create_default_object();
@@ -1367,23 +1367,23 @@  discard block
 block discarded – undo
1367 1367
 
1368 1368
 		//make sure we have default start and end dates if skeleton
1369 1369
 		//handle rows that should NOT be empty
1370
-		if ( empty( $template_args['TKT_start_date'] ) ) {
1370
+		if (empty($template_args['TKT_start_date'])) {
1371 1371
 			//if empty then the start date will be now.
1372 1372
 			$template_args['TKT_start_date'] = date('Y-m-d h:i a', current_time('timestamp'));
1373 1373
 		}
1374 1374
 
1375
-		if ( empty( $template_args['TKT_end_date'] ) ) {
1375
+		if (empty($template_args['TKT_end_date'])) {
1376 1376
 			//get the earliest datetime (if present);
1377
-			$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
+			$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;
1378 1378
 
1379
-			if ( !empty( $earliest_dtt ) )
1379
+			if ( ! empty($earliest_dtt))
1380 1380
 				$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1381 1381
 			else
1382
-				$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d")+7, date("Y") ) );
1382
+				$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d") + 7, date("Y")));
1383 1383
 		}
1384 1384
 
1385
-		$template_args = array_merge( $template_args, $price_args );
1386
-		$template = apply_filters( 'FHEE__Events_Admin_Page__get_ticket_row__template', EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php', $ticket);
1385
+		$template_args = array_merge($template_args, $price_args);
1386
+		$template = apply_filters('FHEE__Events_Admin_Page__get_ticket_row__template', EVENTS_TEMPLATE_PATH.'event_tickets_metabox_ticket_row.template.php', $ticket);
1387 1387
 		return EEH_Template::display_template($template, $template_args, TRUE);
1388 1388
 	}
1389 1389
 
@@ -1396,7 +1396,7 @@  discard block
 block discarded – undo
1396 1396
 			array('id' => false, 'text' => __('No', 'event_espresso'))
1397 1397
 		);
1398 1398
 
1399
-		$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
+		$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);
1400 1400
 
1401 1401
 		//$template_args['is_active_select'] = EEH_Form_Fields::select_input('is_active', $yes_no_values, $this->_cpt_model_obj->is_active());
1402 1402
 		$template_args['_event'] = $this->_cpt_model_obj;
@@ -1405,8 +1405,8 @@  discard block
 block discarded – undo
1405 1405
 		$template_args['default_registration_status'] = EEH_Form_Fields::select_input('default_reg_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status());
1406 1406
 		$template_args['display_description'] = EEH_Form_Fields::select_input('display_desc', $yes_no_values, $this->_cpt_model_obj->display_description());
1407 1407
 		$template_args['display_ticket_selector'] = EEH_Form_Fields::select_input('display_ticket_selector', $yes_no_values, $this->_cpt_model_obj->display_ticket_selector(), '', '', false);
1408
-		$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 );
1409
-		$templatepath = EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php';
1408
+		$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);
1409
+		$templatepath = EVENTS_TEMPLATE_PATH.'event_registration_options.template.php';
1410 1410
 		EEH_Template::display_template($templatepath, $template_args);
1411 1411
 	}
1412 1412
 
@@ -1420,14 +1420,14 @@  discard block
 block discarded – undo
1420 1420
 
1421 1421
 		//first let's see if we have a venue already
1422 1422
 		$event_id = $this->_cpt_model_obj->ID();
1423
-		$venue = !empty( $event_id ) ? $this->_cpt_model_obj->venues() : NULL;
1424
-		$venue = empty( $venue ) ? EE_Registry::instance()->load_model('Venue')->create_default_object() : array_shift( $venue );
1423
+		$venue = ! empty($event_id) ? $this->_cpt_model_obj->venues() : NULL;
1424
+		$venue = empty($venue) ? EE_Registry::instance()->load_model('Venue')->create_default_object() : array_shift($venue);
1425 1425
 		$template_args['_venue'] = $venue;
1426 1426
 
1427 1427
 		$template_args['states_dropdown'] = EEH_Form_Fields::generate_form_input(
1428 1428
 			$QFI = new EE_Question_Form_Input(
1429
-				EE_Question::new_instance( array( 'QST_display_text' => 'State', 'QST_system' => 'state' )),
1430
-				EE_Answer::new_instance( array(  'ANS_value'=> $venue->state_ID() )),
1429
+				EE_Question::new_instance(array('QST_display_text' => 'State', 'QST_system' => 'state')),
1430
+				EE_Answer::new_instance(array('ANS_value'=> $venue->state_ID())),
1431 1431
 				array(
1432 1432
 					'input_name' =>  'state',
1433 1433
 					'input_id' => 'phys-state',
@@ -1439,8 +1439,8 @@  discard block
 block discarded – undo
1439 1439
 		);
1440 1440
 		$template_args['countries_dropdown'] = EEH_Form_Fields::generate_form_input(
1441 1441
 			$QFI = new EE_Question_Form_Input(
1442
-				EE_Question::new_instance( array( 'QST_display_text' => 'Country', 'QST_system' => 'country' )),
1443
-				EE_Answer::new_instance( array(  'ANS_value'=> $venue->country_ID() )),
1442
+				EE_Question::new_instance(array('QST_display_text' => 'Country', 'QST_system' => 'country')),
1443
+				EE_Answer::new_instance(array('ANS_value'=> $venue->country_ID())),
1444 1444
 				array(
1445 1445
 					'input_name' =>  'countries',
1446 1446
 					'input_id' => 'phys-country',
@@ -1451,8 +1451,8 @@  discard block
 block discarded – undo
1451 1451
 			)
1452 1452
 		);
1453 1453
 
1454
-		$template_path = EVENTS_TEMPLATE_PATH . 'event_venues_metabox_content.template.php';
1455
-		EEH_Template::display_template( $template_path, $template_args );
1454
+		$template_path = EVENTS_TEMPLATE_PATH.'event_venues_metabox_content.template.php';
1455
+		EEH_Template::display_template($template_path, $template_args);
1456 1456
 	}
1457 1457
 
1458 1458
 
@@ -1479,21 +1479,21 @@  discard block
 block discarded – undo
1479 1479
 		$EEME = $this->_event_model();
1480 1480
 
1481 1481
 		$offset = ($current_page - 1) * $per_page;
1482
-		$limit = $count ? NULL : $offset . ',' . $per_page;
1482
+		$limit = $count ? NULL : $offset.','.$per_page;
1483 1483
 		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1484 1484
 		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : "DESC";
1485 1485
 
1486 1486
 		if (isset($this->_req_data['month_range'])) {
1487 1487
 			$pieces = explode(' ', $this->_req_data['month_range'], 3);
1488
-			$month_r = !empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
1489
-			$year_r = !empty($pieces[1]) ? $pieces[1] : '';
1488
+			$month_r = ! empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
1489
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1490 1490
 		}
1491 1491
 
1492 1492
 		$where = array();
1493 1493
 
1494
-		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL;
1494
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : NULL;
1495 1495
 		//determine what post_status our condition will have for the query.
1496
-		switch ( $status ) {
1496
+		switch ($status) {
1497 1497
 			case 'month' :
1498 1498
 			case 'today' :
1499 1499
 			case NULL :
@@ -1501,7 +1501,7 @@  discard block
 block discarded – undo
1501 1501
 				break;
1502 1502
 
1503 1503
 			case 'draft' :
1504
-				$where['status'] = array( 'IN', array('draft', 'auto-draft') );
1504
+				$where['status'] = array('IN', array('draft', 'auto-draft'));
1505 1505
 				break;
1506 1506
 
1507 1507
 			default :
@@ -1509,46 +1509,46 @@  discard block
 block discarded – undo
1509 1509
 		}
1510 1510
 
1511 1511
 		//categories?
1512
-		$category = isset( $this->_req_data['EVT_CAT'] ) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
1512
+		$category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
1513 1513
 
1514
-		if ( !empty ( $category ) ) {
1514
+		if ( ! empty ($category)) {
1515 1515
 			$where['Term_Taxonomy.taxonomy'] = 'espresso_event_categories';
1516 1516
 			$where['Term_Taxonomy.term_id'] = $category;
1517 1517
 		}
1518 1518
 
1519 1519
 		//date where conditions
1520 1520
 		if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] != '') {
1521
-			$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
+			$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')));
1522 1522
 		} else if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'today') {
1523
-			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array( strtotime(date('Y-m-d') . ' 0:00:00'), strtotime(date('Y-m-d') . ' 23:59:59') ) );
1524
-		} else if ( isset($this->_req_data['status']) && $this->_req_data['status'] == 'month' ) {
1523
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array(strtotime(date('Y-m-d').' 0:00:00'), strtotime(date('Y-m-d').' 23:59:59')));
1524
+		} else if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'month') {
1525 1525
 			$this_year_r = date('Y');
1526 1526
 			$this_month_r = date('m');
1527 1527
 			$days_this_month = date('t');
1528 1528
 			$start = ' 00:00:00';
1529 1529
 			$end = ' 23:59:59';
1530
-			$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
+			$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)));
1531 1531
 		}
1532 1532
 
1533 1533
 		//possible conditions for capability checks
1534
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_events', 'get_events') ) {
1535
-			$where['status**'] = array( '!=', 'private' );
1534
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
1535
+			$where['status**'] = array('!=', 'private');
1536 1536
 		}
1537 1537
 
1538
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {
1539
-			$where['EVT_wp_user'] =  get_current_user_id();
1538
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1539
+			$where['EVT_wp_user'] = get_current_user_id();
1540 1540
 		}
1541 1541
 
1542
-		if ( isset( $this->_req_data['EVT_wp_user'] ) ) {
1543
-			if ( $this->_req_data['EVT_wp_user'] != get_current_user_id() && EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {
1542
+		if (isset($this->_req_data['EVT_wp_user'])) {
1543
+			if ($this->_req_data['EVT_wp_user'] != get_current_user_id() && EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1544 1544
 				$where['EVT_wp_user'] = $this->_req_data['EVT_wp_user'];
1545 1545
 			}
1546 1546
 		}
1547 1547
 
1548 1548
 
1549 1549
 		//search query handling
1550
-		if ( isset( $this->_req_data['s'] ) ) {
1551
-			$search_string = '%' . $this->_req_data['s'] . '%';
1550
+		if (isset($this->_req_data['s'])) {
1551
+			$search_string = '%'.$this->_req_data['s'].'%';
1552 1552
 			$where['OR'] = array(
1553 1553
 				'EVT_name' => array('LIKE', $search_string),
1554 1554
 				'EVT_desc' => array('LIKE', $search_string),
@@ -1557,32 +1557,32 @@  discard block
 block discarded – undo
1557 1557
 		}
1558 1558
 
1559 1559
 
1560
-		$where = apply_filters( 'FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data );
1561
-		$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 );
1560
+		$where = apply_filters('FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data);
1561
+		$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);
1562 1562
 
1563 1563
 
1564 1564
 		//let's first check if we have special requests coming in.
1565
-		if ( isset( $this->_req_data['active_status'] ) ) {
1566
-			switch ( $this->_req_data['active_status'] ) {
1565
+		if (isset($this->_req_data['active_status'])) {
1566
+			switch ($this->_req_data['active_status']) {
1567 1567
 				case 'upcoming' :
1568
-					return $EEME->get_upcoming_events( $query_params, $count );
1568
+					return $EEME->get_upcoming_events($query_params, $count);
1569 1569
 					break;
1570 1570
 
1571 1571
 				case 'expired' :
1572
-					return $EEME->get_expired_events( $query_params, $count );
1572
+					return $EEME->get_expired_events($query_params, $count);
1573 1573
 					break;
1574 1574
 
1575 1575
 				case 'active' :
1576
-					return $EEME->get_active_events( $query_params, $count );
1576
+					return $EEME->get_active_events($query_params, $count);
1577 1577
 					break;
1578 1578
 
1579 1579
 				case 'inactive' :
1580
-					return $EEME->get_inactive_events( $query_params, $count );
1580
+					return $EEME->get_inactive_events($query_params, $count);
1581 1581
 					break;
1582 1582
 			}
1583 1583
 		}
1584 1584
 
1585
-		$events = $count ? $EEME->count( array( $where ), 'EVT_ID' ) : $EEME->get_all( $query_params );
1585
+		$events = $count ? $EEME->count(array($where), 'EVT_ID') : $EEME->get_all($query_params);
1586 1586
 
1587 1587
 		return $events;
1588 1588
 	}
@@ -1591,23 +1591,23 @@  discard block
 block discarded – undo
1591 1591
 
1592 1592
 
1593 1593
 	//handling for WordPress CPT actions (trash, restore, delete)
1594
-	public function trash_cpt_item( $post_id ) {
1594
+	public function trash_cpt_item($post_id) {
1595 1595
 		$this->_req_data['EVT_ID'] = $post_id;
1596
-		$this->_trash_or_restore_event( 'trash', FALSE );
1596
+		$this->_trash_or_restore_event('trash', FALSE);
1597 1597
 	}
1598 1598
 
1599 1599
 
1600 1600
 
1601 1601
 
1602
-	public function restore_cpt_item( $post_id ) {
1602
+	public function restore_cpt_item($post_id) {
1603 1603
 		$this->_req_data['EVT_ID'] = $post_id;
1604
-		$this->_trash_or_restore_event( 'draft', FALSE );
1604
+		$this->_trash_or_restore_event('draft', FALSE);
1605 1605
 	}
1606 1606
 
1607 1607
 
1608
-	public function delete_cpt_item( $post_id ) {
1608
+	public function delete_cpt_item($post_id) {
1609 1609
 		$this->_req_data['EVT_ID'] = $post_id;
1610
-		$this->_delete_event( FALSE );
1610
+		$this->_delete_event(FALSE);
1611 1611
 	}
1612 1612
 
1613 1613
 
@@ -1619,7 +1619,7 @@  discard block
 block discarded – undo
1619 1619
 	 * @param  string $event_status
1620 1620
 	 * @return void
1621 1621
 	 */
1622
-	protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = TRUE ) {
1622
+	protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = TRUE) {
1623 1623
 		//determine the event id and set to array.
1624 1624
 		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : FALSE;
1625 1625
 		// loop thru events
@@ -1627,7 +1627,7 @@  discard block
 block discarded – undo
1627 1627
 			// clean status
1628 1628
 			$event_status = sanitize_key($event_status);
1629 1629
 			// grab status
1630
-			if (!empty($event_status)) {
1630
+			if ( ! empty($event_status)) {
1631 1631
 				$success = $this->_change_event_status($EVT_ID, $event_status);
1632 1632
 			} else {
1633 1633
 				$success = FALSE;
@@ -1641,7 +1641,7 @@  discard block
 block discarded – undo
1641 1641
 		}
1642 1642
 		$action = $event_status == 'trash' ? 'moved to the trash' : 'restored from the trash';
1643 1643
 
1644
-		if ( $redirect_after )
1644
+		if ($redirect_after)
1645 1645
 			$this->_redirect_after_action($success, 'Event', $action, array('action' => 'default'));
1646 1646
 	}
1647 1647
 
@@ -1656,7 +1656,7 @@  discard block
 block discarded – undo
1656 1656
 		// clean status
1657 1657
 		$event_status = sanitize_key($event_status);
1658 1658
 		// grab status
1659
-		if (!empty($event_status)) {
1659
+		if ( ! empty($event_status)) {
1660 1660
 			$success = TRUE;
1661 1661
 			//determine the event id and set to array.
1662 1662
 			$EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : array();
@@ -1693,13 +1693,13 @@  discard block
 block discarded – undo
1693 1693
 	 */
1694 1694
 	private function _change_event_status($EVT_ID = FALSE, $event_status = FALSE) {
1695 1695
 		// grab event id
1696
-		if (!$EVT_ID) {
1696
+		if ( ! $EVT_ID) {
1697 1697
 			$msg = __('An error occurred. No Event ID or an invalid Event ID was received.', 'event_espresso');
1698 1698
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1699 1699
 			return FALSE;
1700 1700
 		}
1701 1701
 
1702
-		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID( $EVT_ID );
1702
+		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
1703 1703
 
1704 1704
 		// clean status
1705 1705
 		$event_status = sanitize_key($event_status);
@@ -1725,7 +1725,7 @@  discard block
 block discarded – undo
1725 1725
 				$hook = FALSE;
1726 1726
 		}
1727 1727
 		//use class to change status
1728
-		$this->_cpt_model_obj->set_status( $event_status );
1728
+		$this->_cpt_model_obj->set_status($event_status);
1729 1729
 		$success = $this->_cpt_model_obj->save();
1730 1730
 
1731 1731
 		if ($success === FALSE) {
@@ -1745,15 +1745,15 @@  discard block
 block discarded – undo
1745 1745
 	 * @access protected
1746 1746
 	 * @return void
1747 1747
 	 */
1748
-	protected function _delete_event( $redirect_after = TRUE ) {
1748
+	protected function _delete_event($redirect_after = TRUE) {
1749 1749
 		//determine the event id and set to array.
1750 1750
 		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : NULL;
1751
-		$EVT_ID = isset( $this->_req_data['post'] ) ? absint( $this->_req_data['post'] ) : $EVT_ID;
1751
+		$EVT_ID = isset($this->_req_data['post']) ? absint($this->_req_data['post']) : $EVT_ID;
1752 1752
 
1753 1753
 
1754 1754
 		// loop thru events
1755 1755
 		if ($EVT_ID) {
1756
-			$success = $this->_permanently_delete_event( $EVT_ID );
1756
+			$success = $this->_permanently_delete_event($EVT_ID);
1757 1757
 			// get list of events with no prices
1758 1758
 			$espresso_no_ticket_prices = get_option('ee_no_ticket_prices', array());
1759 1759
 			// remove this event from the list of events with no prices
@@ -1767,7 +1767,7 @@  discard block
 block discarded – undo
1767 1767
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1768 1768
 		}
1769 1769
 
1770
-		if ( $redirect_after )
1770
+		if ($redirect_after)
1771 1771
 			$this->_redirect_after_action($success, 'Event', 'deleted', array('action' => 'default', 'status' => 'trash'));
1772 1772
 	}
1773 1773
 
@@ -1813,7 +1813,7 @@  discard block
 block discarded – undo
1813 1813
 	 */
1814 1814
 	private function _permanently_delete_event($EVT_ID = FALSE) {
1815 1815
 		// grab event id
1816
-		if (!$EVT_ID = absint($EVT_ID)) {
1816
+		if ( ! $EVT_ID = absint($EVT_ID)) {
1817 1817
 			$msg = __('An error occurred. No Event ID or an invalid Event ID was received.', 'event_espresso');
1818 1818
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1819 1819
 			return FALSE;
@@ -1824,10 +1824,10 @@  discard block
 block discarded – undo
1824 1824
 
1825 1825
 		//need to delete related tickets and prices first.
1826 1826
 		$datetimes = $this->_cpt_model_obj->get_many_related('Datetime');
1827
-		foreach ( $datetimes as $datetime ) {
1827
+		foreach ($datetimes as $datetime) {
1828 1828
 			$this->_cpt_model_obj->_remove_relation_to($datetime, 'Datetime');
1829 1829
 			$tickets = $datetime->get_many_related('Ticket');
1830
-			foreach ( $tickets as $ticket ) {
1830
+			foreach ($tickets as $ticket) {
1831 1831
 				$ticket->_remove_relation_to($datetime, 'Datetime');
1832 1832
 				$ticket->delete_related_permanently('Price');
1833 1833
 				$ticket->delete_permanently();
@@ -1837,14 +1837,14 @@  discard block
 block discarded – undo
1837 1837
 
1838 1838
 		//what about related venues or terms?
1839 1839
 		$venues = $this->_cpt_model_obj->get_many_related('Venue');
1840
-		foreach ( $venues as $venue ) {
1840
+		foreach ($venues as $venue) {
1841 1841
 			$this->_cpt_model_obj->_remove_relation_to($venue, 'Venue');
1842 1842
 		}
1843 1843
 
1844 1844
 		//any attached question groups?
1845 1845
 		$question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
1846
-		if ( !empty( $question_groups ) ) {
1847
-			foreach ( $question_groups as $question_group ) {
1846
+		if ( ! empty($question_groups)) {
1847
+			foreach ($question_groups as $question_group) {
1848 1848
 				$this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
1849 1849
 			}
1850 1850
 		}
@@ -1853,13 +1853,13 @@  discard block
 block discarded – undo
1853 1853
 
1854 1854
 
1855 1855
 		//Message Template Groups
1856
-		$this->_cpt_model_obj->_remove_relations( 'Message_Template_Group' );
1856
+		$this->_cpt_model_obj->_remove_relations('Message_Template_Group');
1857 1857
 
1858 1858
 
1859 1859
 		//term taxonomies
1860 1860
 		$term_taxonomies = $this->_cpt_model_obj->term_taxonomies();
1861 1861
 
1862
-		foreach ( $term_taxonomies as $term_taxonomy ) {
1862
+		foreach ($term_taxonomies as $term_taxonomy) {
1863 1863
 			$this->_cpt_model_obj->remove_relation_to_term_taxonomy($term_taxonomy);
1864 1864
 		}
1865 1865
 
@@ -1873,7 +1873,7 @@  discard block
 block discarded – undo
1873 1873
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1874 1874
 			return FALSE;
1875 1875
 		}
1876
-		do_action( 'AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted' );
1876
+		do_action('AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted');
1877 1877
 		return TRUE;
1878 1878
 	}
1879 1879
 
@@ -1890,7 +1890,7 @@  discard block
 block discarded – undo
1890 1890
 	 */
1891 1891
 	public function total_events() {
1892 1892
 
1893
-		$count = EEM_Event::instance()->count( array(), 'EVT_ID' );
1893
+		$count = EEM_Event::instance()->count(array(), 'EVT_ID');
1894 1894
 		return $count;
1895 1895
 	}
1896 1896
 
@@ -1905,10 +1905,10 @@  discard block
 block discarded – undo
1905 1905
 	 */
1906 1906
 	public function total_events_draft() {
1907 1907
 		$where = array(
1908
-			'status' => array( 'IN', array('draft', 'auto-draft' ) )
1908
+			'status' => array('IN', array('draft', 'auto-draft'))
1909 1909
 			);
1910 1910
 
1911
-		$count = EEM_Event::instance()->count( array( $where ), 'EVT_ID' );
1911
+		$count = EEM_Event::instance()->count(array($where), 'EVT_ID');
1912 1912
 		return $count;
1913 1913
 	}
1914 1914
 
@@ -1927,7 +1927,7 @@  discard block
 block discarded – undo
1927 1927
 			'status' => 'trash'
1928 1928
 			);
1929 1929
 
1930
-		$count = EEM_Event::instance()->count( array( $where ), 'EVT_ID' );
1930
+		$count = EEM_Event::instance()->count(array($where), 'EVT_ID');
1931 1931
 		return $count;
1932 1932
 	}
1933 1933
 
@@ -1955,11 +1955,11 @@  discard block
 block discarded – undo
1955 1955
 			// translated
1956 1956
 			TRUE
1957 1957
 		);
1958
-		$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
+		$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;
1959 1959
 
1960 1960
 		$this->_set_add_edit_form_tags('update_default_event_settings');
1961 1961
 		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
1962
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template(EVENTS_TEMPLATE_PATH . 'event_settings.template.php', $this->_template_args, TRUE);
1962
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(EVENTS_TEMPLATE_PATH.'event_settings.template.php', $this->_template_args, TRUE);
1963 1963
 		$this->display_admin_page_with_sidebar();
1964 1964
 	}
1965 1965
 
@@ -1987,22 +1987,22 @@  discard block
 block discarded – undo
1987 1987
 	 * @return void
1988 1988
 	 */
1989 1989
 	private function _set_category_object() {
1990
-		if ( isset( $this->_category->id ) && !empty( $this->_category->id ) )
1990
+		if (isset($this->_category->id) && ! empty($this->_category->id))
1991 1991
 			return; //already have the category object so get out.
1992 1992
 
1993 1993
 		//set default category object
1994 1994
 		$this->_set_empty_category_object();
1995 1995
 
1996 1996
 		//only set if we've got an id
1997
-		if ( !isset($this->_req_data['EVT_CAT_ID'] ) ) {
1997
+		if ( ! isset($this->_req_data['EVT_CAT_ID'])) {
1998 1998
 			return;
1999 1999
 		}
2000 2000
 
2001 2001
 		$category_id = absint($this->_req_data['EVT_CAT_ID']);
2002 2002
 
2003
-		$term = get_term( $category_id, 'espresso_event_categories' );
2003
+		$term = get_term($category_id, 'espresso_event_categories');
2004 2004
 
2005
-		if ( !empty( $term ) ) {
2005
+		if ( ! empty($term)) {
2006 2006
 			$this->_category->category_name = $term->name;
2007 2007
 			$this->_category->category_identifier = $term->slug;
2008 2008
 			$this->_category->category_desc = $term->description;
@@ -2016,13 +2016,13 @@  discard block
 block discarded – undo
2016 2016
 
2017 2017
 	private function _set_empty_category_object() {
2018 2018
 		$this->_category = new stdClass();
2019
-		$this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc  = '';
2019
+		$this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = '';
2020 2020
 		$this->_category->id = $this->_category->parent = 0;
2021 2021
 	}
2022 2022
 
2023 2023
 
2024 2024
 	protected function _category_list_table() {
2025
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2025
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2026 2026
 		$this->_search_btn_label = __('Categories', 'event_espresso');
2027 2027
 		$this->_admin_page_title .= $this->get_action_link_or_button('add_category', 'add_category', array(), 'add-new-h2');
2028 2028
 		$this->display_admin_list_table_page_with_sidebar();
@@ -2032,22 +2032,22 @@  discard block
 block discarded – undo
2032 2032
 	protected function _category_details($view) {
2033 2033
 
2034 2034
 		//load formatter helper
2035
-		EE_Registry::instance()->load_helper( 'Formatter' );
2035
+		EE_Registry::instance()->load_helper('Formatter');
2036 2036
 		//load field generator helper
2037
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
2037
+		EE_Registry::instance()->load_helper('Form_Fields');
2038 2038
 
2039 2039
 		$route = $view == 'edit' ? 'update_category' : 'insert_category';
2040 2040
 		$this->_set_add_edit_form_tags($route);
2041 2041
 
2042 2042
 		$this->_set_category_object();
2043
-		$id = !empty($this->_category->id) ? $this->_category->id : '';
2043
+		$id = ! empty($this->_category->id) ? $this->_category->id : '';
2044 2044
 
2045 2045
 		$delete_action = 'delete_category';
2046 2046
 
2047 2047
 		//custom redirect
2048
-		$redirect = EE_Admin_Page::add_query_args_and_nonce( array('action' => 'category_list'), $this->_admin_base_url );
2048
+		$redirect = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'category_list'), $this->_admin_base_url);
2049 2049
 
2050
-		$this->_set_publish_post_box_vars( 'EVT_CAT_ID', $id, $delete_action, $redirect );
2050
+		$this->_set_publish_post_box_vars('EVT_CAT_ID', $id, $delete_action, $redirect);
2051 2051
 
2052 2052
 		//take care of contents
2053 2053
 		$this->_template_args['admin_page_content'] = $this->_category_details_content();
@@ -2061,25 +2061,25 @@  discard block
 block discarded – undo
2061 2061
 			'type' => 'wp_editor',
2062 2062
 			'value' => EEH_Formatter::admin_format_content($this->_category->category_desc),
2063 2063
 			'class' => 'my_editor_custom',
2064
-			'wpeditor_args' => array('media_buttons' => FALSE )
2064
+			'wpeditor_args' => array('media_buttons' => FALSE)
2065 2065
 		);
2066
-		$_wp_editor = $this->_generate_admin_form_fields( $editor_args, 'array' );
2066
+		$_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array');
2067 2067
 
2068
-		$all_terms = get_terms( array('espresso_event_categories' ), array( 'hide_empty' => 0, 'exclude' => array( $this->_category->id ) ) );
2068
+		$all_terms = get_terms(array('espresso_event_categories'), array('hide_empty' => 0, 'exclude' => array($this->_category->id)));
2069 2069
 
2070 2070
 		//setup category select for term parents.
2071 2071
 		$category_select_values[] = array(
2072 2072
 			'text' => __('No Parent', 'event_espresso'),
2073 2073
 			'id' => 0
2074 2074
 			);
2075
-		foreach ( $all_terms as $term ) {
2075
+		foreach ($all_terms as $term) {
2076 2076
 			$category_select_values[] = array(
2077 2077
 				'text' => $term->name,
2078 2078
 				'id' => $term->term_id
2079 2079
 				);
2080 2080
 		}
2081 2081
 
2082
-		$category_select = EEH_Form_Fields::select_input( 'category_parent', $category_select_values, $this->_category->parent );
2082
+		$category_select = EEH_Form_Fields::select_input('category_parent', $category_select_values, $this->_category->parent);
2083 2083
 
2084 2084
 		$template_args = array(
2085 2085
 			'category' => $this->_category,
@@ -2089,15 +2089,15 @@  discard block
 block discarded – undo
2089 2089
 			'disable' => '',
2090 2090
 			'disabled_message' => FALSE
2091 2091
 			);
2092
-		$template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2093
-		return EEH_Template::display_template($template, $template_args, TRUE );
2092
+		$template = EVENTS_TEMPLATE_PATH.'event_category_details.template.php';
2093
+		return EEH_Template::display_template($template, $template_args, TRUE);
2094 2094
 	}
2095 2095
 
2096 2096
 
2097 2097
 	protected function _delete_categories() {
2098
-		$cat_ids = isset( $this->_req_data['EVT_CAT_ID'] ) ? (array) $this->_req_data['EVT_CAT_ID'] : (array) $this->_req_data['category_id'];
2098
+		$cat_ids = isset($this->_req_data['EVT_CAT_ID']) ? (array) $this->_req_data['EVT_CAT_ID'] : (array) $this->_req_data['category_id'];
2099 2099
 
2100
-		foreach ( $cat_ids as $cat_id ) {
2100
+		foreach ($cat_ids as $cat_id) {
2101 2101
 			$this->_delete_category($cat_id);
2102 2102
 		}
2103 2103
 
@@ -2105,7 +2105,7 @@  discard block
 block discarded – undo
2105 2105
 		$query_args = array(
2106 2106
 			'action' => 'category_list'
2107 2107
 			);
2108
-		$this->_redirect_after_action(0,'','',$query_args);
2108
+		$this->_redirect_after_action(0, '', '', $query_args);
2109 2109
 
2110 2110
 	}
2111 2111
 
@@ -2115,50 +2115,50 @@  discard block
 block discarded – undo
2115 2115
 
2116 2116
 	protected function _delete_category($cat_id) {
2117 2117
 		global $wpdb;
2118
-		$cat_id = absint( $cat_id );
2119
-		wp_delete_term( $cat_id, 'espresso_event_categories' );
2118
+		$cat_id = absint($cat_id);
2119
+		wp_delete_term($cat_id, 'espresso_event_categories');
2120 2120
 	}
2121 2121
 
2122 2122
 
2123 2123
 
2124 2124
 	protected function _insert_or_update_category($new_category) {
2125 2125
 
2126
-		$cat_id = $new_category ? $this->_insert_category() : $this->_insert_category( TRUE );
2126
+		$cat_id = $new_category ? $this->_insert_category() : $this->_insert_category(TRUE);
2127 2127
 		$success = 0; //we already have a success message so lets not send another.
2128 2128
 		$query_args = array(
2129 2129
 			'action' => 'edit_category',
2130 2130
 			'EVT_CAT_ID' => $cat_id
2131 2131
 		);
2132
-		$this->_redirect_after_action( $success, '','', $query_args, TRUE );
2132
+		$this->_redirect_after_action($success, '', '', $query_args, TRUE);
2133 2133
 
2134 2134
 	}
2135 2135
 
2136 2136
 
2137 2137
 
2138
-	private function _insert_category( $update = FALSE ) {
2138
+	private function _insert_category($update = FALSE) {
2139 2139
 		$cat_id = $update ? $this->_req_data['EVT_CAT_ID'] : '';
2140
-		$category_name= isset( $this->_req_data['category_name'] ) ? $this->_req_data['category_name'] : '';
2141
-		$category_desc= isset( $this->_req_data['category_desc'] ) ? $this->_req_data['category_desc'] : '';
2142
-		$category_parent = isset( $this->_req_data['category_parent'] ) ? $this->_req_data['category_parent'] : 0;
2140
+		$category_name = isset($this->_req_data['category_name']) ? $this->_req_data['category_name'] : '';
2141
+		$category_desc = isset($this->_req_data['category_desc']) ? $this->_req_data['category_desc'] : '';
2142
+		$category_parent = isset($this->_req_data['category_parent']) ? $this->_req_data['category_parent'] : 0;
2143 2143
 
2144
-		$term_args=array(
2144
+		$term_args = array(
2145 2145
 			'name'=>$category_name,
2146 2146
 			'description'=>$category_desc,
2147 2147
 			'parent'=>$category_parent
2148 2148
 		);
2149 2149
 		//was the category_identifier input disabled?
2150
-		if(isset($this->_req_data['category_identifier'])){
2150
+		if (isset($this->_req_data['category_identifier'])) {
2151 2151
 			$term_args['slug'] = $this->_req_data['category_identifier'];
2152 2152
 		}
2153
-		$insert_ids = $update ? wp_update_term( $cat_id, 'espresso_event_categories', $term_args ) :wp_insert_term( $category_name, 'espresso_event_categories', $term_args );
2153
+		$insert_ids = $update ? wp_update_term($cat_id, 'espresso_event_categories', $term_args) : wp_insert_term($category_name, 'espresso_event_categories', $term_args);
2154 2154
 
2155
-		if ( !is_array( $insert_ids ) ) {
2156
-			$msg = __( 'An error occurred and the category has not been saved to the database.', 'event_espresso', 'event_espresso' );
2157
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2155
+		if ( ! is_array($insert_ids)) {
2156
+			$msg = __('An error occurred and the category has not been saved to the database.', 'event_espresso', 'event_espresso');
2157
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2158 2158
 		} else {
2159 2159
 			$cat_id = $insert_ids['term_id'];
2160
-			$msg = sprintf ( __('The category %s was successfuly saved', 'event_espresso'), $category_name );
2161
-			EE_Error::add_success( $msg );
2160
+			$msg = sprintf(__('The category %s was successfuly saved', 'event_espresso'), $category_name);
2161
+			EE_Error::add_success($msg);
2162 2162
 		}
2163 2163
 
2164 2164
 		return $cat_id;
@@ -2167,32 +2167,32 @@  discard block
 block discarded – undo
2167 2167
 
2168 2168
 
2169 2169
 
2170
-	public function get_categories( $per_page = 10, $current_page = 1, $count = FALSE ) {
2170
+	public function get_categories($per_page = 10, $current_page = 1, $count = FALSE) {
2171 2171
 		global $wpdb;
2172 2172
 
2173 2173
 		//testing term stuff
2174
-		$orderby = isset( $this->_req_data['orderby'] ) ? $this->_req_data['orderby'] : 'Term.term_id';
2175
-		$order = isset( $this->_req_data['order'] ) ? $this->_req_data['order'] : 'DESC';
2176
-		$limit = ($current_page-1)*$per_page;
2174
+		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'Term.term_id';
2175
+		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
2176
+		$limit = ($current_page - 1) * $per_page;
2177 2177
 
2178
-		$where = array( 'taxonomy' => 'espresso_event_categories' );
2178
+		$where = array('taxonomy' => 'espresso_event_categories');
2179 2179
 
2180
-		if ( isset( $this->_req_data['s'] ) ) {
2181
-			$sstr = '%' . $this->_req_data['s'] . '%';
2180
+		if (isset($this->_req_data['s'])) {
2181
+			$sstr = '%'.$this->_req_data['s'].'%';
2182 2182
 			$where['OR'] = array(
2183
-				'Term.name' => array( 'LIKE', $sstr),
2184
-				'description' => array( 'LIKE', $sstr )
2183
+				'Term.name' => array('LIKE', $sstr),
2184
+				'description' => array('LIKE', $sstr)
2185 2185
 				);
2186 2186
 		}
2187 2187
 
2188 2188
 		$query_params = array(
2189
-			$where ,
2190
-			'order_by' => array( $orderby => $order ),
2191
-			'limit' => $limit . ',' . $per_page,
2189
+			$where,
2190
+			'order_by' => array($orderby => $order),
2191
+			'limit' => $limit.','.$per_page,
2192 2192
 			'force_join' => array('Term')
2193 2193
 			);
2194 2194
 
2195
-		$categories = $count ? EEM_Term_Taxonomy::instance()->count( $query_params, 'term_id' ) :EEM_Term_Taxonomy::instance()->get_all( $query_params );
2195
+		$categories = $count ? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id') : EEM_Term_Taxonomy::instance()->get_all($query_params);
2196 2196
 
2197 2197
 		return $categories;
2198 2198
 	}
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.
admin_pages/events/help_tabs/events_default_settings_status.help_tab.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <h3><?php _e('Default Registration Status', 'event_espresso'); ?></h3>
2 2
 <p>
3
-<strong><?php echo EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ); ?></strong><br />
4
-<?php printf( __('A status of %s means that a registration has been accepted as complete. The registration will count towards the registration limit, remaining tickets, and calculations for available seats. Payments (if necessary) can also be made by primary registrants with this status.', 'event_espresso'), EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) ); ?>
3
+<strong><?php echo EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence'); ?></strong><br />
4
+<?php printf(__('A status of %s means that a registration has been accepted as complete. The registration will count towards the registration limit, remaining tickets, and calculations for available seats. Payments (if necessary) can also be made by primary registrants with this status.', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')); ?>
5 5
 </p>
6 6
 <p>
7
-<strong><?php echo EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ); ?></strong><br />
8
-<?php printf( __('A status of %1$s means that a registration has not paid but they ARE able to make payments (if necessary).  %2$s registrations do NOT count towards registration limits, remaining tickets, and calculations for available seats.  If registration for a free event occurs, then registrations are automatically set to %3$s. For paid tickets, %1$s registrations are set to %3$s when full payment is recorded.', 'event_espresso'), EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ), EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence'), EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) ); ?>
7
+<strong><?php echo EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence'); ?></strong><br />
8
+<?php printf(__('A status of %1$s means that a registration has not paid but they ARE able to make payments (if necessary).  %2$s registrations do NOT count towards registration limits, remaining tickets, and calculations for available seats.  If registration for a free event occurs, then registrations are automatically set to %3$s. For paid tickets, %1$s registrations are set to %3$s when full payment is recorded.', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence'), EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence'), EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')); ?>
9 9
 </p>
10 10
 <p>
11
-<strong><?php echo EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ); ?></strong><br />
12
-<?php printf( __('A status of %1$s means that a registration has not paid and they cannot make payments for towards an event.  Un-approved registrations do NOT count towards registration limits, remaining tickets, and calculations for available seats.  This setting differs from the "%2$s" default in that free ticket registrations and paid in full ticket registrations do NOT automatically switch the Registration to %3$s.  Instead, the event admin must manually set the registration to either "%2$s" for registrations requiring payments, or "%3$s" for free events.', 'event_espresso'), EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ), EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'upper' ), EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'upper' ) ); ?>
11
+<strong><?php echo EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence'); ?></strong><br />
12
+<?php printf(__('A status of %1$s means that a registration has not paid and they cannot make payments for towards an event.  Un-approved registrations do NOT count towards registration limits, remaining tickets, and calculations for available seats.  This setting differs from the "%2$s" default in that free ticket registrations and paid in full ticket registrations do NOT automatically switch the Registration to %3$s.  Instead, the event admin must manually set the registration to either "%2$s" for registrations requiring payments, or "%3$s" for free events.', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence'), EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'upper'), EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'upper')); ?>
13 13
 </p>
14 14
\ No newline at end of file
Please login to merge, or discard this patch.
admin_pages/events/help_tours/Event_Add_Category_Help_Tour.class.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 				'options' => array(
56 56
 					'tipLocation' => 'right',
57 57
 					'tipAdjustmentY' => -55,
58
-                    'tipAdjustmentX' => 5
58
+					'tipAdjustmentX' => 5
59 59
 					)
60 60
 				),
61 61
 			40 => array(
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 				'options' => array(
65 65
 					'tipLocation' => 'top',
66 66
 					'tipAdjustmentY' => -75,
67
-                    'tipAdjustmentX' => 250
67
+					'tipAdjustmentX' => 250
68 68
 					)
69 69
 				)
70 70
 			);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 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
 /**
@@ -72,21 +72,21 @@  discard block
 block discarded – undo
72 72
 
73 73
 
74 74
 	protected function _stop_one() {
75
-		$content = '<h3>' . __('Add New Event Category', 'event_espresso') . '</h3>';
76
-		$content .= '<p>' . __('This tour of the Add New Event Category page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
75
+		$content = '<h3>'.__('Add New Event Category', 'event_espresso').'</h3>';
76
+		$content .= '<p>'.__('This tour of the Add New Event Category page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
77 77
 		return $content;
78 78
 	}
79 79
 
80 80
 	protected function _stop_two() {
81
-		return '<p>' . __('Enter a name for your new category.', 'event_espresso') . '</p>';
81
+		return '<p>'.__('Enter a name for your new category.', 'event_espresso').'</p>';
82 82
 	}
83 83
 
84 84
 	protected function _stop_three() {
85
-		return '<p>' . __('Enter a unique ID for your new category.', 'event_espresso') . '</p>';
85
+		return '<p>'.__('Enter a unique ID for your new category.', 'event_espresso').'</p>';
86 86
 	}
87 87
 
88 88
 	protected function _stop_four() {
89
-		return '<p>' . __('The rich text editor can be used to add information about your category. Images and links can also be added along with your text.', 'event_espresso') . '</p>';
89
+		return '<p>'.__('The rich text editor can be used to add information about your category. Images and links can also be added along with your text.', 'event_espresso').'</p>';
90 90
 	}
91 91
 
92 92
 }
93 93
\ No newline at end of file
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.