Completed
Branch BUG-8936-recaptcha-fail (74c1f8)
by
unknown
181:10 queued 167:00
created
admin/extend/registrations/Extend_Registrations_Admin_Page.core.php 4 patches
Braces   +6 added lines, -4 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
@@ -679,8 +680,9 @@  discard block
 block discarded – undo
679 680
 			EE_Error::add_error(__('Missing some required data to toggle the Check-in', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__  );
680 681
 		}
681 682
 
682
-		if ( defined('DOING_AJAX' ) )
683
-			return $new_status;
683
+		if ( defined('DOING_AJAX' ) ) {
684
+					return $new_status;
685
+		}
684 686
 
685 687
 		$this->_redirect_after_action( FALSE,'', '', $query_args, TRUE );
686 688
 
@@ -918,7 +920,7 @@  discard block
 block discarded – undo
918 920
 		$query_params['force_join'] = array('Attendee');//force join to attendee model so that it gets cached, because we're going to need the attendee for each registration
919 921
 		if($count){
920 922
 			$registrations = EEM_Registration::instance()->count(array($query_params[0]));
921
-		}else{
923
+		} else{
922 924
 			$registrations = EEM_Registration::instance()->get_all($query_params);
923 925
 
924 926
 
Please login to merge, or discard this patch.
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -631,8 +631,6 @@
 block discarded – undo
631 631
 	/**
632 632
 	 * 		handles toggleing the checkin status for the registration,
633 633
 	*		@access protected
634
-	*		@param boolean 	$check_in
635
-	*		@return void
636 634
 	*/
637 635
 	protected function _toggle_checkin_status() {
638 636
 		//first let's get the query args out of the way for the redirect
Please login to merge, or discard this patch.
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -453,9 +453,9 @@  discard block
 block discarded – undo
453 453
 
454 454
 	/**
455 455
 	 * 		generates Business Reports regarding Registrations
456
-	*		@access protected
457
-	*		@return void
458
-	*/
456
+	 *		@access protected
457
+	 *		@return void
458
+	 */
459 459
 	protected function _registration_reports() {
460 460
 		$template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
461 461
 		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_reports_template_data, true );
@@ -630,10 +630,10 @@  discard block
 block discarded – undo
630 630
 
631 631
 	/**
632 632
 	 * 		handles toggleing the checkin status for the registration,
633
-	*		@access protected
634
-	*		@param boolean 	$check_in
635
-	*		@return void
636
-	*/
633
+	 *		@access protected
634
+	 *		@param boolean 	$check_in
635
+	 *		@return void
636
+	 */
637 637
 	protected function _toggle_checkin_status() {
638 638
 		//first let's get the query args out of the way for the redirect
639 639
 		$query_args = array(
@@ -754,9 +754,9 @@  discard block
 block discarded – undo
754 754
 
755 755
 	/**
756 756
 	 * 		generates HTML for the Event Registrations List Table
757
-	*		@access protected
758
-	*		@return void
759
-	*/
757
+	 *		@access protected
758
+	 *		@return void
759
+	 */
760 760
 	protected function _event_registrations_list_table() {
761 761
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
762 762
 		$this->_admin_page_title .= isset( $this->_req_data['event_id'] ) ? $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $this->_req_data['event_id']), 'add-new-h2') : '';
@@ -786,11 +786,11 @@  discard block
 block discarded – undo
786 786
 				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved,
787 787
 				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' )
788 788
 				),
789
-            'cancelled_status' => array(
789
+			'cancelled_status' => array(
790 790
 				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled,
791 791
 				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' )
792 792
 				),
793
-            'declined_status' => array(
793
+			'declined_status' => array(
794 794
 				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined,
795 795
 				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' )
796 796
 				),
@@ -818,9 +818,9 @@  discard block
 block discarded – undo
818 818
 	/**
819 819
 	 * 		get_attendees
820 820
 	 * 		@param bool $count whether to return count or data.
821
-	*		@access public
822
-	*		@return array
823
-	*/
821
+	 *		@access public
822
+	 *		@return array
823
+	 */
824 824
 	public function get_event_attendees( $per_page = 10, $count = FALSE, $trash = FALSE, $orderby = '' ) {
825 825
 
826 826
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
Please login to merge, or discard this patch.
Spacing   +216 added lines, -216 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
 /**
@@ -37,20 +37,20 @@  discard block
 block discarded – undo
37 37
 	protected $_reports_template_data = array();
38 38
 
39 39
 
40
-	public function __construct( $routing = TRUE ) {
41
-		parent::__construct( $routing );
42
-		define( 'REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/templates/');
43
-		define( 'REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/assets/');
44
-		define( 'REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registrations/assets/');
40
+	public function __construct($routing = TRUE) {
41
+		parent::__construct($routing);
42
+		define('REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'registrations/templates/');
43
+		define('REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'registrations/assets/');
44
+		define('REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'registrations/assets/');
45 45
 	}
46 46
 
47 47
 
48 48
 	protected function _extend_page_config() {
49
-		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'registrations';
49
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'registrations';
50 50
 
51
-		$reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0;
52
-		$att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) ? ! is_array( $this->_req_data['ATT_ID'] ) : 0;
53
-		$att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id;
51
+		$reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0;
52
+		$att_id = ! empty($this->_req_data['ATT_ID']) ? ! is_array($this->_req_data['ATT_ID']) : 0;
53
+		$att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id;
54 54
 
55 55
 		$new_page_routes = array(
56 56
 			'reports' => array(
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 				)
90 90
 			);
91 91
 
92
-		$this->_page_routes = array_merge( $this->_page_routes, $new_page_routes );
92
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
93 93
 
94 94
 		$new_page_config = array(
95 95
 			'reports' => array(
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 						'filename' => 'registrations_event_checkin_other'
135 135
 					)
136 136
 				),
137
-				'help_tour' => array( 'Event_Checkin_Help_Tour' ),
138
-				'qtips' => array('Registration_List_Table_Tips' ),
137
+				'help_tour' => array('Event_Checkin_Help_Tour'),
138
+				'qtips' => array('Registration_List_Table_Tips'),
139 139
 				'list_table' => 'EE_Event_Registrations_List_Table',
140 140
 				'metaboxes' => array(),
141 141
 				'require_nonce' => FALSE
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 		// var_dump($this->_req_data);
157 157
 		// exit();
158 158
 
159
-		$this->_page_config = array_merge( $this->_page_config, $new_page_config );
159
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
160 160
 		$this->_page_config['contact_list']['list_table'] = 'Extend_EE_Attendee_Contact_List_Table';
161 161
 		$this->_page_config['default']['list_table'] = 'Extend_EE_Registrations_List_Table';
162 162
 	}
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 
166 166
 	protected function _ajax_hooks() {
167 167
 		parent::_ajax_hooks();
168
-		add_action('wp_ajax_get_newsletter_form_content', array( $this, 'get_newsletter_form_content') );
168
+		add_action('wp_ajax_get_newsletter_form_content', array($this, 'get_newsletter_form_content'));
169 169
 	}
170 170
 
171 171
 
@@ -175,20 +175,20 @@  discard block
 block discarded – undo
175 175
 
176 176
 		//if newsletter message type is active then let's add filter and load js for it.
177 177
 		EE_Registry::instance()->load_helper('MSG_Template');
178
-		if ( EEH_MSG_Template::is_mt_active('newsletter') ) {
178
+		if (EEH_MSG_Template::is_mt_active('newsletter')) {
179 179
 			//enqueue newsletter js
180
-			wp_enqueue_script( 'ee-newsletter-trigger', REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.js', array( 'ee-dialog'), EVENT_ESPRESSO_VERSION, TRUE );
181
-			wp_enqueue_style( 'ee-newsletter-trigger-css', REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.css', array(), EVENT_ESPRESSO_VERSION );
180
+			wp_enqueue_script('ee-newsletter-trigger', REG_CAF_ASSETS_URL.'ee-newsletter-trigger.js', array('ee-dialog'), EVENT_ESPRESSO_VERSION, TRUE);
181
+			wp_enqueue_style('ee-newsletter-trigger-css', REG_CAF_ASSETS_URL.'ee-newsletter-trigger.css', array(), EVENT_ESPRESSO_VERSION);
182 182
 			//hook in buttons for newsletter message type trigger.
183
-			add_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', array( $this, 'add_newsletter_action_buttons'), 10 );
183
+			add_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', array($this, 'add_newsletter_action_buttons'), 10);
184 184
 		}
185 185
 	}
186 186
 
187 187
 
188 188
 
189 189
 	public function load_scripts_styles_reports() {
190
-		wp_register_script( 'ee-reg-reports-js', REG_CAF_ASSETS_URL . 'ee-registration-admin-reports.js', array( 'google-charts' ), EVENT_ESPRESSO_VERSION, true );
191
-		wp_enqueue_script( 'ee-reg-reports-js' );
190
+		wp_register_script('ee-reg-reports-js', REG_CAF_ASSETS_URL.'ee-registration-admin-reports.js', array('google-charts'), EVENT_ESPRESSO_VERSION, true);
191
+		wp_enqueue_script('ee-reg-reports-js');
192 192
 		$this->_registration_reports_js_setup();
193 193
 	}
194 194
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 				'slug' => 'all',
221 221
 				'label' => __('All', 'event_espresso'),
222 222
 				'count' => 0,
223
-				'bulk_action' => !isset( $this->_req_data['event_id'] ) ? array() : array(
223
+				'bulk_action' => ! isset($this->_req_data['event_id']) ? array() : array(
224 224
 					'toggle_checkin_status' => __('Toggle Check-In', 'event_espresso'),
225 225
 					//'trash_registrations' => __('Trash Registrations', 'event_espresso')
226 226
 					)
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 				'slug' => 'all',
239 239
 				'label' => __('All', 'event_espresso'),
240 240
 				'count' => 0,
241
-				'bulk_action' => array( 'delete_checkin_rows' => __('Delete Check-In Rows', 'event_espresso') )
241
+				'bulk_action' => array('delete_checkin_rows' => __('Delete Check-In Rows', 'event_espresso'))
242 242
 				),
243 243
 			);
244 244
 	}
@@ -254,20 +254,20 @@  discard block
 block discarded – undo
254 254
 	 */
255 255
 	public function get_newsletter_form_content() {
256 256
 		//do a nonce check cause we're not coming in from an normal route here.
257
-		$nonce = isset( $this->_req_data['get_newsletter_form_content_nonce'] ) ? sanitize_text_field( $this->_req_data['get_newsletter_form_content_nonce'] ) : '';
257
+		$nonce = isset($this->_req_data['get_newsletter_form_content_nonce']) ? sanitize_text_field($this->_req_data['get_newsletter_form_content_nonce']) : '';
258 258
 		$nonce_ref = 'get_newsletter_form_content_nonce';
259 259
 
260
-		$this->_verify_nonce( $nonce, $nonce_ref );
260
+		$this->_verify_nonce($nonce, $nonce_ref);
261 261
 		//let's get the mtp for the incoming MTP_ ID
262
-		if ( !isset( $this->_req_data['GRP_ID'] ) ) {
263
-			EE_Error::add_error( __('There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
262
+		if ( ! isset($this->_req_data['GRP_ID'])) {
263
+			EE_Error::add_error(__('There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
264 264
 			$this->_template_args['success'] = FALSE;
265 265
 			$this->_template_args['error'] = TRUE;
266 266
 			$this->_return_json();
267 267
 		}
268
-		$MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID( $this->_req_data['GRP_ID'] );
269
-		if ( ! $MTPG instanceof EE_Message_Template_Group ) {
270
-			EE_Error::add_error( sprintf( __('The GRP_ID given (%d) does not appear to have a corresponding row in the database.', 'event_espresso'), $this->_req_data['GRP_ID'] ), __FILE__, __FUNCTION__, __LINE__  );
268
+		$MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID($this->_req_data['GRP_ID']);
269
+		if ( ! $MTPG instanceof EE_Message_Template_Group) {
270
+			EE_Error::add_error(sprintf(__('The GRP_ID given (%d) does not appear to have a corresponding row in the database.', 'event_espresso'), $this->_req_data['GRP_ID']), __FILE__, __FUNCTION__, __LINE__);
271 271
 			$this->_template_args['success'] = FALSE;
272 272
 			$this->_template_args['error'] = TRUE;
273 273
 			$this->_return_json();
@@ -276,11 +276,11 @@  discard block
 block discarded – undo
276 276
 		$MTPs = $MTPG->context_templates();
277 277
 		$MTPs = $MTPs['attendee'];
278 278
 		$template_fields = array();
279
-		foreach ( $MTPs as $MTP ) {
279
+		foreach ($MTPs as $MTP) {
280 280
 			$field = $MTP->get('MTP_template_field');
281
-			if ( $field == 'content'  ) {
281
+			if ($field == 'content') {
282 282
 				$content = $MTP->get('MTP_content');
283
-				if ( !empty( $content['newsletter_content'] ) ) {
283
+				if ( ! empty($content['newsletter_content'])) {
284 284
 					$template_fields['newsletter_content'] = $content['newsletter_content'];
285 285
 					}
286 286
 				continue;
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 		$this->_template_args['data'] = array(
294 294
 			'batch_message_from' => isset($template_fields['from']) ? $template_fields['from'] : '',
295 295
 			'batch_message_subject' => isset($template_fields['subject']) ? $template_fields['subject'] : '',
296
-			'batch_message_content' => isset( $template_fields['newsletter_content'] ) ? $template_fields['newsletter_content'] : ''
296
+			'batch_message_content' => isset($template_fields['newsletter_content']) ? $template_fields['newsletter_content'] : ''
297 297
 			);
298 298
 		$this->_return_json();
299 299
 	}
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 	 * @param EE_Admin_List_Table $list_table
310 310
 	 * @return string html string for extra buttons
311 311
 	 */
312
-	public function add_newsletter_action_buttons( EE_Admin_List_Table $list_table ) {
313
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_newsletter_selected_send' ) ) {
312
+	public function add_newsletter_action_buttons(EE_Admin_List_Table $list_table) {
313
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_newsletter_selected_send')) {
314 314
 			return '';
315 315
 		}
316 316
 
@@ -319,13 +319,13 @@  discard block
 block discarded – undo
319 319
 			'event_registrations',
320 320
 			'default'
321 321
 			);
322
-		if ( $this->_current_page == 'espresso_registrations' && in_array( $this->_req_action, $routes_to_add_to )  ) {
323
-			if ( ( $this->_req_action == 'event_registrations' && empty( $this->_req_data['event_id'] ) ) || ( isset( $this->_req_data['status'] ) && $this->_req_data['status'] == 'trash' ) ) {
322
+		if ($this->_current_page == 'espresso_registrations' && in_array($this->_req_action, $routes_to_add_to)) {
323
+			if (($this->_req_action == 'event_registrations' && empty($this->_req_data['event_id'])) || (isset($this->_req_data['status']) && $this->_req_data['status'] == 'trash')) {
324 324
 				echo '';
325 325
 			} else {
326
-				$button_text = sprintf( __('Send Batch Message (%s selected)', 'event_espresso'), '<span class="send-selected-newsletter-count">0</span>' );
327
-				echo '<button id="selected-batch-send-trigger" class="button secondary-button"><span class="dashicons dashicons-email "></span>' . $button_text . '</button>';
328
-				add_action('admin_footer', array( $this, 'newsletter_send_form_skeleton') );
326
+				$button_text = sprintf(__('Send Batch Message (%s selected)', 'event_espresso'), '<span class="send-selected-newsletter-count">0</span>');
327
+				echo '<button id="selected-batch-send-trigger" class="button secondary-button"><span class="dashicons dashicons-email "></span>'.$button_text.'</button>';
328
+				add_action('admin_footer', array($this, 'newsletter_send_form_skeleton'));
329 329
 			}
330 330
 		}
331 331
 	}
@@ -337,38 +337,38 @@  discard block
 block discarded – undo
337 337
 		$list_table = $this->_list_table_object;
338 338
 		$codes = array();
339 339
 		//need to templates for the newsletter message type for the template selector.
340
-		$values[] = array( 'text' => __('Select Template to Use', 'event_espresso'), 'id' => 0 );
341
-		$mtps = EEM_Message_Template_Group::instance()->get_all( array( array( 'MTP_message_type' => 'newsletter', 'MTP_messenger' => 'email' ) ) );
342
-		foreach ( $mtps as $mtp ) {
340
+		$values[] = array('text' => __('Select Template to Use', 'event_espresso'), 'id' => 0);
341
+		$mtps = EEM_Message_Template_Group::instance()->get_all(array(array('MTP_message_type' => 'newsletter', 'MTP_messenger' => 'email')));
342
+		foreach ($mtps as $mtp) {
343 343
 			$name = $mtp->name();
344 344
 			$values[] = array(
345
-				'text' => empty( $name ) ? __('Global', 'event_espresso') : $name,
345
+				'text' => empty($name) ? __('Global', 'event_espresso') : $name,
346 346
 				'id' => $mtp->ID()
347 347
 				);
348 348
 		}
349 349
 
350 350
 		//need to get a list of shortcodes that are available for the newsletter message type.
351 351
 		EE_Registry::instance()->load_helper('MSG_Template');
352
-		$shortcodes = EEH_MSG_Template::get_shortcodes( 'newsletter', 'email', array(), 'attendee', FALSE );
353
-		foreach ( $shortcodes as $field => $shortcode_array ) {
354
-			$codes[$field] = implode(', ', array_keys($shortcode_array ) );
352
+		$shortcodes = EEH_MSG_Template::get_shortcodes('newsletter', 'email', array(), 'attendee', FALSE);
353
+		foreach ($shortcodes as $field => $shortcode_array) {
354
+			$codes[$field] = implode(', ', array_keys($shortcode_array));
355 355
 		}
356 356
 
357 357
 		$shortcodes = $codes;
358 358
 
359
-		$form_template = REG_CAF_TEMPLATE_PATH . 'newsletter-send-form.template.php';
359
+		$form_template = REG_CAF_TEMPLATE_PATH.'newsletter-send-form.template.php';
360 360
 		$form_template_args = array(
361 361
 			'form_action' => admin_url('admin.php?page=espresso_registrations'),
362 362
 			'form_route' => 'newsletter_selected_send',
363 363
 			'form_nonce_name' => 'newsletter_selected_send_nonce',
364
-			'form_nonce' => wp_create_nonce( 'newsletter_selected_send_nonce' ),
364
+			'form_nonce' => wp_create_nonce('newsletter_selected_send_nonce'),
365 365
 			'redirect_back_to' => $this->_req_action,
366
-			'ajax_nonce' => wp_create_nonce( 'get_newsletter_form_content_nonce'),
367
-			'template_selector' => EEH_Form_Fields::select_input('newsletter_mtp_selected', $values ),
366
+			'ajax_nonce' => wp_create_nonce('get_newsletter_form_content_nonce'),
367
+			'template_selector' => EEH_Form_Fields::select_input('newsletter_mtp_selected', $values),
368 368
 			'shortcodes' => $shortcodes,
369 369
 			'id_type' => $list_table instanceof EE_Attendee_Contact_List_Table ? 'contact' : 'registration'
370 370
 			);
371
-		EEH_Template::display_template( $form_template, $form_template_args );
371
+		EEH_Template::display_template($form_template, $form_template_args);
372 372
 	}
373 373
 
374 374
 
@@ -383,35 +383,35 @@  discard block
 block discarded – undo
383 383
 	protected function _newsletter_selected_send() {
384 384
 		$success = TRUE;
385 385
 		//first we need to make sure we have a GRP_ID so we know what template we're sending and updating!
386
-		if ( empty( $this->_req_data['newsletter_mtp_selected'] ) ) {
387
-			EE_Error::add_error( __('In order to send a message, a Message Template GRP_ID is needed. It was not provided so messages were not sent.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
386
+		if (empty($this->_req_data['newsletter_mtp_selected'])) {
387
+			EE_Error::add_error(__('In order to send a message, a Message Template GRP_ID is needed. It was not provided so messages were not sent.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
388 388
 			$success = FALSE;
389 389
 		}
390 390
 
391
-		if ( $success ) {
391
+		if ($success) {
392 392
 			//update Message template in case there are any changes
393
-			$MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID( $this->_req_data['newsletter_mtp_selected'] );
393
+			$MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID($this->_req_data['newsletter_mtp_selected']);
394 394
 			$MTPs = $MTPG instanceof EE_Message_Template_Group ? $MTPG->context_templates() : array();
395
-			if ( empty( $MTPs ) ) {
396
-				EE_Error::add_error( __('Unable to retrieve message template fields from the db. Messages not sent.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
395
+			if (empty($MTPs)) {
396
+				EE_Error::add_error(__('Unable to retrieve message template fields from the db. Messages not sent.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
397 397
 				$success = FALSE;
398 398
 			}
399 399
 
400 400
 			//let's just update the specific fields
401
-			foreach ( $MTPs['attendee'] as $MTP ) {
401
+			foreach ($MTPs['attendee'] as $MTP) {
402 402
 				$field = $MTP->get('MTP_template_field');
403 403
 				$content = $MTP->get('MTP_content');
404 404
 				$new_content = $content;
405
-				switch( $field ) {
405
+				switch ($field) {
406 406
 					case 'from' :
407
-						$new_content = !empty( $this->_req_data['batch_message']['from'] ) ? $this->_req_data['batch_message']['from'] : $content;
407
+						$new_content = ! empty($this->_req_data['batch_message']['from']) ? $this->_req_data['batch_message']['from'] : $content;
408 408
 						break;
409 409
 					case 'subject' :
410
-						$new_content = !empty( $this->_req_data['batch_message']['subject'] ) ? $this->_req_data['batch_message']['subject'] : $content;
410
+						$new_content = ! empty($this->_req_data['batch_message']['subject']) ? $this->_req_data['batch_message']['subject'] : $content;
411 411
 						break;
412 412
 					case 'content' :
413 413
 						$new_content = $content;
414
-						$new_content['newsletter_content'] = !empty( $this->_req_data['batch_message']['content'] ) ? $this->_req_data['batch_message']['content'] : $content['newsletter_content'];
414
+						$new_content['newsletter_content'] = ! empty($this->_req_data['batch_message']['content']) ? $this->_req_data['batch_message']['content'] : $content['newsletter_content'];
415 415
 						break;
416 416
 					default :
417 417
 						continue;
@@ -422,20 +422,20 @@  discard block
 block discarded – undo
422 422
 			}
423 423
 
424 424
 			//great fields are updated!  now let's make sure we just have contact objects (EE_Attendee).
425
-			$id_type = !empty( $this->_req_data['batch_message']['id_type'] ) ? $this->_req_data['batch_message']['id_type'] : 'registration';
425
+			$id_type = ! empty($this->_req_data['batch_message']['id_type']) ? $this->_req_data['batch_message']['id_type'] : 'registration';
426 426
 
427 427
 			//id_type will affect how we assemble the ids.
428
-			$ids = !empty( $this->_req_data['batch_message']['ids'] ) ? json_decode( stripslashes($this->_req_data['batch_message']['ids']) ) : array();
428
+			$ids = ! empty($this->_req_data['batch_message']['ids']) ? json_decode(stripslashes($this->_req_data['batch_message']['ids'])) : array();
429 429
 
430
-			$contacts = $id_type == 'registration' ? EEM_Attendee::instance()->get_array_of_contacts_from_reg_ids( $ids ) : EEM_Attendee::instance()->get_all( array( array( 'ATT_ID' => array('in', $ids ) ) ) );
430
+			$contacts = $id_type == 'registration' ? EEM_Attendee::instance()->get_array_of_contacts_from_reg_ids($ids) : EEM_Attendee::instance()->get_all(array(array('ATT_ID' => array('in', $ids))));
431 431
 
432 432
 			//we do _action because ALL triggers are handled in EED_Messages.
433
-			do_action('AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send', $contacts, $MTPG->ID() );
433
+			do_action('AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send', $contacts, $MTPG->ID());
434 434
 		}
435 435
 		$query_args = array(
436
-			'action' => !empty( $this->_req_data['redirect_back_to'] ) ? $this->_req_data['redirect_back_to'] : 'default'
436
+			'action' => ! empty($this->_req_data['redirect_back_to']) ? $this->_req_data['redirect_back_to'] : 'default'
437 437
 			);
438
-		$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
438
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
439 439
 	}
440 440
 
441 441
 
@@ -457,8 +457,8 @@  discard block
 block discarded – undo
457 457
 	*		@return void
458 458
 	*/
459 459
 	protected function _registration_reports() {
460
-		$template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
461
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_reports_template_data, true );
460
+		$template_path = EE_ADMIN_TEMPLATE.'admin_reports.template.php';
461
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_reports_template_data, true);
462 462
 		// the final template wrapper
463 463
 		$this->display_admin_page_with_no_sidebar();
464 464
 
@@ -471,41 +471,41 @@  discard block
 block discarded – undo
471 471
 	 *
472 472
 	 * @return string
473 473
 	 */
474
-	private function _registrations_per_day_report( $period = '-1 month' ) {
474
+	private function _registrations_per_day_report($period = '-1 month') {
475 475
 		$report_ID = 'reg-admin-registrations-per-day-report-dv';
476 476
 
477 477
 		$REG = EEM_Registration::instance();
478 478
 
479
-		$results = $REG->get_registrations_per_day_report( $period );
479
+		$results = $REG->get_registrations_per_day_report($period);
480 480
 
481 481
 		$results = (array) $results;
482 482
 		$regs = array();
483 483
 		$subtitle = '';
484 484
 
485
-		if( $results ) {
486
-			$regs[] = array( __( 'Date (only days with registrations are shown)', 'event_espresso' ), __('Total Registrations', 'event_espresso' ) );
487
-			foreach ( $results as $result ) {
488
-				$regs[] = array( $result->regDate, (int) $result->total );
485
+		if ($results) {
486
+			$regs[] = array(__('Date (only days with registrations are shown)', 'event_espresso'), __('Total Registrations', 'event_espresso'));
487
+			foreach ($results as $result) {
488
+				$regs[] = array($result->regDate, (int) $result->total);
489 489
 			}
490 490
 
491 491
 			//setup the date range.
492
-			EE_Registry::instance()->load_helper( 'DTT_Helper' );
493
-			$beginning_date = new DateTime( "now " . $period, new DateTimeZone( EEH_DTT_Helper::get_timezone() ) );
494
-			$ending_date = new DateTime( "now", new DateTimeZone( EEH_DTT_Helper::get_timezone() ) );
495
-			$subtitle = sprintf( _x( 'For the period: %s to %s', 'Used to give date range', 'event_espresso' ), $beginning_date->format( 'Y-m-d' ), $ending_date->format( 'Y-m-d' ) );
492
+			EE_Registry::instance()->load_helper('DTT_Helper');
493
+			$beginning_date = new DateTime("now ".$period, new DateTimeZone(EEH_DTT_Helper::get_timezone()));
494
+			$ending_date = new DateTime("now", new DateTimeZone(EEH_DTT_Helper::get_timezone()));
495
+			$subtitle = sprintf(_x('For the period: %s to %s', 'Used to give date range', 'event_espresso'), $beginning_date->format('Y-m-d'), $ending_date->format('Y-m-d'));
496 496
 		}
497 497
 
498
-		$report_title = __( 'Total Registrations per Day', 'event_espresso' );
498
+		$report_title = __('Total Registrations per Day', 'event_espresso');
499 499
 
500 500
 		$report_params = array(
501 501
 			'title' 	=> $report_title,
502 502
 			'subtitle' => $subtitle,
503 503
 			'id' 		=> $report_ID,
504 504
 			'regs' 	=> $regs,
505
-			'noResults' => empty( $regs ),
506
-			'noRegsMsg' => sprintf( __('%sThere are currently no registration records in the last month for this report.%s', 'event_espresso'), '<h2>' . $report_title . '</h2><p>', '</p>' ),
505
+			'noResults' => empty($regs),
506
+			'noRegsMsg' => sprintf(__('%sThere are currently no registration records in the last month for this report.%s', 'event_espresso'), '<h2>'.$report_title.'</h2><p>', '</p>'),
507 507
 		);
508
-		wp_localize_script( 'ee-reg-reports-js', 'regPerDay', $report_params );
508
+		wp_localize_script('ee-reg-reports-js', 'regPerDay', $report_params);
509 509
 
510 510
 		return $report_ID;
511 511
 	}
@@ -517,41 +517,41 @@  discard block
 block discarded – undo
517 517
 	 *
518 518
 	 * @return string
519 519
 	 */
520
-	private function _registrations_per_event_report( $period = '-1 month' ) {
520
+	private function _registrations_per_event_report($period = '-1 month') {
521 521
 
522 522
 		$report_ID = 'reg-admin-registrations-per-event-report-dv';
523 523
 
524 524
 		$REG = EEM_Registration::instance();
525 525
 
526
-		$results = $REG->get_registrations_per_event_report( $period );
526
+		$results = $REG->get_registrations_per_event_report($period);
527 527
 		$results = (array) $results;
528 528
 		$regs = array();
529 529
 		$subtitle = '';
530 530
 
531
-		if ( $results ) {
532
-			$regs[] = array( __( 'Event', 'event_espresso' ), __('Total Registrations', 'event_espresso' ) );
533
-			foreach ( $results as $result ) {
534
-				$regs[] = array( wp_trim_words( $result->event_name, 4, '...' ), (int) $result->total );
531
+		if ($results) {
532
+			$regs[] = array(__('Event', 'event_espresso'), __('Total Registrations', 'event_espresso'));
533
+			foreach ($results as $result) {
534
+				$regs[] = array(wp_trim_words($result->event_name, 4, '...'), (int) $result->total);
535 535
 			}
536 536
 
537 537
 			//setup the date range.
538
-			EE_Registry::instance()->load_helper( 'DTT_Helper' );
539
-			$beginning_date = new DateTime( "now " . $period, new DateTimeZone( EEH_DTT_Helper::get_timezone() ) );
540
-			$ending_date = new DateTime( "now", new DateTimeZone( EEH_DTT_Helper::get_timezone() ) );
541
-			$subtitle = sprintf( _x( 'For the period: %s to %s', 'Used to give date range', 'event_espresso' ), $beginning_date->format( 'Y-m-d' ), $ending_date->format( 'Y-m-d' ) );
538
+			EE_Registry::instance()->load_helper('DTT_Helper');
539
+			$beginning_date = new DateTime("now ".$period, new DateTimeZone(EEH_DTT_Helper::get_timezone()));
540
+			$ending_date = new DateTime("now", new DateTimeZone(EEH_DTT_Helper::get_timezone()));
541
+			$subtitle = sprintf(_x('For the period: %s to %s', 'Used to give date range', 'event_espresso'), $beginning_date->format('Y-m-d'), $ending_date->format('Y-m-d'));
542 542
 		}
543 543
 
544
-		$report_title = __( 'Total Registrations per Event', 'event_espresso' );
544
+		$report_title = __('Total Registrations per Event', 'event_espresso');
545 545
 
546 546
 		$report_params = array(
547 547
 			'title' 	=> $report_title,
548 548
 			'subtitle' => $subtitle,
549 549
 			'id' 		=> $report_ID,
550 550
 			'regs' 	=> $regs,
551
-			'noResults' => empty( $regs ),
552
-			'noRegsMsg' => sprintf( __('%sThere are currently no registration records in the last month for this report.%s', 'event_espresso'), '<h2>' . $report_title . '</h2><p>', '</p>' ),
551
+			'noResults' => empty($regs),
552
+			'noRegsMsg' => sprintf(__('%sThere are currently no registration records in the last month for this report.%s', 'event_espresso'), '<h2>'.$report_title.'</h2><p>', '</p>'),
553 553
 		);
554
-		wp_localize_script( 'ee-reg-reports-js', 'regPerEvent', $report_params );
554
+		wp_localize_script('ee-reg-reports-js', 'regPerEvent', $report_params);
555 555
 
556 556
 		return $report_ID;
557 557
 	}
@@ -565,8 +565,8 @@  discard block
 block discarded – undo
565 565
 	 * @return void
566 566
 	 */
567 567
 	protected function _registration_checkin_list_table() {
568
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
569
-		$reg_id = isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : null;
568
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
569
+		$reg_id = isset($this->_req_data['_REGID']) ? $this->_req_data['_REGID'] : null;
570 570
 		$reg = EEM_Registration::instance()->get_one_by_ID($reg_id);
571 571
 		$this->_admin_page_title .= $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $reg->event_ID()), 'add-new-h2');
572 572
 
@@ -580,15 +580,15 @@  discard block
 block discarded – undo
580 580
 				'desc' => __('This indicates the attendee has been checked out', 'event_espresso')
581 581
 				)
582 582
 			);
583
-		$this->_template_args['after_list_table'] = $this->_display_legend( $legend_items );
583
+		$this->_template_args['after_list_table'] = $this->_display_legend($legend_items);
584 584
 
585 585
 
586
-		$dtt_id = isset(  $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL;
587
-		$go_back_url = !empty( $reg_id )  ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'event_registrations', 'event_id' => EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Event')->ID(), 'DTT_ID' => $dtt_id ), $this->_admin_base_url ) : '';
586
+		$dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL;
587
+		$go_back_url = ! empty($reg_id) ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'event_registrations', 'event_id' => EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Event')->ID(), 'DTT_ID' => $dtt_id), $this->_admin_base_url) : '';
588 588
 
589
-		$this->_template_args['before_list_table'] = !empty( $reg_id ) && !empty( $dtt_id ) ? '<h2>' . sprintf(__("%s's check in records for %s at the event, %s", 'event_espresso'), '<span id="checkin-attendee-name">' . EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Attendee')->full_name() . '</span>', '<span id="checkin-dtt"><a href="' . $go_back_url . '">' . EEM_Datetime::instance()->get_one_by_ID($dtt_id)->start_date_and_time() . ' - ' . EEM_Datetime::instance()->get_one_by_ID($dtt_id)->end_date_and_time() . '</a></span>', '<span id="checkin-event-name">' . EEM_Datetime::instance()->get_one_by_ID($dtt_id)->get_first_related('Event')->get('EVT_name') . '</span>' ) . '</h2>' : '';
590
-		$this->_template_args['list_table_hidden_fields'] = !empty( $reg_id ) ? '<input type="hidden" name="_REGID" value="' . $reg_id . '">' : '';
591
-		$this->_template_args['list_table_hidden_fields'] .= !empty( $dtt_id ) ? '<input type="hidden" name="DTT_ID" value="' . $dtt_id . '">' : '';
589
+		$this->_template_args['before_list_table'] = ! empty($reg_id) && ! empty($dtt_id) ? '<h2>'.sprintf(__("%s's check in records for %s at the event, %s", 'event_espresso'), '<span id="checkin-attendee-name">'.EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Attendee')->full_name().'</span>', '<span id="checkin-dtt"><a href="'.$go_back_url.'">'.EEM_Datetime::instance()->get_one_by_ID($dtt_id)->start_date_and_time().' - '.EEM_Datetime::instance()->get_one_by_ID($dtt_id)->end_date_and_time().'</a></span>', '<span id="checkin-event-name">'.EEM_Datetime::instance()->get_one_by_ID($dtt_id)->get_first_related('Event')->get('EVT_name').'</span>').'</h2>' : '';
590
+		$this->_template_args['list_table_hidden_fields'] = ! empty($reg_id) ? '<input type="hidden" name="_REGID" value="'.$reg_id.'">' : '';
591
+		$this->_template_args['list_table_hidden_fields'] .= ! empty($dtt_id) ? '<input type="hidden" name="DTT_ID" value="'.$dtt_id.'">' : '';
592 592
 
593 593
 		$this->display_admin_list_table_page_with_no_sidebar();
594 594
 	}
@@ -601,24 +601,24 @@  discard block
 block discarded – undo
601 601
 	 */
602 602
 	public function toggle_checkin_status() {
603 603
 		//first make sure we have the necessary data
604
-		if ( !isset( $this->_req_data['_regid'] ) ) {
605
-			EE_Error::add_error( __('There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
604
+		if ( ! isset($this->_req_data['_regid'])) {
605
+			EE_Error::add_error(__('There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
606 606
 			$this->_template_args['success'] = FALSE;
607 607
 			$this->_template_args['error'] = TRUE;
608 608
 			$this->_return_json();
609 609
 		};
610 610
 
611 611
 		//do a nonce check cause we're not coming in from an normal route here.
612
-		$nonce = isset( $this->_req_data['checkinnonce'] ) ? sanitize_text_field( $this->_req_data['checkinnonce'] ) : '';
612
+		$nonce = isset($this->_req_data['checkinnonce']) ? sanitize_text_field($this->_req_data['checkinnonce']) : '';
613 613
 		$nonce_ref = 'checkin_nonce';
614 614
 
615
-		$this->_verify_nonce( $nonce, $nonce_ref );
615
+		$this->_verify_nonce($nonce, $nonce_ref);
616 616
 
617 617
 		//beautiful! Made it this far so let's get the status.
618 618
 		$new_status = $this->_toggle_checkin_status();
619 619
 
620 620
 		//setup new class to return via ajax
621
-		$this->_template_args['admin_page_content'] = 'clickable trigger-checkin checkin-icons checkedin-status-' . $new_status;
621
+		$this->_template_args['admin_page_content'] = 'clickable trigger-checkin checkin-icons checkedin-status-'.$new_status;
622 622
 		$this->_template_args['success'] = TRUE;
623 623
 		$this->_return_json();
624 624
 	}
@@ -638,32 +638,32 @@  discard block
 block discarded – undo
638 638
 		//first let's get the query args out of the way for the redirect
639 639
 		$query_args = array(
640 640
 			'action' => 'event_registrations',
641
-			'event_id' => isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : NULL,
642
-			'DTT_ID' => isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL
641
+			'event_id' => isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : NULL,
642
+			'DTT_ID' => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL
643 643
 			);
644 644
 		$new_status = FALSE;
645 645
 
646 646
 		// bulk action check in toggle
647
-		if ( ! empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] )) {
647
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
648 648
 			// cycle thru checkboxes
649
-			while ( list( $REG_ID, $value ) = each($this->_req_data['checkbox'])) {
650
-				$DTT_ID = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL;
649
+			while (list($REG_ID, $value) = each($this->_req_data['checkbox'])) {
650
+				$DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL;
651 651
 				$new_status = $this->_toggle_checkin($REG_ID, $DTT_ID);
652 652
 			}
653 653
 
654
-		} elseif ( isset( $this->_req_data['_regid'] ) ) {
654
+		} elseif (isset($this->_req_data['_regid'])) {
655 655
 			//coming from ajax request
656
-			$DTT_ID = isset( $this->_req_data['dttid'] ) ? $this->_req_data['dttid'] : NULL;
656
+			$DTT_ID = isset($this->_req_data['dttid']) ? $this->_req_data['dttid'] : NULL;
657 657
 			$query_args['DTT_ID'] = $DTT_ID;
658 658
 			$new_status = $this->_toggle_checkin($this->_req_data['_regid'], $DTT_ID);
659 659
 		} else {
660
-			EE_Error::add_error(__('Missing some required data to toggle the Check-in', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__  );
660
+			EE_Error::add_error(__('Missing some required data to toggle the Check-in', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
661 661
 		}
662 662
 
663
-		if ( defined('DOING_AJAX' ) )
663
+		if (defined('DOING_AJAX'))
664 664
 			return $new_status;
665 665
 
666
-		$this->_redirect_after_action( FALSE,'', '', $query_args, TRUE );
666
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
667 667
 
668 668
 	}
669 669
 
@@ -679,11 +679,11 @@  discard block
 block discarded – undo
679 679
 	 */
680 680
 	private function _toggle_checkin($REG_ID, $DTT_ID) {
681 681
 		$REG = EEM_Registration::instance()->get_one_by_ID($REG_ID);
682
-		$new_status = $REG->toggle_checkin_status( $DTT_ID );
683
-		if ( $new_status !== FALSE ) {
684
-			EE_Error::add_success($REG->get_checkin_msg($DTT_ID) );
682
+		$new_status = $REG->toggle_checkin_status($DTT_ID);
683
+		if ($new_status !== FALSE) {
684
+			EE_Error::add_success($REG->get_checkin_msg($DTT_ID));
685 685
 		} else {
686
-			EE_Error::add_error($REG->get_checkin_msg($DTT_ID, TRUE), __FILE__, __FUNCTION__, __LINE__ );
686
+			EE_Error::add_error($REG->get_checkin_msg($DTT_ID, TRUE), __FILE__, __FUNCTION__, __LINE__);
687 687
 			$new_status = FALSE;
688 688
 		}
689 689
 		return $new_status;
@@ -699,28 +699,28 @@  discard block
 block discarded – undo
699 699
 	protected function _delete_checkin_rows() {
700 700
 		$query_args = array(
701 701
 			'action' => 'registration_checkins',
702
-			'DTT_ID' => isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : 0,
703
-			'_REGID' => isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : 0
702
+			'DTT_ID' => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
703
+			'_REGID' => isset($this->_req_data['_REGID']) ? $this->_req_data['_REGID'] : 0
704 704
 			);
705
-		if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) {
706
-			while ( list( $CHK_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
705
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
706
+			while (list($CHK_ID, $value) = each($this->_req_data['checkbox'])) {
707 707
 				$errors = 0;
708
-				if ( ! EEM_Checkin::instance()->delete_by_ID($CHK_ID ) ) {
708
+				if ( ! EEM_Checkin::instance()->delete_by_ID($CHK_ID)) {
709 709
 					$errors++;
710 710
 				}
711 711
 			}
712 712
 		} else {
713
-			EE_Error::add_error(__('So, something went wrong with the bulk delete because there was no data received for instructions on WHAT to delete!', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
714
-			$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
713
+			EE_Error::add_error(__('So, something went wrong with the bulk delete because there was no data received for instructions on WHAT to delete!', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
714
+			$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
715 715
 		}
716 716
 
717
-		if ( $errors > 0 ) {
718
-			EE_Error::add_error( sprintf( __('There were %d records that did not delete successfully', 'event_espresso'), $errors ), __FILE__, __FUNCTION__, __LINE__ );
717
+		if ($errors > 0) {
718
+			EE_Error::add_error(sprintf(__('There were %d records that did not delete successfully', 'event_espresso'), $errors), __FILE__, __FUNCTION__, __LINE__);
719 719
 		} else {
720
-			EE_Error::add_success( __('Records were successfully deleted', 'event_espresso') );
720
+			EE_Error::add_success(__('Records were successfully deleted', 'event_espresso'));
721 721
 		}
722 722
 
723
-		$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
723
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
724 724
 	}
725 725
 
726 726
 
@@ -732,20 +732,20 @@  discard block
 block discarded – undo
732 732
 	protected function _delete_checkin_row() {
733 733
 		$query_args = array(
734 734
 			'action' => 'registration_checkins',
735
-			'DTT_ID' => isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : 0,
736
-			'_REGID' => isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : 0
735
+			'DTT_ID' => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
736
+			'_REGID' => isset($this->_req_data['_REGID']) ? $this->_req_data['_REGID'] : 0
737 737
 			);
738 738
 
739
-		if ( !empty( $this->_req_data['CHK_ID'] ) ) {
740
-			if ( ! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'] ) ) {
741
-				EE_Error::add_error(__('Something went wrong and this check-in record was not deleted', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
739
+		if ( ! empty($this->_req_data['CHK_ID'])) {
740
+			if ( ! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'])) {
741
+				EE_Error::add_error(__('Something went wrong and this check-in record was not deleted', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
742 742
 			} else {
743
-				EE_Error::add_success( __('Check-In record successfully deleted', 'event_espresso') );
743
+				EE_Error::add_success(__('Check-In record successfully deleted', 'event_espresso'));
744 744
 			}
745 745
 		} else {
746
-			EE_Error::add_error(__('In order to delete a Check-in record, there must be a Check-In ID available. There is not. It is not your fault, there is just a gremlin living in the code', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
746
+			EE_Error::add_error(__('In order to delete a Check-in record, there must be a Check-In ID available. There is not. It is not your fault, there is just a gremlin living in the code', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
747 747
 		}
748
-		$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
748
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
749 749
 	}
750 750
 
751 751
 
@@ -758,8 +758,8 @@  discard block
 block discarded – undo
758 758
 	*		@return void
759 759
 	*/
760 760
 	protected function _event_registrations_list_table() {
761
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
762
-		$this->_admin_page_title .= isset( $this->_req_data['event_id'] ) ? $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $this->_req_data['event_id']), 'add-new-h2') : '';
761
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
762
+		$this->_admin_page_title .= isset($this->_req_data['event_id']) ? $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $this->_req_data['event_id']), 'add-new-h2') : '';
763 763
 
764 764
 		$legend_items = array(
765 765
 			'star-icon' => array(
@@ -783,31 +783,31 @@  discard block
 block discarded – undo
783 783
 				'desc' => __('View All Check-in Records for this Registrant', 'event_espresso')
784 784
 				),
785 785
 			'approved_status' => array(
786
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved,
787
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' )
786
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved,
787
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')
788 788
 				),
789 789
             'cancelled_status' => array(
790
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled,
791
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' )
790
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled,
791
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence')
792 792
 				),
793 793
             'declined_status' => array(
794
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined,
795
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' )
794
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined,
795
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence')
796 796
 				),
797 797
 			'not_approved' => array(
798
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved,
799
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' )
798
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved,
799
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence')
800 800
 				),
801 801
 			'pending_status' => array(
802
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment,
803
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' )
802
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment,
803
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence')
804 804
 				)/**/
805 805
 			);
806
-		$this->_template_args['after_list_table'] = $this->_display_legend( $legend_items );
806
+		$this->_template_args['after_list_table'] = $this->_display_legend($legend_items);
807 807
 
808
-		$event_id = isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : null;
809
-		$this->_template_args['before_list_table'] = !empty( $event_id ) ? '<h2>' . sprintf(__('Viewing Registrations for Event: %s', 'event_espresso'), EEM_Event::instance()->get_one_by_ID($event_id)->get('EVT_name') ) . '</h2>' : '';
810
-		$this->_template_args['list_table_hidden_fields'] = !empty( $event_id ) ? '<input type="hidden" name="event_id" value="' . $event_id . '">' : '';
808
+		$event_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null;
809
+		$this->_template_args['before_list_table'] = ! empty($event_id) ? '<h2>'.sprintf(__('Viewing Registrations for Event: %s', 'event_espresso'), EEM_Event::instance()->get_one_by_ID($event_id)->get('EVT_name')).'</h2>' : '';
810
+		$this->_template_args['list_table_hidden_fields'] = ! empty($event_id) ? '<input type="hidden" name="event_id" value="'.$event_id.'">' : '';
811 811
 
812 812
 		$this->display_admin_list_table_page_with_no_sidebar();
813 813
 	}
@@ -821,15 +821,15 @@  discard block
 block discarded – undo
821 821
 	*		@access public
822 822
 	*		@return array
823 823
 	*/
824
-	public function get_event_attendees( $per_page = 10, $count = FALSE, $trash = FALSE, $orderby = '' ) {
824
+	public function get_event_attendees($per_page = 10, $count = FALSE, $trash = FALSE, $orderby = '') {
825 825
 
826
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
827
-		require_once(EE_MODELS . 'EEM_Attendee.model.php');
826
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
827
+		require_once(EE_MODELS.'EEM_Attendee.model.php');
828 828
 		//$ATT_MDL = EEM_Attendee::instance();
829 829
 
830
-		$EVT_ID = isset($this->_req_data['event_id']) ? absint( $this->_req_data['event_id'] ) : FALSE;
831
-		$CAT_ID = isset($this->_req_data['category_id']) ? absint( $this->_req_data['category_id'] ) : FALSE;
832
-		$DTT_ID = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL;
830
+		$EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE;
831
+		$CAT_ID = isset($this->_req_data['category_id']) ? absint($this->_req_data['category_id']) : FALSE;
832
+		$DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL;
833 833
 
834 834
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : $orderby;
835 835
 
@@ -842,94 +842,94 @@  discard block
 block discarded – undo
842 842
 //				$orderby = 'reg.REG_final_price';
843 843
 		}
844 844
 
845
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
845
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
846 846
 
847
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
848
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
847
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
848
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
849 849
 
850 850
 
851
-		$offset = ($current_page-1)*$per_page;
852
-		$limit = $count ? NULL : array( $offset, $per_page );
853
-		$query_params = array(array('Event.status'=>array('IN',  array_keys(EEM_Event::instance()->get_status_array()))));
854
-		if ($EVT_ID){
855
-			$query_params[0]['EVT_ID']=$EVT_ID;
851
+		$offset = ($current_page - 1) * $per_page;
852
+		$limit = $count ? NULL : array($offset, $per_page);
853
+		$query_params = array(array('Event.status'=>array('IN', array_keys(EEM_Event::instance()->get_status_array()))));
854
+		if ($EVT_ID) {
855
+			$query_params[0]['EVT_ID'] = $EVT_ID;
856 856
 		}
857
-		if($CAT_ID){
857
+		if ($CAT_ID) {
858 858
 			throw new EE_Error("You specified a Category Id for this query. Thats odd because we are now using terms and taxonomies. So did you mean the term taxonomy id o rthe term id?");
859 859
 		}
860 860
 
861 861
 		//if DTT is included we do multiple datetimes.
862
-		if ( $DTT_ID ) {
862
+		if ($DTT_ID) {
863 863
 			$query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID;
864 864
 		}
865 865
 
866 866
 		//make sure we only have default where on the current regs
867 867
 		$query_params['default_where_conditions'] = 'this_model_only';
868 868
 
869
-		$status_ids_array = apply_filters( 'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array', array( EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved ) );
869
+		$status_ids_array = apply_filters('FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array', array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved));
870 870
 
871
-		$query_params[0]['STS_ID']= array('IN', $status_ids_array );
871
+		$query_params[0]['STS_ID'] = array('IN', $status_ids_array);
872 872
 
873
-		if($trash){
874
-			$query_params[0]['Attendee.status']=  EEM_CPT_Base::post_status_trashed;
873
+		if ($trash) {
874
+			$query_params[0]['Attendee.status'] = EEM_CPT_Base::post_status_trashed;
875 875
 		}
876 876
 
877
-		if ( isset( $this->_req_data['s'] ) ) {
878
-			$sstr = '%' . $this->_req_data['s'] . '%';
877
+		if (isset($this->_req_data['s'])) {
878
+			$sstr = '%'.$this->_req_data['s'].'%';
879 879
 			$query_params[0]['OR'] = array(
880
-				'Event.EVT_name' => array( 'LIKE', $sstr),
881
-				'Event.EVT_desc' => array( 'LIKE', $sstr ),
882
-				'Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
883
-				'Attendee.ATT_fname' => array( 'LIKE', $sstr ),
884
-				'Attendee.ATT_lname' => array( 'LIKE', $sstr ),
885
-				'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ),
886
-				'Attendee.ATT_email' => array('LIKE', $sstr ),
887
-				'Attendee.ATT_address' => array( 'LIKE', $sstr ),
888
-				'Attendee.ATT_address2' => array( 'LIKE', $sstr ),
889
-				'Attendee.ATT_city' => array( 'LIKE', $sstr ),
890
-				'REG_final_price' => array( 'LIKE', $sstr ),
891
-				'REG_code' => array( 'LIKE', $sstr ),
892
-				'REG_count' => array( 'LIKE' , $sstr ),
893
-				'REG_group_size' => array( 'LIKE' , $sstr ),
894
-				'Ticket.TKT_name' => array( 'LIKE', $sstr ),
895
-				'Ticket.TKT_description' => array( 'LIKE', $sstr )
880
+				'Event.EVT_name' => array('LIKE', $sstr),
881
+				'Event.EVT_desc' => array('LIKE', $sstr),
882
+				'Event.EVT_short_desc' => array('LIKE', $sstr),
883
+				'Attendee.ATT_fname' => array('LIKE', $sstr),
884
+				'Attendee.ATT_lname' => array('LIKE', $sstr),
885
+				'Attendee.ATT_short_bio' => array('LIKE', $sstr),
886
+				'Attendee.ATT_email' => array('LIKE', $sstr),
887
+				'Attendee.ATT_address' => array('LIKE', $sstr),
888
+				'Attendee.ATT_address2' => array('LIKE', $sstr),
889
+				'Attendee.ATT_city' => array('LIKE', $sstr),
890
+				'REG_final_price' => array('LIKE', $sstr),
891
+				'REG_code' => array('LIKE', $sstr),
892
+				'REG_count' => array('LIKE', $sstr),
893
+				'REG_group_size' => array('LIKE', $sstr),
894
+				'Ticket.TKT_name' => array('LIKE', $sstr),
895
+				'Ticket.TKT_description' => array('LIKE', $sstr)
896 896
 				);
897 897
 		}
898 898
 
899 899
 		$query_params['order_by'][$orderby] = $sort;
900 900
 		$query_params['limit'] = $limit;
901
-		$query_params['force_join'] = array('Attendee');//force join to attendee model so that it gets cached, because we're going to need the attendee for each registration
902
-		if($count){
903
-			$registrations = EEM_Registration::instance()->count(array($query_params[0], 'default_where_conditions' => 'this_model_only' ));
904
-		}else{
901
+		$query_params['force_join'] = array('Attendee'); //force join to attendee model so that it gets cached, because we're going to need the attendee for each registration
902
+		if ($count) {
903
+			$registrations = EEM_Registration::instance()->count(array($query_params[0], 'default_where_conditions' => 'this_model_only'));
904
+		} else {
905 905
 			$registrations = EEM_Registration::instance()->get_all($query_params);
906 906
 
907 907
 
908 908
 	//		$registrations = EEM_Registration::instance();
909 909
 	//		$all_attendees = EEM_Attendee::instance()->get_event_attendees( $EVT_ID, $CAT_ID, $reg_status, $trash, $orderby, $sort, $limit, $output );
910
-			if ( isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration ) {
910
+			if (isset($registrations[0]) && $registrations[0] instanceof EE_Registration) {
911 911
 				//EEH_Debug_Tools::printr( $all_attendees[0], '$all_attendees[0]  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
912 912
 				// name
913 913
 				$first_registration = $registrations[0];
914 914
 				$event_obj = $first_registration->event_obj();
915
-				if($event_obj){
915
+				if ($event_obj) {
916 916
 					$event_name = $first_registration->event_obj()->name();
917
-					$event_date = 'TODO: we need to get date from earliest price date or should this be the actual event date?';//$first_registration->date_obj()->reg_start_date_and_time('l F j, Y,', ' g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
917
+					$event_date = 'TODO: we need to get date from earliest price date or should this be the actual event date?'; //$first_registration->date_obj()->reg_start_date_and_time('l F j, Y,', ' g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
918 918
 					// edit event link
919
-					if ( $event_name != '' ) {
920
-						$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL );
921
-						$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
922
-						$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
919
+					if ($event_name != '') {
920
+						$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL);
921
+						$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>';
922
+						$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
923 923
 					}
924 924
 
925
-					$back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL );
926
-					$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="' . esc_attr__( 'click to return to viewing all registrations ', 'event_espresso' ) . '">&laquo; ' . __( 'Back to All Registrations', 'event_espresso' ) . '</a>';
925
+					$back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL);
926
+					$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="'.esc_attr__('click to return to viewing all registrations ', 'event_espresso').'">&laquo; '.__('Back to All Registrations', 'event_espresso').'</a>';
927 927
 
928 928
 					$this->_template_args['before_admin_page_content'] = '
929 929
 				<div id="admin-page-header">
930
-					<h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1>
931
-					<h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3>
932
-					<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span>
930
+					<h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1>
931
+					<h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3>
932
+					<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span>
933 933
 				</div>
934 934
 				';
935 935
 				}
Please login to merge, or discard this patch.
admin/extend/registrations/templates/newsletter-send-form.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
                 <input type="hidden" id="get_newsletter_form_content_nonce" name="get_newsletter_form_content_nonce" value="<?php echo $ajax_nonce; ?>">
33 33
                 <input type="hidden" name="batch_message[id_type]" value="<?php echo $id_type; ?>">
34 34
                 <input id="newsletter-batch-ids" type="hidden" name="batch_message[ids]" value="">
35
-                <h3 class="newsletter-send-form-title"><?php printf( __('Sending batch message to %s people...', 'event_espresso'), '[NUMPEOPLE]' ); ?></h3>
35
+                <h3 class="newsletter-send-form-title"><?php printf(__('Sending batch message to %s people...', 'event_espresso'), '[NUMPEOPLE]'); ?></h3>
36 36
                 <label for="batch-message-template-selector"><?php _e('Select Template:', 'event_espresso'); ?></label>
37 37
                 <?php echo $template_selector; ?>
38 38
                 <div class="batch-message-edit-fields" style="display:none;">
Please login to merge, or discard this patch.
caffeinated/admin/extend/support/Extend_Support_Admin_Page.core.php 2 patches
Spacing   +11 added lines, -11 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
 /**
@@ -29,16 +29,16 @@  discard block
 block discarded – undo
29 29
  */
30 30
 class Extend_Support_Admin_Page extends Support_Admin_Page {
31 31
 
32
-	public function __construct( $routing = TRUE ) {
33
-		parent::__construct( $routing );
34
-		define( 'EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'support/templates/' );
32
+	public function __construct($routing = TRUE) {
33
+		parent::__construct($routing);
34
+		define('EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'support/templates/');
35 35
 	}
36 36
 
37 37
 
38 38
 
39 39
 
40 40
 	protected function _extend_page_config() {
41
-		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'support';
41
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'support';
42 42
 		//new routes and new configs (or overrides )
43 43
 		$new_page_routes = array(
44 44
 			'faq' => array(
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 				'capability' => 'ee_read_ee'
47 47
 				)
48 48
 			);
49
-		$this->_page_routes = array_merge( $this->_page_routes, $new_page_routes );
49
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
50 50
 
51 51
 		$new_page_config = array(
52 52
 			'faq' => array(
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 				'require_nonce' => FALSE
58 58
 				)
59 59
 			);
60
-		$this->_page_config = array_merge( $this->_page_config, $new_page_config );
60
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
61 61
 
62 62
 		$this->_page_config['default']['metaboxes'][] = '_installation_boxes';
63 63
 	}
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 
67 67
 
68 68
 	protected function _faq() {
69
-		$template_path = EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH . 'support_admin_details_faq.template.php';
70
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, '', TRUE);
69
+		$template_path = EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH.'support_admin_details_faq.template.php';
70
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, '', TRUE);
71 71
 		$this->display_admin_page_with_sidebar();
72 72
 
73 73
 	}
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 
76 76
 
77 77
 	protected function _installation_boxes() {
78
-		$callback_args = array('template_path' => EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH . 'support_admin_details_additional_information.template.php');
79
-		add_meta_box( 'espresso_additional_information_support', __('Additional Information', 'event_espresso'), create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE);' ), $this->_current_screen_id, 'normal', 'high', $callback_args);
78
+		$callback_args = array('template_path' => EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH.'support_admin_details_additional_information.template.php');
79
+		add_meta_box('espresso_additional_information_support', __('Additional Information', 'event_espresso'), create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE);'), $this->_current_screen_id, 'normal', 'high', $callback_args);
80 80
 	}
81 81
 
82 82
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
admin/extend/support/templates/support_admin_details_faq.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 		</dt>
39 39
 		<dd>
40 40
             <p>
41
-            <?php printf( __('You can add the events or venues page as items to the navigation menu by going to Appearance --> Menus and check the boxes found under the %sEvent Espresso Pages%s section. Then click the Add to Menu button and finally click on the Save Menu button.', 'event_espresso'), '<strong>', '</strong>' ); ?>
41
+            <?php printf(__('You can add the events or venues page as items to the navigation menu by going to Appearance --> Menus and check the boxes found under the %sEvent Espresso Pages%s section. Then click the Add to Menu button and finally click on the Save Menu button.', 'event_espresso'), '<strong>', '</strong>'); ?>
42 42
             <br />
43 43
 			<?php _e('Quick Link:', 'event_espresso'); ?>
44 44
 			<a href="<?php echo site_url('/wp-admin/nav-menus.php'); ?>"><?php _e('Menu Manager', 'event_espresso'); ?></a>
Please login to merge, or discard this patch.
caffeinated/admin/new/pricing/Price_Types_List_Table.class.php 2 patches
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
  */
29 29
 class Price_Types_List_Table extends EE_Admin_List_Table {
30 30
 
31
-	public function __construct( $admin_page ) {
31
+	public function __construct($admin_page) {
32 32
 		parent::__construct($admin_page);
33
-		require_once(EE_MODELS . 'EEM_Price_Type.model.php');
33
+		require_once(EE_MODELS.'EEM_Price_Type.model.php');
34 34
 		$this->_PRT = EEM_Price_Type::instance();
35 35
 	}
36 36
 
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
 
40 40
 	protected function _setup_data() {
41 41
 		$trashed = $this->_admin_page->get_view() == 'trashed' ? TRUE : FALSE;
42
-		$this->_data = $this->_admin_page->get_price_types_overview_data( $this->_per_page, FALSE, $trashed );
43
-		$this->_all_data_count = $this->_admin_page->get_price_types_overview_data( $this->_per_page, TRUE, FALSE );
44
-		$this->_trashed_count = $this->_admin_page->get_price_types_overview_data( $this->_per_page, TRUE, TRUE );
42
+		$this->_data = $this->_admin_page->get_price_types_overview_data($this->_per_page, FALSE, $trashed);
43
+		$this->_all_data_count = $this->_admin_page->get_price_types_overview_data($this->_per_page, TRUE, FALSE);
44
+		$this->_trashed_count = $this->_admin_page->get_price_types_overview_data($this->_per_page, TRUE, TRUE);
45 45
 	}
46 46
 
47 47
 
@@ -57,14 +57,14 @@  discard block
 block discarded – undo
57 57
 		$this->_columns = array(
58 58
 				'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
59 59
 				'name' => __('Name', 'event_espresso'),
60
-				'base_type' => '<div class="jst-cntr">' . __('Base Type', 'event_espresso') . '</div>',
61
-				'percent' => '<div class="jst-cntr">' . __('Applied', 'event_espresso') . '<br/>' . __('as ', 'event_espresso') . '<span class="big-text">' . __('%', 'event_espresso') . '</span>' . __(' or ', 'event_espresso') . '<span class="big-text">' . __('$', 'event_espresso') . '</span></div>',
62
-				'order' => '<div class="jst-cntr">' . __('Order of', 'event_espresso') . '<br/>' . __('Application', 'event_espresso') . '</div>'
60
+				'base_type' => '<div class="jst-cntr">'.__('Base Type', 'event_espresso').'</div>',
61
+				'percent' => '<div class="jst-cntr">'.__('Applied', 'event_espresso').'<br/>'.__('as ', 'event_espresso').'<span class="big-text">'.__('%', 'event_espresso').'</span>'.__(' or ', 'event_espresso').'<span class="big-text">'.__('$', 'event_espresso').'</span></div>',
62
+				'order' => '<div class="jst-cntr">'.__('Order of', 'event_espresso').'<br/>'.__('Application', 'event_espresso').'</div>'
63 63
 			);
64 64
 
65 65
 		$this->_sortable_columns = array(
66 66
 			// TRUE means its already sorted
67
-			'name' => array( 'name' => FALSE )
67
+			'name' => array('name' => FALSE)
68 68
 		);
69 69
 
70 70
 		$this->_hidden_columns = array();
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 	protected function _add_view_counts() {
84 84
 		$this->_views['all']['count'] = $this->_all_data_count;
85
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price_types', 'pricing_trash_price_type' ) ) {
85
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price_types', 'pricing_trash_price_type')) {
86 86
 			$this->_views['trashed']['count'] = $this->_trashed_count;
87 87
 		}
88 88
 	}
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 
93 93
 
94 94
 	function column_cb($item) {
95
-		if ( $item->base_type() !== 1 )
96
-			return sprintf( '<input type="checkbox" name="checkbox[%1$s]" />', /* $1%s */ $item->ID() );
95
+		if ($item->base_type() !== 1)
96
+			return sprintf('<input type="checkbox" name="checkbox[%1$s]" />', /* $1%s */ $item->ID());
97 97
 		return '';
98 98
 	}
99 99
 
@@ -106,30 +106,30 @@  discard block
 block discarded – undo
106 106
 		//Build row actions
107 107
 		$actions = array();
108 108
 		// edit price link
109
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_default_price_type', 'pricing_edit_price_type', $item->ID() ) ) {
110
-			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_price_type', 'id'=>$item->ID() ), PRICING_ADMIN_URL );
111
-			$actions['edit'] = '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Price Type', 'event_espresso' ) . '">' . __( 'Edit', 'event_espresso' ) . '</a>';
109
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_default_price_type', 'pricing_edit_price_type', $item->ID())) {
110
+			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_price_type', 'id'=>$item->ID()), PRICING_ADMIN_URL);
111
+			$actions['edit'] = '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Price Type', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>';
112 112
 		}
113 113
 
114
-		$name_link = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_default_price_type', 'pricing_edit_price_type', $item->ID() ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Price Type', 'event_espresso' ) . '">' . stripslashes( $item->name() ) . '</a>' : $item->name();
114
+		$name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_default_price_type', 'pricing_edit_price_type', $item->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Price Type', 'event_espresso').'">'.stripslashes($item->name()).'</a>' : $item->name();
115 115
 
116
-		if ( $item->base_type() !== 1 ) {
117
-			if ( $this->_view == 'all' ) {
116
+		if ($item->base_type() !== 1) {
117
+			if ($this->_view == 'all') {
118 118
 				// trash price link
119
-				if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price_type', 'pricing_trash_price_type', $item->ID() ) ) {
120
-					$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_price_type', 'id'=>$item->ID(), 'noheader' => TRUE ), PRICING_ADMIN_URL );
121
-					$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Move Price Type to Trash', 'event_espresso' ) . '">' . __( 'Move to Trash', 'event_espresso' ) . '</a>';
119
+				if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price_type', 'pricing_trash_price_type', $item->ID())) {
120
+					$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_price_type', 'id'=>$item->ID(), 'noheader' => TRUE), PRICING_ADMIN_URL);
121
+					$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Price Type to Trash', 'event_espresso').'">'.__('Move to Trash', 'event_espresso').'</a>';
122 122
 				}
123 123
 			} else {
124 124
 				// restore price link
125
-				if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price_type', 'pricing_restore_price_type', $item->ID() ) ) {
126
-					$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_price_type', 'id'=>$item->ID(), 'noheader' => TRUE ), PRICING_ADMIN_URL );
127
-					$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Price Type', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>';
125
+				if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price_type', 'pricing_restore_price_type', $item->ID())) {
126
+					$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_price_type', 'id'=>$item->ID(), 'noheader' => TRUE), PRICING_ADMIN_URL);
127
+					$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Price Type', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
128 128
 				}
129 129
 				// delete price link
130
-				if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price_type', 'pricing_delete_price_type', $item->ID() ) ) {
131
-					$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_price_type', 'id'=>$item->ID(), 'noheader' => TRUE ), PRICING_ADMIN_URL );
132
-					$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Price Type Permanently', 'event_espresso' ) . '">' . __( 'Delete Permanently', 'event_espresso' ) . '</a>';
130
+				if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price_type', 'pricing_delete_price_type', $item->ID())) {
131
+					$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_price_type', 'id'=>$item->ID(), 'noheader' => TRUE), PRICING_ADMIN_URL);
132
+					$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Price Type Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
133 133
 				}
134 134
 			}
135 135
 		}
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
 
148 148
 
149 149
 	function column_base_type($item) {
150
-		return '<div class="jst-cntr">' . $item->base_type_name()  . '</div>';
150
+		return '<div class="jst-cntr">'.$item->base_type_name().'</div>';
151 151
 	}
152 152
 
153 153
 
154 154
 
155 155
 
156 156
 	function column_percent($item) {
157
-		return '<div class="jst-cntr">' . ( $item->is_percent() ? '%' : EE_Registry::instance()->CFG->currency->sign ) . '</div>';
157
+		return '<div class="jst-cntr">'.($item->is_percent() ? '%' : EE_Registry::instance()->CFG->currency->sign).'</div>';
158 158
 	}
159 159
 
160 160
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
 
164 164
 	function column_order($item) {
165
-		return '<div class="jst-cntr">' . $item->order() . '</div>';
165
+		return '<div class="jst-cntr">'.$item->order().'</div>';
166 166
 	}
167 167
 
168 168
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 
3 5
 /**
4 6
  * Event Espresso
@@ -92,8 +94,9 @@  discard block
 block discarded – undo
92 94
 
93 95
 
94 96
 	function column_cb($item) {
95
-		if ( $item->base_type() !== 1 )
96
-			return sprintf( '<input type="checkbox" name="checkbox[%1$s]" />', /* $1%s */ $item->ID() );
97
+		if ( $item->base_type() !== 1 ) {
98
+					return sprintf( '<input type="checkbox" name="checkbox[%1$s]" />', /* $1%s */ $item->ID() );
99
+		}
97 100
 		return '';
98 101
 	}
99 102
 
Please login to merge, or discard this patch.
caffeinated/admin/new/pricing/Prices_List_Table.class.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,10 +79,10 @@
 block discarded – undo
79 79
 						'amount' => array( 'amount' => FALSE )
80 80
 			);
81 81
 
82
-        $this->_hidden_columns = array(
82
+		$this->_hidden_columns = array(
83 83
 			);
84 84
 
85
-        $this->_ajax_sorting_callback = 'update_prices_order';
85
+		$this->_ajax_sorting_callback = 'update_prices_order';
86 86
 
87 87
 	}
88 88
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 
3 5
 /**
4 6
  * Event Espresso
@@ -118,8 +120,9 @@  discard block
 block discarded – undo
118 120
 
119 121
 		$new_row = $row_class;
120 122
 
121
-		if ( $item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4 )
122
-			$new_row .= ' rowsortable';
123
+		if ( $item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4 ) {
124
+					$new_row .= ' rowsortable';
125
+		}
123 126
 
124 127
 		return ' class="' . $new_row . '"';
125 128
 	}
@@ -131,8 +134,9 @@  discard block
 block discarded – undo
131 134
 
132 135
 
133 136
 	function column_cb($item) {
134
-		if ( $item->type_obj()->base_type() !== 1 )
135
-			return sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() );
137
+		if ( $item->type_obj()->base_type() !== 1 ) {
138
+					return sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() );
139
+		}
136 140
 		return '';
137 141
 	}
138 142
 
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	protected $_price_types = array();
38 38
 
39
-	public function __construct( $admin_page ) {
39
+	public function __construct($admin_page) {
40 40
 		parent::__construct($admin_page);
41
-		require_once(EE_MODELS . 'EEM_Price_Type.model.php');
41
+		require_once(EE_MODELS.'EEM_Price_Type.model.php');
42 42
 		$this->_PRT = EEM_Price_Type::instance();
43 43
 		$this->_price_types = $this->_PRT->get_all_deleted_and_undeleted();
44 44
 	}
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 
49 49
 	protected function _setup_data() {
50 50
 		$trashed = $this->_admin_page->get_view() == 'trashed' ? true : false;
51
-		$this->_data = $this->_admin_page->get_prices_overview_data( $this->_per_page, false, $trashed );
52
-		$this->_all_data_count = $this->_admin_page->get_prices_overview_data( $this->_per_page, true, false );
53
-		$this->_trashed_count = $this->_admin_page->get_prices_overview_data( $this->_per_page, true, true );
51
+		$this->_data = $this->_admin_page->get_prices_overview_data($this->_per_page, false, $trashed);
52
+		$this->_all_data_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, false);
53
+		$this->_trashed_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, true);
54 54
 	}
55 55
 
56 56
 
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 
75 75
 			$this->_sortable_columns = array(
76 76
 						// true means its already sorted
77
-						'name' => array( 'name' => false ),
78
-						'type' => array( 'type' => false ),
79
-						'amount' => array( 'amount' => false )
77
+						'name' => array('name' => false),
78
+						'type' => array('type' => false),
79
+						'amount' => array('amount' => false)
80 80
 			);
81 81
 
82 82
         $this->_hidden_columns = array(
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
 	protected function _add_view_counts() {
100 100
 		$this->_views['all']['count'] = $this->_all_data_count;
101
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_prices', 'pricing_trash_price') ) {
101
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_prices', 'pricing_trash_price')) {
102 102
 			$this->_views['trashed']['count'] = $this->_trashed_count;
103 103
 		}
104 104
 	}
@@ -112,16 +112,16 @@  discard block
 block discarded – undo
112 112
 	 * @param  object $item the current item
113 113
 	 * @return string
114 114
 	 */
115
-	protected function _get_row_class( $item ) {
115
+	protected function _get_row_class($item) {
116 116
 		static $row_class = '';
117
-		$row_class = ( $row_class == '' ? 'alternate' : '' );
117
+		$row_class = ($row_class == '' ? 'alternate' : '');
118 118
 
119 119
 		$new_row = $row_class;
120 120
 
121
-		if ( $item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4 )
121
+		if ($item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4)
122 122
 			$new_row .= ' rowsortable';
123 123
 
124
-		return ' class="' . $new_row . '"';
124
+		return ' class="'.$new_row.'"';
125 125
 	}
126 126
 
127 127
 
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
 
132 132
 
133 133
 	function column_cb($item) {
134
-		if ( $item->type_obj()->base_type() !== 1 )
135
-			return sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() );
134
+		if ($item->type_obj()->base_type() !== 1)
135
+			return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID());
136 136
 		return '';
137 137
 	}
138 138
 
@@ -145,31 +145,31 @@  discard block
 block discarded – undo
145 145
 		//Build row actions
146 146
 		$actions = array();
147 147
 		// edit price link
148
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_default_price', 'pricing_edit_price', $item->ID() ) ) {
149
-			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_price', 'id'=>$item->ID() ), PRICING_ADMIN_URL );
150
-			$actions['edit'] = '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Price', 'event_espresso' ) . '">' . __( 'Edit', 'event_espresso' ) . '</a>';
148
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_default_price', 'pricing_edit_price', $item->ID())) {
149
+			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_price', 'id'=>$item->ID()), PRICING_ADMIN_URL);
150
+			$actions['edit'] = '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Price', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>';
151 151
 		}
152 152
 
153
-		$name_link = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_default_price', 'edit_price', $item->ID() ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Price', 'event_espresso' ) . '">' . stripslashes( $item->name() ) . '</a>' : $item->name();
153
+		$name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_default_price', 'edit_price', $item->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Price', 'event_espresso').'">'.stripslashes($item->name()).'</a>' : $item->name();
154 154
 
155
-		if ( $item->type_obj()->base_type() !== 1 ) {
155
+		if ($item->type_obj()->base_type() !== 1) {
156 156
 			if ($this->_view == 'all') {
157 157
 				// trash price link
158
-				if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price', 'pricing_trash_price', $item->ID() ) ) {
159
-					$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_price', 'id'=>$item->ID(), 'noheader' => true ), PRICING_ADMIN_URL );
160
-					$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Move Price to Trash', 'event_espresso' ) . '">' . __( 'Move to Trash', 'event_espresso' ) . '</a>';
158
+				if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price', 'pricing_trash_price', $item->ID())) {
159
+					$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_price', 'id'=>$item->ID(), 'noheader' => true), PRICING_ADMIN_URL);
160
+					$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Price to Trash', 'event_espresso').'">'.__('Move to Trash', 'event_espresso').'</a>';
161 161
 				}
162 162
 			} else {
163
-				if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price', 'pricing_restore_price', $item->ID() ) ) {
163
+				if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price', 'pricing_restore_price', $item->ID())) {
164 164
 					// restore price link
165
-					$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_price', 'id'=>$item->ID(), 'noheader' => true ), PRICING_ADMIN_URL );
166
-					$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Price', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>';
165
+					$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_price', 'id'=>$item->ID(), 'noheader' => true), PRICING_ADMIN_URL);
166
+					$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Price', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
167 167
 				}
168 168
 
169 169
 				// delete price link
170
-				if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price', 'pricing_delete_price', $item->ID() ) ) {
171
-					$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_price', 'id'=>$item->ID(), 'noheader' => true ), PRICING_ADMIN_URL );
172
-					$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Price Permanently', 'event_espresso' ) . '">' . __( 'Delete Permanently', 'event_espresso' ) . '</a>';
170
+				if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price', 'pricing_delete_price', $item->ID())) {
171
+					$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_price', 'id'=>$item->ID(), 'noheader' => true), PRICING_ADMIN_URL);
172
+					$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Price Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
173 173
 				}
174 174
 			}
175 175
 		}
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
179 179
 										/* $1%s */ $name_link,
180 180
 										/* $2%s */ $item->ID(),
181
-										/* $3%s */ $this->row_actions( $actions )
181
+										/* $3%s */ $this->row_actions($actions)
182 182
 		);
183 183
 	}
184 184
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 
196 196
 
197 197
 	function column_description($item) {
198
-		return stripslashes( $item->desc() );
198
+		return stripslashes($item->desc());
199 199
 	}
200 200
 
201 201
 
@@ -204,9 +204,9 @@  discard block
 block discarded – undo
204 204
 
205 205
 	function column_amount($item) {
206 206
 		if ($this->_price_types[$item->type()]->is_percent()) {
207
-			return '<div class="pad-amnt-rght">' . number_format($item->amount(), 1) . '%</div>';
207
+			return '<div class="pad-amnt-rght">'.number_format($item->amount(), 1).'%</div>';
208 208
 		} else {
209
-			return '<div class="pad-amnt-rght">' . EEH_Template::format_currency( $item->amount() ) . '</div>';
209
+			return '<div class="pad-amnt-rght">'.EEH_Template::format_currency($item->amount()).'</div>';
210 210
 		}
211 211
 	}
212 212
 
Please login to merge, or discard this patch.
caffeinated/admin/new/pricing/Pricing_Admin_Page.core.php 3 patches
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
 
79 79
 	/**
80 80
 	 * 		an array for storing request actions and their corresponding methods
81
-	*		@access private
82
-	*		@return void
83
-	*/
81
+	 *		@access private
82
+	 *		@return void
83
+	 */
84 84
 	protected function _set_page_routes() {
85 85
 		$prc_id = ! empty( $this->_req_data['PRC_ID'] ) && ! is_array( $this->_req_data['PRC_ID'] ) ? $this->_req_data['PRC_ID'] : 0;
86 86
 		$prt_id =  ! empty( $this->_req_data['PRT_ID'] ) && ! is_array( $this->_req_data['PRT_ID'] ) ? $this->_req_data['PRT_ID'] : 0;
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 							'order' => 10
201 201
 						),
202 202
 					'list_table' => 'Prices_List_Table',
203
-                    'help_tabs' => array(
203
+					'help_tabs' => array(
204 204
 						'pricing_default_pricing_help_tab' => array(
205 205
 							'title' => __('Default Pricing', 'event_espresso'),
206 206
 							'filename' => 'pricing_default_pricing'
@@ -223,13 +223,13 @@  discard block
 block discarded – undo
223 223
 							'order' => 20,
224 224
 							'persistent' => FALSE
225 225
 						),
226
-                    'help_tabs' => array(
226
+					'help_tabs' => array(
227 227
 						'add_new_default_price_help_tab' => array(
228 228
 							'title' => __('Add New Default Price', 'event_espresso'),
229 229
 							'filename' => 'pricing_add_new_default_price'
230 230
 							)
231 231
 						),
232
-                    'help_tour' => array('Pricing_Add_New_Default_Price_Help_Tour'),
232
+					'help_tour' => array('Pricing_Add_New_Default_Price_Help_Tour'),
233 233
 					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ),
234 234
 					'require_nonce' => FALSE
235 235
 				),
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 							'persistent' => FALSE
242 242
 						),
243 243
 					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ),
244
-                    'help_tabs' => array(
244
+					'help_tabs' => array(
245 245
 						'edit_default_price_help_tab' => array(
246 246
 							'title' => __('Edit Default Price', 'event_espresso'),
247 247
 							'filename' => 'pricing_edit_default_price'
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 							'order' => 30
257 257
 						),
258 258
 					'list_table' => 'Price_Types_List_Table',
259
-                    'help_tabs' => array(
259
+					'help_tabs' => array(
260 260
 						'pricing_price_types_help_tab' => array(
261 261
 							'title' => __('Price Types', 'event_espresso'),
262 262
 							'filename' => 'pricing_price_types'
@@ -280,13 +280,13 @@  discard block
 block discarded – undo
280 280
 							'order' => 40,
281 281
 							'persistent' => FALSE
282 282
 						),
283
-                    'help_tabs' => array(
283
+					'help_tabs' => array(
284 284
 						'add_new_price_type_help_tab' => array(
285 285
 							'title' => __('Add New Price Type', 'event_espresso'),
286 286
 							'filename' => 'pricing_add_new_price_type'
287 287
 							)
288 288
 						),
289
-                    'help_tour' => array( 'Pricing_Add_New_Price_Type_Help_Tour' ),
289
+					'help_tour' => array( 'Pricing_Add_New_Price_Type_Help_Tour' ),
290 290
 					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ),
291 291
 					'require_nonce' => FALSE
292 292
 				),
@@ -296,13 +296,13 @@  discard block
 block discarded – undo
296 296
 							'order' => 40,
297 297
 							'persistent' => FALSE
298 298
 						),
299
-                    'help_tabs' => array(
299
+					'help_tabs' => array(
300 300
 						'edit_price_type_help_tab' => array(
301 301
 							'title' => __('Edit Price Type', 'event_espresso'),
302 302
 							'filename' => 'pricing_edit_price_type'
303 303
 							)
304 304
 						),
305
-                    'help_tour' => array( 'Pricing_Edit_Price_Type_Help_Tour' ),
305
+					'help_tour' => array( 'Pricing_Edit_Price_Type_Help_Tour' ),
306 306
 					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ),
307 307
 
308 308
 					'require_nonce' => FALSE
@@ -433,9 +433,9 @@  discard block
 block discarded – undo
433 433
 
434 434
 	/**
435 435
 	 * 		generates HTML for main Prices Admin page
436
-	*		@access protected
437
-	*		@return void
438
-	*/
436
+	 *		@access protected
437
+	 *		@return void
438
+	 */
439 439
 	protected function _price_overview_list_table() {
440 440
 		$this->_admin_page_title .= $this->get_action_link_or_button('add_new_price', 'add', array(), 'add-new-h2');
441 441
 		$this->admin_page_title .= $this->_learn_more_about_pricing_link();
@@ -449,13 +449,13 @@  discard block
 block discarded – undo
449 449
 
450 450
 
451 451
 	/**
452
-	*	retrieve data for Prices List table
453
-	*	@access public
454
-	* 	@param  int  $per_page    how many prices displayed per page
455
-	* 	@param  boolean $count   return the count or objects
456
-	* 	@param  boolean $trashed   whether the current view is of the trash can - eww yuck!
457
-	* 	@return mixed (int|array)  int = count || array of price objects
458
-	*/
452
+	 *	retrieve data for Prices List table
453
+	 *	@access public
454
+	 * 	@param  int  $per_page    how many prices displayed per page
455
+	 * 	@param  boolean $count   return the count or objects
456
+	 * 	@param  boolean $trashed   whether the current view is of the trash can - eww yuck!
457
+	 * 	@return mixed (int|array)  int = count || array of price objects
458
+	 */
459 459
 	public function get_prices_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) {
460 460
 
461 461
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -525,9 +525,9 @@  discard block
 block discarded – undo
525 525
 
526 526
 	/**
527 527
 	 * 		_price_details
528
-	*		@access protected
529
-	*		@return void
530
-	*/
528
+	 *		@access protected
529
+	 *		@return void
530
+	 */
531 531
 	protected function _edit_price_details() {
532 532
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
533 533
 		// grab price ID
@@ -587,9 +587,9 @@  discard block
 block discarded – undo
587 587
 
588 588
 	/**
589 589
 	 * 		declare price details page metaboxes
590
-	*		@access protected
591
-	*		@return void
592
-	*/
590
+	 *		@access protected
591
+	 *		@return void
592
+	 */
593 593
 	protected function _price_details_meta_boxes() {
594 594
 		add_meta_box( 'edit-price-details-mbox', __( 'Default Price Details', 'event_espresso' ), array( $this, '_edit_price_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
595 595
 	}
@@ -601,9 +601,9 @@  discard block
 block discarded – undo
601 601
 
602 602
 	/**
603 603
 	 * 		_edit_price_details_meta_box
604
-	*		@access public
605
-	*		@return void
606
-	*/
604
+	 *		@access public
605
+	 *		@return void
606
+	 */
607 607
 	public function _edit_price_details_meta_box() {
608 608
 		echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_details_main_meta_box.template.php', $this->_template_args, TRUE );
609 609
 	}
@@ -614,9 +614,9 @@  discard block
 block discarded – undo
614 614
 
615 615
 	/**
616 616
 	 * 		set_price_column_values
617
-	*		@access protected
618
-	*		@return array
619
-	*/
617
+	 *		@access protected
618
+	 *		@return array
619
+	 */
620 620
 	protected function set_price_column_values() {
621 621
 
622 622
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -643,10 +643,10 @@  discard block
 block discarded – undo
643 643
 
644 644
 	/**
645 645
 	 * 		insert_or_update_price
646
-	*		@param boolean 		$insert - whether to insert or update
647
-	*		@access protected
648
-	*		@return void
649
-	*/
646
+	 *		@param boolean 		$insert - whether to insert or update
647
+	 *		@access protected
648
+	 *		@return void
649
+	 */
650 650
 	protected function _insert_or_update_price( $insert = FALSE ) {
651 651
 
652 652
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
@@ -719,10 +719,10 @@  discard block
 block discarded – undo
719 719
 
720 720
 	/**
721 721
 	 * 		_trash_or_restore_price
722
-	*		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
723
-	*		@access protected
724
-	*		@return void
725
-	*/
722
+	 *		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
723
+	 *		@access protected
724
+	 *		@return void
725
+	 */
726 726
 	protected function _trash_or_restore_price( $trash = TRUE ) {
727 727
 
728 728
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
@@ -802,9 +802,9 @@  discard block
 block discarded – undo
802 802
 
803 803
 	/**
804 804
 	 * 		_delete_price
805
-	*		@access protected
806
-	*		@return void
807
-	*/
805
+	 *		@access protected
806
+	 *		@return void
807
+	 */
808 808
 	protected function _delete_price() {
809 809
 
810 810
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
@@ -881,9 +881,9 @@  discard block
 block discarded – undo
881 881
 
882 882
 	/**
883 883
 	 * 		generates HTML for main Prices Admin page
884
-	*		@access protected
885
-	*		@return void
886
-	*/
884
+	 *		@access protected
885
+	 *		@return void
886
+	 */
887 887
 	protected function _price_types_overview_list_table() {
888 888
 		$this->_admin_page_title .= $this->get_action_link_or_button('add_new_price_type', 'add_type', array(), 'add-new-h2');
889 889
 		$this->admin_page_title .= $this->_learn_more_about_pricing_link();
@@ -897,13 +897,13 @@  discard block
 block discarded – undo
897 897
 
898 898
 
899 899
 	/**
900
-	*	retrieve data for Price Types List table
901
-	*	@access public
902
-	* 	@param  int  $per_page    how many prices displayed per page
903
-	* 	@param  boolean $count   return the count or objects
904
-	* 	@param  boolean $trashed   whether the current view is of the trash can - eww yuck!
905
-	* 	@return mixed (int|array)  int = count || array of price objects
906
-	*/
900
+	 *	retrieve data for Price Types List table
901
+	 *	@access public
902
+	 * 	@param  int  $per_page    how many prices displayed per page
903
+	 * 	@param  boolean $count   return the count or objects
904
+	 * 	@param  boolean $trashed   whether the current view is of the trash can - eww yuck!
905
+	 * 	@return mixed (int|array)  int = count || array of price objects
906
+	 */
907 907
 	public function get_price_types_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) {
908 908
 
909 909
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -958,9 +958,9 @@  discard block
 block discarded – undo
958 958
 
959 959
 	/**
960 960
 	 * 		_edit_price_type_details
961
-	*		@access protected
962
-	*		@return void
963
-	*/
961
+	 *		@access protected
962
+	 *		@return void
963
+	 */
964 964
 	protected function _edit_price_type_details() {
965 965
 
966 966
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -1015,9 +1015,9 @@  discard block
 block discarded – undo
1015 1015
 
1016 1016
 	/**
1017 1017
 	 * 		declare price type details page metaboxes
1018
-	*		@access protected
1019
-	*		@return void
1020
-	*/
1018
+	 *		@access protected
1019
+	 *		@return void
1020
+	 */
1021 1021
 	protected function _price_type_details_meta_boxes() {
1022 1022
 		add_meta_box( 'edit-price-details-mbox', __( 'Price Type Details', 'event_espresso' ), array( $this, '_edit_price_type_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1023 1023
 	}
@@ -1028,9 +1028,9 @@  discard block
 block discarded – undo
1028 1028
 
1029 1029
 	/**
1030 1030
 	 * 		_edit_price_type_details_meta_box
1031
-	*		@access public
1032
-	*		@return void
1033
-	*/
1031
+	 *		@access public
1032
+	 *		@return void
1033
+	 */
1034 1034
 	public function _edit_price_type_details_meta_box() {
1035 1035
 		echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_type_details_main_meta_box.template.php', $this->_template_args, TRUE );
1036 1036
 	}
@@ -1040,9 +1040,9 @@  discard block
 block discarded – undo
1040 1040
 
1041 1041
 	/**
1042 1042
 	 * 		set_price_type_column_values
1043
-	*		@access protected
1044
-	*		@return void
1045
-	*/
1043
+	 *		@access protected
1044
+	 *		@return void
1045
+	 */
1046 1046
 	protected function set_price_type_column_values() {
1047 1047
 
1048 1048
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -1090,10 +1090,10 @@  discard block
 block discarded – undo
1090 1090
 
1091 1091
 	/**
1092 1092
 	 * 		_insert_or_update_price_type
1093
-	*		@param boolean 		$new_price_type - whether to insert or update
1094
-	*		@access protected
1095
-	*		@return void
1096
-	*/
1093
+	 *		@param boolean 		$new_price_type - whether to insert or update
1094
+	 *		@access protected
1095
+	 *		@return void
1096
+	 */
1097 1097
 	protected function _insert_or_update_price_type( $new_price_type = FALSE ) {
1098 1098
 
1099 1099
 //		echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
@@ -1134,10 +1134,10 @@  discard block
 block discarded – undo
1134 1134
 
1135 1135
 	/**
1136 1136
 	 * 		_trash_or_restore_price_type
1137
-	*		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
1138
-	*		@access protected
1139
-	*		@return void
1140
-	*/
1137
+	 *		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
1138
+	 *		@access protected
1139
+	 *		@return void
1140
+	 */
1141 1141
 	protected function _trash_or_restore_price_type( $trash = TRUE ) {
1142 1142
 
1143 1143
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
@@ -1191,9 +1191,9 @@  discard block
 block discarded – undo
1191 1191
 
1192 1192
 	/**
1193 1193
 	 * 		_delete_price_type
1194
-	*		@access protected
1195
-	*		@return void
1196
-	*/
1194
+	 *		@access protected
1195
+	 *		@return void
1196
+	 */
1197 1197
 	protected function _delete_price_type() {
1198 1198
 
1199 1199
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
@@ -1230,9 +1230,9 @@  discard block
 block discarded – undo
1230 1230
 
1231 1231
 	/**
1232 1232
 	 * 		_learn_more_about_pricing_link
1233
-	*		@access protected
1234
-	*		@return string
1235
-	*/
1233
+	 *		@access protected
1234
+	 *		@return string
1235
+	 */
1236 1236
 	protected function _learn_more_about_pricing_link() {
1237 1237
 		return '<a class="hidden" style="margin:0 20px; cursor:pointer; font-size:12px;" >' . __('learn more about how pricing works', 'event_espresso') . '</a>';
1238 1238
 	}
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
@@ -513,7 +515,7 @@  discard block
 block discarded – undo
513 515
 
514 516
 		if($count){
515 517
 			return EEM_Price::instance()->count_deleted_and_undeleted(array($_where));
516
-		}else{
518
+		} else{
517 519
 			return EEM_Price::instance()->get_all_deleted_and_undeleted($query_params);
518 520
 		}
519 521
 	}
@@ -943,7 +945,7 @@  discard block
 block discarded – undo
943 945
 			'limit'=>$limit);
944 946
 		if($count){
945 947
 			return EEM_Price_Type::instance()->count_deleted_and_undeleted($query_params);
946
-		}else{
948
+		} else{
947 949
 			return EEM_Price_Type::instance()->get_all_deleted_and_undeleted($query_params);
948 950
 		}
949 951
 
Please login to merge, or discard this patch.
Spacing   +184 added lines, -184 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 	 * @param bool $routing
32 32
 	 * @return Pricing_Admin_Page
33 33
 	 */
34
-	public function __construct( $routing = TRUE ) {
35
-		parent::__construct( $routing );
34
+	public function __construct($routing = TRUE) {
35
+		parent::__construct($routing);
36 36
 	}
37 37
 
38 38
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 
51 51
 	protected function _ajax_hooks() {
52
-		add_action('wp_ajax_espresso_update_prices_order', array( $this, 'update_price_order' ));
52
+		add_action('wp_ajax_espresso_update_prices_order', array($this, 'update_price_order'));
53 53
 	}
54 54
 
55 55
 
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 	*		@return void
83 83
 	*/
84 84
 	protected function _set_page_routes() {
85
-		$prc_id = ! empty( $this->_req_data['PRC_ID'] ) && ! is_array( $this->_req_data['PRC_ID'] ) ? $this->_req_data['PRC_ID'] : 0;
86
-		$prt_id =  ! empty( $this->_req_data['PRT_ID'] ) && ! is_array( $this->_req_data['PRT_ID'] ) ? $this->_req_data['PRT_ID'] : 0;
85
+		$prc_id = ! empty($this->_req_data['PRC_ID']) && ! is_array($this->_req_data['PRC_ID']) ? $this->_req_data['PRC_ID'] : 0;
86
+		$prt_id = ! empty($this->_req_data['PRT_ID']) && ! is_array($this->_req_data['PRT_ID']) ? $this->_req_data['PRT_ID'] : 0;
87 87
 		$this->_page_routes = array(
88 88
 			'default' => array(
89 89
 					'func' => '_price_overview_list_table',
@@ -91,38 +91,38 @@  discard block
 block discarded – undo
91 91
 				),
92 92
 			'add_new_price'	=> array(
93 93
 					'func' => '_edit_price_details',
94
-					'args' => array( 'new_price' => TRUE ),
94
+					'args' => array('new_price' => TRUE),
95 95
 					'capability' => 'ee_edit_default_prices'
96 96
 				),
97 97
 			'edit_price'	=> array(
98 98
 					'func' => '_edit_price_details',
99
-					'args' => array( 'new_price' => FALSE ),
99
+					'args' => array('new_price' => FALSE),
100 100
 					'capability' => 'ee_edit_default_price',
101 101
 					'obj_id' => $prc_id
102 102
 				),
103 103
 			'insert_price'	=> array(
104 104
 					'func' => '_insert_or_update_price',
105
-					'args' => array( 'new_price' => TRUE ),
105
+					'args' => array('new_price' => TRUE),
106 106
 					'noheader' => TRUE,
107 107
 					'capability' => 'ee_edit_default_prices',
108 108
 				),
109 109
 			'update_price'	=> array(
110 110
 					'func' => '_insert_or_update_price',
111
-					'args' => array( 'new_price' => FALSE ),
111
+					'args' => array('new_price' => FALSE),
112 112
 					'noheader' => TRUE,
113 113
 					'capability' => 'ee_edit_default_price',
114 114
 					'obj_id' => $prc_id
115 115
 				),
116 116
 			'trash_price'	=> array(
117 117
 					'func' => '_trash_or_restore_price',
118
-					'args' => array( 'trash' => TRUE ),
118
+					'args' => array('trash' => TRUE),
119 119
 					'noheader' => TRUE,
120 120
 					'capability' => 'ee_delete_default_price',
121 121
 					'obj_id' => $prc_id
122 122
 				),
123 123
 			'restore_price'	=> array(
124 124
 					'func' => '_trash_or_restore_price',
125
-					'args' => array( 'trash' => FALSE ),
125
+					'args' => array('trash' => FALSE),
126 126
 					'noheader' => TRUE,
127 127
 					'capability' => 'ee_delete_default_price',
128 128
 					'obj_id' => $prc_id
@@ -154,27 +154,27 @@  discard block
 block discarded – undo
154 154
 				),
155 155
 			'insert_price_type'	=> array(
156 156
 					'func' => '_insert_or_update_price_type',
157
-					'args' => array( 'new_price_type' => TRUE ),
157
+					'args' => array('new_price_type' => TRUE),
158 158
 					'noheader' => TRUE,
159 159
 					'capability' => 'ee_edit_default_price_types'
160 160
 				),
161 161
 			'update_price_type' => array(
162 162
 					'func' => '_insert_or_update_price_type',
163
-					'args' => array( 'new_price_type' => FALSE ),
163
+					'args' => array('new_price_type' => FALSE),
164 164
 					'noheader' => TRUE,
165 165
 					'capability' => 'ee_edit_default_price_type',
166 166
 					'obj_id' => $prt_id
167 167
 				),
168 168
 			'trash_price_type'	=> array(
169 169
 					'func' => '_trash_or_restore_price_type',
170
-					'args' => array( 'trash' => TRUE ),
170
+					'args' => array('trash' => TRUE),
171 171
 					'noheader' => TRUE,
172 172
 					'capability' => 'ee_delete_default_price_type',
173 173
 					'obj_id' => $prt_id
174 174
 				),
175 175
 			'restore_price_type'	=> array(
176 176
 					'func' => '_trash_or_restore_price_type',
177
-					'args' => array( 'trash' => FALSE ),
177
+					'args' => array('trash' => FALSE),
178 178
 					'noheader' => TRUE,
179 179
 					'capability' => 'ee_delete_default_price_type',
180 180
 					'obj_id' => $prt_id
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 							'filename' => 'pricing_default_pricing_views_bulk_actions_search'
215 215
 							)
216 216
 						),
217
-					'help_tour' => array( 'Pricing_Default_Prices_Help_Tour'),
217
+					'help_tour' => array('Pricing_Default_Prices_Help_Tour'),
218 218
 					'require_nonce' => FALSE
219 219
 				),
220 220
 			'add_new_price' => array(
@@ -230,24 +230,24 @@  discard block
 block discarded – undo
230 230
 							)
231 231
 						),
232 232
                     'help_tour' => array('Pricing_Add_New_Default_Price_Help_Tour'),
233
-					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ),
233
+					'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes'),
234 234
 					'require_nonce' => FALSE
235 235
 				),
236 236
 			'edit_price' => array(
237 237
 					'nav' => array(
238 238
 							'label' => __('Edit Default Price', 'event_espresso'),
239 239
 							'order' => 20,
240
-							'url' => isset($this->_req_data['id']) ? add_query_arg(array('id' => $this->_req_data['id'] ), $this->_current_page_view_url )  : $this->_admin_base_url,
240
+							'url' => isset($this->_req_data['id']) ? add_query_arg(array('id' => $this->_req_data['id']), $this->_current_page_view_url) : $this->_admin_base_url,
241 241
 							'persistent' => FALSE
242 242
 						),
243
-					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ),
243
+					'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes'),
244 244
                     'help_tabs' => array(
245 245
 						'edit_default_price_help_tab' => array(
246 246
 							'title' => __('Edit Default Price', 'event_espresso'),
247 247
 							'filename' => 'pricing_edit_default_price'
248 248
 							)
249 249
 						),
250
-					'help_tour' => array( 'Pricing_Edit_Default_Price_Help_Tour' ),
250
+					'help_tour' => array('Pricing_Edit_Default_Price_Help_Tour'),
251 251
 					'require_nonce' => FALSE
252 252
 				),
253 253
 			'price_types' => array(
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 							'filename' => 'pricing_price_types_views_bulk_actions_search'
271 271
 							),
272 272
 						),
273
-					'help_tour' => array( 'Pricing_Price_Types_Default_Help_Tour' ),
273
+					'help_tour' => array('Pricing_Price_Types_Default_Help_Tour'),
274 274
 					'metaboxes' => array('_espresso_news_post_box', '_espresso_links_post_box'),
275 275
 					'require_nonce' => FALSE
276 276
 				),
@@ -286,8 +286,8 @@  discard block
 block discarded – undo
286 286
 							'filename' => 'pricing_add_new_price_type'
287 287
 							)
288 288
 						),
289
-                    'help_tour' => array( 'Pricing_Add_New_Price_Type_Help_Tour' ),
290
-					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ),
289
+                    'help_tour' => array('Pricing_Add_New_Price_Type_Help_Tour'),
290
+					'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes'),
291 291
 					'require_nonce' => FALSE
292 292
 				),
293 293
 			'edit_price_type' => array(
@@ -302,8 +302,8 @@  discard block
 block discarded – undo
302 302
 							'filename' => 'pricing_edit_price_type'
303 303
 							)
304 304
 						),
305
-                    'help_tour' => array( 'Pricing_Edit_Price_Type_Help_Tour' ),
306
-					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ),
305
+                    'help_tour' => array('Pricing_Edit_Price_Type_Help_Tour'),
306
+					'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes'),
307 307
 
308 308
 					'require_nonce' => FALSE
309 309
 				)
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 	public function load_scripts_styles() {
341 341
 		//styles
342 342
 		wp_enqueue_style('espresso-ui-theme');
343
-		wp_register_style( 'espresso_PRICING', PRICING_ASSETS_URL . 'espresso_pricing_admin.css', array(), EVENT_ESPRESSO_VERSION );
343
+		wp_register_style('espresso_PRICING', PRICING_ASSETS_URL.'espresso_pricing_admin.css', array(), EVENT_ESPRESSO_VERSION);
344 344
 		wp_enqueue_style('espresso_PRICING');
345 345
 
346 346
 		//scripts
@@ -350,8 +350,8 @@  discard block
 block discarded – undo
350 350
 		//wp_enqueue_script('jquery-ui-dialog');
351 351
 		//wp_enqueue_script('jquery-ui-draggable');
352 352
 		//wp_enqueue_script('jquery-ui-datepicker');
353
-		wp_register_script( 'espresso_PRICING', PRICING_ASSETS_URL . 'espresso_pricing_admin.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE );
354
-		wp_enqueue_script( 'espresso_PRICING' );
353
+		wp_register_script('espresso_PRICING', PRICING_ASSETS_URL.'espresso_pricing_admin.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
354
+		wp_enqueue_script('espresso_PRICING');
355 355
 	}
356 356
 
357 357
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 
360 360
 
361 361
 	public function load_scripts_styles_default() {
362
-		wp_enqueue_script( 'espresso_ajax_table_sorting' );
362
+		wp_enqueue_script('espresso_ajax_table_sorting');
363 363
 	}
364 364
 
365 365
 
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 				)
388 388
 		);
389 389
 
390
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_prices', 'pricing_trash_price' ) ) {
390
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_prices', 'pricing_trash_price')) {
391 391
 			$this->_views['trashed'] = array(
392 392
 					'slug' => 'trashed',
393 393
 					'label' => __('Trash', 'event_espresso'),
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 				)
418 418
 		);
419 419
 
420
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price_types', 'pricing_trash_price_type' ) ) {
420
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price_types', 'pricing_trash_price_type')) {
421 421
 			 $this->_views['trashed'] = array(
422 422
 					'slug' => 'trashed',
423 423
 					'label' => __('Trash', 'event_espresso'),
@@ -456,18 +456,18 @@  discard block
 block discarded – undo
456 456
 	* 	@param  boolean $trashed   whether the current view is of the trash can - eww yuck!
457 457
 	* 	@return mixed (int|array)  int = count || array of price objects
458 458
 	*/
459
-	public function get_prices_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) {
459
+	public function get_prices_overview_data($per_page = 10, $count = FALSE, $trashed = FALSE) {
460 460
 
461
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
461
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
462 462
 		// start with an empty array
463 463
 		$event_pricing = array();
464 464
 
465
-		require_once( PRICING_ADMIN . 'Prices_List_Table.class.php' );
466
-		require_once(EE_MODELS . 'EEM_Price.model.php');
465
+		require_once(PRICING_ADMIN.'Prices_List_Table.class.php');
466
+		require_once(EE_MODELS.'EEM_Price.model.php');
467 467
 		//$PRC = EEM_Price::instance();
468 468
 
469 469
 		$this->_req_data['orderby'] = empty($this->_req_data['orderby']) ? '' : $this->_req_data['orderby'];
470
-		$order = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
470
+		$order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
471 471
 
472 472
 		switch ($this->_req_data['orderby']) {
473 473
 			case 'name':
@@ -480,27 +480,27 @@  discard block
 block discarded – undo
480 480
 				$orderby = array('PRC_amount'=>$order);
481 481
 				break;
482 482
 			default:
483
-				$orderby = array( 'PRC_order'=>$order, 'Price_Type.PRT_order'=>$order, 'PRC_ID'=>$order);
483
+				$orderby = array('PRC_order'=>$order, 'Price_Type.PRT_order'=>$order, 'PRC_ID'=>$order);
484 484
 		}
485 485
 
486
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
487
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
486
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
487
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
488 488
 
489 489
 		$_where = array(
490 490
 				'PRC_is_default' => 1,
491 491
 				'PRC_deleted' => $trashed
492 492
 				);
493 493
 
494
-		$offset = ($current_page-1)*$per_page;
495
-		$limit = array( $offset, $per_page );
494
+		$offset = ($current_page - 1) * $per_page;
495
+		$limit = array($offset, $per_page);
496 496
 
497
-		if ( isset( $this->_req_data['s'] ) ) {
498
-			$sstr = '%' . $this->_req_data['s'] . '%';
497
+		if (isset($this->_req_data['s'])) {
498
+			$sstr = '%'.$this->_req_data['s'].'%';
499 499
 			$_where['OR'] = array(
500
-				'PRC_name' => array('LIKE',$sstr ),
501
-				'PRC_desc' => array('LIKE',$sstr ),
502
-				'PRC_amount' => array( 'LIKE',$sstr ),
503
-				'Price_Type.PRT_name' => array( 'LIKE', $sstr )
500
+				'PRC_name' => array('LIKE', $sstr),
501
+				'PRC_desc' => array('LIKE', $sstr),
502
+				'PRC_amount' => array('LIKE', $sstr),
503
+				'Price_Type.PRT_name' => array('LIKE', $sstr)
504 504
 				);
505 505
 		}
506 506
 
@@ -511,9 +511,9 @@  discard block
 block discarded – undo
511 511
 			'group_by'=>'PRC_ID'
512 512
 			);
513 513
 
514
-		if($count){
515
-			return $trashed ? EEM_Price::instance()->count( array( $_where ) ) : EEM_Price::instance()->count_deleted_and_undeleted(array($_where));
516
-		}else{
514
+		if ($count) {
515
+			return $trashed ? EEM_Price::instance()->count(array($_where)) : EEM_Price::instance()->count_deleted_and_undeleted(array($_where));
516
+		} else {
517 517
 			return EEM_Price::instance()->get_all_deleted_and_undeleted($query_params);
518 518
 		}
519 519
 	}
@@ -529,40 +529,40 @@  discard block
 block discarded – undo
529 529
 	*		@return void
530 530
 	*/
531 531
 	protected function _edit_price_details() {
532
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
532
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
533 533
 		// grab price ID
534
-		$PRC_ID = isset( $this->_req_data['id'] ) && ! empty( $this->_req_data['id'] ) ? absint( $this->_req_data['id'] ) : FALSE;
534
+		$PRC_ID = isset($this->_req_data['id']) && ! empty($this->_req_data['id']) ? absint($this->_req_data['id']) : FALSE;
535 535
 		// change page title based on request action
536
-		$this->_admin_page_title = ucwords( str_replace( '_', ' ', $this->_req_action ));
536
+		$this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action));
537 537
 		// add PRC_ID to title if editing
538
-		$this->_admin_page_title = $PRC_ID ? $this->_admin_page_title . ' # ' . $PRC_ID : $this->_admin_page_title;
538
+		$this->_admin_page_title = $PRC_ID ? $this->_admin_page_title.' # '.$PRC_ID : $this->_admin_page_title;
539 539
 
540 540
 		// get prices
541
-		require_once(EE_MODELS . 'EEM_Price.model.php');
541
+		require_once(EE_MODELS.'EEM_Price.model.php');
542 542
 		$PRC = EEM_Price::instance();
543 543
 
544
-		if ( $PRC_ID ) {
545
-			$price = $PRC->get_one_by_ID( $PRC_ID );
544
+		if ($PRC_ID) {
545
+			$price = $PRC->get_one_by_ID($PRC_ID);
546 546
 			$additional_hidden_fields = array(
547
-					'PRC_ID' => array( 'type' => 'hidden', 'value' => $PRC_ID )
547
+					'PRC_ID' => array('type' => 'hidden', 'value' => $PRC_ID)
548 548
 				);
549
-			$this->_set_add_edit_form_tags( 'update_price', $additional_hidden_fields );
549
+			$this->_set_add_edit_form_tags('update_price', $additional_hidden_fields);
550 550
 		} else {
551 551
 			$price = $PRC->get_new_price();
552
-			$this->_set_add_edit_form_tags( 'insert_price' );
552
+			$this->_set_add_edit_form_tags('insert_price');
553 553
 		}
554 554
 
555 555
 		$this->_template_args['PRC_ID'] = $PRC_ID;
556 556
 		$this->_template_args['price'] = $price;
557 557
 
558 558
 		// get price types
559
-		require_once(EE_MODELS . 'EEM_Price_Type.model.php');
559
+		require_once(EE_MODELS.'EEM_Price_Type.model.php');
560 560
 		$PRT = EEM_Price_Type::instance();
561
-		$price_types = $PRT->get_all( array( array('PBT_ID' => array('!=', 1 ) ) ) );
561
+		$price_types = $PRT->get_all(array(array('PBT_ID' => array('!=', 1))));
562 562
 		$price_type_names = array();
563 563
 		if (empty($price_types)) {
564
-			$msg = __( 'You have no price types defined. Please add a price type before adding a price.', 'event_espresso' );
565
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
564
+			$msg = __('You have no price types defined. Please add a price type before adding a price.', 'event_espresso');
565
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
566 566
 			exit();
567 567
 		} else {
568 568
 			foreach ($price_types as $type) {
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
 		$this->_template_args['price_types'] = $price_type_names;
576 576
 		$this->_template_args['learn_more_about_pricing_link'] = $this->_learn_more_about_pricing_link();
577 577
 
578
-		$this->_set_publish_post_box_vars( 'id', $PRC_ID );
578
+		$this->_set_publish_post_box_vars('id', $PRC_ID);
579 579
 		// the details template wrapper
580 580
 		$this->display_admin_page_with_sidebar();
581 581
 	}
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 	*		@return void
592 592
 	*/
593 593
 	protected function _price_details_meta_boxes() {
594
-		add_meta_box( 'edit-price-details-mbox', __( 'Default Price Details', 'event_espresso' ), array( $this, '_edit_price_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
594
+		add_meta_box('edit-price-details-mbox', __('Default Price Details', 'event_espresso'), array($this, '_edit_price_details_meta_box'), $this->wp_page_slug, 'normal', 'high');
595 595
 	}
596 596
 
597 597
 
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 	*		@return void
606 606
 	*/
607 607
 	public function _edit_price_details_meta_box() {
608
-		echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_details_main_meta_box.template.php', $this->_template_args, TRUE );
608
+		echo EEH_Template::display_template(PRICING_TEMPLATE_PATH.'pricing_details_main_meta_box.template.php', $this->_template_args, TRUE);
609 609
 	}
610 610
 
611 611
 
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 	*/
620 620
 	protected function set_price_column_values() {
621 621
 
622
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
622
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
623 623
 
624 624
 		$set_column_values = array(
625 625
 				'PRT_ID' => absint($this->_req_data['PRT_ID']),
@@ -647,12 +647,12 @@  discard block
 block discarded – undo
647 647
 	*		@access protected
648 648
 	*		@return void
649 649
 	*/
650
-	protected function _insert_or_update_price( $insert = FALSE ) {
650
+	protected function _insert_or_update_price($insert = FALSE) {
651 651
 
652 652
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
653
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
653
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
654 654
 
655
-		require_once(EE_MODELS . 'EEM_Price.model.php');
655
+		require_once(EE_MODELS.'EEM_Price.model.php');
656 656
 		$PRC = EEM_Price::instance();
657 657
 
658 658
 		// why be so pessimistic ???  : (
@@ -660,14 +660,14 @@  discard block
 block discarded – undo
660 660
 
661 661
 		$set_column_values = $this->set_price_column_values();
662 662
 		// is this a new Price ?
663
-		if ( $insert ) {
663
+		if ($insert) {
664 664
 			// run the insert
665
-			if ( $PRC_ID = $PRC->insert( $set_column_values )) {
665
+			if ($PRC_ID = $PRC->insert($set_column_values)) {
666 666
 				//make sure this new price modifier is attached to the ticket but ONLY if it is not a tax type
667 667
 				$PR = EEM_price::instance()->get_one_by_ID($PRC_ID);
668
-				if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) {
668
+				if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) {
669 669
 					$ticket = EEM_Ticket::instance()->get_one_by_ID(1);
670
-					$ticket->_add_relation_to( $PR, 'Price' );
670
+					$ticket->_add_relation_to($PR, 'Price');
671 671
 					$ticket->save();
672 672
 				}
673 673
 				$success = 1;
@@ -677,29 +677,29 @@  discard block
 block discarded – undo
677 677
 			}
678 678
 			$action_desc = 'created';
679 679
 		} else {
680
-			$PRC_ID = absint( $this->_req_data['PRC_ID'] );
680
+			$PRC_ID = absint($this->_req_data['PRC_ID']);
681 681
 			// run the update
682
-			$where_cols_n_values = array( 'PRC_ID' => $PRC_ID );
683
-			if ( $PRC->update( $set_column_values, array($where_cols_n_values))) {
682
+			$where_cols_n_values = array('PRC_ID' => $PRC_ID);
683
+			if ($PRC->update($set_column_values, array($where_cols_n_values))) {
684 684
 				$success = 1;
685 685
 			}
686 686
 
687 687
 			$PR = EEM_Price::instance()->get_one_by_ID($PRC_ID);
688
-			if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) {
688
+			if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) {
689 689
 
690 690
 				//if this is $PRC_ID == 1, then we need to update the default ticket attached to this price so the TKT_price value is updated.
691
-				if ( $PRC_ID === 1 ) {
691
+				if ($PRC_ID === 1) {
692 692
 					$ticket = $PR->get_first_related('Ticket');
693
-					if ( $ticket ) {
694
-						$ticket->set('TKT_price', $PR->get('PRC_amount') );
695
-						$ticket->set('TKT_name', $PR->get('PRC_name') );
693
+					if ($ticket) {
694
+						$ticket->set('TKT_price', $PR->get('PRC_amount'));
695
+						$ticket->set('TKT_name', $PR->get('PRC_name'));
696 696
 						$ticket->set('TKT_description', $PR->get('PRC_desc'));
697 697
 						$ticket->save();
698 698
 					}
699 699
 				} else {
700 700
 					//we make sure this price is attached to base ticket. but ONLY if its not a tax ticket type.
701 701
 					$ticket = EEM_Ticket::instance()->get_one_by_ID(1);
702
-					$ticket->_add_relation_to( $PRC_ID, 'Price' );
702
+					$ticket->_add_relation_to($PRC_ID, 'Price');
703 703
 					$ticket->save();
704 704
 				}
705 705
 			}
@@ -707,9 +707,9 @@  discard block
 block discarded – undo
707 707
 			$action_desc = 'updated';
708 708
 		}
709 709
 
710
-		$query_args = array( 'action' => 'edit_price', 'id' => $PRC_ID );
710
+		$query_args = array('action' => 'edit_price', 'id' => $PRC_ID);
711 711
 
712
-		$this->_redirect_after_action( $success, 'Prices', $action_desc, $query_args );
712
+		$this->_redirect_after_action($success, 'Prices', $action_desc, $query_args);
713 713
 
714 714
 	}
715 715
 
@@ -723,12 +723,12 @@  discard block
 block discarded – undo
723 723
 	*		@access protected
724 724
 	*		@return void
725 725
 	*/
726
-	protected function _trash_or_restore_price( $trash = TRUE ) {
726
+	protected function _trash_or_restore_price($trash = TRUE) {
727 727
 
728 728
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
729
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
729
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
730 730
 
731
-		require_once(EE_MODELS . 'EEM_Price.model.php');
731
+		require_once(EE_MODELS.'EEM_Price.model.php');
732 732
 		$PRC = EEM_Price::instance();
733 733
 
734 734
 		$success = 1;
@@ -737,18 +737,18 @@  discard block
 block discarded – undo
737 737
 		//get base ticket for updating
738 738
 		$ticket = EEM_Ticket::instance()->get_one_by_ID(1);
739 739
 		//Checkboxes
740
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
740
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
741 741
 			// if array has more than one element than success message should be plural
742
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
742
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
743 743
 			// cycle thru checkboxes
744
-			while (list( $PRC_ID, $value ) = each($this->_req_data['checkbox'])) {
745
-				if ( ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), absint($PRC_ID) ) ) {
744
+			while (list($PRC_ID, $value) = each($this->_req_data['checkbox'])) {
745
+				if ( ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), absint($PRC_ID))) {
746 746
 					$success = 0;
747 747
 				} else {
748 748
 					$PR = EEM_Price::instance()->get_one_by_ID($PRC_ID);
749
-					if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) {
749
+					if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) {
750 750
 						//if trashing then remove relations to base default ticket.  If restoring then add back to base default ticket
751
-						if ( $PRC_deleted ) {
751
+						if ($PRC_deleted) {
752 752
 							$ticket->_remove_relation_to($PRC_ID, 'Price');
753 753
 						} else {
754 754
 							$ticket->_add_relation_to($PRC_ID, 'Price');
@@ -760,14 +760,14 @@  discard block
 block discarded – undo
760 760
 
761 761
 		} else {
762 762
 			// grab single id and delete
763
-			$PRC_ID = isset( $this->_req_data['id'] ) ? absint($this->_req_data['id']) : 0;
764
-			if ( empty( $PRC_ID ) || ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), $PRC_ID) ) {
763
+			$PRC_ID = isset($this->_req_data['id']) ? absint($this->_req_data['id']) : 0;
764
+			if (empty($PRC_ID) || ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), $PRC_ID)) {
765 765
 				$success = 0;
766 766
 			} else {
767 767
 				$PR = EEM_Price::instance()->get_one_by_ID($PRC_ID);
768
-				if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) {
768
+				if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) {
769 769
 					//if trashing then remove relations to base default ticket.  If restoring then add back to base default ticket
770
-					if ( $PRC_deleted ) {
770
+					if ($PRC_deleted) {
771 771
 						$ticket->_remove_relation_to($PRC_ID, 'Price');
772 772
 					} else {
773 773
 						$ticket->_add_relation_to($PRC_ID, 'Price');
@@ -781,17 +781,17 @@  discard block
 block discarded – undo
781 781
 			'action' => 'default'
782 782
 			);
783 783
 
784
-		if ( $success ) {
785
-			if ( $trash ) {
784
+		if ($success) {
785
+			if ($trash) {
786 786
 				$msg = $success == 2 ? __('The Prices have been trashed.', 'event_espresso') : __('The Price has been trashed.', 'event_espresso');
787 787
 			} else {
788 788
 				$msg = $success == 2 ? __('The Prices have been restored.', 'event_espresso') : __('The Price has been restored.', 'event_espresso');
789 789
 			}
790 790
 
791
-			EE_Error::add_success( $msg );
791
+			EE_Error::add_success($msg);
792 792
 		}
793 793
 
794
-		$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
794
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
795 795
 
796 796
 	}
797 797
 
@@ -808,19 +808,19 @@  discard block
 block discarded – undo
808 808
 	protected function _delete_price() {
809 809
 
810 810
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
811
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
811
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
812 812
 
813
-		require_once(EE_MODELS . 'EEM_Price.model.php');
813
+		require_once(EE_MODELS.'EEM_Price.model.php');
814 814
 		$PRC = EEM_Price::instance();
815 815
 
816 816
 		$success = 1;
817 817
 		//Checkboxes
818
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
818
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
819 819
 			// if array has more than one element than success message should be plural
820
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
820
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
821 821
 			// cycle thru bulk action checkboxes
822
-			while (list( $PRC_ID, $value ) = each($this->_req_data['checkbox'])) {
823
-				if (!$PRC->delete_permanently_by_ID(absint($PRC_ID))) {
822
+			while (list($PRC_ID, $value) = each($this->_req_data['checkbox'])) {
823
+				if ( ! $PRC->delete_permanently_by_ID(absint($PRC_ID))) {
824 824
 					$success = 0;
825 825
 				}
826 826
 			}
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
 
835 835
 		}
836 836
 
837
-		$this->_redirect_after_action( $success, 'Prices', 'deleted', array() );
837
+		$this->_redirect_after_action($success, 'Prices', 'deleted', array());
838 838
 
839 839
 	}
840 840
 
@@ -842,16 +842,16 @@  discard block
 block discarded – undo
842 842
 
843 843
 
844 844
 	public function update_price_order() {
845
-		$success = __( 'Price order was updated successfully.', 'event_espresso' );
845
+		$success = __('Price order was updated successfully.', 'event_espresso');
846 846
 
847 847
 		// grab our row IDs
848
-		$row_ids = isset( $this->_req_data['row_ids'] ) && ! empty( $this->_req_data['row_ids'] ) ? explode( ',', rtrim( $this->_req_data['row_ids'], ',' )) : FALSE;
848
+		$row_ids = isset($this->_req_data['row_ids']) && ! empty($this->_req_data['row_ids']) ? explode(',', rtrim($this->_req_data['row_ids'], ',')) : FALSE;
849 849
 
850
-		if ( is_array( $row_ids )) {
851
-			for ( $i = 0; $i < count( $row_ids ); $i++ ) {
850
+		if (is_array($row_ids)) {
851
+			for ($i = 0; $i < count($row_ids); $i++) {
852 852
 				//Update the prices when re-ordering
853 853
 				$id = absint($row_ids[$i]);
854
-				if ( EEM_Price::instance()->update ( array( 'PRC_order' => $i+1 ), array(array( 'PRC_ID' => $id ) )) === FALSE ) {
854
+				if (EEM_Price::instance()->update(array('PRC_order' => $i + 1), array(array('PRC_ID' => $id))) === FALSE) {
855 855
 					$success = FALSE;
856 856
 				}
857 857
 			}
@@ -859,9 +859,9 @@  discard block
 block discarded – undo
859 859
 			$success = FALSE;
860 860
 		}
861 861
 
862
-		$errors = ! $success ? __( 'An error occurred. The price order was not updated.', 'event_espresso' ) : FALSE;
862
+		$errors = ! $success ? __('An error occurred. The price order was not updated.', 'event_espresso') : FALSE;
863 863
 
864
-		echo json_encode( array( 'return_data' => FALSE, 'success' => $success, 'errors' => $errors ));
864
+		echo json_encode(array('return_data' => FALSE, 'success' => $success, 'errors' => $errors));
865 865
 		die();
866 866
 	}
867 867
 
@@ -904,46 +904,46 @@  discard block
 block discarded – undo
904 904
 	* 	@param  boolean $trashed   whether the current view is of the trash can - eww yuck!
905 905
 	* 	@return mixed (int|array)  int = count || array of price objects
906 906
 	*/
907
-	public function get_price_types_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) {
907
+	public function get_price_types_overview_data($per_page = 10, $count = FALSE, $trashed = FALSE) {
908 908
 
909
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
909
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
910 910
 		// start with an empty array
911 911
 
912
-		require_once( PRICING_ADMIN . 'Price_Types_List_Table.class.php' );
913
-		require_once( EE_MODELS . 'EEM_Price_Type.model.php' );
912
+		require_once(PRICING_ADMIN.'Price_Types_List_Table.class.php');
913
+		require_once(EE_MODELS.'EEM_Price_Type.model.php');
914 914
 
915 915
 		$this->_req_data['orderby'] = empty($this->_req_data['orderby']) ? '' : $this->_req_data['orderby'];
916
-		$order = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
916
+		$order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
917 917
 		switch ($this->_req_data['orderby']) {
918 918
 			case 'name':
919
-				$orderby = array( 'PRT_name' => $order);
919
+				$orderby = array('PRT_name' => $order);
920 920
 				break;
921 921
 			default:
922
-				$orderby = array( 'PRT_order' => $order);
922
+				$orderby = array('PRT_order' => $order);
923 923
 		}
924 924
 
925 925
 
926
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
927
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
926
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
927
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
928 928
 
929
-		$offset = ($current_page-1)*$per_page;
930
-		$limit = array( $offset, $per_page );
929
+		$offset = ($current_page - 1) * $per_page;
930
+		$limit = array($offset, $per_page);
931 931
 
932
-		$_where = array('PRT_deleted'=>$trashed, 'PBT_ID' => array('!=', 1 ) );
932
+		$_where = array('PRT_deleted'=>$trashed, 'PBT_ID' => array('!=', 1));
933 933
 
934
-		if ( isset( $this->_req_data['s'] ) ) {
935
-			$sstr = '%' . $this->_req_data['s'] . '%';
934
+		if (isset($this->_req_data['s'])) {
935
+			$sstr = '%'.$this->_req_data['s'].'%';
936 936
 			$_where['OR'] = array(
937
-				'PRT_name' => array( 'LIKE', $sstr )
937
+				'PRT_name' => array('LIKE', $sstr)
938 938
 				);
939 939
 		}
940 940
 		$query_params = array(
941 941
 			$_where,
942 942
 			'order_by'=>$orderby,
943 943
 			'limit'=>$limit);
944
-		if($count){
944
+		if ($count) {
945 945
 			return EEM_Price_Type::instance()->count_deleted_and_undeleted($query_params);
946
-		}else{
946
+		} else {
947 947
 			return EEM_Price_Type::instance()->get_all_deleted_and_undeleted($query_params);
948 948
 		}
949 949
 
@@ -963,25 +963,25 @@  discard block
 block discarded – undo
963 963
 	*/
964 964
 	protected function _edit_price_type_details() {
965 965
 
966
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
966
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
967 967
 
968 968
 
969 969
 		// grab price type ID
970
-		$PRT_ID = isset( $this->_req_data['id'] ) && ! empty( $this->_req_data['id'] ) ? absint( $this->_req_data['id'] ) : FALSE;
970
+		$PRT_ID = isset($this->_req_data['id']) && ! empty($this->_req_data['id']) ? absint($this->_req_data['id']) : FALSE;
971 971
 		// change page title based on request action
972
-		$this->_admin_page_title = ucwords( str_replace( '_', ' ', $this->_req_action ));
972
+		$this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action));
973 973
 		// add PRT_ID to title if editing
974
-		$this->_admin_page_title = $PRT_ID ? $this->_admin_page_title . ' # ' . $PRT_ID : $this->_admin_page_title;
974
+		$this->_admin_page_title = $PRT_ID ? $this->_admin_page_title.' # '.$PRT_ID : $this->_admin_page_title;
975 975
 
976 976
 //		require_once(EE_MODELS . 'EEM_Price_Type.model.php');
977 977
 
978
-		if ( $PRT_ID ) {
979
-			$price_type = EEM_Price_Type::instance()->get_one_by_ID( $PRT_ID );
980
-			$additional_hidden_fields = array( 'PRT_ID' => array( 'type' => 'hidden', 'value' => $PRT_ID ));
981
-			$this->_set_add_edit_form_tags( 'update_price_type', $additional_hidden_fields );
978
+		if ($PRT_ID) {
979
+			$price_type = EEM_Price_Type::instance()->get_one_by_ID($PRT_ID);
980
+			$additional_hidden_fields = array('PRT_ID' => array('type' => 'hidden', 'value' => $PRT_ID));
981
+			$this->_set_add_edit_form_tags('update_price_type', $additional_hidden_fields);
982 982
 		} else {
983 983
 			$price_type = EEM_Price_Type::instance()->get_new_price_type();
984
-			$this->_set_add_edit_form_tags( 'insert_price_type' );
984
+			$this->_set_add_edit_form_tags('insert_price_type');
985 985
 		}
986 986
 
987 987
 		$this->_template_args['PRT_ID'] = $PRT_ID;
@@ -990,19 +990,19 @@  discard block
 block discarded – undo
990 990
 
991 991
 		$base_types = EEM_Price_Type::instance()->get_base_types();
992 992
 		$select_values = array();
993
-		foreach ( $base_types as $ref => $text ) {
994
-			if ( $ref == EEM_Price_Type::base_type_base_price ) {
993
+		foreach ($base_types as $ref => $text) {
994
+			if ($ref == EEM_Price_Type::base_type_base_price) {
995 995
 				//do not allow creation of base_type_base_prices because that's a system only base type.
996 996
 				continue;
997 997
 			}
998
-			$values[] = array( 'id' => $ref, 'text' => $text );
998
+			$values[] = array('id' => $ref, 'text' => $text);
999 999
 		}
1000 1000
 
1001 1001
 
1002 1002
 		$this->_template_args['base_type_select'] = EEH_Form_Fields::select_input('base_type', $values, $price_type->base_type(), 'id="price-type-base-type-slct"');
1003 1003
 		$this->_template_args['learn_more_about_pricing_link'] = $this->_learn_more_about_pricing_link();
1004
-		$redirect_URL = add_query_arg( array( 'action' => 'price_types'), $this->_admin_base_url );
1005
-		$this->_set_publish_post_box_vars( 'id', $PRT_ID, FALSE, $redirect_URL );
1004
+		$redirect_URL = add_query_arg(array('action' => 'price_types'), $this->_admin_base_url);
1005
+		$this->_set_publish_post_box_vars('id', $PRT_ID, FALSE, $redirect_URL);
1006 1006
 		// the details template wrapper
1007 1007
 		$this->display_admin_page_with_sidebar();
1008 1008
 
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
 	*		@return void
1020 1020
 	*/
1021 1021
 	protected function _price_type_details_meta_boxes() {
1022
-		add_meta_box( 'edit-price-details-mbox', __( 'Price Type Details', 'event_espresso' ), array( $this, '_edit_price_type_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1022
+		add_meta_box('edit-price-details-mbox', __('Price Type Details', 'event_espresso'), array($this, '_edit_price_type_details_meta_box'), $this->wp_page_slug, 'normal', 'high');
1023 1023
 	}
1024 1024
 
1025 1025
 
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
 	*		@return void
1033 1033
 	*/
1034 1034
 	public function _edit_price_type_details_meta_box() {
1035
-		echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_type_details_main_meta_box.template.php', $this->_template_args, TRUE );
1035
+		echo EEH_Template::display_template(PRICING_TEMPLATE_PATH.'pricing_type_details_main_meta_box.template.php', $this->_template_args, TRUE);
1036 1036
 	}
1037 1037
 
1038 1038
 
@@ -1045,9 +1045,9 @@  discard block
 block discarded – undo
1045 1045
 	*/
1046 1046
 	protected function set_price_type_column_values() {
1047 1047
 
1048
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1048
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1049 1049
 
1050
-		$base_type = !empty( $this->_req_data['base_type'] ) ? $this->_req_data['base_type'] : EEM_Price_Type::base_type_base_price;
1050
+		$base_type = ! empty($this->_req_data['base_type']) ? $this->_req_data['base_type'] : EEM_Price_Type::base_type_base_price;
1051 1051
 
1052 1052
 		switch ($base_type) {
1053 1053
 
@@ -1094,12 +1094,12 @@  discard block
 block discarded – undo
1094 1094
 	*		@access protected
1095 1095
 	*		@return void
1096 1096
 	*/
1097
-	protected function _insert_or_update_price_type( $new_price_type = FALSE ) {
1097
+	protected function _insert_or_update_price_type($new_price_type = FALSE) {
1098 1098
 
1099 1099
 //		echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
1100
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1100
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1101 1101
 
1102
-		require_once(EE_MODELS . 'EEM_Price_Type.model.php');
1102
+		require_once(EE_MODELS.'EEM_Price_Type.model.php');
1103 1103
 		$PRT = EEM_Price_Type::instance();
1104 1104
 
1105 1105
 		// why be so pessimistic ???  : (
@@ -1107,24 +1107,24 @@  discard block
 block discarded – undo
1107 1107
 
1108 1108
 		$set_column_values = $this->set_price_type_column_values();
1109 1109
 		// is this a new Price ?
1110
-		if ( $new_price_type ) {
1110
+		if ($new_price_type) {
1111 1111
 			// run the insert
1112
-			if ( $PRT_ID = $PRT->insert( $set_column_values )) {
1112
+			if ($PRT_ID = $PRT->insert($set_column_values)) {
1113 1113
 				$success = 1;
1114 1114
 			}
1115 1115
 			$action_desc = 'created';
1116 1116
 		} else {
1117 1117
 			$PRT_ID = absint($this->_req_data['PRT_ID']);
1118 1118
 			// run the update
1119
-			$where_cols_n_values = array('PRT_ID' => $PRT_ID );
1120
-			if ( $PRT->update( $set_column_values, array( $where_cols_n_values ))) {
1119
+			$where_cols_n_values = array('PRT_ID' => $PRT_ID);
1120
+			if ($PRT->update($set_column_values, array($where_cols_n_values))) {
1121 1121
 				$success = 1;
1122 1122
 			}
1123 1123
 			$action_desc = 'updated';
1124 1124
 		}
1125 1125
 
1126
-		$query_args = array( 'action'=> 'edit_price_type', 'id' => $PRT_ID );
1127
-		$this->_redirect_after_action( $success, 'Price Type', $action_desc, $query_args );
1126
+		$query_args = array('action'=> 'edit_price_type', 'id' => $PRT_ID);
1127
+		$this->_redirect_after_action($success, 'Price Type', $action_desc, $query_args);
1128 1128
 
1129 1129
 	}
1130 1130
 
@@ -1138,49 +1138,49 @@  discard block
 block discarded – undo
1138 1138
 	*		@access protected
1139 1139
 	*		@return void
1140 1140
 	*/
1141
-	protected function _trash_or_restore_price_type( $trash = TRUE ) {
1141
+	protected function _trash_or_restore_price_type($trash = TRUE) {
1142 1142
 
1143 1143
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
1144
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1144
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1145 1145
 
1146
-		require_once(EE_MODELS . 'EEM_Price_Type.model.php');
1146
+		require_once(EE_MODELS.'EEM_Price_Type.model.php');
1147 1147
 		$PRT = EEM_Price_Type::instance();
1148 1148
 
1149 1149
 		$success = 1;
1150 1150
 		$PRT_deleted = $trash ? TRUE : FALSE;
1151 1151
 		//Checkboxes
1152
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1152
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1153 1153
 			// if array has more than one element than success message should be plural
1154
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
1155
-			$what = count( $this->_req_data['checkbox'] ) > 1 ? 'Price Types' : 'Price Type';
1154
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1155
+			$what = count($this->_req_data['checkbox']) > 1 ? 'Price Types' : 'Price Type';
1156 1156
 			// cycle thru checkboxes
1157
-			while (list( $PRT_ID, $value ) = each($this->_req_data['checkbox'])) {
1158
-				if ( ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID ) ) {
1157
+			while (list($PRT_ID, $value) = each($this->_req_data['checkbox'])) {
1158
+				if ( ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID)) {
1159 1159
 					$success = 0;
1160 1160
 				}
1161 1161
 			}
1162 1162
 
1163 1163
 		} else {
1164 1164
 			// grab single id and delete
1165
-			$PRT_ID = isset( $this->_req_data['id'] ) ? absint($this->_req_data['id']) : 0;
1166
-			if ( empty( $PRT_ID ) || ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID )) {
1165
+			$PRT_ID = isset($this->_req_data['id']) ? absint($this->_req_data['id']) : 0;
1166
+			if (empty($PRT_ID) || ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID)) {
1167 1167
 				$success = 0;
1168 1168
 			}
1169 1169
 			$what = 'Price Type';
1170 1170
 
1171 1171
 		}
1172 1172
 
1173
-		$query_args = array( 'action' => 'price_types' );
1174
-		if ( $success ) {
1175
-			if ( $trash ) {
1173
+		$query_args = array('action' => 'price_types');
1174
+		if ($success) {
1175
+			if ($trash) {
1176 1176
 				$msg = $success > 1 ? __('The Price Types have been trashed.', 'event_espresso') : __('The Price Type has been trashed.', 'event_espresso');
1177 1177
 			} else {
1178 1178
 				$msg = $success > 1 ? __('The Price Types have been restored.', 'event_espresso') : __('The Price Type has been restored.', 'event_espresso');
1179 1179
 			}
1180
-			EE_Error::add_success( $msg );
1180
+			EE_Error::add_success($msg);
1181 1181
 		}
1182 1182
 
1183
-		$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
1183
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
1184 1184
 
1185 1185
 	}
1186 1186
 
@@ -1197,19 +1197,19 @@  discard block
 block discarded – undo
1197 1197
 	protected function _delete_price_type() {
1198 1198
 
1199 1199
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
1200
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1200
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1201 1201
 
1202 1202
 		$PRT = EEM_Price_Type::instance();
1203 1203
 
1204 1204
 		$success = 1;
1205 1205
 		//Checkboxes
1206
-		if (!empty($this->_req_data['checkbox'])) {
1206
+		if ( ! empty($this->_req_data['checkbox'])) {
1207 1207
 			// if array has more than one element than success message should be plural
1208
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
1208
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1209 1209
 			$what = $PRT->item_name($success);
1210 1210
 			// cycle thru bulk action checkboxes
1211
-			while (list( $PRT_ID, $value ) = each($this->_req_data['checkbox'])) {
1212
-				if (!$PRT->delete_permanently_by_ID($PRT_ID) ) {
1211
+			while (list($PRT_ID, $value) = each($this->_req_data['checkbox'])) {
1212
+				if ( ! $PRT->delete_permanently_by_ID($PRT_ID)) {
1213 1213
 					$success = 0;
1214 1214
 				}
1215 1215
 			}
@@ -1217,8 +1217,8 @@  discard block
 block discarded – undo
1217 1217
 		}
1218 1218
 
1219 1219
 
1220
-		$query_args = array( 'action'=> 'price_types' );
1221
-		$this->_redirect_after_action( $success, $what, 'deleted', $query_args );
1220
+		$query_args = array('action'=> 'price_types');
1221
+		$this->_redirect_after_action($success, $what, 'deleted', $query_args);
1222 1222
 
1223 1223
 	}
1224 1224
 
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
 	*		@return string
1235 1235
 	*/
1236 1236
 	protected function _learn_more_about_pricing_link() {
1237
-		return '<a class="hidden" style="margin:0 20px; cursor:pointer; font-size:12px;" >' . __('learn more about how pricing works', 'event_espresso') . '</a>';
1237
+		return '<a class="hidden" style="margin:0 20px; cursor:pointer; font-size:12px;" >'.__('learn more about how pricing works', 'event_espresso').'</a>';
1238 1238
 	}
1239 1239
 
1240 1240
 
Please login to merge, or discard this patch.
caffeinated/admin/new/pricing/Pricing_Admin_Page_Init.core.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 *
24 24
 * ------------------------------------------------------------------------
25 25
 */
26
-class Pricing_Admin_Page_Init extends EE_Admin_Page_Init  {
26
+class Pricing_Admin_Page_Init extends EE_Admin_Page_Init {
27 27
 
28 28
 
29 29
 
@@ -36,20 +36,20 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	public function __construct() {
38 38
 
39
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
39
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
40 40
 
41
-		define( 'PRICING_PG_SLUG', 'pricing' );
42
-		define( 'PRICING_LABEL', __('Pricing', 'event_espresso'));
43
-		define( 'PRICING_PG_NAME', ucwords( str_replace( '_', '', PRICING_PG_SLUG )));
44
-		define( 'PRICING_ADMIN', EE_CORE_CAF_ADMIN . 'new' . DS . PRICING_PG_SLUG . DS );
45
-		define( 'PRICING_ADMIN_URL', admin_url( 'admin.php?page=' . PRICING_PG_SLUG ));
46
-		define( 'PRICING_ASSETS_PATH', PRICING_ADMIN . 'assets' . DS );
47
-		define( 'PRICING_ASSETS_URL', EE_CORE_CAF_ADMIN_URL . 'new' . DS . PRICING_PG_SLUG .'/assets/' );
48
-		define( 'PRICING_TEMPLATE_PATH', PRICING_ADMIN . 'templates' . DS );
49
-		define( 'PRICING_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL . 'new' . DS . PRICING_PG_SLUG . DS . 'templates/' );
41
+		define('PRICING_PG_SLUG', 'pricing');
42
+		define('PRICING_LABEL', __('Pricing', 'event_espresso'));
43
+		define('PRICING_PG_NAME', ucwords(str_replace('_', '', PRICING_PG_SLUG)));
44
+		define('PRICING_ADMIN', EE_CORE_CAF_ADMIN.'new'.DS.PRICING_PG_SLUG.DS);
45
+		define('PRICING_ADMIN_URL', admin_url('admin.php?page='.PRICING_PG_SLUG));
46
+		define('PRICING_ASSETS_PATH', PRICING_ADMIN.'assets'.DS);
47
+		define('PRICING_ASSETS_URL', EE_CORE_CAF_ADMIN_URL.'new'.DS.PRICING_PG_SLUG.'/assets/');
48
+		define('PRICING_TEMPLATE_PATH', PRICING_ADMIN.'templates'.DS);
49
+		define('PRICING_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL.'new'.DS.PRICING_PG_SLUG.DS.'templates/');
50 50
 
51 51
 		parent::__construct();
52
-		$this->_folder_path = EE_CORE_CAF_ADMIN . 'new' . DS . $this->_folder_name . DS;
52
+		$this->_folder_path = EE_CORE_CAF_ADMIN.'new'.DS.$this->_folder_name.DS;
53 53
 
54 54
 	}
55 55
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 
66 66
 	protected function _set_menu_map() {
67
-		$this->_menu_map = new EE_Admin_Page_Sub_Menu( array(
67
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(array(
68 68
 			'menu_group' => 'management',
69 69
 			'menu_order' => 20,
70 70
 			'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
new/pricing/help_tours/Pricing_Add_New_Default_Price_Help_Tour.class.php 2 patches
Spacing   +7 added lines, -7 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
 /**
@@ -78,25 +78,25 @@  discard block
 block discarded – undo
78 78
 
79 79
 
80 80
 	protected function _start() {
81
-		$content = '<h3>' . __('Add New Default Price', 'event_espresso') . '</h3>';
82
-		$content .= '<p>' . __('This tour of the add new default price page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
81
+		$content = '<h3>'.__('Add New Default Price', 'event_espresso').'</h3>';
82
+		$content .= '<p>'.__('This tour of the add new default price page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
83 83
 		return $content;
84 84
 	}
85 85
 
86 86
 	protected function _price_type_stop() {
87
-		return '<p>' . __('Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', 'event_espresso') . '</p>';
87
+		return '<p>'.__('Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', 'event_espresso').'</p>';
88 88
 	}
89 89
 
90 90
 	protected function _price_name_stop() {
91
-		return '<p>' . __('The name of the price, discount, tax, or surcharge that will be seen by your customers.', 'event_espresso') . '</p>';
91
+		return '<p>'.__('The name of the price, discount, tax, or surcharge that will be seen by your customers.', 'event_espresso').'</p>';
92 92
 	}
93 93
 
94 94
 	protected function _price_description_stop() {
95
-		return '<p>' . __('View the price type (price, discount, tax or surcharge) description.', 'event_espresso') . '</p>';
95
+		return '<p>'.__('View the price type (price, discount, tax or surcharge) description.', 'event_espresso').'</p>';
96 96
 	}
97 97
 
98 98
 	protected function _price_amount_stop() {
99
-		return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>';
99
+		return '<p>'.__('The ticket amount before any deductions.', 'event_espresso').'</p>';
100 100
 	}
101 101
 
102 102
 }
103 103
\ 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
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.