Completed
Branch FET-8347-separate-logging (f2247f)
by
unknown
39:36 queued 30:33
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/templates/whats_new.template.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@
 block discarded – undo
1 1
 <div class="changelog point-releases">
2
-	<h3><?php echo _n( 'Minor Release Information', 'Minor Releases', 1 ); ?></h3>
3
-	<!-- <h3><?php echo _n( 'Major Release Information', 'Major Releases', 1 ); ?></h3>-->
2
+	<h3><?php echo _n('Minor Release Information', 'Minor Releases', 1); ?></h3>
3
+	<!-- <h3><?php echo _n('Major Release Information', 'Major Releases', 1); ?></h3>-->
4 4
 	<?php $type = 'minor'; ?>
5 5
 	<?php //$type = 'major'; ?>
6
-	<p><?php printf( __( '<strong>Version %1$s</strong> is a %2$s bug fix/enhancement release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type ); ?>
6
+	<p><?php printf(__('<strong>Version %1$s</strong> is a %2$s bug fix/enhancement release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type); ?>
7 7
 		<?php
8
-			$ver = explode( '.', EVENT_ESPRESSO_VERSION );
9
-			array_pop( $ver );
10
-			$ver = implode( '.', $ver );
8
+			$ver = explode('.', EVENT_ESPRESSO_VERSION);
9
+			array_pop($ver);
10
+			$ver = implode('.', $ver);
11 11
 		?>
12
-		<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://eventespresso.com/wiki/ee4-changelog/#' . $ver ); ?>
12
+		<?php printf(__('For more information, see <a href="%s">the release notes</a>.'), 'http://eventespresso.com/wiki/ee4-changelog/#'.$ver); ?>
13 13
  	</p>
14 14
 </div>
15 15
 
16 16
 <div class="changelog">
17 17
 	<?php
18 18
 	//maintenance mode on?
19
-	if ( EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ) {
19
+	if (EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) {
20 20
 		?>
21 21
 		<div class="ee-attention">
22
-			<h2 class="ee-maintenance-mode-callout"><?php  _e('Event Espresso is in full maintenance mode.' , 'event_espresso'); ?></h2>
22
+			<h2 class="ee-maintenance-mode-callout"><?php  _e('Event Espresso is in full maintenance mode.', 'event_espresso'); ?></h2>
23 23
 			<p>
24 24
 			<?php
25 25
 				printf(
Please login to merge, or discard this patch.
admin_pages/events/Event_Categories_Admin_List_Table.class.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 class Event_Categories_Admin_List_Table extends EE_Admin_List_Table {
33 33
 
34
-	public function __construct( $admin_page ) {
34
+	public function __construct($admin_page) {
35 35
 		parent::__construct($admin_page);
36 36
 	}
37 37
 
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 	protected function _setup_data() {
42
-		$this->_data = $this->_admin_page->get_categories( $this->_per_page, $this->_current_page);
43
-		$this->_all_data_count = EEM_Term_Taxonomy::instance()->count( array( array( 'taxonomy' => 'espresso_event_categories' ) ) );
42
+		$this->_data = $this->_admin_page->get_categories($this->_per_page, $this->_current_page);
43
+		$this->_all_data_count = EEM_Term_Taxonomy::instance()->count(array(array('taxonomy' => 'espresso_event_categories')));
44 44
 	}
45 45
 
46 46
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 
50 50
 	protected function _set_properties() {
51 51
 		$this->_wp_list_args = array(
52
-			'singular' => __('event category', 'event_espresso' ),
53
-			'plural' => __('event categories', 'event_espresso' ),
52
+			'singular' => __('event category', 'event_espresso'),
53
+			'plural' => __('event categories', 'event_espresso'),
54 54
 			'ajax' => TRUE, //for now,
55 55
 			'screen' => $this->_admin_page->get_current_screen()->id
56 56
 			);
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 			);
65 65
 
66 66
 		$this->_sortable_columns = array(
67
-			'id' => array( 'Term.term_id' => true ),
68
-			'name' => array( 'Term.slug' => false ),
69
-			'count' => array( 'term_count' => false )
67
+			'id' => array('Term.term_id' => true),
68
+			'name' => array('Term.slug' => false),
69
+			'count' => array('term_count' => false)
70 70
 			);
71 71
 
72 72
 		$this->_hidden_columns = array();
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
 
98 98
 	public function column_cb($item) {
99
-		return sprintf( '<input type="checkbox" name="EVT_CAT_ID[]" value="%s" />', $item->get('term_id') );
99
+		return sprintf('<input type="checkbox" name="EVT_CAT_ID[]" value="%s" />', $item->get('term_id'));
100 100
 	}
101 101
 
102 102
 
@@ -123,17 +123,17 @@  discard block
 block discarded – undo
123 123
 			'EVT_CAT_ID' => $item->get('term_id')
124 124
 		);
125 125
 
126
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
127
-		$delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EVENTS_ADMIN_URL );
126
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
127
+		$delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EVENTS_ADMIN_URL);
128 128
 
129 129
 		$actions = array(
130
-			'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Category', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>'
130
+			'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Category', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'
131 131
 			);
132 132
 
133 133
 
134
-		$actions['delete'] = '<a href="' . $delete_link . '" title="' . esc_attr__('Delete Category', 'event_espresso') . '">' . __('Delete', 'event_espresso') . '</a>';
134
+		$actions['delete'] = '<a href="'.$delete_link.'" title="'.esc_attr__('Delete Category', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>';
135 135
 
136
-		$content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->get_first_related('Term')->get('name') . '</a></strong>';
136
+		$content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->get_first_related('Term')->get('name').'</a></strong>';
137 137
 		$content .= $this->row_actions($actions);
138 138
 		return $content;
139 139
 	}
@@ -142,20 +142,20 @@  discard block
 block discarded – undo
142 142
 
143 143
 
144 144
 	public function column_shortcode($item) {
145
-		$content = '[ESPRESSO_EVENTS category_slug="' . $item->get_first_related('Term')->get('slug') . '"]';
145
+		$content = '[ESPRESSO_EVENTS category_slug="'.$item->get_first_related('Term')->get('slug').'"]';
146 146
 		return $content;
147 147
 	}
148 148
 
149 149
 
150 150
 
151 151
 
152
-	public function column_count( $item ) {
152
+	public function column_count($item) {
153 153
 		$e_args = array(
154 154
 			'action' => 'default',
155 155
 			'EVT_CAT' => $item->get_first_related('Term')->ID()
156 156
 			);
157
-		$e_link = EE_Admin_Page::add_query_args_and_nonce( $e_args, EVENTS_ADMIN_URL );
158
-		$content = '<a href="' . $e_link . '">' . $item->get('term_count') . '</a>';
157
+		$e_link = EE_Admin_Page::add_query_args_and_nonce($e_args, EVENTS_ADMIN_URL);
158
+		$content = '<a href="'.$e_link.'">'.$item->get('term_count').'</a>';
159 159
 		return $content;
160 160
 	}
161 161
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
admin_pages/events/Events_Admin_List_Table.class.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,8 +111,8 @@
 block discarded – undo
111 111
 		$regs = $item->count_related('Registration');
112 112
 		return $regs > 0 && $this->_view == 'trash' ? '<span class="ee-lock-icon"></span>' : sprintf(
113 113
 			'<input type="checkbox" name="EVT_IDs[]" value="%s" />', $item->ID()
114
-        );
115
-    }
114
+		);
115
+	}
116 116
 
117 117
 
118 118
 
Please login to merge, or discard this patch.
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
 
34 34
 	private $_dtt;
35 35
 
36
-	public function __construct( $admin_page ) {
36
+	public function __construct($admin_page) {
37 37
 		parent::__construct($admin_page);
38
-		require_once( EE_HELPERS . 'EEH_DTT_Helper.helper.php' );
38
+		require_once(EE_HELPERS.'EEH_DTT_Helper.helper.php');
39 39
 	}
40 40
 
41 41
 	protected function _setup_data() {
42 42
 		$this->_data = $this->_admin_page->get_events($this->_per_page, $this->_current_page);
43
- 		$this->_all_data_count = $this->_admin_page->get_events(0,0, TRUE);
43
+ 		$this->_all_data_count = $this->_admin_page->get_events(0, 0, TRUE);
44 44
 	}
45 45
 
46 46
 	protected function _set_properties() {
@@ -68,15 +68,15 @@  discard block
 block discarded – undo
68 68
 
69 69
 
70 70
 		$this->_sortable_columns = array(
71
-			'id' => array( 'EVT_ID' => true ),
72
-			'name' => array( 'EVT_name' => false ),
73
-			'author' => array( 'EVT_wp_user' => false ),
74
-			'venue' => array( 'Venue.VNU_name' => false ),
71
+			'id' => array('EVT_ID' => true),
72
+			'name' => array('EVT_name' => false),
73
+			'author' => array('EVT_wp_user' => false),
74
+			'venue' => array('Venue.VNU_name' => false),
75 75
 			'start_date_time' => array('Datetime.DTT_EVT_start' => false),
76 76
 			'reg_begins' => array('Datetime.Ticket.TKT_start_date' => false),
77 77
 			);
78 78
 
79
-		$this->_hidden_columns = array( 'author' );
79
+		$this->_hidden_columns = array('author');
80 80
 	}
81 81
 
82 82
 
@@ -91,15 +91,15 @@  discard block
 block discarded – undo
91 91
 	protected function _add_view_counts() {
92 92
 		$this->_views['all']['count'] = $this->_admin_page->total_events();
93 93
 		$this->_views['draft']['count'] = $this->_admin_page->total_events_draft();
94
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) {
94
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
95 95
 			$this->_views['trash']['count'] = $this->_admin_page->total_trashed_events();
96 96
 		}
97 97
 	}
98 98
 
99 99
 
100 100
 
101
-	public function column_status( EE_Event $item ) {
102
-		return '<span class="ee-status-strip ee-status-strip-td event-status-' . $item->get_active_status() . '"></span>';
101
+	public function column_status(EE_Event $item) {
102
+		return '<span class="ee-status-strip ee-status-strip-td event-status-'.$item->get_active_status().'"></span>';
103 103
 	}/**/
104 104
 
105 105
 
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
 				'action' => 'edit',
129 129
 				'post' => $item->ID()
130 130
 			);
131
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
132
-		$actions = $this->_column_name_action_setup( $item );
131
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
132
+		$actions = $this->_column_name_action_setup($item);
133 133
 		$status = ''; //$item->status() !== 'publish' ? ' (' . $item->status() . ')' : '';
134
-		$content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>' . $status;
134
+		$content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->name().'</a></strong>'.$status;
135 135
 		$content .= $this->row_actions($actions);
136 136
 		return $content;
137 137
 
@@ -148,72 +148,72 @@  discard block
 block discarded – undo
148 148
 	 *
149 149
 	 * @return array array of actions
150 150
 	 */
151
-	protected function _column_name_action_setup( EE_Event $item ) {
151
+	protected function _column_name_action_setup(EE_Event $item) {
152 152
 		//todo: remove when attendees is active
153
-		if ( !defined('REG_ADMIN_URL') )
153
+		if ( ! defined('REG_ADMIN_URL'))
154 154
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
155 155
 
156 156
 		$actions = array();
157 157
 
158
-		if ( EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID() ) ) {
158
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID())) {
159 159
 			$edit_query_args = array(
160 160
 					'action' => 'edit',
161 161
 					'post' => $item->ID()
162 162
 				);
163
-			$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
164
-			$actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Event', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>';
163
+			$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
164
+			$actions['edit'] = '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Event', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>';
165 165
 
166 166
 		}
167 167
 
168
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ) {
168
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID())) {
169 169
 			$attendees_query_args = array(
170 170
 					'action' => 'default',
171 171
 					'event_id' => $item->ID()
172 172
 				);
173
-			$attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL );
174
-			$actions['attendees'] = '<a href="' . $attendees_link . '" title="' . esc_attr__('View Registrations', 'event_espresso') . '">' . __('Registrations', 'event_espresso') . '</a>';
173
+			$attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL);
174
+			$actions['attendees'] = '<a href="'.$attendees_link.'" title="'.esc_attr__('View Registrations', 'event_espresso').'">'.__('Registrations', 'event_espresso').'</a>';
175 175
 		}
176 176
 
177
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_trash_event', $item->ID() ) ) {
177
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_trash_event', $item->ID())) {
178 178
 			$trash_event_query_args = array(
179 179
 					'action' => 'trash_event',
180 180
 					'EVT_ID' => $item->ID()
181 181
 				);
182
-			$trash_event_link = EE_Admin_Page::add_query_args_and_nonce( $trash_event_query_args, EVENTS_ADMIN_URL );
182
+			$trash_event_link = EE_Admin_Page::add_query_args_and_nonce($trash_event_query_args, EVENTS_ADMIN_URL);
183 183
 		}
184 184
 
185
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_restore_event', $item->ID() ) ) {
185
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_restore_event', $item->ID())) {
186 186
 			$restore_event_query_args = array(
187 187
 					'action' => 'restore_event',
188 188
 					'EVT_ID' => $item->ID()
189 189
 				);
190
-			$restore_event_link = EE_Admin_Page::add_query_args_and_nonce( $restore_event_query_args, EVENTS_ADMIN_URL );
190
+			$restore_event_link = EE_Admin_Page::add_query_args_and_nonce($restore_event_query_args, EVENTS_ADMIN_URL);
191 191
 		}
192 192
 
193
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_delete_event', $item->ID() ) ) {
193
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_delete_event', $item->ID())) {
194 194
 			$delete_event_query_args = array(
195 195
 					'action' => 'delete_event',
196 196
 					'EVT_ID' => $item->ID()
197 197
 				);
198
-			$delete_event_link = EE_Admin_Page::add_query_args_and_nonce( $delete_event_query_args, EVENTS_ADMIN_URL );
198
+			$delete_event_link = EE_Admin_Page::add_query_args_and_nonce($delete_event_query_args, EVENTS_ADMIN_URL);
199 199
 		}
200 200
 
201 201
 		$view_link = get_permalink($item->ID());
202 202
 
203
-		$actions['view'] = '<a href="' . $view_link . '" title="' . esc_attr__('View Event', 'event_espresso') . '">' . __('View', 'event_espresso') . '</a>';
203
+		$actions['view'] = '<a href="'.$view_link.'" title="'.esc_attr__('View Event', 'event_espresso').'">'.__('View', 'event_espresso').'</a>';
204 204
 
205
-		switch ( $item->get( 'status' ) ) {
205
+		switch ($item->get('status')) {
206 206
 			case 'trash' :
207
-					if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_restore_event', $item->ID() ) ) {
208
-						$actions['restore_from_trash'] = '<a href="' . $restore_event_link . '" title="' . esc_attr__('Restore from Trash', 'event_espresso') . '">' . __('Restore from Trash', 'event_espresso') . '</a>';
207
+					if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_restore_event', $item->ID())) {
208
+						$actions['restore_from_trash'] = '<a href="'.$restore_event_link.'" title="'.esc_attr__('Restore from Trash', 'event_espresso').'">'.__('Restore from Trash', 'event_espresso').'</a>';
209 209
 					}
210
-					if ( $item->count_related('Registration') === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_delete_event', $item->ID() ) ) {
211
-						$actions['delete permanently'] = '<a href="' . $delete_event_link . '" title="' . esc_attr__('Delete Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
210
+					if ($item->count_related('Registration') === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_delete_event', $item->ID())) {
211
+						$actions['delete permanently'] = '<a href="'.$delete_event_link.'" title="'.esc_attr__('Delete Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
212 212
 					}
213 213
 				break;
214 214
 			default :
215
-					if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_event', 'espresso_events_trash_event', $item->ID() ) ) {
216
-						$actions['move to trash'] = '<a href="' . $trash_event_link . '" title="' . esc_attr__('Trash Event', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
215
+					if (EE_Registry::instance()->CAP->current_user_can('ee_delete_event', 'espresso_events_trash_event', $item->ID())) {
216
+						$actions['move to trash'] = '<a href="'.$trash_event_link.'" title="'.esc_attr__('Trash Event', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
217 217
 					}
218 218
 		}
219 219
 		return $actions;
@@ -222,34 +222,34 @@  discard block
 block discarded – undo
222 222
 
223 223
 
224 224
 
225
-	public function column_author( EE_Event $item ) {
225
+	public function column_author(EE_Event $item) {
226 226
 		//user author info
227
-		$event_author = get_userdata( $item->wp_user() );
228
-		$gravatar = get_avatar( $item->wp_user(), '15' );
227
+		$event_author = get_userdata($item->wp_user());
228
+		$gravatar = get_avatar($item->wp_user(), '15');
229 229
 		//filter link
230 230
 		$query_args = array(
231 231
 			'action' => 'default',
232 232
 			'EVT_wp_user' => $item->wp_user()
233 233
 			);
234
-		$filter_url = EE_Admin_Page::add_query_args_and_nonce( $query_args, EVENTS_ADMIN_URL );
235
-		return $gravatar . '  <a href="' . $filter_url . '" title="' . esc_attr__('Click to filter events by this author.', 'event_espresso') . '">' . $event_author->display_name . '</a>';
234
+		$filter_url = EE_Admin_Page::add_query_args_and_nonce($query_args, EVENTS_ADMIN_URL);
235
+		return $gravatar.'  <a href="'.$filter_url.'" title="'.esc_attr__('Click to filter events by this author.', 'event_espresso').'">'.$event_author->display_name.'</a>';
236 236
 	}
237 237
 
238 238
 
239 239
 
240 240
 
241 241
 	public function column_venue($item) {
242
-		$venue = $item->get_first_related( 'Venue' );
243
-		return !empty( $venue ) ? $venue->name() : '';
242
+		$venue = $item->get_first_related('Venue');
243
+		return ! empty($venue) ? $venue->name() : '';
244 244
 	}
245 245
 
246 246
 
247 247
 
248 248
 
249 249
 	public function column_start_date_time($item) {
250
-		echo !empty( $this->_dtt ) ?  $this->_dtt->get_i18n_datetime('DTT_EVT_start') : __('No Date was saved for this Event', 'event_espresso');
250
+		echo ! empty($this->_dtt) ? $this->_dtt->get_i18n_datetime('DTT_EVT_start') : __('No Date was saved for this Event', 'event_espresso');
251 251
 		//display in user's timezone?
252
-		echo !empty( $this->_dtt ) ? $this->_dtt->display_in_my_timezone('DTT_EVT_start', 'get_i18n_datetime', '', 'My Timezone: ' ) : '';
252
+		echo ! empty($this->_dtt) ? $this->_dtt->display_in_my_timezone('DTT_EVT_start', 'get_i18n_datetime', '', 'My Timezone: ') : '';
253 253
 
254 254
 	}
255 255
 
@@ -258,9 +258,9 @@  discard block
 block discarded – undo
258 258
 
259 259
 	public function column_reg_begins($item) {
260 260
 		$reg_start = $item->get_ticket_with_earliest_start_time();
261
-		echo !empty( $reg_start ) ? $reg_start->get_i18n_datetime('TKT_start_date') : __('No Tickets have been setup for this Event', 'event_espresso');
261
+		echo ! empty($reg_start) ? $reg_start->get_i18n_datetime('TKT_start_date') : __('No Tickets have been setup for this Event', 'event_espresso');
262 262
 		//display in user's timezone?
263
-		echo !empty( $reg_start ) ? $reg_start->display_in_my_timezone('TKT_start_date', 'get_i18n_datetime', '', 'My Timezone: ' ) : '';/**/
263
+		echo ! empty($reg_start) ? $reg_start->display_in_my_timezone('TKT_start_date', 'get_i18n_datetime', '', 'My Timezone: ') : ''; /**/
264 264
 	}
265 265
 
266 266
 
@@ -278,51 +278,51 @@  discard block
 block discarded – undo
278 278
 				'action' => 'default',
279 279
 				'event_id' => $item->ID()
280 280
 			);
281
-		$attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL );
282
-		$registered_attendees = EEM_Registration::instance()->get_event_registration_count( $item->ID() );
283
-		return  EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? '<a href="' . $attendees_link . '">' . $registered_attendees . '</a>' : $registered_attendees;
281
+		$attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL);
282
+		$registered_attendees = EEM_Registration::instance()->get_event_registration_count($item->ID());
283
+		return  EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? '<a href="'.$attendees_link.'">'.$registered_attendees.'</a>' : $registered_attendees;
284 284
 	}
285 285
 
286 286
 
287 287
 
288 288
 	public function column_tkts_sold($item) {
289
-		return EEM_Ticket::instance()->sum(array( array('Datetime.EVT_ID' => $item->ID() )), 'TKT_sold' );
289
+		return EEM_Ticket::instance()->sum(array(array('Datetime.EVT_ID' => $item->ID())), 'TKT_sold');
290 290
 	}
291 291
 
292 292
 
293 293
 
294 294
 	public function column_actions($item) {
295 295
 		//todo: remove when attendees is active
296
-		if ( !defined('REG_ADMIN_URL') )
296
+		if ( ! defined('REG_ADMIN_URL'))
297 297
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
298 298
 		$actionlinks = array();
299 299
 
300 300
 		$view_link = get_permalink($item->ID());
301 301
 
302
-		$actionlinks[] = '<a href="' .  $view_link . '" title="' . esc_attr__('View Event', 'event_espresso') . '" target="_blank">';
302
+		$actionlinks[] = '<a href="'.$view_link.'" title="'.esc_attr__('View Event', 'event_espresso').'" target="_blank">';
303 303
 		$actionlinks[] = '<div class="dashicons dashicons-search"></div></a>';
304 304
 
305
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'espresso_events_edit', $item->ID() ) ) {
305
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $item->ID())) {
306 306
 			$edit_query_args = array(
307 307
 					'action' => 'edit',
308 308
 					'post' => $item->ID()
309 309
 				);
310
-			$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
311
-			$actionlinks[] = '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Event', 'event_espresso') . '"><div class="ee-icon ee-icon-calendar-edit"></div></a>';
310
+			$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
311
+			$actionlinks[] = '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Event', 'event_espresso').'"><div class="ee-icon ee-icon-calendar-edit"></div></a>';
312 312
 		}
313 313
 
314
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ) {
314
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID())) {
315 315
 			$attendees_query_args = array(
316 316
 				'action' => 'default',
317 317
 				'event_id' => $item->ID()
318 318
 			);
319
-			$attendees_link = EE_Admin_Page::add_query_args_and_nonce( $attendees_query_args, REG_ADMIN_URL );
320
-			$actionlinks[] = '<a href="' . $attendees_link . '" title="' . esc_attr__('View Registrants', 'event_espresso') . '"><div class="dashicons dashicons-groups"></div></a>';
319
+			$attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL);
320
+			$actionlinks[] = '<a href="'.$attendees_link.'" title="'.esc_attr__('View Registrants', 'event_espresso').'"><div class="dashicons dashicons-groups"></div></a>';
321 321
 		}
322 322
 
323
-		$actionlinks = apply_filters( 'FHEE__Events_Admin_List_Table__column_actions__action_links', $actionlinks, $item );
323
+		$actionlinks = apply_filters('FHEE__Events_Admin_List_Table__column_actions__action_links', $actionlinks, $item);
324 324
 
325
-		return $this->_action_string( implode( "\n\t", $actionlinks ), $item, 'div' );
325
+		return $this->_action_string(implode("\n\t", $actionlinks), $item, 'div');
326 326
 	}
327 327
 
328 328
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -150,8 +151,9 @@  discard block
 block discarded – undo
150 151
 	 */
151 152
 	protected function _column_name_action_setup( EE_Event $item ) {
152 153
 		//todo: remove when attendees is active
153
-		if ( !defined('REG_ADMIN_URL') )
154
-			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
154
+		if ( !defined('REG_ADMIN_URL') ) {
155
+					define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
156
+		}
155 157
 
156 158
 		$actions = array();
157 159
 
@@ -293,8 +295,9 @@  discard block
 block discarded – undo
293 295
 
294 296
 	public function column_actions($item) {
295 297
 		//todo: remove when attendees is active
296
-		if ( !defined('REG_ADMIN_URL') )
297
-			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
298
+		if ( !defined('REG_ADMIN_URL') ) {
299
+					define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
300
+		}
298 301
 		$actionlinks = array();
299 302
 
300 303
 		$view_link = get_permalink($item->ID());
Please login to merge, or discard this patch.
admin_pages/events/Events_Admin_Page.core.php 3 patches
Braces   +23 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if (!defined('EVENT_ESPRESSO_VERSION')) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -871,8 +872,9 @@  discard block
 block discarded – undo
871 872
 		$venue_id = !empty( $data['venue_id'] ) ? $data['venue_id'] : NULL;
872 873
 
873 874
 		//very important.  If we don't have a venue name then we'll get out because not necessary to create empty venue
874
-		if ( empty( $data['venue_title'] ) )
875
-			return;
875
+		if ( empty( $data['venue_title'] ) ) {
876
+					return;
877
+		}
876 878
 
877 879
 		$venue_array = array(
878 880
 				'VNU_wp_user' => $evtobj->get('EVT_wp_user'),
@@ -1194,7 +1196,9 @@  discard block
 block discarded – undo
1194 1196
 
1195 1197
 
1196 1198
 		//if no postid then get out cause we need it for stuff in here
1197
-		if ( empty( $postid ) ) return;
1199
+		if ( empty( $postid ) ) {
1200
+			return;
1201
+		}
1198 1202
 
1199 1203
 
1200 1204
 		//handle datetime saves
@@ -1436,10 +1440,11 @@  discard block
 block discarded – undo
1436 1440
 			//get the earliest datetime (if present);
1437 1441
 			$earliest_dtt = $this->_cpt_model_obj->ID() > 0 ? $this->_cpt_model_obj->get_first_related('Datetime', array('order_by'=> array('DTT_EVT_start' => 'ASC' ) ) ) : NULL;
1438 1442
 
1439
-			if ( !empty( $earliest_dtt ) )
1440
-				$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1441
-			else
1442
-				$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d")+7, date("Y") ) );
1443
+			if ( !empty( $earliest_dtt ) ) {
1444
+							$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1445
+			} else {
1446
+							$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d")+7, date("Y") ) );
1447
+			}
1443 1448
 		}
1444 1449
 
1445 1450
 		$template_args = array_merge( $template_args, $price_args );
@@ -1715,8 +1720,9 @@  discard block
 block discarded – undo
1715 1720
 		}
1716 1721
 		$action = $event_status == 'trash' ? 'moved to the trash' : 'restored from the trash';
1717 1722
 
1718
-		if ( $redirect_after )
1719
-			$this->_redirect_after_action($success, 'Event', $action, array('action' => 'default'));
1723
+		if ( $redirect_after ) {
1724
+					$this->_redirect_after_action($success, 'Event', $action, array('action' => 'default'));
1725
+		}
1720 1726
 	}
1721 1727
 
1722 1728
 	/**
@@ -1841,8 +1847,9 @@  discard block
 block discarded – undo
1841 1847
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1842 1848
 		}
1843 1849
 
1844
-		if ( $redirect_after )
1845
-			$this->_redirect_after_action($success, 'Event', 'deleted', array('action' => 'default', 'status' => 'trash'));
1850
+		if ( $redirect_after ) {
1851
+					$this->_redirect_after_action($success, 'Event', 'deleted', array('action' => 'default', 'status' => 'trash'));
1852
+		}
1846 1853
 	}
1847 1854
 
1848 1855
 	/**
@@ -2074,8 +2081,10 @@  discard block
 block discarded – undo
2074 2081
 	 * @return void
2075 2082
 	 */
2076 2083
 	private function _set_category_object() {
2077
-		if ( isset( $this->_category->id ) && !empty( $this->_category->id ) )
2078
-			return; //already have the category object so get out.
2084
+		if ( isset( $this->_category->id ) && !empty( $this->_category->id ) ) {
2085
+					return;
2086
+		}
2087
+		//already have the category object so get out.
2079 2088
 
2080 2089
 		//set default category object
2081 2090
 		$this->_set_empty_category_object();
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
 	 * Handles saving everything related to Tickets (datetimes, tickets, prices)
917 917
 	 * @param  EE_Event $evtobj The Event object we're attaching data to
918 918
 	 * @param  array    $data   The request data from the form
919
-	 * @return bool             success or fail
919
+	 * @return boolean|null             success or fail
920 920
 	 */
921 921
 	protected function _default_tickets_update( $evtobj, $data ) {
922 922
 		$success = TRUE;
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
 	 * This just returns whatever is set as the _event object property
1252 1252
 	 *
1253 1253
 	 * //todo this will become obsolete once the models are in place
1254
-	 * @return object
1254
+	 * @return EE_CPT_Base
1255 1255
 	 */
1256 1256
 	public function get_event_object() {
1257 1257
 		return $this->_cpt_model_obj;
@@ -1707,9 +1707,8 @@  discard block
 block discarded – undo
1707 1707
 	 * _trash_or_restore_events
1708 1708
 	 *
1709 1709
 	 * @access  private
1710
-	 * @param  int $event_id
1711 1710
 	 * @param  string $event_status
1712
-	 * @return void
1711
+	 * @return boolean
1713 1712
 	 */
1714 1713
 	private function _change_event_status($EVT_ID = FALSE, $event_status = FALSE) {
1715 1714
 		// grab event id
@@ -1829,7 +1828,7 @@  discard block
 block discarded – undo
1829 1828
 	 *
1830 1829
 	 * @access  private
1831 1830
 	 * @param  int $EVT_ID
1832
-	 * @return void
1831
+	 * @return boolean
1833 1832
 	 */
1834 1833
 	private function _permanently_delete_event($EVT_ID = FALSE) {
1835 1834
 		// grab event id
Please login to merge, or discard this patch.
Spacing   +352 added lines, -352 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() {
@@ -93,20 +93,20 @@  discard block
 block discarded – undo
93 93
 				'edit' => __('Update Event', 'event_espresso'),
94 94
 				'add_category' => __('Save New Category', 'event_espresso'),
95 95
 				'edit_category' => __('Update Category', 'event_espresso'),
96
-				'template_settings' => __( 'Update Settings', 'event_espresso' )
96
+				'template_settings' => __('Update Settings', 'event_espresso')
97 97
 				)
98 98
 		);
99 99
 	}
100 100
 
101 101
 	protected function _set_page_routes() {
102 102
 		//load formatter helper
103
-		EE_Registry::instance()->load_helper( 'Formatter' );
103
+		EE_Registry::instance()->load_helper('Formatter');
104 104
 		//load field generator helper
105
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
105
+		EE_Registry::instance()->load_helper('Form_Fields');
106 106
 
107 107
 		//is there a evt_id in the request?
108
-		$evt_id = ! empty( $this->_req_data['EVT_ID'] ) && ! is_array( $this->_req_data['EVT_ID'] ) ? $this->_req_data['EVT_ID'] : 0;
109
-		$evt_id = ! empty( $this->_req_data['post'] ) ? $this->_req_data['post'] : $evt_id;
108
+		$evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : 0;
109
+		$evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
110 110
 
111 111
 
112 112
 		$this->_page_routes = array(
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 				'help_tour' => array(
321 321
 					'Event_Editor_Help_Tour'
322 322
 					),
323
-				'qtips' => array( 'EE_Event_Editor_Decaf_Tips' ),
323
+				'qtips' => array('EE_Event_Editor_Decaf_Tips'),
324 324
 				'require_nonce' => FALSE
325 325
 			),
326 326
 			'edit' => array(
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 				'help_tour' => array(
377 377
 					'Event_Edit_Help_Tour'
378 378
 				),
379
-				'qtips' => array( 'EE_Event_Editor_Decaf_Tips' ),
379
+				'qtips' => array('EE_Event_Editor_Decaf_Tips'),
380 380
 				'require_nonce' => FALSE
381 381
 			),
382 382
 			'default_event_settings' => array(
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 						'filename' => 'events_default_settings_status'
399 399
 					)
400 400
 				),
401
-				'help_tour' => array( 'Event_Default_Settings_Help_Tour'),
401
+				'help_tour' => array('Event_Default_Settings_Help_Tour'),
402 402
 				'require_nonce' => FALSE
403 403
 			),
404 404
 			//template settings
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 						'filename' => 'general_settings_templates'
415 415
 					)
416 416
 				),
417
-				'help_tour' => array( 'Templates_Help_Tour' ),
417
+				'help_tour' => array('Templates_Help_Tour'),
418 418
 				'require_nonce' => FALSE
419 419
 			),
420 420
 			//event category stuff
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 					'label' => __('Edit Category', 'event_espresso'),
439 439
 					'order' => 15,
440 440
 					'persistent' => FALSE,
441
-					'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
441
+					'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
442 442
 					),
443 443
 				'help_tabs' => array(
444 444
 					'edit_category_help_tab' => array(
@@ -508,14 +508,14 @@  discard block
 block discarded – undo
508 508
 
509 509
 	public function load_scripts_styles() {
510 510
 
511
-		wp_register_style('events-admin-css', EVENTS_ASSETS_URL . 'events-admin-page.css', array(), EVENT_ESPRESSO_VERSION);
512
-		wp_register_style('ee-cat-admin', EVENTS_ASSETS_URL . 'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION );
511
+		wp_register_style('events-admin-css', EVENTS_ASSETS_URL.'events-admin-page.css', array(), EVENT_ESPRESSO_VERSION);
512
+		wp_register_style('ee-cat-admin', EVENTS_ASSETS_URL.'ee-cat-admin.css', array(), EVENT_ESPRESSO_VERSION);
513 513
 		wp_enqueue_style('events-admin-css');
514 514
 		wp_enqueue_style('ee-cat-admin');
515 515
 		//todo note: we also need to load_scripts_styles per view (i.e. default/view_report/event_details
516 516
 		//registers for all views
517 517
 		//scripts
518
-		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);
518
+		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);
519 519
 	}
520 520
 
521 521
 	/**
@@ -533,11 +533,11 @@  discard block
 block discarded – undo
533 533
 	public function load_scripts_styles_edit() {
534 534
 		//styles
535 535
 		wp_enqueue_style('espresso-ui-theme');
536
-		wp_register_style('event-editor-css', EVENTS_ASSETS_URL . 'event-editor.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
536
+		wp_register_style('event-editor-css', EVENTS_ASSETS_URL.'event-editor.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
537 537
 		wp_enqueue_style('event-editor-css');
538 538
 
539 539
 		//scripts
540
-		wp_register_script('event-datetime-metabox', EVENTS_ASSETS_URL . 'event-datetime-metabox.js', array('event_editor_js', 'ee-datepicker'), EVENT_ESPRESSO_VERSION );
540
+		wp_register_script('event-datetime-metabox', EVENTS_ASSETS_URL.'event-datetime-metabox.js', array('event_editor_js', 'ee-datepicker'), EVENT_ESPRESSO_VERSION);
541 541
 		wp_enqueue_script('event-datetime-metabox');
542 542
 
543 543
 		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');
@@ -590,35 +590,35 @@  discard block
 block discarded – undo
590 590
 	 */
591 591
 	public function verify_event_edit($event = NULL) {
592 592
 		// no event?
593
-		if ( empty( $event )) {
593
+		if (empty($event)) {
594 594
 			// set event
595 595
 			$event = $this->_cpt_model_obj;
596 596
 		}
597 597
 		// STILL no event?
598
-		if ( empty ( $event )) {
598
+		if (empty ($event)) {
599 599
 			return;
600 600
 		}
601 601
 		// first check if event is active.
602
-		if ( $event->is_expired() || $event->is_inactive() || $event->status() == EEM_Event::cancelled || $event->status() == EEM_Event::postponed ) {
602
+		if ($event->is_expired() || $event->is_inactive() || $event->status() == EEM_Event::cancelled || $event->status() == EEM_Event::postponed) {
603 603
 			return;
604 604
 		}
605 605
 		$orig_status = $event->status();
606 606
 		//made it here so it IS active... next check that any of the tickets are sold.
607
-		if ( $event->is_sold_out() || $event->is_sold_out(TRUE ) ) {
608
-			if ( $event->status() !== $orig_status && $orig_status !== EEM_Event::sold_out  ) {
609
-				EE_Error::add_attention( sprintf(
610
-					__( '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' ),
611
-					EEH_Template::pretty_status( EEM_Event::sold_out, FALSE, 'sentence' )
607
+		if ($event->is_sold_out() || $event->is_sold_out(TRUE)) {
608
+			if ($event->status() !== $orig_status && $orig_status !== EEM_Event::sold_out) {
609
+				EE_Error::add_attention(sprintf(
610
+					__('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'),
611
+					EEH_Template::pretty_status(EEM_Event::sold_out, FALSE, 'sentence')
612 612
 				));
613 613
 			}
614 614
 			return;
615 615
 		}
616 616
 		//now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
617
-		if ( ! $event->tickets_on_sale() ) {
617
+		if ( ! $event->tickets_on_sale()) {
618 618
 			return;
619 619
 		}
620 620
 		//made it here so show warning
621
-		EE_Error::add_attention( $this->_edit_event_warning() );
621
+		EE_Error::add_attention($this->_edit_event_warning());
622 622
 	}
623 623
 
624 624
 
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 			),
659 659
 		);
660 660
 
661
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) {
661
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
662 662
 			$this->_views['trash'] = array(
663 663
 				'slug' => 'trash',
664 664
 				'label' => __('Trash', 'event_espresso'),
@@ -688,39 +688,39 @@  discard block
 block discarded – undo
688 688
 				'desc' => __('View Registrations for Event', 'event_espresso')
689 689
 			)
690 690
 		);
691
-		$items  = apply_filters( 'FHEE__Events_Admin_Page___event_legend_items__items', $items );
691
+		$items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
692 692
 		$statuses = array(
693 693
 			'sold_out_status' => array(
694
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
695
-				'desc' => EEH_Template::pretty_status( EE_Datetime::sold_out, FALSE, 'sentence' )
694
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::sold_out,
695
+				'desc' => EEH_Template::pretty_status(EE_Datetime::sold_out, FALSE, 'sentence')
696 696
 			),
697 697
 			'active_status' => array(
698
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
699
-				'desc' => EEH_Template::pretty_status( EE_Datetime::active, FALSE, 'sentence' )
698
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::active,
699
+				'desc' => EEH_Template::pretty_status(EE_Datetime::active, FALSE, 'sentence')
700 700
 			),
701 701
 			'upcoming_status' => array(
702
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
703
-				'desc' => EEH_Template::pretty_status( EE_Datetime::upcoming, FALSE, 'sentence' )
702
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::upcoming,
703
+				'desc' => EEH_Template::pretty_status(EE_Datetime::upcoming, FALSE, 'sentence')
704 704
 			),
705 705
 			'postponed_status' => array(
706
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
707
-				'desc' => EEH_Template::pretty_status( EE_Datetime::postponed, FALSE, 'sentence' )
706
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::postponed,
707
+				'desc' => EEH_Template::pretty_status(EE_Datetime::postponed, FALSE, 'sentence')
708 708
 			),
709 709
 			'cancelled_status' => array(
710
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
711
-				'desc' => EEH_Template::pretty_status( EE_Datetime::cancelled, FALSE, 'sentence' )
710
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::cancelled,
711
+				'desc' => EEH_Template::pretty_status(EE_Datetime::cancelled, FALSE, 'sentence')
712 712
 			),
713 713
 			'expired_status' => array(
714
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
715
-				'desc' => EEH_Template::pretty_status( EE_Datetime::expired, FALSE, 'sentence' )
714
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::expired,
715
+				'desc' => EEH_Template::pretty_status(EE_Datetime::expired, FALSE, 'sentence')
716 716
 			),
717 717
 			'inactive_status' => array(
718
-				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
719
-				'desc' => EEH_Template::pretty_status( EE_Datetime::inactive, FALSE, 'sentence' )
718
+				'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::inactive,
719
+				'desc' => EEH_Template::pretty_status(EE_Datetime::inactive, FALSE, 'sentence')
720 720
 			)
721 721
 		);
722
-		$statuses = apply_filters( 'FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses );
723
-		return array_merge( $items, $statuses );
722
+		$statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses);
723
+		return array_merge($items, $statuses);
724 724
 	}
725 725
 
726 726
 
@@ -732,8 +732,8 @@  discard block
 block discarded – undo
732 732
 	 * @return EEM_Event
733 733
 	 */
734 734
 	private function _event_model() {
735
-		if ( ! $this->_event_model instanceof EEM_Event ) {
736
-			$this->_event_model = EE_Registry::instance()->load_model( 'Event' );
735
+		if ( ! $this->_event_model instanceof EEM_Event) {
736
+			$this->_event_model = EE_Registry::instance()->load_model('Event');
737 737
 		}
738 738
 		return $this->_event_model;
739 739
 	}
@@ -752,12 +752,12 @@  discard block
 block discarded – undo
752 752
 	 * @param  string $new_slug  what the slug is
753 753
 	 * @return string            The new html string for the permalink area
754 754
 	 */
755
-	public function extra_permalink_field_buttons( $return, $id, $new_title, $new_slug ) {
755
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug) {
756 756
 		//make sure this is only when editing
757
-		if ( !empty( $id ) ) {
758
-			$post = get_post( $id );
759
-			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">' . __('Shortcode', 'event_espresso') . '</a> ';
760
-			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id=\'' . $post->ID . '\']"">';
757
+		if ( ! empty($id)) {
758
+			$post = get_post($id);
759
+			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'.__('Shortcode', 'event_espresso').'</a> ';
760
+			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id=\''.$post->ID.'\']"">';
761 761
 		}
762 762
 		return $return;
763 763
 	}
@@ -773,8 +773,8 @@  discard block
 block discarded – undo
773 773
 	 * @return string html for generated table
774 774
 	 */
775 775
 	protected function _events_overview_list_table() {
776
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
777
-		$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' ) .
776
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
777
+		$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').
778 778
 		$this->_display_legend($this->_event_legend_items());
779 779
 		$this->_admin_page_title .= $this->get_action_link_or_button('create_new', 'add', array(), 'add-new-h2');
780 780
 		$this->display_admin_list_table_page_with_no_sidebar();
@@ -792,46 +792,46 @@  discard block
 block discarded – undo
792 792
 
793 793
 
794 794
 
795
-	protected function _insert_update_cpt_item( $post_id, $post ) {
795
+	protected function _insert_update_cpt_item($post_id, $post) {
796 796
 
797 797
 		$event_values = array(
798
-			'EVT_display_desc' => !empty( $this->_req_data['display_desc'] ) ? 1 : 0,
799
-			'EVT_display_ticket_selector' => !empty( $this->_req_data['display_ticket_selector'] ) ? 1 : 0,
798
+			'EVT_display_desc' => ! empty($this->_req_data['display_desc']) ? 1 : 0,
799
+			'EVT_display_ticket_selector' => ! empty($this->_req_data['display_ticket_selector']) ? 1 : 0,
800 800
 			'EVT_additional_limit' => min(
801
-					apply_filters( 'FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255 ),
802
-					!empty( $this->_req_data['additional_limit'] ) ? $this->_req_data['additional_limit'] : NULL ),
803
-			'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,
804
-			'EVT_member_only' => !empty( $this->_req_data['member_only'] ) ? 1 : 0,
805
-			'EVT_allow_overflow' => !empty( $this->_req_data['EVT_allow_overflow'] ) ? 1 : 0,
806
-			'EVT_timezone_string' => !empty( $this->_req_data['timezone_string'] ) ? $this->_req_data['timezone_string'] : NULL,
807
-			'EVT_external_URL' => !empty( $this->_req_data['externalURL'] ) ? $this->_req_data['externalURL'] : NULL,
808
-			'EVT_phone' => !empty( $this->_req_data['event_phone'] ) ? $this->_req_data['event_phone'] : NULL
801
+					apply_filters('FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255),
802
+					! empty($this->_req_data['additional_limit']) ? $this->_req_data['additional_limit'] : NULL ),
803
+			'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,
804
+			'EVT_member_only' => ! empty($this->_req_data['member_only']) ? 1 : 0,
805
+			'EVT_allow_overflow' => ! empty($this->_req_data['EVT_allow_overflow']) ? 1 : 0,
806
+			'EVT_timezone_string' => ! empty($this->_req_data['timezone_string']) ? $this->_req_data['timezone_string'] : NULL,
807
+			'EVT_external_URL' => ! empty($this->_req_data['externalURL']) ? $this->_req_data['externalURL'] : NULL,
808
+			'EVT_phone' => ! empty($this->_req_data['event_phone']) ? $this->_req_data['event_phone'] : NULL
809 809
 			);
810 810
 
811 811
 		//update event
812
-		$success = $this->_event_model()->update_by_ID( $event_values, $post_id );
812
+		$success = $this->_event_model()->update_by_ID($event_values, $post_id);
813 813
 
814 814
 
815 815
 		//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!
816
-		$get_one_where = array( $this->_event_model()->primary_key_name() => $post_id, 'status' => $post->post_status );
817
-		$event = $this->_event_model()->get_one( array($get_one_where) );
816
+		$get_one_where = array($this->_event_model()->primary_key_name() => $post_id, 'status' => $post->post_status);
817
+		$event = $this->_event_model()->get_one(array($get_one_where));
818 818
 
819 819
 
820 820
 		//the following are default callbacks for event attachment updates that can be overridden by caffeinated functionality and/or addons.
821
-		$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') ) );
821
+		$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')));
822 822
 
823 823
 		$att_success = TRUE;
824 824
 
825
-		foreach ( $event_update_callbacks as $e_callback ) {
826
-			$_succ = call_user_func_array( $e_callback, array( $event,  $this->_req_data ) );
827
-			$att_success = !$att_success ? $att_success : $_succ; //if ANY of these updates fail then we want the appropriate global error message
825
+		foreach ($event_update_callbacks as $e_callback) {
826
+			$_succ = call_user_func_array($e_callback, array($event, $this->_req_data));
827
+			$att_success = ! $att_success ? $att_success : $_succ; //if ANY of these updates fail then we want the appropriate global error message
828 828
 		}
829 829
 
830 830
 		//any errors?
831
-		if ( $success && FALSE === $att_success ) {
832
-			EE_Error::add_error( __('Event Details saved successfully but something went wrong with saving attachments.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
833
-		} else if ( $success === FALSE ) {
834
-			EE_Error::add_error( __('Event Details did not save successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
831
+		if ($success && FALSE === $att_success) {
832
+			EE_Error::add_error(__('Event Details saved successfully but something went wrong with saving attachments.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
833
+		} else if ($success === FALSE) {
834
+			EE_Error::add_error(__('Event Details did not save successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
835 835
 		}
836 836
 	}
837 837
 
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
 	/**
842 842
 	 * @see parent::restore_item()
843 843
 	 */
844
-	protected function _restore_cpt_item( $post_id, $revision_id ) {
844
+	protected function _restore_cpt_item($post_id, $revision_id) {
845 845
 		//copy existing event meta to new post
846 846
 		$post_evt = $this->_event_model()->get_one_by_ID($post_id);
847 847
 
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
 		$post_evt->restore_revision($revision_id);
850 850
 
851 851
 		//related objs restore
852
-		$post_evt->restore_revision($revision_id, array( 'Venue', 'Datetime', 'Price' ) );
852
+		$post_evt->restore_revision($revision_id, array('Venue', 'Datetime', 'Price'));
853 853
 	}
854 854
 
855 855
 
@@ -861,50 +861,50 @@  discard block
 block discarded – undo
861 861
 	 * @param  array  $data   The request data from the form
862 862
 	 * @return bool           Success or fail.
863 863
 	 */
864
-	protected function _default_venue_update( $evtobj, $data ) {
865
-		require_once( EE_MODELS . 'EEM_Venue.model.php' );
864
+	protected function _default_venue_update($evtobj, $data) {
865
+		require_once(EE_MODELS.'EEM_Venue.model.php');
866 866
 		$venue_model = EE_Registry::instance()->load_model('Venue');
867 867
 		$rows_affected = NULL;
868
-		$venue_id = !empty( $data['venue_id'] ) ? $data['venue_id'] : NULL;
868
+		$venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : NULL;
869 869
 
870 870
 		//very important.  If we don't have a venue name then we'll get out because not necessary to create empty venue
871
-		if ( empty( $data['venue_title'] ) )
871
+		if (empty($data['venue_title']))
872 872
 			return;
873 873
 
874 874
 		$venue_array = array(
875 875
 				'VNU_wp_user' => $evtobj->get('EVT_wp_user'),
876
-				'VNU_name' => !empty( $data['venue_title'] ) ? $data['venue_title'] : NULL,
877
-				'VNU_desc' => !empty( $data['venue_description'] ) ? $data['venue_description'] : NULL,
878
-				'VNU_identifier' => !empty( $data['venue_identifier'] ) ? $data['venue_identifier'] : NULL,
879
-				'VNU_short_desc' => !empty( $data['venue_short_description'] ) ? $data['venue_short_description'] : NULL,
880
-				'VNU_address' => !empty( $data['address'] ) ? $data['address'] : NULL,
881
-				'VNU_address2' => !empty( $data['address2'] ) ? $data['address2'] : NULL,
882
-				'VNU_city' => !empty( $data['city'] ) ? $data['city'] : NULL,
883
-				'STA_ID' => !empty( $data['state'] ) ? $data['state'] : NULL,
884
-				'CNT_ISO' => !empty( $data['countries'] ) ? $data['countries'] : NULL,
885
-				'VNU_zip' => !empty( $data['zip'] ) ? $data['zip'] : NULL,
886
-				'VNU_phone' => !empty( $data['venue_phone'] ) ? $data['venue_phone'] : NULL,
887
-				'VNU_capacity' => !empty( $data['venue_capacity'] ) ? $data['venue_capacity'] : NULL,
888
-				'VNU_url' => !empty($data['venue_url'] ) ? $data['venue_url'] : NULL,
889
-				'VNU_virtual_phone' => !empty($data['virtual_phone']) ? $data['virtual_phone'] : NULL,
890
-				'VNU_virtual_url' => !empty( $data['virtual_url'] ) ? $data['virtual_url'] : NULL,
891
-				'VNU_enable_for_gmap' => isset( $data['enable_for_gmap'] ) ? 1 : 0,
876
+				'VNU_name' => ! empty($data['venue_title']) ? $data['venue_title'] : NULL,
877
+				'VNU_desc' => ! empty($data['venue_description']) ? $data['venue_description'] : NULL,
878
+				'VNU_identifier' => ! empty($data['venue_identifier']) ? $data['venue_identifier'] : NULL,
879
+				'VNU_short_desc' => ! empty($data['venue_short_description']) ? $data['venue_short_description'] : NULL,
880
+				'VNU_address' => ! empty($data['address']) ? $data['address'] : NULL,
881
+				'VNU_address2' => ! empty($data['address2']) ? $data['address2'] : NULL,
882
+				'VNU_city' => ! empty($data['city']) ? $data['city'] : NULL,
883
+				'STA_ID' => ! empty($data['state']) ? $data['state'] : NULL,
884
+				'CNT_ISO' => ! empty($data['countries']) ? $data['countries'] : NULL,
885
+				'VNU_zip' => ! empty($data['zip']) ? $data['zip'] : NULL,
886
+				'VNU_phone' => ! empty($data['venue_phone']) ? $data['venue_phone'] : NULL,
887
+				'VNU_capacity' => ! empty($data['venue_capacity']) ? $data['venue_capacity'] : NULL,
888
+				'VNU_url' => ! empty($data['venue_url']) ? $data['venue_url'] : NULL,
889
+				'VNU_virtual_phone' => ! empty($data['virtual_phone']) ? $data['virtual_phone'] : NULL,
890
+				'VNU_virtual_url' => ! empty($data['virtual_url']) ? $data['virtual_url'] : NULL,
891
+				'VNU_enable_for_gmap' => isset($data['enable_for_gmap']) ? 1 : 0,
892 892
 				'status' => 'publish'
893 893
 			);
894 894
 
895 895
 
896 896
 		//if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
897
-		if ( !empty( $venue_id ) ) {
898
-			$update_where = array( $venue_model->primary_key_name() => $venue_id );
899
-			$rows_affected = $venue_model->update( $venue_array, array( $update_where ) );
897
+		if ( ! empty($venue_id)) {
898
+			$update_where = array($venue_model->primary_key_name() => $venue_id);
899
+			$rows_affected = $venue_model->update($venue_array, array($update_where));
900 900
 			//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.
901
-			$evtobj->_add_relation_to( $venue_id, 'Venue' );
901
+			$evtobj->_add_relation_to($venue_id, 'Venue');
902 902
 			return $rows_affected > 0 ? TRUE : FALSE;
903 903
 		} else {
904 904
 			//we insert the venue
905
-			$venue_id = $venue_model->insert( $venue_array );
906
-			$evtobj->_add_relation_to( $venue_id, 'Venue' );
907
-			return !empty( $venue_id ) ? TRUE : FALSE;
905
+			$venue_id = $venue_model->insert($venue_array);
906
+			$evtobj->_add_relation_to($venue_id, 'Venue');
907
+			return ! empty($venue_id) ? TRUE : FALSE;
908 908
 		}
909 909
 		return TRUE; //when we have the ancestor come in it's already been handled by the revision save.
910 910
 	}
@@ -918,41 +918,41 @@  discard block
 block discarded – undo
918 918
 	 * @param  array    $data   The request data from the form
919 919
 	 * @return bool             success or fail
920 920
 	 */
921
-	protected function _default_tickets_update( $evtobj, $data ) {
921
+	protected function _default_tickets_update($evtobj, $data) {
922 922
 		$success = TRUE;
923
-		foreach ( $data['edit_event_datetimes'] as $row => $dtt ) {
924
-			$dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty( $dtt['DTT_EVT_end'] ) ? $dtt['DTT_EVT_end'] : $dtt['DTT_EVT_start'];
923
+		foreach ($data['edit_event_datetimes'] as $row => $dtt) {
924
+			$dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty($dtt['DTT_EVT_end']) ? $dtt['DTT_EVT_end'] : $dtt['DTT_EVT_start'];
925 925
 			$datetime_values = array(
926
-				'DTT_ID' => !empty( $dtt['DTT_ID'] ) ? $dtt['DTT_ID'] : NULL,
926
+				'DTT_ID' => ! empty($dtt['DTT_ID']) ? $dtt['DTT_ID'] : NULL,
927 927
 				'DTT_EVT_start' => $dtt['DTT_EVT_start'],
928 928
 				'DTT_EVT_end' => $dtt['DTT_EVT_end'],
929
-				'DTT_reg_limit' => empty( $dtt['DTT_reg_limit'] ) ? INF : $dtt['DTT_reg_limit'],
929
+				'DTT_reg_limit' => empty($dtt['DTT_reg_limit']) ? INF : $dtt['DTT_reg_limit'],
930 930
 				'DTT_order' => $row,
931 931
 				);
932 932
 
933 933
 			//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.
934 934
 
935
-			if ( !empty( $dtt['DTT_ID'] ) ) {
936
-				$DTM = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($dtt['DTT_ID'] );
937
-				foreach ( $datetime_values as $field => $value ) {
938
-					$DTM->set( $field, $value );
935
+			if ( ! empty($dtt['DTT_ID'])) {
936
+				$DTM = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($dtt['DTT_ID']);
937
+				foreach ($datetime_values as $field => $value) {
938
+					$DTM->set($field, $value);
939 939
 				}
940 940
 
941 941
 				$DTM->save();
942 942
 				//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.
943 943
 				$saved_dtts[$DTM->ID()] = $DTM;
944 944
 			} else {
945
-				$DTM = EE_Registry::instance()->load_class('Datetime', array( $datetime_values ), FALSE, FALSE );
945
+				$DTM = EE_Registry::instance()->load_class('Datetime', array($datetime_values), FALSE, FALSE);
946 946
 			}
947 947
 
948
-			$DTT = $evtobj->_add_relation_to( $DTM, 'Datetime' );
948
+			$DTT = $evtobj->_add_relation_to($DTM, 'Datetime');
949 949
 
950 950
 			//load DTT helper
951 951
 			EE_Registry::instance()->load_helper('DTT_Helper');
952 952
 
953 953
 			//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.
954
-			if( $DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end') ) {
955
-				$DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start') );
954
+			if ($DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end')) {
955
+				$DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start'));
956 956
 				$DTT = EEH_DTT_Helper::date_time_add($DTT, 'DTT_EVT_end', 'days');
957 957
 				$DTT->save();
958 958
 			}
@@ -960,29 +960,29 @@  discard block
 block discarded – undo
960 960
 			//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.
961 961
 			$saved_dtt = $DTT;
962 962
 
963
-			$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.
963
+			$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.
964 964
 		}
965 965
 
966 966
 		//no dtts get deleted so we don't do any of that logic here.
967 967
 		//update tickets next
968
-		$old_tickets = isset( $data['ticket_IDs'] ) ? explode(',', $data['ticket_IDs'] ) : array();
969
-		foreach ( $data['edit_tickets'] as $row => $tkt ) {
968
+		$old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : array();
969
+		foreach ($data['edit_tickets'] as $row => $tkt) {
970 970
 			$update_prices = false;
971
-			$ticket_price = isset( $data['edit_prices'][$row][1]['PRC_amount'] ) ? $data['edit_prices'][$row][1]['PRC_amount'] : 0;
971
+			$ticket_price = isset($data['edit_prices'][$row][1]['PRC_amount']) ? $data['edit_prices'][$row][1]['PRC_amount'] : 0;
972 972
 
973 973
 			$TKT_values = array(
974
-				'TKT_ID' => !empty( $tkt['TKT_ID'] ) ? $tkt['TKT_ID'] : NULL,
975
-				'TTM_ID' => !empty( $tkt['TTM_ID'] ) ? $tkt['TTM_ID'] : 0,
976
-				'TKT_name' => !empty( $tkt['TKT_name'] ) ? $tkt['TKT_name'] : '',
977
-				'TKT_description' => !empty( $tkt['TKT_description'] ) ? $tkt['TKT_description'] : '',
978
-				'TKT_start_date' => isset( $tkt['TKT_start_date'] ) ? $tkt['TKT_start_date'] : current_time('mysql'),
979
-				'TKT_end_date' => isset( $tkt['TKT_end_date'] ) ? $tkt['TKT_end_date'] : current_time('mysql'),
980
-				'TKT_qty' => empty( $tkt['TKT_qty'] ) ? INF : $tkt['TKT_qty'],
981
-				'TKT_uses' => empty( $tkt['TKT_uses'] ) ? INF : $tkt['TKT_uses'],
982
-				'TKT_min' => empty( $tkt['TKT_min'] ) ? 0 : $tkt['TKT_min'],
983
-				'TKT_max' => empty( $tkt['TKT_max'] ) ? INF : $tkt['TKT_max'],
974
+				'TKT_ID' => ! empty($tkt['TKT_ID']) ? $tkt['TKT_ID'] : NULL,
975
+				'TTM_ID' => ! empty($tkt['TTM_ID']) ? $tkt['TTM_ID'] : 0,
976
+				'TKT_name' => ! empty($tkt['TKT_name']) ? $tkt['TKT_name'] : '',
977
+				'TKT_description' => ! empty($tkt['TKT_description']) ? $tkt['TKT_description'] : '',
978
+				'TKT_start_date' => isset($tkt['TKT_start_date']) ? $tkt['TKT_start_date'] : current_time('mysql'),
979
+				'TKT_end_date' => isset($tkt['TKT_end_date']) ? $tkt['TKT_end_date'] : current_time('mysql'),
980
+				'TKT_qty' => empty($tkt['TKT_qty']) ? INF : $tkt['TKT_qty'],
981
+				'TKT_uses' => empty($tkt['TKT_uses']) ? INF : $tkt['TKT_uses'],
982
+				'TKT_min' => empty($tkt['TKT_min']) ? 0 : $tkt['TKT_min'],
983
+				'TKT_max' => empty($tkt['TKT_max']) ? INF : $tkt['TKT_max'],
984 984
 				'TKT_row' => $row,
985
-				'TKT_order' => isset( $tkt['TKT_order'] ) ? $tkt['TKT_order'] : $row,
985
+				'TKT_order' => isset($tkt['TKT_order']) ? $tkt['TKT_order'] : $row,
986 986
 				'TKT_price' => $ticket_price
987 987
 				);
988 988
 
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
 
991 991
 
992 992
 			//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.
993
-			if ( isset( $tkt['TKT_is_default'] ) && $tkt['TKT_is_default'] ) {
993
+			if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
994 994
 				$TKT_values['TKT_ID'] = 0;
995 995
 				$TKT_values['TKT_is_default'] = 0;
996 996
 				$TKT_values['TKT_price'] = $ticket_price;
@@ -1001,22 +1001,22 @@  discard block
 block discarded – undo
1001 1001
 			//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.
1002 1002
 			//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.
1003 1003
 
1004
-			if ( !empty( $tkt['TKT_ID'] ) ) {
1005
-				$TKT = EE_Registry::instance()->load_model( 'Ticket')->get_one_by_ID( $tkt['TKT_ID'] );
1004
+			if ( ! empty($tkt['TKT_ID'])) {
1005
+				$TKT = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($tkt['TKT_ID']);
1006 1006
 
1007 1007
 
1008
-				$ticket_sold = $TKT->count_related('Registration', array( array( 'STS_ID' => array( 'NOT IN', array( EEM_Registration::status_id_incomplete ) ) ) ) ) > 0 ? true : false;
1008
+				$ticket_sold = $TKT->count_related('Registration', array(array('STS_ID' => array('NOT IN', array(EEM_Registration::status_id_incomplete))))) > 0 ? true : false;
1009 1009
 
1010 1010
 				//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.
1011
-				$create_new_TKT = $ticket_sold && $ticket_price != $TKT->get('TKT_price') && !$TKT->get('TKT_deleted') ? TRUE : FALSE;
1011
+				$create_new_TKT = $ticket_sold && $ticket_price != $TKT->get('TKT_price') && ! $TKT->get('TKT_deleted') ? TRUE : FALSE;
1012 1012
 
1013 1013
 				//set new values
1014
-				foreach ( $TKT_values as $field => $value ) {
1015
-					$TKT->set( $field, $value );
1014
+				foreach ($TKT_values as $field => $value) {
1015
+					$TKT->set($field, $value);
1016 1016
 				}
1017 1017
 
1018 1018
 				//if $create_new_TKT is false then we can safely update the existing ticket.  Otherwise we have to create a new ticket.
1019
-				if ( $create_new_TKT ) {
1019
+				if ($create_new_TKT) {
1020 1020
 					//archive the old ticket first
1021 1021
 					$TKT->set('TKT_deleted', 1);
1022 1022
 					$TKT->save();
@@ -1027,22 +1027,22 @@  discard block
 block discarded – undo
1027 1027
 
1028 1028
 					//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.
1029 1029
 					$TKT = clone $TKT;
1030
-					$TKT->set( 'TKT_ID', 0 );
1031
-					$TKT->set( 'TKT_deleted', 0 );
1032
-					$TKT->set( 'TKT_price', $ticket_price );
1033
-					$TKT->set( 'TKT_sold', 0 );
1030
+					$TKT->set('TKT_ID', 0);
1031
+					$TKT->set('TKT_deleted', 0);
1032
+					$TKT->set('TKT_price', $ticket_price);
1033
+					$TKT->set('TKT_sold', 0);
1034 1034
 
1035 1035
 					//now we need to make sure that $new prices are created as well and attached to new ticket.
1036 1036
 					$update_prices = TRUE;
1037 1037
 				}
1038 1038
 
1039 1039
 				//make sure price is set if it hasn't been already
1040
-				$TKT->set( 'TKT_price', $ticket_price );
1040
+				$TKT->set('TKT_price', $ticket_price);
1041 1041
 
1042 1042
 			} else {
1043 1043
 				//no TKT_id so a new TKT
1044 1044
 				$TKT_values['TKT_price'] = $ticket_price;
1045
-				$TKT = EE_Registry::instance()->load_class('Ticket', array( $TKT_values ), FALSE, FALSE );
1045
+				$TKT = EE_Registry::instance()->load_class('Ticket', array($TKT_values), FALSE, FALSE);
1046 1046
 				$update_prices = TRUE;
1047 1047
 			}
1048 1048
 
@@ -1050,27 +1050,27 @@  discard block
 block discarded – undo
1050 1050
 			$TKT->save();
1051 1051
 
1052 1052
 			//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.
1053
-			if( $TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date') ) {
1054
-				$TKT->set('TKT_end_date', $TKT->get('TKT_start_date') );
1053
+			if ($TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date')) {
1054
+				$TKT->set('TKT_end_date', $TKT->get('TKT_start_date'));
1055 1055
 				EE_Registry::instance()->load_helper('DTT_Helper');
1056 1056
 				$TKT = EEH_DTT_Helper::date_time_add($TKT, 'TKT_end_date', 'days');
1057 1057
 				$TKT->save();
1058 1058
 			}
1059 1059
 
1060 1060
 			//initially let's add the ticket to the dtt
1061
-			$saved_dtt->_add_relation_to( $TKT, 'Ticket' );
1061
+			$saved_dtt->_add_relation_to($TKT, 'Ticket');
1062 1062
 
1063 1063
 			$saved_tickets[$TKT->ID()] = $TKT;
1064 1064
 
1065 1065
 			//add prices to ticket
1066
-			$this->_add_prices_to_ticket( $data['edit_prices'][$row], $TKT, $update_prices );
1066
+			$this->_add_prices_to_ticket($data['edit_prices'][$row], $TKT, $update_prices);
1067 1067
 		}
1068 1068
 		//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.
1069
-		$old_tickets = isset( $old_tickets[0] ) && $old_tickets[0] == '' ? array() : $old_tickets;
1070
-		$tickets_removed = array_diff( $old_tickets, array_keys( $saved_tickets ) );
1069
+		$old_tickets = isset($old_tickets[0]) && $old_tickets[0] == '' ? array() : $old_tickets;
1070
+		$tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
1071 1071
 
1072
-		foreach ( $tickets_removed as $id ) {
1073
-			$id = absint( $id );
1072
+		foreach ($tickets_removed as $id) {
1073
+			$id = absint($id);
1074 1074
 
1075 1075
 			//get the ticket for this id
1076 1076
 			$tkt_to_remove = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($id);
@@ -1078,7 +1078,7 @@  discard block
 block discarded – undo
1078 1078
 			//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)
1079 1079
 			$dtts = $tkt_to_remove->get_many_related('Datetime');
1080 1080
 
1081
-			foreach( $dtts as $dtt ) {
1081
+			foreach ($dtts as $dtt) {
1082 1082
 				$tkt_to_remove->_remove_relation_to($dtt, 'Datetime');
1083 1083
 			}
1084 1084
 
@@ -1103,31 +1103,31 @@  discard block
 block discarded – undo
1103 1103
 	 * @param bool 		$new_prices Whether attach existing incoming prices or create new ones.
1104 1104
 	 * @return  void
1105 1105
 	 */
1106
-	private function  _add_prices_to_ticket( $prices, EE_Ticket $ticket, $new_prices = FALSE ) {
1107
-		foreach ( $prices as $row => $prc ) {
1106
+	private function  _add_prices_to_ticket($prices, EE_Ticket $ticket, $new_prices = FALSE) {
1107
+		foreach ($prices as $row => $prc) {
1108 1108
 			$PRC_values = array(
1109
-				'PRC_ID' => !empty( $prc['PRC_ID'] ) ? $prc['PRC_ID'] : NULL,
1110
-				'PRT_ID' => !empty( $prc['PRT_ID'] ) ? $prc['PRT_ID'] : NULL,
1111
-				'PRC_amount' => !empty( $prc['PRC_amount'] ) ? $prc['PRC_amount'] : 0,
1112
-				'PRC_name' => !empty( $prc['PRC_name'] ) ? $prc['PRC_name'] : '',
1113
-				'PRC_desc' => !empty( $prc['PRC_desc'] ) ? $prc['PRC_desc'] : '',
1109
+				'PRC_ID' => ! empty($prc['PRC_ID']) ? $prc['PRC_ID'] : NULL,
1110
+				'PRT_ID' => ! empty($prc['PRT_ID']) ? $prc['PRT_ID'] : NULL,
1111
+				'PRC_amount' => ! empty($prc['PRC_amount']) ? $prc['PRC_amount'] : 0,
1112
+				'PRC_name' => ! empty($prc['PRC_name']) ? $prc['PRC_name'] : '',
1113
+				'PRC_desc' => ! empty($prc['PRC_desc']) ? $prc['PRC_desc'] : '',
1114 1114
 				'PRC_is_default' => 0, //make sure prices are NOT set as default from this context
1115 1115
 				'PRC_order' => $row
1116 1116
 				);
1117 1117
 
1118
-			if ( $new_prices || empty( $PRC_values['PRC_ID'] ) ) {
1118
+			if ($new_prices || empty($PRC_values['PRC_ID'])) {
1119 1119
 				$PRC_values['PRC_ID'] = 0;
1120
-				$PRC = EE_Registry::instance()->load_class('Price', array( $PRC_values ), FALSE, FALSE);
1120
+				$PRC = EE_Registry::instance()->load_class('Price', array($PRC_values), FALSE, FALSE);
1121 1121
 			} else {
1122
-				$PRC = EE_Registry::instance()->load_model( 'Price' )->get_one_by_ID( $prc['PRC_ID'] );
1122
+				$PRC = EE_Registry::instance()->load_model('Price')->get_one_by_ID($prc['PRC_ID']);
1123 1123
 				//update this price with new values
1124
-				foreach ( $PRC_values as $field => $newprc ) {
1125
-					$PRC->set( $field, $newprc );
1124
+				foreach ($PRC_values as $field => $newprc) {
1125
+					$PRC->set($field, $newprc);
1126 1126
 				}
1127 1127
 				$PRC->save();
1128 1128
 			}
1129 1129
 
1130
-			$PRC = $ticket->_add_relation_to( $PRC, 'Price' );
1130
+			$PRC = $ticket->_add_relation_to($PRC, 'Price');
1131 1131
 		}
1132 1132
 	}
1133 1133
 
@@ -1150,33 +1150,33 @@  discard block
 block discarded – undo
1150 1150
 
1151 1151
 		return; //TEMPORARILY EXITING CAUSE THIS IS A TODO
1152 1152
 
1153
-		$postid = isset( $this->_req_data['post_ID'] ) ? $this->_req_data['post_ID'] : NULL;
1153
+		$postid = isset($this->_req_data['post_ID']) ? $this->_req_data['post_ID'] : NULL;
1154 1154
 
1155 1155
 
1156 1156
 		//if no postid then get out cause we need it for stuff in here
1157
-		if ( empty( $postid ) ) return;
1157
+		if (empty($postid)) return;
1158 1158
 
1159 1159
 
1160 1160
 		//handle datetime saves
1161 1161
 		$items = array();
1162 1162
 
1163
-		$get_one_where = array( $this->_event_model()->primary_key_name() => $postid );
1164
-		$event = $this->_event_model()->get_one( array($get_one_where) );
1163
+		$get_one_where = array($this->_event_model()->primary_key_name() => $postid);
1164
+		$event = $this->_event_model()->get_one(array($get_one_where));
1165 1165
 
1166 1166
 		//now let's get the attached datetimes from the most recent autosave
1167 1167
 		$dtts = $event->get_many_related('Datetime');
1168 1168
 
1169 1169
 		$dtt_ids = array();
1170
-		foreach( $dtts as $dtt ) {
1170
+		foreach ($dtts as $dtt) {
1171 1171
 			$dtt_ids[] = $dtt->ID();
1172 1172
 			$order = $dtt->order();
1173 1173
 			$this->_template_args['data']['items']['ID-'.$order] = $dtt->ID();
1174 1174
 		}
1175
-		$this->_template_args['data']['items']['datetime_IDS'] = serialize( $dtt_ids );
1175
+		$this->_template_args['data']['items']['datetime_IDS'] = serialize($dtt_ids);
1176 1176
 
1177 1177
 		//handle DECAF venues
1178 1178
 		//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.
1179
-		if ( $do_venue_autosaves = apply_filters( 'FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', TRUE ) ) {
1179
+		if ($do_venue_autosaves = apply_filters('FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', TRUE)) {
1180 1180
 			$venue = $event->get_first_related('Venue');
1181 1181
 			$this->_template_args['data']['items']['venue-id'] = $venue->ID();
1182 1182
 		}
@@ -1187,23 +1187,23 @@  discard block
 block discarded – undo
1187 1187
 
1188 1188
 		$ticket_ids = array();
1189 1189
 		$price_ids = array();
1190
-		foreach ( $tickets as $ticket ) {
1190
+		foreach ($tickets as $ticket) {
1191 1191
 			$ticket_ids[] = $price->ID();
1192 1192
 			$ticket_order = $price->get('TKT_order');
1193
-			$this->_template_args['data']['items']['edit-ticket-id-' . $ticket_order] = $ticket->ID();
1194
-			$this->_template_args['data']['items']['edit-ticket-event-id-' . $order] = $event->ID();
1193
+			$this->_template_args['data']['items']['edit-ticket-id-'.$ticket_order] = $ticket->ID();
1194
+			$this->_template_args['data']['items']['edit-ticket-event-id-'.$order] = $event->ID();
1195 1195
 
1196 1196
 			//now we have to make sure the prices are updated appropriately
1197 1197
 			$prices = $ticket->get_many_related('Prices');
1198 1198
 
1199
-			foreach ( $prices as $price ) {
1199
+			foreach ($prices as $price) {
1200 1200
 				$price_ids[] = $price->ID();
1201 1201
 				$price_order = $price->get('PRC_order');
1202
-				$this->_template_args['data']['items']['quick-edit-ticket-price-id-ticketrow-' . $ticket_order . '-' . $price_order] = $price->ID();
1203
-				$this->_template_args['data']['items']['edit-ticket-price-id-ticketrow-' . $ticket_row . '-' . $price_row] = $price->ID();
1204
-				$this->_template_args['data']['items']['edit-ticket-price-is-default-ticketrow-' . $ticket_row . '-' . $price_row] = $price->get('PRC_is_default');
1202
+				$this->_template_args['data']['items']['quick-edit-ticket-price-id-ticketrow-'.$ticket_order.'-'.$price_order] = $price->ID();
1203
+				$this->_template_args['data']['items']['edit-ticket-price-id-ticketrow-'.$ticket_row.'-'.$price_row] = $price->ID();
1204
+				$this->_template_args['data']['items']['edit-ticket-price-is-default-ticketrow-'.$ticket_row.'-'.$price_row] = $price->get('PRC_is_default');
1205 1205
 			}
1206
-			$this->_template_args['data']['items']['price-IDs-ticketrow-' . $ticket_row] = implode(',', $price_ids);
1206
+			$this->_template_args['data']['items']['price-IDs-ticketrow-'.$ticket_row] = implode(',', $price_ids);
1207 1207
 		}
1208 1208
 		$this->_template_args['data']['items']['ticket-IDs'] = implode(',', $ticket_ids);
1209 1209
 	}
@@ -1221,26 +1221,26 @@  discard block
 block discarded – undo
1221 1221
 	private function _generate_publish_box_extra_content() {
1222 1222
 
1223 1223
 		//load formatter helper
1224
-  		EE_Registry::instance()->load_helper( 'Formatter' );
1224
+  		EE_Registry::instance()->load_helper('Formatter');
1225 1225
 
1226 1226
   		//args for getting related registrations
1227
-  		$approved_query_args = array( array( 'REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_approved ) );
1228
-  		$not_approved_query_args = array( array( 'REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_not_approved ) );
1229
-  		$pending_payment_query_args = array( array( 'REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_pending_payment ) );
1227
+  		$approved_query_args = array(array('REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_approved));
1228
+  		$not_approved_query_args = array(array('REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_not_approved));
1229
+  		$pending_payment_query_args = array(array('REG_deleted' => 0, 'STS_ID' => EEM_Registration::status_id_pending_payment));
1230 1230
 
1231 1231
 
1232 1232
 		// publish box
1233
-		$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);
1234
-		$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);
1235
-		$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);
1233
+		$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);
1234
+		$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);
1235
+		$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);
1236 1236
 		$publish_box_extra_args['approved_regs'] = $this->_cpt_model_obj->count_related('Registration', $approved_query_args);
1237 1237
 		$publish_box_extra_args['not_approved_regs'] = $this->_cpt_model_obj->count_related('Registration', $not_approved_query_args);
1238 1238
 		$publish_box_extra_args['pending_payment_regs'] = $this->_cpt_model_obj->count_related('Registration', $pending_payment_query_args);
1239
-		$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');
1239
+		$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');
1240 1240
 		//$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');
1241
-		$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 );
1241
+		$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);
1242 1242
 		// load template
1243
-		EEH_Template::display_template( EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php', $publish_box_extra_args );
1243
+		EEH_Template::display_template(EVENTS_TEMPLATE_PATH.'event_publish_box_extras.template.php', $publish_box_extra_args);
1244 1244
 	}
1245 1245
 
1246 1246
 
@@ -1272,7 +1272,7 @@  discard block
 block discarded – undo
1272 1272
 		$this->verify_cpt_object();
1273 1273
 		add_meta_box('espresso_event_editor_tickets', __('Event Datetime & Ticket', 'event_espresso'), array($this, 'ticket_metabox'), $this->page_slug, 'normal', 'high');
1274 1274
 		add_meta_box('espresso_event_editor_event_options', __('Event Registration Options', 'event_espresso'), array($this, 'registration_options_meta_box'), $this->page_slug, 'side', 'default');
1275
-		add_meta_box('espresso_event_editor_venue', __('Venue Details', 'event_espresso'), array( $this, 'venue_metabox' ), $this->page_slug, 'normal', 'core');
1275
+		add_meta_box('espresso_event_editor_venue', __('Venue Details', 'event_espresso'), array($this, 'venue_metabox'), $this->page_slug, 'normal', 'core');
1276 1276
 		//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".
1277 1277
 	}
1278 1278
 
@@ -1297,53 +1297,53 @@  discard block
 block discarded – undo
1297 1297
 			'disabled' => ''
1298 1298
 			);
1299 1299
 
1300
-		$event_id = is_object( $this->_cpt_model_obj ) ? $this->_cpt_model_obj->ID() : NULL;
1300
+		$event_id = is_object($this->_cpt_model_obj) ? $this->_cpt_model_obj->ID() : NULL;
1301 1301
 
1302
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1302
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1303 1303
 
1304 1304
 		/**
1305 1305
 		 * 1. Start with retrieving Datetimes
1306 1306
 		 * 2. Fore each datetime get related tickets
1307 1307
 		 * 3. For each ticket get related prices
1308 1308
 		 */
1309
-		$times = EE_Registry::instance()->load_model('Datetime' )->get_all_event_dates( $event_id );
1310
-		EE_Registry::instance()->load_helper('DTT_Helper' );
1309
+		$times = EE_Registry::instance()->load_model('Datetime')->get_all_event_dates($event_id);
1310
+		EE_Registry::instance()->load_helper('DTT_Helper');
1311 1311
 
1312 1312
 		$firstdtt = array_slice($times, 0, 1);
1313 1313
 		//do we get related tickets?
1314
-		if ( $firstdtt[0]->get('DTT_ID') !== 0 ) {
1315
-			foreach ( $times as $time ) {
1314
+		if ($firstdtt[0]->get('DTT_ID') !== 0) {
1315
+			foreach ($times as $time) {
1316 1316
 				$existing_datetime_ids[] = $time->get('DTT_ID');
1317 1317
 				$template_args['time'] = $time;
1318
-				$related_tickets = $time->get_many_related('Ticket', array( array( 'OR' => array( 'TKT_deleted' => 1, 'TKT_deleted*' => 0 ) ), 'default_where_conditions' => 'none' ) );
1318
+				$related_tickets = $time->get_many_related('Ticket', array(array('OR' => array('TKT_deleted' => 1, 'TKT_deleted*' => 0)), 'default_where_conditions' => 'none'));
1319 1319
 
1320
-				if ( !empty($related_tickets) ) {
1320
+				if ( ! empty($related_tickets)) {
1321 1321
 					$template_args['total_ticket_rows'] = count($related_tickets);
1322 1322
 					$row = 0;
1323
-					foreach ( $related_tickets as $ticket ) {
1323
+					foreach ($related_tickets as $ticket) {
1324 1324
 						$existing_ticket_ids[] = $ticket->get('TKT_ID');
1325
-						$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, FALSE, $row );
1325
+						$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, FALSE, $row);
1326 1326
 
1327 1327
 						$row++;
1328 1328
 					}
1329 1329
 				} else {
1330 1330
 					$template_args['total_ticket_rows'] = 1;
1331 1331
 					$ticket = EE_Registry::instance()->load_model('Ticket')->create_default_object();
1332
-					$template_args['ticket_rows'] .= $this->_get_ticket_row( $ticket );
1332
+					$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket);
1333 1333
 				}
1334 1334
 			}
1335 1335
 		} else {
1336 1336
 			$template_args['time'] = $times[0];
1337 1337
 			$ticket = EE_Registry::instance()->load_model('Ticket')->get_all_default_tickets();
1338
-			$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);
1338
+			$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);
1339 1339
 		}
1340 1340
 
1341 1341
 		$template_args['event_datetime_help_link'] = $this->_get_help_tab_link('event_editor_event_datetimes_help_tab');
1342 1342
 		$template_args['ticket_options_help_link'] = $this->_get_help_tab_link('ticket_options_info');
1343 1343
 		$template_args['existing_datetime_ids'] = implode(',', $existing_datetime_ids);
1344 1344
 		$template_args['existing_ticket_ids'] = implode(',', $existing_ticket_ids);
1345
-		$template_args['ticket_js_structure'] = $this->_get_ticket_row( EE_Registry::instance()->load_model('Ticket')->create_default_object(), TRUE );
1346
-		$template = apply_filters( 'FHEE__Events_Admin_Page__ticket_metabox__template', EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php' );
1345
+		$template_args['ticket_js_structure'] = $this->_get_ticket_row(EE_Registry::instance()->load_model('Ticket')->create_default_object(), TRUE);
1346
+		$template = apply_filters('FHEE__Events_Admin_Page__ticket_metabox__template', EVENTS_TEMPLATE_PATH.'event_tickets_metabox_main.template.php');
1347 1347
 		EEH_Template::display_template($template, $template_args);
1348 1348
 	}
1349 1349
 
@@ -1357,21 +1357,21 @@  discard block
 block discarded – undo
1357 1357
 	 * @param  boolean    $skeleton whether we're generating a skeleton for js manipulation
1358 1358
 	 * @return string               generated html for the ticket row.
1359 1359
 	 */
1360
-	private function _get_ticket_row( $ticket, $skeleton = FALSE, $row = 0 ) {
1360
+	private function _get_ticket_row($ticket, $skeleton = FALSE, $row = 0) {
1361 1361
 		$template_args = array(
1362
-			'tkt_status_class' => ' tkt-status-' . $ticket->ticket_status(),
1363
-			'tkt_archive_class' => $ticket->ticket_status() === EE_Ticket::archived && !$skeleton ? ' tkt-archived' : '',
1362
+			'tkt_status_class' => ' tkt-status-'.$ticket->ticket_status(),
1363
+			'tkt_archive_class' => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived' : '',
1364 1364
 			'ticketrow' => $skeleton ? 'TICKETNUM' : $row,
1365 1365
 			'TKT_ID' => $ticket->get('TKT_ID'),
1366 1366
 			'TKT_name' => $ticket->get('TKT_name'),
1367 1367
 			'TKT_start_date' => $skeleton ? '' : $ticket->get_date('TKT_start_date', 'Y-m-d h:i a'),
1368 1368
 			'TKT_end_date' => $skeleton ? '' : $ticket->get_date('TKT_end_date', 'Y-m-d h:i a'),
1369 1369
 			'TKT_is_default' => $ticket->get('TKT_is_default'),
1370
-			'TKT_qty' => $ticket->get_pretty('TKT_qty','input'),
1370
+			'TKT_qty' => $ticket->get_pretty('TKT_qty', 'input'),
1371 1371
 			'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1372 1372
 			'TKT_sold' => $skeleton ? 0 : $ticket->get('TKT_sold'),
1373
-			'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',
1374
-			'disabled' => $skeleton || ( !empty( $ticket ) && ! $ticket->get('TKT_deleted' ) ) ? '' : ' disabled=disabled'
1373
+			'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',
1374
+			'disabled' => $skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted')) ? '' : ' disabled=disabled'
1375 1375
 			);
1376 1376
 
1377 1377
 		$price = $ticket->ID() !== 0 ? $ticket->get_first_related('Price', array('default_where_conditions' => 'none')) : EE_Registry::instance()->load_model('Price')->create_default_object();
@@ -1387,23 +1387,23 @@  discard block
 block discarded – undo
1387 1387
 
1388 1388
 		//make sure we have default start and end dates if skeleton
1389 1389
 		//handle rows that should NOT be empty
1390
-		if ( empty( $template_args['TKT_start_date'] ) ) {
1390
+		if (empty($template_args['TKT_start_date'])) {
1391 1391
 			//if empty then the start date will be now.
1392 1392
 			$template_args['TKT_start_date'] = date('Y-m-d h:i a', current_time('timestamp'));
1393 1393
 		}
1394 1394
 
1395
-		if ( empty( $template_args['TKT_end_date'] ) ) {
1395
+		if (empty($template_args['TKT_end_date'])) {
1396 1396
 			//get the earliest datetime (if present);
1397
-			$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;
1397
+			$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;
1398 1398
 
1399
-			if ( !empty( $earliest_dtt ) )
1399
+			if ( ! empty($earliest_dtt))
1400 1400
 				$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1401 1401
 			else
1402
-				$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d")+7, date("Y") ) );
1402
+				$template_args['TKT_end_date'] = date('Y-m-d h:i a', mktime(0, 0, 0, date("m"), date("d") + 7, date("Y")));
1403 1403
 		}
1404 1404
 
1405
-		$template_args = array_merge( $template_args, $price_args );
1406
-		$template = apply_filters( 'FHEE__Events_Admin_Page__get_ticket_row__template', EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php', $ticket);
1405
+		$template_args = array_merge($template_args, $price_args);
1406
+		$template = apply_filters('FHEE__Events_Admin_Page__get_ticket_row__template', EVENTS_TEMPLATE_PATH.'event_tickets_metabox_ticket_row.template.php', $ticket);
1407 1407
 		return EEH_Template::display_template($template, $template_args, TRUE);
1408 1408
 	}
1409 1409
 
@@ -1416,7 +1416,7 @@  discard block
 block discarded – undo
1416 1416
 			array('id' => false, 'text' => __('No', 'event_espresso'))
1417 1417
 		);
1418 1418
 
1419
-		$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);
1419
+		$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);
1420 1420
 
1421 1421
 		//$template_args['is_active_select'] = EEH_Form_Fields::select_input('is_active', $yes_no_values, $this->_cpt_model_obj->is_active());
1422 1422
 		$template_args['_event'] = $this->_cpt_model_obj;
@@ -1425,8 +1425,8 @@  discard block
 block discarded – undo
1425 1425
 		$template_args['default_registration_status'] = EEH_Form_Fields::select_input('default_reg_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status());
1426 1426
 		$template_args['display_description'] = EEH_Form_Fields::select_input('display_desc', $yes_no_values, $this->_cpt_model_obj->display_description());
1427 1427
 		$template_args['display_ticket_selector'] = EEH_Form_Fields::select_input('display_ticket_selector', $yes_no_values, $this->_cpt_model_obj->display_ticket_selector(), '', '', false);
1428
-		$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 );
1429
-		$templatepath = EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php';
1428
+		$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);
1429
+		$templatepath = EVENTS_TEMPLATE_PATH.'event_registration_options.template.php';
1430 1430
 		EEH_Template::display_template($templatepath, $template_args);
1431 1431
 	}
1432 1432
 
@@ -1440,14 +1440,14 @@  discard block
 block discarded – undo
1440 1440
 
1441 1441
 		//first let's see if we have a venue already
1442 1442
 		$event_id = $this->_cpt_model_obj->ID();
1443
-		$venue = !empty( $event_id ) ? $this->_cpt_model_obj->venues() : NULL;
1444
-		$venue = empty( $venue ) ? EE_Registry::instance()->load_model('Venue')->create_default_object() : array_shift( $venue );
1443
+		$venue = ! empty($event_id) ? $this->_cpt_model_obj->venues() : NULL;
1444
+		$venue = empty($venue) ? EE_Registry::instance()->load_model('Venue')->create_default_object() : array_shift($venue);
1445 1445
 		$template_args['_venue'] = $venue;
1446 1446
 
1447 1447
 		$template_args['states_dropdown'] = EEH_Form_Fields::generate_form_input(
1448 1448
 			$QFI = new EE_Question_Form_Input(
1449
-				EE_Question::new_instance( array( 'QST_display_text' => 'State', 'QST_system' => 'state' )),
1450
-				EE_Answer::new_instance( array(  'ANS_value'=> $venue->state_ID() )),
1449
+				EE_Question::new_instance(array('QST_display_text' => 'State', 'QST_system' => 'state')),
1450
+				EE_Answer::new_instance(array('ANS_value'=> $venue->state_ID())),
1451 1451
 				array(
1452 1452
 					'input_name' =>  'state',
1453 1453
 					'input_id' => 'phys-state',
@@ -1459,8 +1459,8 @@  discard block
 block discarded – undo
1459 1459
 		);
1460 1460
 		$template_args['countries_dropdown'] = EEH_Form_Fields::generate_form_input(
1461 1461
 			$QFI = new EE_Question_Form_Input(
1462
-				EE_Question::new_instance( array( 'QST_display_text' => 'Country', 'QST_system' => 'country' )),
1463
-				EE_Answer::new_instance( array(  'ANS_value'=> $venue->country_ID() )),
1462
+				EE_Question::new_instance(array('QST_display_text' => 'Country', 'QST_system' => 'country')),
1463
+				EE_Answer::new_instance(array('ANS_value'=> $venue->country_ID())),
1464 1464
 				array(
1465 1465
 					'input_name' =>  'countries',
1466 1466
 					'input_id' => 'phys-country',
@@ -1471,8 +1471,8 @@  discard block
 block discarded – undo
1471 1471
 			)
1472 1472
 		);
1473 1473
 
1474
-		$template_path = EVENTS_TEMPLATE_PATH . 'event_venues_metabox_content.template.php';
1475
-		EEH_Template::display_template( $template_path, $template_args );
1474
+		$template_path = EVENTS_TEMPLATE_PATH.'event_venues_metabox_content.template.php';
1475
+		EEH_Template::display_template($template_path, $template_args);
1476 1476
 	}
1477 1477
 
1478 1478
 
@@ -1499,21 +1499,21 @@  discard block
 block discarded – undo
1499 1499
 		$EEME = $this->_event_model();
1500 1500
 
1501 1501
 		$offset = ($current_page - 1) * $per_page;
1502
-		$limit = $count ? NULL : $offset . ',' . $per_page;
1502
+		$limit = $count ? NULL : $offset.','.$per_page;
1503 1503
 		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1504 1504
 		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : "DESC";
1505 1505
 
1506 1506
 		if (isset($this->_req_data['month_range'])) {
1507 1507
 			$pieces = explode(' ', $this->_req_data['month_range'], 3);
1508
-			$month_r = !empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
1509
-			$year_r = !empty($pieces[1]) ? $pieces[1] : '';
1508
+			$month_r = ! empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
1509
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1510 1510
 		}
1511 1511
 
1512 1512
 		$where = array();
1513 1513
 
1514
-		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL;
1514
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : NULL;
1515 1515
 		//determine what post_status our condition will have for the query.
1516
-		switch ( $status ) {
1516
+		switch ($status) {
1517 1517
 			case 'month' :
1518 1518
 			case 'today' :
1519 1519
 			case NULL :
@@ -1521,7 +1521,7 @@  discard block
 block discarded – undo
1521 1521
 				break;
1522 1522
 
1523 1523
 			case 'draft' :
1524
-				$where['status'] = array( 'IN', array('draft', 'auto-draft') );
1524
+				$where['status'] = array('IN', array('draft', 'auto-draft'));
1525 1525
 				break;
1526 1526
 
1527 1527
 			default :
@@ -1529,46 +1529,46 @@  discard block
 block discarded – undo
1529 1529
 		}
1530 1530
 
1531 1531
 		//categories?
1532
-		$category = isset( $this->_req_data['EVT_CAT'] ) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
1532
+		$category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
1533 1533
 
1534
-		if ( !empty ( $category ) ) {
1534
+		if ( ! empty ($category)) {
1535 1535
 			$where['Term_Taxonomy.taxonomy'] = 'espresso_event_categories';
1536 1536
 			$where['Term_Taxonomy.term_id'] = $category;
1537 1537
 		}
1538 1538
 
1539 1539
 		//date where conditions
1540 1540
 		if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] != '') {
1541
-			$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' ) ) );
1541
+			$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')));
1542 1542
 		} else if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'today') {
1543
-			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array( strtotime(date('Y-m-d') . ' 0:00:00'), strtotime(date('Y-m-d') . ' 23:59:59') ) );
1544
-		} else if ( isset($this->_req_data['status']) && $this->_req_data['status'] == 'month' ) {
1543
+			$where['Datetime.DTT_EVT_start'] = array('BETWEEN', array(strtotime(date('Y-m-d').' 0:00:00'), strtotime(date('Y-m-d').' 23:59:59')));
1544
+		} else if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'month') {
1545 1545
 			$this_year_r = date('Y');
1546 1546
 			$this_month_r = date('m');
1547 1547
 			$days_this_month = date('t');
1548 1548
 			$start = ' 00:00:00';
1549 1549
 			$end = ' 23:59:59';
1550
-			$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) ) );
1550
+			$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)));
1551 1551
 		}
1552 1552
 
1553 1553
 		//possible conditions for capability checks
1554
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_events', 'get_events') ) {
1555
-			$where['status**'] = array( '!=', 'private' );
1554
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
1555
+			$where['status**'] = array('!=', 'private');
1556 1556
 		}
1557 1557
 
1558
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {
1559
-			$where['EVT_wp_user'] =  get_current_user_id();
1558
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1559
+			$where['EVT_wp_user'] = get_current_user_id();
1560 1560
 		}
1561 1561
 
1562
-		if ( isset( $this->_req_data['EVT_wp_user'] ) ) {
1563
-			if ( $this->_req_data['EVT_wp_user'] != get_current_user_id() && EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {
1562
+		if (isset($this->_req_data['EVT_wp_user'])) {
1563
+			if ($this->_req_data['EVT_wp_user'] != get_current_user_id() && EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1564 1564
 				$where['EVT_wp_user'] = $this->_req_data['EVT_wp_user'];
1565 1565
 			}
1566 1566
 		}
1567 1567
 
1568 1568
 
1569 1569
 		//search query handling
1570
-		if ( isset( $this->_req_data['s'] ) ) {
1571
-			$search_string = '%' . $this->_req_data['s'] . '%';
1570
+		if (isset($this->_req_data['s'])) {
1571
+			$search_string = '%'.$this->_req_data['s'].'%';
1572 1572
 			$where['OR'] = array(
1573 1573
 				'EVT_name' => array('LIKE', $search_string),
1574 1574
 				'EVT_desc' => array('LIKE', $search_string),
@@ -1577,32 +1577,32 @@  discard block
 block discarded – undo
1577 1577
 		}
1578 1578
 
1579 1579
 
1580
-		$where = apply_filters( 'FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data );
1581
-		$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 );
1580
+		$where = apply_filters('FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data);
1581
+		$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);
1582 1582
 
1583 1583
 
1584 1584
 		//let's first check if we have special requests coming in.
1585
-		if ( isset( $this->_req_data['active_status'] ) ) {
1586
-			switch ( $this->_req_data['active_status'] ) {
1585
+		if (isset($this->_req_data['active_status'])) {
1586
+			switch ($this->_req_data['active_status']) {
1587 1587
 				case 'upcoming' :
1588
-					return $EEME->get_upcoming_events( $query_params, $count );
1588
+					return $EEME->get_upcoming_events($query_params, $count);
1589 1589
 					break;
1590 1590
 
1591 1591
 				case 'expired' :
1592
-					return $EEME->get_expired_events( $query_params, $count );
1592
+					return $EEME->get_expired_events($query_params, $count);
1593 1593
 					break;
1594 1594
 
1595 1595
 				case 'active' :
1596
-					return $EEME->get_active_events( $query_params, $count );
1596
+					return $EEME->get_active_events($query_params, $count);
1597 1597
 					break;
1598 1598
 
1599 1599
 				case 'inactive' :
1600
-					return $EEME->get_inactive_events( $query_params, $count );
1600
+					return $EEME->get_inactive_events($query_params, $count);
1601 1601
 					break;
1602 1602
 			}
1603 1603
 		}
1604 1604
 
1605
-		$events = $count ? $EEME->count( array( $where ), 'EVT_ID' ) : $EEME->get_all( $query_params );
1605
+		$events = $count ? $EEME->count(array($where), 'EVT_ID') : $EEME->get_all($query_params);
1606 1606
 
1607 1607
 		return $events;
1608 1608
 	}
@@ -1611,23 +1611,23 @@  discard block
 block discarded – undo
1611 1611
 
1612 1612
 
1613 1613
 	//handling for WordPress CPT actions (trash, restore, delete)
1614
-	public function trash_cpt_item( $post_id ) {
1614
+	public function trash_cpt_item($post_id) {
1615 1615
 		$this->_req_data['EVT_ID'] = $post_id;
1616
-		$this->_trash_or_restore_event( 'trash', FALSE );
1616
+		$this->_trash_or_restore_event('trash', FALSE);
1617 1617
 	}
1618 1618
 
1619 1619
 
1620 1620
 
1621 1621
 
1622
-	public function restore_cpt_item( $post_id ) {
1622
+	public function restore_cpt_item($post_id) {
1623 1623
 		$this->_req_data['EVT_ID'] = $post_id;
1624
-		$this->_trash_or_restore_event( 'draft', FALSE );
1624
+		$this->_trash_or_restore_event('draft', FALSE);
1625 1625
 	}
1626 1626
 
1627 1627
 
1628
-	public function delete_cpt_item( $post_id ) {
1628
+	public function delete_cpt_item($post_id) {
1629 1629
 		$this->_req_data['EVT_ID'] = $post_id;
1630
-		$this->_delete_event( FALSE );
1630
+		$this->_delete_event(FALSE);
1631 1631
 	}
1632 1632
 
1633 1633
 
@@ -1639,7 +1639,7 @@  discard block
 block discarded – undo
1639 1639
 	 * @param  string $event_status
1640 1640
 	 * @return void
1641 1641
 	 */
1642
-	protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = TRUE ) {
1642
+	protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = TRUE) {
1643 1643
 		//determine the event id and set to array.
1644 1644
 		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : FALSE;
1645 1645
 		// loop thru events
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
 			// clean status
1648 1648
 			$event_status = sanitize_key($event_status);
1649 1649
 			// grab status
1650
-			if (!empty($event_status)) {
1650
+			if ( ! empty($event_status)) {
1651 1651
 				$success = $this->_change_event_status($EVT_ID, $event_status);
1652 1652
 			} else {
1653 1653
 				$success = FALSE;
@@ -1661,7 +1661,7 @@  discard block
 block discarded – undo
1661 1661
 		}
1662 1662
 		$action = $event_status == 'trash' ? 'moved to the trash' : 'restored from the trash';
1663 1663
 
1664
-		if ( $redirect_after )
1664
+		if ($redirect_after)
1665 1665
 			$this->_redirect_after_action($success, 'Event', $action, array('action' => 'default'));
1666 1666
 	}
1667 1667
 
@@ -1676,7 +1676,7 @@  discard block
 block discarded – undo
1676 1676
 		// clean status
1677 1677
 		$event_status = sanitize_key($event_status);
1678 1678
 		// grab status
1679
-		if (!empty($event_status)) {
1679
+		if ( ! empty($event_status)) {
1680 1680
 			$success = TRUE;
1681 1681
 			//determine the event id and set to array.
1682 1682
 			$EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : array();
@@ -1713,13 +1713,13 @@  discard block
 block discarded – undo
1713 1713
 	 */
1714 1714
 	private function _change_event_status($EVT_ID = FALSE, $event_status = FALSE) {
1715 1715
 		// grab event id
1716
-		if (!$EVT_ID) {
1716
+		if ( ! $EVT_ID) {
1717 1717
 			$msg = __('An error occurred. No Event ID or an invalid Event ID was received.', 'event_espresso');
1718 1718
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1719 1719
 			return FALSE;
1720 1720
 		}
1721 1721
 
1722
-		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID( $EVT_ID );
1722
+		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
1723 1723
 
1724 1724
 		// clean status
1725 1725
 		$event_status = sanitize_key($event_status);
@@ -1745,7 +1745,7 @@  discard block
 block discarded – undo
1745 1745
 				$hook = FALSE;
1746 1746
 		}
1747 1747
 		//use class to change status
1748
-		$this->_cpt_model_obj->set_status( $event_status );
1748
+		$this->_cpt_model_obj->set_status($event_status);
1749 1749
 		$success = $this->_cpt_model_obj->save();
1750 1750
 
1751 1751
 		if ($success === FALSE) {
@@ -1765,15 +1765,15 @@  discard block
 block discarded – undo
1765 1765
 	 * @access protected
1766 1766
 	 * @return void
1767 1767
 	 */
1768
-	protected function _delete_event( $redirect_after = TRUE ) {
1768
+	protected function _delete_event($redirect_after = TRUE) {
1769 1769
 		//determine the event id and set to array.
1770 1770
 		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : NULL;
1771
-		$EVT_ID = isset( $this->_req_data['post'] ) ? absint( $this->_req_data['post'] ) : $EVT_ID;
1771
+		$EVT_ID = isset($this->_req_data['post']) ? absint($this->_req_data['post']) : $EVT_ID;
1772 1772
 
1773 1773
 
1774 1774
 		// loop thru events
1775 1775
 		if ($EVT_ID) {
1776
-			$success = $this->_permanently_delete_event( $EVT_ID );
1776
+			$success = $this->_permanently_delete_event($EVT_ID);
1777 1777
 			// get list of events with no prices
1778 1778
 			$espresso_no_ticket_prices = get_option('ee_no_ticket_prices', array());
1779 1779
 			// remove this event from the list of events with no prices
@@ -1787,7 +1787,7 @@  discard block
 block discarded – undo
1787 1787
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1788 1788
 		}
1789 1789
 
1790
-		if ( $redirect_after )
1790
+		if ($redirect_after)
1791 1791
 			$this->_redirect_after_action($success, 'Event', 'deleted', array('action' => 'default', 'status' => 'trash'));
1792 1792
 	}
1793 1793
 
@@ -1833,7 +1833,7 @@  discard block
 block discarded – undo
1833 1833
 	 */
1834 1834
 	private function _permanently_delete_event($EVT_ID = FALSE) {
1835 1835
 		// grab event id
1836
-		if (!$EVT_ID = absint($EVT_ID)) {
1836
+		if ( ! $EVT_ID = absint($EVT_ID)) {
1837 1837
 			$msg = __('An error occurred. No Event ID or an invalid Event ID was received.', 'event_espresso');
1838 1838
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1839 1839
 			return FALSE;
@@ -1844,10 +1844,10 @@  discard block
 block discarded – undo
1844 1844
 
1845 1845
 		//need to delete related tickets and prices first.
1846 1846
 		$datetimes = $this->_cpt_model_obj->get_many_related('Datetime');
1847
-		foreach ( $datetimes as $datetime ) {
1847
+		foreach ($datetimes as $datetime) {
1848 1848
 			$this->_cpt_model_obj->_remove_relation_to($datetime, 'Datetime');
1849 1849
 			$tickets = $datetime->get_many_related('Ticket');
1850
-			foreach ( $tickets as $ticket ) {
1850
+			foreach ($tickets as $ticket) {
1851 1851
 				$ticket->_remove_relation_to($datetime, 'Datetime');
1852 1852
 				$ticket->delete_related_permanently('Price');
1853 1853
 				$ticket->delete_permanently();
@@ -1857,14 +1857,14 @@  discard block
 block discarded – undo
1857 1857
 
1858 1858
 		//what about related venues or terms?
1859 1859
 		$venues = $this->_cpt_model_obj->get_many_related('Venue');
1860
-		foreach ( $venues as $venue ) {
1860
+		foreach ($venues as $venue) {
1861 1861
 			$this->_cpt_model_obj->_remove_relation_to($venue, 'Venue');
1862 1862
 		}
1863 1863
 
1864 1864
 		//any attached question groups?
1865 1865
 		$question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
1866
-		if ( !empty( $question_groups ) ) {
1867
-			foreach ( $question_groups as $question_group ) {
1866
+		if ( ! empty($question_groups)) {
1867
+			foreach ($question_groups as $question_group) {
1868 1868
 				$this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
1869 1869
 			}
1870 1870
 		}
@@ -1873,13 +1873,13 @@  discard block
 block discarded – undo
1873 1873
 
1874 1874
 
1875 1875
 		//Message Template Groups
1876
-		$this->_cpt_model_obj->_remove_relations( 'Message_Template_Group' );
1876
+		$this->_cpt_model_obj->_remove_relations('Message_Template_Group');
1877 1877
 
1878 1878
 
1879 1879
 		//term taxonomies
1880 1880
 		$term_taxonomies = $this->_cpt_model_obj->term_taxonomies();
1881 1881
 
1882
-		foreach ( $term_taxonomies as $term_taxonomy ) {
1882
+		foreach ($term_taxonomies as $term_taxonomy) {
1883 1883
 			$this->_cpt_model_obj->remove_relation_to_term_taxonomy($term_taxonomy);
1884 1884
 		}
1885 1885
 
@@ -1893,7 +1893,7 @@  discard block
 block discarded – undo
1893 1893
 			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1894 1894
 			return FALSE;
1895 1895
 		}
1896
-		do_action( 'AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted' );
1896
+		do_action('AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted');
1897 1897
 		return TRUE;
1898 1898
 	}
1899 1899
 
@@ -1910,7 +1910,7 @@  discard block
 block discarded – undo
1910 1910
 	 */
1911 1911
 	public function total_events() {
1912 1912
 
1913
-		$count = EEM_Event::instance()->count( array(), 'EVT_ID' );
1913
+		$count = EEM_Event::instance()->count(array(), 'EVT_ID');
1914 1914
 		return $count;
1915 1915
 	}
1916 1916
 
@@ -1925,10 +1925,10 @@  discard block
 block discarded – undo
1925 1925
 	 */
1926 1926
 	public function total_events_draft() {
1927 1927
 		$where = array(
1928
-			'status' => array( 'IN', array('draft', 'auto-draft' ) )
1928
+			'status' => array('IN', array('draft', 'auto-draft'))
1929 1929
 			);
1930 1930
 
1931
-		$count = EEM_Event::instance()->count( array( $where ), 'EVT_ID' );
1931
+		$count = EEM_Event::instance()->count(array($where), 'EVT_ID');
1932 1932
 		return $count;
1933 1933
 	}
1934 1934
 
@@ -1947,7 +1947,7 @@  discard block
 block discarded – undo
1947 1947
 			'status' => 'trash'
1948 1948
 			);
1949 1949
 
1950
-		$count = EEM_Event::instance()->count( array( $where ), 'EVT_ID' );
1950
+		$count = EEM_Event::instance()->count(array($where), 'EVT_ID');
1951 1951
 		return $count;
1952 1952
 	}
1953 1953
 
@@ -1975,11 +1975,11 @@  discard block
 block discarded – undo
1975 1975
 			// translated
1976 1976
 			TRUE
1977 1977
 		);
1978
-		$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;
1978
+		$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;
1979 1979
 
1980 1980
 		$this->_set_add_edit_form_tags('update_default_event_settings');
1981 1981
 		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
1982
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template(EVENTS_TEMPLATE_PATH . 'event_settings.template.php', $this->_template_args, TRUE);
1982
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(EVENTS_TEMPLATE_PATH.'event_settings.template.php', $this->_template_args, TRUE);
1983 1983
 		$this->display_admin_page_with_sidebar();
1984 1984
 	}
1985 1985
 
@@ -2005,9 +2005,9 @@  discard block
 block discarded – undo
2005 2005
 
2006 2006
 	protected function _template_settings() {
2007 2007
 		$this->_admin_page_title = __('Template Settings (Preview)', 'event_espresso');
2008
-		$this->_template_args['preview_img'] = '<img src="' . EVENTS_ASSETS_URL . DS . 'images' . DS . 'caffeinated_template_features.jpg" alt="' . esc_attr__( 'Template Settings Preview screenshot', 'event_espresso' ) . '" />';
2009
-		$this->_template_args['preview_text'] = '<strong>'.__( 'Template Settings is a feature that is only available in the Caffeinated version of Event Espresso. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.', 'event_espresso' ).'</strong>';
2010
-		$this->display_admin_caf_preview_page( 'template_settings_tab' );
2008
+		$this->_template_args['preview_img'] = '<img src="'.EVENTS_ASSETS_URL.DS.'images'.DS.'caffeinated_template_features.jpg" alt="'.esc_attr__('Template Settings Preview screenshot', 'event_espresso').'" />';
2009
+		$this->_template_args['preview_text'] = '<strong>'.__('Template Settings is a feature that is only available in the Caffeinated version of Event Espresso. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.', 'event_espresso').'</strong>';
2010
+		$this->display_admin_caf_preview_page('template_settings_tab');
2011 2011
 	}
2012 2012
 
2013 2013
 
@@ -2020,22 +2020,22 @@  discard block
 block discarded – undo
2020 2020
 	 * @return void
2021 2021
 	 */
2022 2022
 	private function _set_category_object() {
2023
-		if ( isset( $this->_category->id ) && !empty( $this->_category->id ) )
2023
+		if (isset($this->_category->id) && ! empty($this->_category->id))
2024 2024
 			return; //already have the category object so get out.
2025 2025
 
2026 2026
 		//set default category object
2027 2027
 		$this->_set_empty_category_object();
2028 2028
 
2029 2029
 		//only set if we've got an id
2030
-		if ( !isset($this->_req_data['EVT_CAT_ID'] ) ) {
2030
+		if ( ! isset($this->_req_data['EVT_CAT_ID'])) {
2031 2031
 			return;
2032 2032
 		}
2033 2033
 
2034 2034
 		$category_id = absint($this->_req_data['EVT_CAT_ID']);
2035 2035
 
2036
-		$term = get_term( $category_id, 'espresso_event_categories' );
2036
+		$term = get_term($category_id, 'espresso_event_categories');
2037 2037
 
2038
-		if ( !empty( $term ) ) {
2038
+		if ( ! empty($term)) {
2039 2039
 			$this->_category->category_name = $term->name;
2040 2040
 			$this->_category->category_identifier = $term->slug;
2041 2041
 			$this->_category->category_desc = $term->description;
@@ -2049,13 +2049,13 @@  discard block
 block discarded – undo
2049 2049
 
2050 2050
 	private function _set_empty_category_object() {
2051 2051
 		$this->_category = new stdClass();
2052
-		$this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc  = '';
2052
+		$this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = '';
2053 2053
 		$this->_category->id = $this->_category->parent = 0;
2054 2054
 	}
2055 2055
 
2056 2056
 
2057 2057
 	protected function _category_list_table() {
2058
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2058
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2059 2059
 		$this->_search_btn_label = __('Categories', 'event_espresso');
2060 2060
 		$this->_admin_page_title .= $this->get_action_link_or_button('add_category', 'add_category', array(), 'add-new-h2');
2061 2061
 		$this->display_admin_list_table_page_with_sidebar();
@@ -2065,22 +2065,22 @@  discard block
 block discarded – undo
2065 2065
 	protected function _category_details($view) {
2066 2066
 
2067 2067
 		//load formatter helper
2068
-		EE_Registry::instance()->load_helper( 'Formatter' );
2068
+		EE_Registry::instance()->load_helper('Formatter');
2069 2069
 		//load field generator helper
2070
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
2070
+		EE_Registry::instance()->load_helper('Form_Fields');
2071 2071
 
2072 2072
 		$route = $view == 'edit' ? 'update_category' : 'insert_category';
2073 2073
 		$this->_set_add_edit_form_tags($route);
2074 2074
 
2075 2075
 		$this->_set_category_object();
2076
-		$id = !empty($this->_category->id) ? $this->_category->id : '';
2076
+		$id = ! empty($this->_category->id) ? $this->_category->id : '';
2077 2077
 
2078 2078
 		$delete_action = 'delete_category';
2079 2079
 
2080 2080
 		//custom redirect
2081
-		$redirect = EE_Admin_Page::add_query_args_and_nonce( array('action' => 'category_list'), $this->_admin_base_url );
2081
+		$redirect = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'category_list'), $this->_admin_base_url);
2082 2082
 
2083
-		$this->_set_publish_post_box_vars( 'EVT_CAT_ID', $id, $delete_action, $redirect );
2083
+		$this->_set_publish_post_box_vars('EVT_CAT_ID', $id, $delete_action, $redirect);
2084 2084
 
2085 2085
 		//take care of contents
2086 2086
 		$this->_template_args['admin_page_content'] = $this->_category_details_content();
@@ -2094,25 +2094,25 @@  discard block
 block discarded – undo
2094 2094
 			'type' => 'wp_editor',
2095 2095
 			'value' => EEH_Formatter::admin_format_content($this->_category->category_desc),
2096 2096
 			'class' => 'my_editor_custom',
2097
-			'wpeditor_args' => array('media_buttons' => FALSE )
2097
+			'wpeditor_args' => array('media_buttons' => FALSE)
2098 2098
 		);
2099
-		$_wp_editor = $this->_generate_admin_form_fields( $editor_args, 'array' );
2099
+		$_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array');
2100 2100
 
2101
-		$all_terms = get_terms( array('espresso_event_categories' ), array( 'hide_empty' => 0, 'exclude' => array( $this->_category->id ) ) );
2101
+		$all_terms = get_terms(array('espresso_event_categories'), array('hide_empty' => 0, 'exclude' => array($this->_category->id)));
2102 2102
 
2103 2103
 		//setup category select for term parents.
2104 2104
 		$category_select_values[] = array(
2105 2105
 			'text' => __('No Parent', 'event_espresso'),
2106 2106
 			'id' => 0
2107 2107
 			);
2108
-		foreach ( $all_terms as $term ) {
2108
+		foreach ($all_terms as $term) {
2109 2109
 			$category_select_values[] = array(
2110 2110
 				'text' => $term->name,
2111 2111
 				'id' => $term->term_id
2112 2112
 				);
2113 2113
 		}
2114 2114
 
2115
-		$category_select = EEH_Form_Fields::select_input( 'category_parent', $category_select_values, $this->_category->parent );
2115
+		$category_select = EEH_Form_Fields::select_input('category_parent', $category_select_values, $this->_category->parent);
2116 2116
 
2117 2117
 		$template_args = array(
2118 2118
 			'category' => $this->_category,
@@ -2122,15 +2122,15 @@  discard block
 block discarded – undo
2122 2122
 			'disable' => '',
2123 2123
 			'disabled_message' => FALSE
2124 2124
 			);
2125
-		$template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2126
-		return EEH_Template::display_template($template, $template_args, TRUE );
2125
+		$template = EVENTS_TEMPLATE_PATH.'event_category_details.template.php';
2126
+		return EEH_Template::display_template($template, $template_args, TRUE);
2127 2127
 	}
2128 2128
 
2129 2129
 
2130 2130
 	protected function _delete_categories() {
2131
-		$cat_ids = isset( $this->_req_data['EVT_CAT_ID'] ) ? (array) $this->_req_data['EVT_CAT_ID'] : (array) $this->_req_data['category_id'];
2131
+		$cat_ids = isset($this->_req_data['EVT_CAT_ID']) ? (array) $this->_req_data['EVT_CAT_ID'] : (array) $this->_req_data['category_id'];
2132 2132
 
2133
-		foreach ( $cat_ids as $cat_id ) {
2133
+		foreach ($cat_ids as $cat_id) {
2134 2134
 			$this->_delete_category($cat_id);
2135 2135
 		}
2136 2136
 
@@ -2138,7 +2138,7 @@  discard block
 block discarded – undo
2138 2138
 		$query_args = array(
2139 2139
 			'action' => 'category_list'
2140 2140
 			);
2141
-		$this->_redirect_after_action(0,'','',$query_args);
2141
+		$this->_redirect_after_action(0, '', '', $query_args);
2142 2142
 
2143 2143
 	}
2144 2144
 
@@ -2148,61 +2148,61 @@  discard block
 block discarded – undo
2148 2148
 
2149 2149
 	protected function _delete_category($cat_id) {
2150 2150
 		global $wpdb;
2151
-		$cat_id = absint( $cat_id );
2152
-		wp_delete_term( $cat_id, 'espresso_event_categories' );
2151
+		$cat_id = absint($cat_id);
2152
+		wp_delete_term($cat_id, 'espresso_event_categories');
2153 2153
 	}
2154 2154
 
2155 2155
 
2156 2156
 
2157 2157
 	protected function _insert_or_update_category($new_category) {
2158 2158
 
2159
-		$cat_id = $new_category ? $this->_insert_category() : $this->_insert_category( TRUE );
2159
+		$cat_id = $new_category ? $this->_insert_category() : $this->_insert_category(TRUE);
2160 2160
 		$success = 0; //we already have a success message so lets not send another.
2161 2161
 
2162
-		if ( $cat_id ) {
2162
+		if ($cat_id) {
2163 2163
 			$query_args = array(
2164 2164
 				'action'     => 'edit_category',
2165 2165
 				'EVT_CAT_ID' => $cat_id
2166 2166
 			);
2167 2167
 		} else {
2168
-			$query_args = array( 'action' => 'add_category' );
2168
+			$query_args = array('action' => 'add_category');
2169 2169
 		}
2170
-		$this->_redirect_after_action( $success, '','', $query_args, TRUE );
2170
+		$this->_redirect_after_action($success, '', '', $query_args, TRUE);
2171 2171
 
2172 2172
 	}
2173 2173
 
2174 2174
 
2175 2175
 
2176
-	private function _insert_category( $update = FALSE ) {
2176
+	private function _insert_category($update = FALSE) {
2177 2177
 		$cat_id = $update ? $this->_req_data['EVT_CAT_ID'] : '';
2178
-		$category_name= isset( $this->_req_data['category_name'] ) ? $this->_req_data['category_name'] : '';
2179
-		$category_desc= isset( $this->_req_data['category_desc'] ) ? $this->_req_data['category_desc'] : '';
2180
-		$category_parent = isset( $this->_req_data['category_parent'] ) ? $this->_req_data['category_parent'] : 0;
2178
+		$category_name = isset($this->_req_data['category_name']) ? $this->_req_data['category_name'] : '';
2179
+		$category_desc = isset($this->_req_data['category_desc']) ? $this->_req_data['category_desc'] : '';
2180
+		$category_parent = isset($this->_req_data['category_parent']) ? $this->_req_data['category_parent'] : 0;
2181 2181
 
2182
-		if ( empty( $category_name ) ) {
2183
-			$msg = __( 'You must add a name for the category.', 'event_espresso' );
2184
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2182
+		if (empty($category_name)) {
2183
+			$msg = __('You must add a name for the category.', 'event_espresso');
2184
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2185 2185
 			return false;
2186 2186
 		}
2187 2187
 
2188
-		$term_args=array(
2188
+		$term_args = array(
2189 2189
 			'name'=>$category_name,
2190 2190
 			'description'=>$category_desc,
2191 2191
 			'parent'=>$category_parent
2192 2192
 		);
2193 2193
 		//was the category_identifier input disabled?
2194
-		if(isset($this->_req_data['category_identifier'])){
2194
+		if (isset($this->_req_data['category_identifier'])) {
2195 2195
 			$term_args['slug'] = $this->_req_data['category_identifier'];
2196 2196
 		}
2197
-		$insert_ids = $update ? wp_update_term( $cat_id, 'espresso_event_categories', $term_args ) :wp_insert_term( $category_name, 'espresso_event_categories', $term_args );
2197
+		$insert_ids = $update ? wp_update_term($cat_id, 'espresso_event_categories', $term_args) : wp_insert_term($category_name, 'espresso_event_categories', $term_args);
2198 2198
 
2199
-		if ( !is_array( $insert_ids ) ) {
2200
-			$msg = __( 'An error occurred and the category has not been saved to the database.', 'event_espresso' );
2201
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2199
+		if ( ! is_array($insert_ids)) {
2200
+			$msg = __('An error occurred and the category has not been saved to the database.', 'event_espresso');
2201
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2202 2202
 		} else {
2203 2203
 			$cat_id = $insert_ids['term_id'];
2204
-			$msg = sprintf ( __('The category %s was successfuly saved', 'event_espresso'), $category_name );
2205
-			EE_Error::add_success( $msg );
2204
+			$msg = sprintf(__('The category %s was successfuly saved', 'event_espresso'), $category_name);
2205
+			EE_Error::add_success($msg);
2206 2206
 		}
2207 2207
 
2208 2208
 		return $cat_id;
@@ -2211,32 +2211,32 @@  discard block
 block discarded – undo
2211 2211
 
2212 2212
 
2213 2213
 
2214
-	public function get_categories( $per_page = 10, $current_page = 1, $count = FALSE ) {
2214
+	public function get_categories($per_page = 10, $current_page = 1, $count = FALSE) {
2215 2215
 		global $wpdb;
2216 2216
 
2217 2217
 		//testing term stuff
2218
-		$orderby = isset( $this->_req_data['orderby'] ) ? $this->_req_data['orderby'] : 'Term.term_id';
2219
-		$order = isset( $this->_req_data['order'] ) ? $this->_req_data['order'] : 'DESC';
2220
-		$limit = ($current_page-1)*$per_page;
2218
+		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'Term.term_id';
2219
+		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
2220
+		$limit = ($current_page - 1) * $per_page;
2221 2221
 
2222
-		$where = array( 'taxonomy' => 'espresso_event_categories' );
2222
+		$where = array('taxonomy' => 'espresso_event_categories');
2223 2223
 
2224
-		if ( isset( $this->_req_data['s'] ) ) {
2225
-			$sstr = '%' . $this->_req_data['s'] . '%';
2224
+		if (isset($this->_req_data['s'])) {
2225
+			$sstr = '%'.$this->_req_data['s'].'%';
2226 2226
 			$where['OR'] = array(
2227
-				'Term.name' => array( 'LIKE', $sstr),
2228
-				'description' => array( 'LIKE', $sstr )
2227
+				'Term.name' => array('LIKE', $sstr),
2228
+				'description' => array('LIKE', $sstr)
2229 2229
 				);
2230 2230
 		}
2231 2231
 
2232 2232
 		$query_params = array(
2233
-			$where ,
2234
-			'order_by' => array( $orderby => $order ),
2235
-			'limit' => $limit . ',' . $per_page,
2233
+			$where,
2234
+			'order_by' => array($orderby => $order),
2235
+			'limit' => $limit.','.$per_page,
2236 2236
 			'force_join' => array('Term')
2237 2237
 			);
2238 2238
 
2239
-		$categories = $count ? EEM_Term_Taxonomy::instance()->count( $query_params, 'term_id' ) :EEM_Term_Taxonomy::instance()->get_all( $query_params );
2239
+		$categories = $count ? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id') : EEM_Term_Taxonomy::instance()->get_all($query_params);
2240 2240
 
2241 2241
 		return $categories;
2242 2242
 	}
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_tabs/general_settings_templates.help_tab.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 </li>
34 34
 <li>
35 35
 <strong><?php _e('Display Descriptions', 'event_espresso'); ?></strong><br />
36
-<?php printf( __('Whether descriptions should be shown on the event list page.%sSelecting "none" will NOT display any of the text content you entered into the main text editor on the event admin page.%sSelecting "excerpt" will display the text you entered into the "Excerpt" textarea on the event admin page, OR, any text in the main text editor above the "' . htmlentities( '<!--more-->' ) . '" tag.%sSelecting "full description" will display ALL of the text content you entered into the main text editor on the event admin page.', 'event_espresso'), '<br/>', '<br/>', '<br/>' );?>
36
+<?php printf(__('Whether descriptions should be shown on the event list page.%sSelecting "none" will NOT display any of the text content you entered into the main text editor on the event admin page.%sSelecting "excerpt" will display the text you entered into the "Excerpt" textarea on the event admin page, OR, any text in the main text editor above the "'.htmlentities('<!--more-->').'" tag.%sSelecting "full description" will display ALL of the text content you entered into the main text editor on the event admin page.', 'event_espresso'), '<br/>', '<br/>', '<br/>'); ?>
37 37
 </li>
38 38
 <li>
39 39
 <strong><?php _e('Display Ticket Selector', 'event_espresso'); ?></strong><br />
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.