Completed
Branch FET-8365-add-indexes (4b9253)
by
unknown
527:08 queued 512:28
created
admin/extend/registration_form/Extend_Registration_Form_Admin_Page.core.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -235,13 +235,13 @@  discard block
 block discarded – undo
235 235
 					'persistent' => FALSE
236 236
 					),
237 237
 				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ),
238
-                'help_tabs' => array(
238
+				'help_tabs' => array(
239 239
 					'registration_form_add_question_help_tab' => array(
240 240
 						'title' => __('Add Question', 'event_espresso'),
241 241
 						'filename' => 'registration_form_add_question'
242 242
 						),
243 243
 					),
244
-                'help_tour' => array( 'Registration_Form_Add_Question_Help_Tour'),
244
+				'help_tour' => array( 'Registration_Form_Add_Question_Help_Tour'),
245 245
 				'require_nonce' => FALSE
246 246
 				),
247 247
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 						'filename' => 'registration_form_add_question_group'
259 259
 						),
260 260
 					),
261
-                'help_tour' => array( 'Registration_Form_Add_Question_Group_Help_Tour'),
261
+				'help_tour' => array( 'Registration_Form_Add_Question_Group_Help_Tour'),
262 262
 				'require_nonce' => FALSE
263 263
 				),
264 264
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 						'filename' => 'registration_form_edit_question_group'
277 277
 						),
278 278
 					),
279
-                'help_tour' => array( 'Registration_Form_Edit_Question_Group_Help_Tour'),
279
+				'help_tour' => array( 'Registration_Form_Edit_Question_Group_Help_Tour'),
280 280
 				'require_nonce' => FALSE
281 281
 				),
282 282
 
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 						'filename' => 'registration_form_reg_form_settings'
296 296
 						),
297 297
 					),
298
-                'help_tour' => array( 'Registration_Form_Settings_Help_Tour'),
298
+				'help_tour' => array( 'Registration_Form_Settings_Help_Tour'),
299 299
 				'require_nonce' => FALSE
300 300
 				)
301 301
 
Please login to merge, or discard this patch.
Spacing   +144 added lines, -144 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
 /**
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 
31 31
 
32 32
 
33
-	public function __construct( $routing = TRUE ) {
34
-		define( 'REGISTRATION_FORM_CAF_ADMIN', EE_CORE_CAF_ADMIN_EXTEND . 'registration_form' . DS );
35
-		define( 'REGISTRATION_FORM_CAF_ASSETS_PATH', REGISTRATION_FORM_CAF_ADMIN . 'assets' . DS );
36
-		define( 'REGISTRATION_FORM_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registration_form/assets/' );
37
-		define( 'REGISTRATION_FORM_CAF_TEMPLATE_PATH', REGISTRATION_FORM_CAF_ADMIN . 'templates' . DS );
38
-		define( 'REGISTRATION_FORM_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registration_form/templates/' );
39
-		parent::__construct( $routing );
33
+	public function __construct($routing = TRUE) {
34
+		define('REGISTRATION_FORM_CAF_ADMIN', EE_CORE_CAF_ADMIN_EXTEND.'registration_form'.DS);
35
+		define('REGISTRATION_FORM_CAF_ASSETS_PATH', REGISTRATION_FORM_CAF_ADMIN.'assets'.DS);
36
+		define('REGISTRATION_FORM_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'registration_form/assets/');
37
+		define('REGISTRATION_FORM_CAF_TEMPLATE_PATH', REGISTRATION_FORM_CAF_ADMIN.'templates'.DS);
38
+		define('REGISTRATION_FORM_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'registration_form/templates/');
39
+		parent::__construct($routing);
40 40
 	}
41 41
 
42 42
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 
47 47
 	protected function _extend_page_config() {
48 48
 		$this->_admin_base_path = REGISTRATION_FORM_CAF_ADMIN;
49
-		$qst_id = ! empty( $this->_req_data['QST_ID'] ) && ! is_array( $this->_req_data['QST_ID'] ) ? $this->_req_data['QST_ID'] : 0;
50
-		$qsg_id = ! empty( $this->_req_data['QSG_ID'] ) && ! is_array( $this->_req_data['QSG_ID'] ) ? $this->_req_data['QSG_ID'] : 0;
49
+		$qst_id = ! empty($this->_req_data['QST_ID']) && ! is_array($this->_req_data['QST_ID']) ? $this->_req_data['QST_ID'] : 0;
50
+		$qsg_id = ! empty($this->_req_data['QSG_ID']) && ! is_array($this->_req_data['QSG_ID']) ? $this->_req_data['QSG_ID'] : 0;
51 51
 
52 52
 		$new_page_routes = array(
53 53
 			'question_groups' => array(
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 				'func' => '_trash_or_restore_questions',
77 77
 				'capability' => 'ee_delete_question',
78 78
 				'obj_id' => $qst_id,
79
-				'args' => array( 'trash' => FALSE ),
79
+				'args' => array('trash' => FALSE),
80 80
 				'noheader' => TRUE
81 81
 				),
82 82
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
 			'trash_question_group' => array(
137 137
 				'func' => '_trash_or_restore_question_groups',
138
-				'args' => array( 'trash' => TRUE ),
138
+				'args' => array('trash' => TRUE),
139 139
 				'capability' => 'ee_delete_question_group',
140 140
 				'obj_id' => $qsg_id,
141 141
 				'noheader' => TRUE
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 
144 144
 			'restore_question_group' => array(
145 145
 				'func' => '_trash_or_restore_question_groups',
146
-				'args' => array( 'trash' => FALSE ),
146
+				'args' => array('trash' => FALSE),
147 147
 				'capability' => 'ee_delete_question_group',
148 148
 				'obj_id' => $qsg_id,
149 149
 				'noheader' => TRUE
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
 			'update_question_group' => array(
160 160
 				'func' => '_insert_or_update_question_group',
161
-				'args' => array('new_question_group' => FALSE ),
161
+				'args' => array('new_question_group' => FALSE),
162 162
 				'capability' => 'ee_edit_question_group',
163 163
 				'obj_id' => $qsg_id,
164 164
 				'noheader' => TRUE,
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 					'noheader' => TRUE
197 197
 				),
198 198
 			);
199
-		$this->_page_routes = array_merge( $this->_page_routes, $new_page_routes );
199
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
200 200
 
201 201
 		$new_page_config = array(
202 202
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 						'filename' => 'registration_form_question_groups_views_bulk_actions_search'
221 221
 						),
222 222
 					),
223
-				'help_tour' => array( 'Registration_Form_Question_Groups_Help_Tour'),
223
+				'help_tour' => array('Registration_Form_Question_Groups_Help_Tour'),
224 224
 				'metaboxes' => $this->_default_espresso_metaboxes,
225 225
 				'require_nonce' => FALSE,
226 226
 				'qtips' => array(
@@ -234,14 +234,14 @@  discard block
 block discarded – undo
234 234
 					'order' => 5,
235 235
 					'persistent' => FALSE
236 236
 					),
237
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ),
237
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
238 238
                 'help_tabs' => array(
239 239
 					'registration_form_add_question_help_tab' => array(
240 240
 						'title' => __('Add Question', 'event_espresso'),
241 241
 						'filename' => 'registration_form_add_question'
242 242
 						),
243 243
 					),
244
-                'help_tour' => array( 'Registration_Form_Add_Question_Help_Tour'),
244
+                'help_tour' => array('Registration_Form_Add_Question_Help_Tour'),
245 245
 				'require_nonce' => FALSE
246 246
 				),
247 247
 
@@ -251,14 +251,14 @@  discard block
 block discarded – undo
251 251
 					'order' => 5,
252 252
 					'persistent' => FALSE
253 253
 					),
254
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ),
254
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
255 255
 				'help_tabs' => array(
256 256
 					'registration_form_add_question_group_help_tab' => array(
257 257
 						'title' => __('Add Question Group', 'event_espresso'),
258 258
 						'filename' => 'registration_form_add_question_group'
259 259
 						),
260 260
 					),
261
-                'help_tour' => array( 'Registration_Form_Add_Question_Group_Help_Tour'),
261
+                'help_tour' => array('Registration_Form_Add_Question_Group_Help_Tour'),
262 262
 				'require_nonce' => FALSE
263 263
 				),
264 264
 
@@ -267,16 +267,16 @@  discard block
 block discarded – undo
267 267
 					'label' => __('Edit Question Group', 'event_espresso'),
268 268
 					'order' => 5,
269 269
 					'persistent' => FALSE,
270
-					'url' => isset($this->_req_data['question_group_id']) ? add_query_arg(array('question_group_id' => $this->_req_data['question_group_id'] ), $this->_current_page_view_url )  : $this->_admin_base_url
270
+					'url' => isset($this->_req_data['question_group_id']) ? add_query_arg(array('question_group_id' => $this->_req_data['question_group_id']), $this->_current_page_view_url) : $this->_admin_base_url
271 271
 					),
272
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ),
272
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
273 273
 				'help_tabs' => array(
274 274
 					'registration_form_edit_question_group_help_tab' => array(
275 275
 						'title' => __('Edit Question Group', 'event_espresso'),
276 276
 						'filename' => 'registration_form_edit_question_group'
277 277
 						),
278 278
 					),
279
-                'help_tour' => array( 'Registration_Form_Edit_Question_Group_Help_Tour'),
279
+                'help_tour' => array('Registration_Form_Edit_Question_Group_Help_Tour'),
280 280
 				'require_nonce' => FALSE
281 281
 				),
282 282
 
@@ -288,19 +288,19 @@  discard block
 block discarded – undo
288 288
 				'labels' => array(
289 289
 					'publishbox' => __('Update Settings', 'event_espresso')
290 290
 					),
291
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ),
291
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
292 292
 				'help_tabs' => array(
293 293
 					'registration_form_reg_form_settings_help_tab' => array(
294 294
 						'title' => __('Registration Form Settings', 'event_espresso'),
295 295
 						'filename' => 'registration_form_reg_form_settings'
296 296
 						),
297 297
 					),
298
-                'help_tour' => array( 'Registration_Form_Settings_Help_Tour'),
298
+                'help_tour' => array('Registration_Form_Settings_Help_Tour'),
299 299
 				'require_nonce' => FALSE
300 300
 				)
301 301
 
302 302
 			);
303
-		$this->_page_config = array_merge( $this->_page_config, $new_page_config );
303
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
304 304
 
305 305
 		//change the list table we're going to use so it's the NEW list table!
306 306
 		$this->_page_config['default']['list_table'] = 'Extend_Registration_Form_Questions_Admin_List_Table';
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 			'edit_question_group' => __('Edit Question Group', 'event_espresso'),
315 315
 			'delete_question_group' => __('Delete Question Group', 'event_espresso'),
316 316
 			);
317
-		$this->_labels['buttons'] = array_merge( $this->_labels['buttons'], $new_labels );
317
+		$this->_labels['buttons'] = array_merge($this->_labels['buttons'], $new_labels);
318 318
 
319 319
 	}
320 320
 
@@ -323,14 +323,14 @@  discard block
 block discarded – undo
323 323
 
324 324
 
325 325
 	protected function _ajax_hooks() {
326
-		add_action('wp_ajax_espresso_update_question_group_order', array( $this, 'update_question_group_order' ));
326
+		add_action('wp_ajax_espresso_update_question_group_order', array($this, 'update_question_group_order'));
327 327
 	}
328 328
 
329 329
 
330 330
 
331 331
 
332 332
 	public function load_scripts_styles_question_groups() {
333
-		wp_enqueue_script( 'espresso_ajax_table_sorting' );
333
+		wp_enqueue_script('espresso_ajax_table_sorting');
334 334
 	}
335 335
 
336 336
 
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 	 * @return void
352 352
 	 */
353 353
 	public function load_sortable_question_script() {
354
-		wp_register_script('ee-question-sortable', REGISTRATION_FORM_CAF_ASSETS_URL . 'ee_question_order.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, true);
354
+		wp_register_script('ee-question-sortable', REGISTRATION_FORM_CAF_ASSETS_URL.'ee_question_order.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, true);
355 355
 		wp_enqueue_script('ee-question-sortable');
356 356
 	}
357 357
 
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 				)
371 371
 		);
372 372
 
373
-		if ( EE_Registry::instance()->CAP->current_user_can('ee_delete_questions', 'espresso_registration_form_trash_questions' ) ) {
373
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_questions', 'espresso_registration_form_trash_questions')) {
374 374
 			$this->_views['trash'] = array(
375 375
 				'slug' => 'trash',
376 376
 				'label' => __('Trash', 'event_espresso'),
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 				)
401 401
 		);
402 402
 
403
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_groups', 'espresso_registration_form_trash_question_groups' ) ) {
403
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question_groups', 'espresso_registration_form_trash_question_groups')) {
404 404
 			$this->_views['trash'] = array(
405 405
 				'slug' => 'trash',
406 406
 				'label' => __('Trash', 'event_espresso'),
@@ -436,16 +436,16 @@  discard block
 block discarded – undo
436 436
 
437 437
 
438 438
 
439
-	protected function _delete_question(){
440
-		$success=$this->_question_model->delete_permanently_by_ID(intval($this->_req_data['QST_ID']));
441
-		$query_args=array('action'=>'default','status'=>'all');
439
+	protected function _delete_question() {
440
+		$success = $this->_question_model->delete_permanently_by_ID(intval($this->_req_data['QST_ID']));
441
+		$query_args = array('action'=>'default', 'status'=>'all');
442 442
 		$this->_redirect_after_action($success, $this->_question_model->item_name($success), 'deleted', $query_args);
443 443
 	}
444 444
 
445 445
 
446 446
 	protected function _delete_questions() {
447 447
 		$success = $this->_delete_items($this->_question_model);
448
-		$this->_redirect_after_action( $success, $this->_question_model->item_name($success), 'deleted permanently', array( 'action'=>'default', 'status'=>'trash' ));
448
+		$this->_redirect_after_action($success, $this->_question_model->item_name($success), 'deleted permanently', array('action'=>'default', 'status'=>'trash'));
449 449
 	}
450 450
 
451 451
 
@@ -454,27 +454,27 @@  discard block
 block discarded – undo
454 454
  * @param EEM_Base $model
455 455
  * @return int number of items deleted permanenetly
456 456
  */
457
-	private function _delete_items(EEM_Soft_Delete_Base $model){
457
+	private function _delete_items(EEM_Soft_Delete_Base $model) {
458 458
 		$success = 0;
459
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
460
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
459
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
460
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
461 461
 			// if array has more than one element than success message should be plural
462
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
462
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
463 463
 			// cycle thru bulk action checkboxes
464
-			while (list( $ID, $value ) = each($this->_req_data['checkbox'])) {
464
+			while (list($ID, $value) = each($this->_req_data['checkbox'])) {
465 465
 
466
-				if (!$model->delete_permanently_by_ID(absint($ID))) {
466
+				if ( ! $model->delete_permanently_by_ID(absint($ID))) {
467 467
 					$success = 0;
468 468
 				}
469 469
 			}
470 470
 
471
-		}elseif( !empty($this->_req_data['QSG_ID'])){
471
+		}elseif ( ! empty($this->_req_data['QSG_ID'])) {
472 472
 			$success = $model->delete_permanently_by_ID($this->_req_data['QSG_ID']);
473 473
 
474
-		}elseif( !empty($this->_req_data['QST_ID'])){
474
+		}elseif ( ! empty($this->_req_data['QST_ID'])) {
475 475
 			$success = $model->delete_permanently_by_ID($this->_req_data['QST_ID']);
476
-		}else{
477
-			EE_Error::add_error( sprintf(__("No Questions or Question Groups were selected for deleting. This error usually shows when you've attempted to delete via bulk action but there were no selections.", "event_espresso")), __FILE__, __FUNCTION__, __LINE__ );
476
+		} else {
477
+			EE_Error::add_error(sprintf(__("No Questions or Question Groups were selected for deleting. This error usually shows when you've attempted to delete via bulk action but there were no selections.", "event_espresso")), __FILE__, __FUNCTION__, __LINE__);
478 478
 		}
479 479
 		return $success;
480 480
 	}
@@ -488,29 +488,29 @@  discard block
 block discarded – undo
488 488
 
489 489
 
490 490
 
491
-	protected function _edit_question_group( $type = 'add' ) {
492
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
493
-		$ID=isset( $this->_req_data['QSG_ID'] ) && ! empty( $this->_req_data['QSG_ID'] ) ? absint( $this->_req_data['QSG_ID'] ) : FALSE;
494
-		$this->_admin_page_title = ucwords( str_replace( '_', ' ', $this->_req_action ));
491
+	protected function _edit_question_group($type = 'add') {
492
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
493
+		$ID = isset($this->_req_data['QSG_ID']) && ! empty($this->_req_data['QSG_ID']) ? absint($this->_req_data['QSG_ID']) : FALSE;
494
+		$this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action));
495 495
 		// add ID to title if editing
496
-		$this->_admin_page_title = $ID ? $this->_admin_page_title . ' # ' . $ID : $this->_admin_page_title;
497
-		if($ID){
498
-			$questionGroup=$this->_question_group_model->get_one_by_ID($ID);
499
-			$additional_hidden_fields=array('QSG_ID'=>array('type'=>'hidden','value'=>$ID));
496
+		$this->_admin_page_title = $ID ? $this->_admin_page_title.' # '.$ID : $this->_admin_page_title;
497
+		if ($ID) {
498
+			$questionGroup = $this->_question_group_model->get_one_by_ID($ID);
499
+			$additional_hidden_fields = array('QSG_ID'=>array('type'=>'hidden', 'value'=>$ID));
500 500
 			$this->_set_add_edit_form_tags('update_question_group', $additional_hidden_fields);
501
-		}else{
501
+		} else {
502 502
 			$questionGroup = EEM_Question_Group::instance()->create_default_object();
503 503
 			$questionGroup->set_order_to_latest();
504 504
 			$this->_set_add_edit_form_tags('insert_question_group');
505 505
 		}
506 506
 		$this->_template_args['values'] = $this->_yes_no_values;
507
-		$this->_template_args['all_questions']=$questionGroup->questions_in_and_not_in_group();
508
-		$this->_template_args['QSG_ID']=$ID ? $ID : TRUE;
509
-		$this->_template_args['question_group']=$questionGroup;
507
+		$this->_template_args['all_questions'] = $questionGroup->questions_in_and_not_in_group();
508
+		$this->_template_args['QSG_ID'] = $ID ? $ID : TRUE;
509
+		$this->_template_args['question_group'] = $questionGroup;
510 510
 
511
-		$redirect_URL = add_query_arg( array( 'action' => 'question_groups'), $this->_admin_base_url );
512
-		$this->_set_publish_post_box_vars( 'id', $ID, FALSE, $redirect_URL  );
513
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( REGISTRATION_FORM_CAF_TEMPLATE_PATH . 'question_groups_main_meta_box.template.php', $this->_template_args, TRUE );
511
+		$redirect_URL = add_query_arg(array('action' => 'question_groups'), $this->_admin_base_url);
512
+		$this->_set_publish_post_box_vars('id', $ID, FALSE, $redirect_URL);
513
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(REGISTRATION_FORM_CAF_TEMPLATE_PATH.'question_groups_main_meta_box.template.php', $this->_template_args, TRUE);
514 514
 
515 515
 		// the details template wrapper
516 516
 		$this->display_admin_page_with_sidebar();
@@ -521,87 +521,87 @@  discard block
 block discarded – undo
521 521
 
522 522
 	protected function _delete_question_groups() {
523 523
 		$success = $this->_delete_items($this->_question_group_model);
524
-		$this->_redirect_after_action( $success, $this->_question_group_model->item_name($success), 'deleted permanently', array( 'action'=>'question_groups', 'status'=>'trash' ));
524
+		$this->_redirect_after_action($success, $this->_question_group_model->item_name($success), 'deleted permanently', array('action'=>'question_groups', 'status'=>'trash'));
525 525
 	}
526 526
 
527 527
 
528 528
 
529
-	protected function _insert_or_update_question_group( $new_question_group = TRUE) {
530
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
531
-		$set_column_values=$this->_set_column_values_for($this->_question_group_model);
532
-		if ( $new_question_group ){
529
+	protected function _insert_or_update_question_group($new_question_group = TRUE) {
530
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
531
+		$set_column_values = $this->_set_column_values_for($this->_question_group_model);
532
+		if ($new_question_group) {
533 533
 			$QSG_ID = $this->_question_group_model->insert($set_column_values);
534 534
 			$success = $QSG_ID ? 1 : 0;
535 535
 		} else {
536 536
 			$QSG_ID = absint($this->_req_data['QSG_ID']);
537
-			unset( $set_column_values[ 'QSG_ID' ] );
538
-			$success= $this->_question_group_model->update( $set_column_values, array( array( 'QSG_ID' => $QSG_ID )));
537
+			unset($set_column_values['QSG_ID']);
538
+			$success = $this->_question_group_model->update($set_column_values, array(array('QSG_ID' => $QSG_ID)));
539 539
 		}
540 540
 		// update the existing related questions
541 541
 		// BUT FIRST...  delete the phone question from the Question_Group_Question if it is being added to this question group (therefore removed from the existing group)
542
-		if ( isset( $this->_req_data['questions'], $this->_req_data['questions'][ EEM_Attendee::phone_question_id ] )) {
542
+		if (isset($this->_req_data['questions'], $this->_req_data['questions'][EEM_Attendee::phone_question_id])) {
543 543
 			// delete where QST ID = system phone question ID and Question Group ID is NOT this group
544
-			EEM_Question_Group_Question::instance()->delete( array( array( 'QST_ID' => EEM_Attendee::phone_question_id, 'QSG_ID' => array( '!=', $QSG_ID ))));
544
+			EEM_Question_Group_Question::instance()->delete(array(array('QST_ID' => EEM_Attendee::phone_question_id, 'QSG_ID' => array('!=', $QSG_ID))));
545 545
 		}
546 546
 		/** @type EE_Question_Group $question_group */
547
-		$question_group=$this->_question_group_model->get_one_by_ID( $QSG_ID );
547
+		$question_group = $this->_question_group_model->get_one_by_ID($QSG_ID);
548 548
 		$questions = $question_group->questions();
549 549
 		// make sure system phone question is added to list of questions for this group
550
-		if ( ! isset( $questions[ EEM_Attendee::phone_question_id ] )) {
551
-			$questions[ EEM_Attendee::phone_question_id ] = EEM_Question::instance()->get_one_by_ID( EEM_Attendee::phone_question_id );
550
+		if ( ! isset($questions[EEM_Attendee::phone_question_id])) {
551
+			$questions[EEM_Attendee::phone_question_id] = EEM_Question::instance()->get_one_by_ID(EEM_Attendee::phone_question_id);
552 552
 		}
553 553
 
554
-		foreach( $questions as $question_ID => $question ){
554
+		foreach ($questions as $question_ID => $question) {
555 555
 			// first we always check for order.
556
-			if ( ! empty( $this->_req_data['question_orders'][ $question_ID ] ) ){
556
+			if ( ! empty($this->_req_data['question_orders'][$question_ID])) {
557 557
 				//update question order
558
-				$question_group->update_question_order( $question_ID, $this->_req_data['question_orders'][ $question_ID ] );
558
+				$question_group->update_question_order($question_ID, $this->_req_data['question_orders'][$question_ID]);
559 559
 			}
560 560
 
561 561
 			// then we always check if adding or removing.
562
-			if ( isset( $this->_req_data['questions'], $this->_req_data['questions'][ $question_ID ] )) {
563
-				$question_group->add_question( $question_ID );
562
+			if (isset($this->_req_data['questions'], $this->_req_data['questions'][$question_ID])) {
563
+				$question_group->add_question($question_ID);
564 564
 			} else {
565 565
 				// not found, remove it (but only if not a system question for the personal group)
566
-				if ( ! ( $question->is_system_question() && $question_group->system_group() === EEM_Question_Group::system_personal )) {
567
-					$question_group->remove_question( $question_ID );
566
+				if ( ! ($question->is_system_question() && $question_group->system_group() === EEM_Question_Group::system_personal)) {
567
+					$question_group->remove_question($question_ID);
568 568
 				}
569 569
 			}
570 570
 		}
571 571
 		// save new related questions
572
-		if ( isset( $this->_req_data['questions'] )) {
573
-			foreach( $this->_req_data['questions'] as $QST_ID ){
574
-				$question_group->add_question( $QST_ID );
575
-				if ( isset( $this->_req_data['question_orders'][ $QST_ID ] )) {
576
-					$question_group->update_question_order( $QST_ID, $this->_req_data['question_orders'][ $QST_ID ] );
572
+		if (isset($this->_req_data['questions'])) {
573
+			foreach ($this->_req_data['questions'] as $QST_ID) {
574
+				$question_group->add_question($QST_ID);
575
+				if (isset($this->_req_data['question_orders'][$QST_ID])) {
576
+					$question_group->update_question_order($QST_ID, $this->_req_data['question_orders'][$QST_ID]);
577 577
 				}
578 578
 			}
579 579
 		}
580 580
 
581
-		if ( $success !== FALSE ) {
582
-			$msg = $new_question_group ? sprintf( __('The %s has been created', 'event_espresso'), $this->_question_group_model->item_name() ) : sprintf( __('The %s has been updated', 'event_espresso' ), $this->_question_group_model->item_name() );
583
-			EE_Error::add_success( $msg );
581
+		if ($success !== FALSE) {
582
+			$msg = $new_question_group ? sprintf(__('The %s has been created', 'event_espresso'), $this->_question_group_model->item_name()) : sprintf(__('The %s has been updated', 'event_espresso'), $this->_question_group_model->item_name());
583
+			EE_Error::add_success($msg);
584 584
 		}
585
-		$this->_redirect_after_action(FALSE, '', '', array('action'=>'edit_question_group','QSG_ID'=>$QSG_ID), TRUE);
585
+		$this->_redirect_after_action(FALSE, '', '', array('action'=>'edit_question_group', 'QSG_ID'=>$QSG_ID), TRUE);
586 586
 
587 587
 	}
588 588
 
589 589
 
590 590
 
591 591
 	protected function _trash_or_restore_question_groups($trash = TRUE) {
592
-		return $this->_trash_or_restore_items( $this->_question_group_model, $trash );
592
+		return $this->_trash_or_restore_items($this->_question_group_model, $trash);
593 593
 	}
594 594
 
595
-	protected function _trash_question(){
596
-		$success=$this->_question_model->delete_by_ID(intval($this->_req_data['QST_ID']));
597
-		$query_args=array('action'=>'default','status'=>'all');
595
+	protected function _trash_question() {
596
+		$success = $this->_question_model->delete_by_ID(intval($this->_req_data['QST_ID']));
597
+		$query_args = array('action'=>'default', 'status'=>'all');
598 598
 		$this->_redirect_after_action($success, $this->_question_model->item_name($success), 'trashed', $query_args);
599 599
 	}
600 600
 
601 601
 
602 602
 
603
-	protected function _trash_or_restore_questions($trash=TRUE){
604
-		$this->_trash_or_restore_items( $this->_question_model, $trash );
603
+	protected function _trash_or_restore_questions($trash = TRUE) {
604
+		$this->_trash_or_restore_items($this->_question_model, $trash);
605 605
 	}
606 606
 
607 607
 
@@ -612,21 +612,21 @@  discard block
 block discarded – undo
612 612
 	 * @param EEM_Base $model
613 613
 	 * @param boolean $trash wehter to trash or restore
614 614
 	 */
615
-	private function _trash_or_restore_items( EEM_Base $model, $trash = TRUE ) {
615
+	private function _trash_or_restore_items(EEM_Base $model, $trash = TRUE) {
616 616
 
617
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
617
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
618 618
 
619 619
 		$success = 1;
620 620
 		//Checkboxes
621 621
 		//echo "trash $trash";
622 622
 		//var_dump($this->_req_data['checkbox']);die;
623
-		if ( isset( $this->_req_data['checkbox'] )) {
624
-			if ( isset( $this->_req_data['checkbox'] ) && ! empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] )) {
623
+		if (isset($this->_req_data['checkbox'])) {
624
+			if (isset($this->_req_data['checkbox']) && ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
625 625
 				// if array has more than one element than success message should be plural
626
-				$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
626
+				$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
627 627
 				// cycle thru bulk action checkboxes
628
-				while (list( $ID, $value ) = each($this->_req_data['checkbox'])) {
629
-					if ( ! $model->delete_or_restore_by_ID($trash,absint($ID))) {
628
+				while (list($ID, $value) = each($this->_req_data['checkbox'])) {
629
+					if ( ! $model->delete_or_restore_by_ID($trash, absint($ID))) {
630 630
 						$success = 0;
631 631
 					}
632 632
 				}
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
 			} else {
635 635
 				// grab single id and delete
636 636
 				$ID = absint($this->_req_data['checkbox']);
637
-				if ( ! $model->delete_or_restore_by_ID($trash,$ID)) {
637
+				if ( ! $model->delete_or_restore_by_ID($trash, $ID)) {
638 638
 					$success = 0;
639 639
 				}
640 640
 			}
@@ -642,53 +642,53 @@  discard block
 block discarded – undo
642 642
 		} else {
643 643
 			// delete via trash link
644 644
 			// grab single id and delete
645
-			$ID = absint($this->_req_data[ $model->primary_key_name() ]);
646
-			if ( ! $model->delete_or_restore_by_ID($trash,$ID)) {
645
+			$ID = absint($this->_req_data[$model->primary_key_name()]);
646
+			if ( ! $model->delete_or_restore_by_ID($trash, $ID)) {
647 647
 				$success = 0;
648 648
 			}
649 649
 
650 650
 		}
651 651
 
652 652
 
653
-		$action = $model instanceof EEM_Question ? 'default' : 'question_groups';//strtolower( $model->item_name(2) );
653
+		$action = $model instanceof EEM_Question ? 'default' : 'question_groups'; //strtolower( $model->item_name(2) );
654 654
 		//echo "action :$action";
655 655
 		//$action = 'questions' ? 'default' : $action;
656
-		if($trash){
656
+		if ($trash) {
657 657
 			$action_desc = 'trashed';
658 658
 			$status = 'trash';
659
-		}else{
659
+		} else {
660 660
 			$action_desc = 'restored';
661 661
 			$status = 'all';
662 662
 		}
663
-		$this->_redirect_after_action( $success, $model->item_name($success), $action_desc, array( 'action' => $action, 'status'=>$status ) );
663
+		$this->_redirect_after_action($success, $model->item_name($success), $action_desc, array('action' => $action, 'status'=>$status));
664 664
 	}
665 665
 
666 666
 
667 667
 
668 668
 
669
-	public function get_trashed_questions( $per_page,$current_page = 1, $count = FALSE ) {
669
+	public function get_trashed_questions($per_page, $current_page = 1, $count = FALSE) {
670 670
 		$query_params = $this->get_query_params(EEM_Question::instance(), $per_page, $current_page);
671 671
 
672
-		if( $count ){
672
+		if ($count) {
673 673
 			//note: this a subclass of EEM_Soft_Delete_Base, so thsi is actually only getting nontrashed items
674
-			$where = isset( $query_params[0] ) ? array( $query_params[0] ) : array();
675
-			$results=$this->_question_model->count_deleted($where);
676
-		}else{
674
+			$where = isset($query_params[0]) ? array($query_params[0]) : array();
675
+			$results = $this->_question_model->count_deleted($where);
676
+		} else {
677 677
 			//note: this a subclass of EEM_Soft_Delete_Base, so thsi is actually only getting nontrashed items
678
-			$results=$this->_question_model->get_all_deleted($query_params);
678
+			$results = $this->_question_model->get_all_deleted($query_params);
679 679
 		}
680 680
 		return $results;
681 681
 	}
682 682
 
683 683
 
684 684
 
685
-	public function get_question_groups( $per_page,$current_page = 1, $count = FALSE ) {
686
-		$questionGroupModel=EEM_Question_Group::instance();
687
-		$query_params=$this->get_query_params($questionGroupModel,$per_page,$current_page);
688
-		if ($count){
689
-			$where = isset( $query_params[0] ) ? array( $query_params[0] ) : array();
685
+	public function get_question_groups($per_page, $current_page = 1, $count = FALSE) {
686
+		$questionGroupModel = EEM_Question_Group::instance();
687
+		$query_params = $this->get_query_params($questionGroupModel, $per_page, $current_page);
688
+		if ($count) {
689
+			$where = isset($query_params[0]) ? array($query_params[0]) : array();
690 690
 			$results = $questionGroupModel->count($where);
691
-		}else{
691
+		} else {
692 692
 			$results = $questionGroupModel->get_all($query_params);
693 693
 		}
694 694
 		return $results;
@@ -696,14 +696,14 @@  discard block
 block discarded – undo
696 696
 
697 697
 
698 698
 
699
-	public function get_trashed_question_groups( $per_page,$current_page = 1, $count = FALSE ) {
700
-		$questionGroupModel=EEM_Question_Group::instance();
701
-		$query_params=$this->get_query_params($questionGroupModel,$per_page,$current_page);
702
-		if($count){
703
-			$where = isset( $query_params[0] ) ? array($query_params[0]) : array();
699
+	public function get_trashed_question_groups($per_page, $current_page = 1, $count = FALSE) {
700
+		$questionGroupModel = EEM_Question_Group::instance();
701
+		$query_params = $this->get_query_params($questionGroupModel, $per_page, $current_page);
702
+		if ($count) {
703
+			$where = isset($query_params[0]) ? array($query_params[0]) : array();
704 704
 			$query_params['limit'] = NULL;
705 705
 			$results = $questionGroupModel->count_deleted($where);
706
-		}else{
706
+		} else {
707 707
 			$results = $questionGroupModel->get_all_deleted($query_params);
708 708
 		}
709 709
 		return $results;
@@ -716,22 +716,22 @@  discard block
 block discarded – undo
716 716
 	 */
717 717
 	public function update_question_group_order() {
718 718
 
719
-		$success = __( 'Question group order was updated successfully.', 'event_espresso' );
719
+		$success = __('Question group order was updated successfully.', 'event_espresso');
720 720
 
721 721
 		// grab our row IDs
722
-		$row_ids = isset( $this->_req_data['row_ids'] ) && ! empty( $this->_req_data['row_ids'] ) ? explode( ',', rtrim( $this->_req_data['row_ids'], ',' )) : FALSE;
722
+		$row_ids = isset($this->_req_data['row_ids']) && ! empty($this->_req_data['row_ids']) ? explode(',', rtrim($this->_req_data['row_ids'], ',')) : FALSE;
723 723
 
724
-		$perpage = !empty( $this->_req_data['perpage'] ) ? (int) $this->_req_data['perpage'] : NULL;
725
-		$curpage = !empty( $this->_req_data['curpage'] ) ? (int) $this->_req_data['curpage'] : NULL;
724
+		$perpage = ! empty($this->_req_data['perpage']) ? (int) $this->_req_data['perpage'] : NULL;
725
+		$curpage = ! empty($this->_req_data['curpage']) ? (int) $this->_req_data['curpage'] : NULL;
726 726
 
727
-		if ( is_array( $row_ids )) {
727
+		if (is_array($row_ids)) {
728 728
 			//figure out where we start the row_id count at for the current page.
729
-			$qsgcount = empty( $curpage ) ? 0 : ($curpage - 1 ) * $perpage;
729
+			$qsgcount = empty($curpage) ? 0 : ($curpage - 1) * $perpage;
730 730
 
731 731
 			global $wpdb;
732
-			for ( $i = 0; $i < count($row_ids); $i++ ) {
732
+			for ($i = 0; $i < count($row_ids); $i++) {
733 733
 				//Update the questions when re-ordering
734
-				if ( EEM_Question_Group::instance()->update ( array( 'QSG_order' => $qsgcount ), array(array( 'QSG_ID' => $row_ids[$i] ))) === FALSE ) {
734
+				if (EEM_Question_Group::instance()->update(array('QSG_order' => $qsgcount), array(array('QSG_ID' => $row_ids[$i]))) === FALSE) {
735 735
 					$success = FALSE;
736 736
 				}
737 737
 				$qsgcount++;
@@ -740,9 +740,9 @@  discard block
 block discarded – undo
740 740
 			$success = FALSE;
741 741
 		}
742 742
 
743
-		$errors = ! $success ? __( 'An error occurred. The question group order was not updated.', 'event_espresso' ) : FALSE;
743
+		$errors = ! $success ? __('An error occurred. The question group order was not updated.', 'event_espresso') : FALSE;
744 744
 
745
-		echo json_encode( array( 'return_data' => FALSE, 'success' => $success, 'errors' => $errors ));
745
+		echo json_encode(array('return_data' => FALSE, 'success' => $success, 'errors' => $errors));
746 746
 		die();
747 747
 
748 748
 	}
@@ -759,10 +759,10 @@  discard block
 block discarded – undo
759 759
 
760 760
 	protected function _reg_form_settings() {
761 761
 		$this->_template_args['values'] = $this->_yes_no_values;
762
-		$this->_template_args = apply_filters( 'FHEE__Extend_Registration_Form_Admin_Page___reg_form_settings___template_args', $this->_template_args );
763
-		$this->_set_add_edit_form_tags( 'update_reg_form_settings' );
764
-		$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
765
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( REGISTRATION_FORM_CAF_TEMPLATE_PATH . 'reg_form_settings.template.php', $this->_template_args, TRUE );
762
+		$this->_template_args = apply_filters('FHEE__Extend_Registration_Form_Admin_Page___reg_form_settings___template_args', $this->_template_args);
763
+		$this->_set_add_edit_form_tags('update_reg_form_settings');
764
+		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
765
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(REGISTRATION_FORM_CAF_TEMPLATE_PATH.'reg_form_settings.template.php', $this->_template_args, TRUE);
766 766
 		$this->display_admin_page_with_sidebar();
767 767
 	}
768 768
 
@@ -770,9 +770,9 @@  discard block
 block discarded – undo
770 770
 
771 771
 
772 772
 	protected function _update_reg_form_settings() {
773
-		EE_Registry::instance()->CFG->registration = apply_filters( 'FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration', EE_Registry::instance()->CFG->registration );
774
-		$success = $this->_update_espresso_configuration( __('Registration Form Options', 'event_espresso'), EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, __LINE__ );
775
-		$this->_redirect_after_action( $success, __('Registration Form Options', 'event_espresso'), 'updated', array( 'action' => 'view_reg_form_settings' ) );
773
+		EE_Registry::instance()->CFG->registration = apply_filters('FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration', EE_Registry::instance()->CFG->registration);
774
+		$success = $this->_update_espresso_configuration(__('Registration Form Options', 'event_espresso'), EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, __LINE__);
775
+		$this->_redirect_after_action($success, __('Registration Form Options', 'event_espresso'), 'updated', array('action' => 'view_reg_form_settings'));
776 776
 	}
777 777
 
778 778
 }
Please login to merge, or discard this patch.
Braces   +10 added lines, -9 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
@@ -468,12 +469,12 @@  discard block
 block discarded – undo
468 469
 				}
469 470
 			}
470 471
 
471
-		}elseif( !empty($this->_req_data['QSG_ID'])){
472
+		} elseif( !empty($this->_req_data['QSG_ID'])){
472 473
 			$success = $model->delete_permanently_by_ID($this->_req_data['QSG_ID']);
473 474
 
474
-		}elseif( !empty($this->_req_data['QST_ID'])){
475
+		} elseif( !empty($this->_req_data['QST_ID'])){
475 476
 			$success = $model->delete_permanently_by_ID($this->_req_data['QST_ID']);
476
-		}else{
477
+		} else{
477 478
 			EE_Error::add_error( sprintf(__("No Questions or Question Groups were selected for deleting. This error usually shows when you've attempted to delete via bulk action but there were no selections.", "event_espresso")), __FILE__, __FUNCTION__, __LINE__ );
478 479
 		}
479 480
 		return $success;
@@ -498,7 +499,7 @@  discard block
 block discarded – undo
498 499
 			$questionGroup=$this->_question_group_model->get_one_by_ID($ID);
499 500
 			$additional_hidden_fields=array('QSG_ID'=>array('type'=>'hidden','value'=>$ID));
500 501
 			$this->_set_add_edit_form_tags('update_question_group', $additional_hidden_fields);
501
-		}else{
502
+		} else{
502 503
 			$questionGroup = EEM_Question_Group::instance()->create_default_object();
503 504
 			$questionGroup->set_order_to_latest();
504 505
 			$this->_set_add_edit_form_tags('insert_question_group');
@@ -656,7 +657,7 @@  discard block
 block discarded – undo
656 657
 		if($trash){
657 658
 			$action_desc = 'trashed';
658 659
 			$status = 'trash';
659
-		}else{
660
+		} else{
660 661
 			$action_desc = 'restored';
661 662
 			$status = 'all';
662 663
 		}
@@ -673,7 +674,7 @@  discard block
 block discarded – undo
673 674
 			//note: this a subclass of EEM_Soft_Delete_Base, so thsi is actually only getting nontrashed items
674 675
 			$where = isset( $query_params[0] ) ? array( $query_params[0] ) : array();
675 676
 			$results=$this->_question_model->count_deleted($where);
676
-		}else{
677
+		} else{
677 678
 			//note: this a subclass of EEM_Soft_Delete_Base, so thsi is actually only getting nontrashed items
678 679
 			$results=$this->_question_model->get_all_deleted($query_params);
679 680
 		}
@@ -688,7 +689,7 @@  discard block
 block discarded – undo
688 689
 		if ($count){
689 690
 			$where = isset( $query_params[0] ) ? array( $query_params[0] ) : array();
690 691
 			$results = $questionGroupModel->count($where);
691
-		}else{
692
+		} else{
692 693
 			$results = $questionGroupModel->get_all($query_params);
693 694
 		}
694 695
 		return $results;
@@ -703,7 +704,7 @@  discard block
 block discarded – undo
703 704
 			$where = isset( $query_params[0] ) ? array($query_params[0]) : array();
704 705
 			$query_params['limit'] = NULL;
705 706
 			$results = $questionGroupModel->count_deleted($where);
706
-		}else{
707
+		} else{
707 708
 			$results = $questionGroupModel->get_all_deleted($query_params);
708 709
 		}
709 710
 		return $results;
Please login to merge, or discard this patch.
Extend_Registration_Form_Questions_Admin_List_Table.class.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
 
32 32
 class Extend_Registration_Form_Questions_Admin_List_Table extends Registration_Form_Questions_Admin_List_Table {
33 33
 
34
-	public function __construct( $admin_page ) {
35
-		parent::__construct( $admin_page );
34
+	public function __construct($admin_page) {
35
+		parent::__construct($admin_page);
36 36
 	}
37 37
 
38 38
 	public function column_display_text(EE_Question $item) {
39 39
 		$system_question = $item->is_system_question();
40 40
 		$actions = array();
41 41
 
42
-		if ( !defined('REG_ADMIN_URL') )
42
+		if ( ! defined('REG_ADMIN_URL'))
43 43
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
44 44
 
45 45
 		$edit_query_args = array(
@@ -63,31 +63,31 @@  discard block
 block discarded – undo
63 63
 			);
64 64
 
65 65
 
66
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_FORMS_ADMIN_URL );
67
-		$trash_link = EE_Admin_Page::add_query_args_and_nonce( $trash_query_args, EE_FORMS_ADMIN_URL );
68
-		$restore_link = EE_Admin_Page::add_query_args_and_nonce( $restore_query_args, EE_FORMS_ADMIN_URL );
69
-		$delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EE_FORMS_ADMIN_URL );
66
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
67
+		$trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL);
68
+		$restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL);
69
+		$delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL);
70 70
 
71
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question', 'espresso_registration_form_edit_question', $item->ID() ) ) {
71
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_question', 'espresso_registration_form_edit_question', $item->ID())) {
72 72
 			$actions = array(
73
-				'edit' => '<a href="' . $edit_link . '" title="' . __('Edit Question', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>'
73
+				'edit' => '<a href="'.$edit_link.'" title="'.__('Edit Question', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'
74 74
 			);
75 75
 		}
76 76
 
77
-		if ( ! $system_question && $this->_view != 'trash' && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question', 'espresso_registration_form_trash_question', $item->ID() ) ) {
78
-			$actions['delete'] = '<a href="' . $trash_link . '" title="' . __('Trash Question', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
77
+		if ( ! $system_question && $this->_view != 'trash' && EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_trash_question', $item->ID())) {
78
+			$actions['delete'] = '<a href="'.$trash_link.'" title="'.__('Trash Question', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
79 79
 		}
80 80
 
81
-		if ( $this->_view == 'trash' ) {
82
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question', 'espresso_registration_form_restore_question', $item->ID() ) ) {
83
-				$actions['restore'] = '<a href="' . $restore_link . '" title="' . __('Restore Question', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>';
81
+		if ($this->_view == 'trash') {
82
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_restore_question', $item->ID())) {
83
+				$actions['restore'] = '<a href="'.$restore_link.'" title="'.__('Restore Question', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
84 84
 			}
85
-			if ( $item->count_related('Answer') === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question', 'espresso_registration_form_delete_questions', $item->ID() ) ) {
86
-				$actions['delete_permanently'] = '<a href="' . $delete_link . '" title="' . __('Delete Question Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
85
+			if ($item->count_related('Answer') === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_delete_questions', $item->ID())) {
86
+				$actions['delete_permanently'] = '<a href="'.$delete_link.'" title="'.__('Delete Question Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
87 87
 			}
88 88
 		}
89 89
 
90
-		$content = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question', 'espresso_registration_form_edit_question', $item->ID() ) ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->display_text() . '</a></strong>' : $item->display_text();
90
+		$content = EE_Registry::instance()->CAP->current_user_can('ee_edit_question', 'espresso_registration_form_edit_question', $item->ID()) ? '<strong><a class="row-title" href="'.$edit_link.'">'.$item->display_text().'</a></strong>' : $item->display_text();
91 91
 		$content .= $this->row_actions($actions);
92 92
 		return $content;
93 93
 	}
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -125,8 +126,9 @@  discard block
 block discarded – undo
125 126
 		$actions = array();
126 127
 
127 128
 		//return $item->name();
128
-		if ( !defined('REG_ADMIN_URL') )
129
-			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
129
+		if ( !defined('REG_ADMIN_URL') ) {
130
+					define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
131
+		}
130 132
 
131 133
 		$edit_query_args = array(
132 134
 				'action' => 'edit_question_group',
Please login to merge, or discard this patch.
Registration_Form_Question_Groups_Admin_List_Table.class.php 2 patches
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 class Registration_Form_Question_Groups_Admin_List_Table extends EE_Admin_List_Table {
32 32
 
33 33
 
34
-	public function __construct( $admin_page ) {
34
+	public function __construct($admin_page) {
35 35
 		parent::__construct($admin_page);
36 36
 	}
37 37
 
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 	protected function _setup_data() {
42
-		$this->_data = $this->_view != 'trash' ? $this->_admin_page->get_question_groups( $this->_per_page,$this->_current_page, FALSE ) : $this->_admin_page->get_trashed_question_groups( $this->_per_page,$this->_current_page, FALSE );
43
-		$this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_question_groups( $this->_per_page,$this->_current_page, TRUE ) : $this->_admin_page->get_trashed_question_groups( $this->_per_page,$this->_current_page, TRUE );
42
+		$this->_data = $this->_view != 'trash' ? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, FALSE) : $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, FALSE);
43
+		$this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, TRUE) : $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, TRUE);
44 44
 	}
45 45
 
46 46
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 
50 50
 	protected function _set_properties() {
51 51
 		$this->_wp_list_args = array(
52
-			'singular' => __('question group', 'event_espresso' ),
53
-			'plural' => __('question groups', 'event_espresso' ),
52
+			'singular' => __('question group', 'event_espresso'),
53
+			'plural' => __('question groups', 'event_espresso'),
54 54
 			'ajax' => TRUE, //for now,
55 55
 			'screen' => $this->_admin_page->get_current_screen()->id
56 56
 			);
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 			);
66 66
 
67 67
 		$this->_sortable_columns = array(
68
-			'id' => array( 'QSG_ID' => FALSE ),
69
-			'name' => array( 'QSG_name' => FALSE )
68
+			'id' => array('QSG_ID' => FALSE),
69
+			'name' => array('QSG_name' => FALSE)
70 70
 			);
71 71
 
72 72
 		$this->_hidden_columns = array(
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 
93 93
 
94 94
 	protected function _add_view_counts() {
95
-		$this->_views['all']['count'] = $this->_admin_page->get_question_groups( $this->_per_page,$this->_current_page, TRUE );
96
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_groups', 'espresso_registration_form_trash_question_group' ) ) {
97
-			$this->_views['trash']['count'] = $this->_admin_page->get_trashed_question_groups( $this->_per_page,$this->_current_page, TRUE );
95
+		$this->_views['all']['count'] = $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, TRUE);
96
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question_groups', 'espresso_registration_form_trash_question_group')) {
97
+			$this->_views['trash']['count'] = $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, TRUE);
98 98
 		}
99 99
 	}
100 100
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$system_group = $item->get('QSG_system');
108 108
 		$has_questions_with_answers = $item->has_questions_with_answers();
109 109
 		$lock_icon = $system_group === 0 && $this->_view == 'trash' && $has_questions_with_answers ? 'ee-lock-icon ee-alternate-color' : 'ee-lock-icon ee-system-lock';
110
-		return $system_group > 0 || ( $system_group === 0 && $this->_view == 'trash' && $has_questions_with_answers ) || ! EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_groups', 'espresso_registration_form_trash_question_groups' ) ? '<span class="' . $lock_icon . '"></span>'  . sprintf( '<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />', $item->ID() )  : sprintf( '<input type="checkbox" id="QSG_ID[%1$d]" name="checkbox[%1$d]" value="%1$d" />', $item->ID() );
110
+		return $system_group > 0 || ($system_group === 0 && $this->_view == 'trash' && $has_questions_with_answers) || ! EE_Registry::instance()->CAP->current_user_can('ee_delete_question_groups', 'espresso_registration_form_trash_question_groups') ? '<span class="'.$lock_icon.'"></span>'.sprintf('<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />', $item->ID()) : sprintf('<input type="checkbox" id="QSG_ID[%1$d]" name="checkbox[%1$d]" value="%1$d" />', $item->ID());
111 111
 	}
112 112
 
113 113
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 		$actions = array();
126 126
 
127 127
 		//return $item->name();
128
-		if ( !defined('REG_ADMIN_URL') )
128
+		if ( ! defined('REG_ADMIN_URL'))
129 129
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
130 130
 
131 131
 		$edit_query_args = array(
@@ -150,32 +150,32 @@  discard block
 block discarded – undo
150 150
 
151 151
 
152 152
 
153
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_FORMS_ADMIN_URL );
154
-		$trash_link = EE_Admin_Page::add_query_args_and_nonce( $trash_query_args, EE_FORMS_ADMIN_URL );
155
-		$restore_link = EE_Admin_Page::add_query_args_and_nonce( $restore_query_args, EE_FORMS_ADMIN_URL );
156
-		$delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EE_FORMS_ADMIN_URL );
153
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
154
+		$trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL);
155
+		$restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL);
156
+		$delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL);
157 157
 
158
-		if (  EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question_group', 'espresso_registration_form_edit_question_group', $item->ID() ) ) {
158
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_question_group', 'espresso_registration_form_edit_question_group', $item->ID())) {
159 159
 			$actions = array(
160
-				'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Question Group', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>'
160
+				'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Question Group', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'
161 161
 			);
162 162
 		}
163
-		if ( $item->get('QSG_system') < 1 && $this->_view != 'trash' &&  EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_group', 'espresso_registration_form_trash_question_group', $item->ID() ) ) {
164
-			$actions['delete'] = '<a href="' . $trash_link . '" title="' . esc_attr__('Delete Question Group', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
163
+		if ($item->get('QSG_system') < 1 && $this->_view != 'trash' && EE_Registry::instance()->CAP->current_user_can('ee_delete_question_group', 'espresso_registration_form_trash_question_group', $item->ID())) {
164
+			$actions['delete'] = '<a href="'.$trash_link.'" title="'.esc_attr__('Delete Question Group', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
165 165
 		}
166 166
 
167
-		if ( $this->_view == 'trash' ) {
167
+		if ($this->_view == 'trash') {
168 168
 
169
-			if (  EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_group', 'espresso_registration_form_restore_question_group', $item->ID() ) ) {
170
-				$actions['restore'] = '<a href="' . $restore_link . '" title="' . esc_attr__('Restore Question Group', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>';
169
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question_group', 'espresso_registration_form_restore_question_group', $item->ID())) {
170
+				$actions['restore'] = '<a href="'.$restore_link.'" title="'.esc_attr__('Restore Question Group', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
171 171
 			}
172 172
 
173
-			if ( !$item->has_questions_with_answers() &&  EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_group', 'espresso_registration_form_delete_question_group', $item->ID() ) ) {
174
-				$actions['delete_permanently'] = '<a href="' . $delete_link . '" title="' . esc_attr__('Delete Question Group Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
173
+			if ( ! $item->has_questions_with_answers() && EE_Registry::instance()->CAP->current_user_can('ee_delete_question_group', 'espresso_registration_form_delete_question_group', $item->ID())) {
174
+				$actions['delete_permanently'] = '<a href="'.$delete_link.'" title="'.esc_attr__('Delete Question Group Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
175 175
 			}
176 176
 		}
177 177
 
178
-		$content =  EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question_group', 'espresso_registration_form_edit_question_group', $item->ID() ) ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>' : $item->name();
178
+		$content = EE_Registry::instance()->CAP->current_user_can('ee_edit_question_group', 'espresso_registration_form_edit_question_group', $item->ID()) ? '<strong><a class="row-title" href="'.$edit_link.'">'.$item->name().'</a></strong>' : $item->name();
179 179
 		$content .= $this->row_actions($actions);
180 180
 		return $content;
181 181
 	}
@@ -196,13 +196,13 @@  discard block
 block discarded – undo
196 196
 
197 197
 
198 198
 	public function column_show_group_name(EE_Question_Group $item) {
199
-		return $this->_yes_no[ $item->show_group_name() ];
199
+		return $this->_yes_no[$item->show_group_name()];
200 200
 	}
201 201
 
202 202
 
203 203
 
204 204
 	public function column_show_group_desc(EE_Question_Group $item) {
205
-		return $this->_yes_no[ $item->show_group_desc() ];
205
+		return $this->_yes_no[$item->show_group_desc()];
206 206
 	}
207 207
 
208 208
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -125,8 +126,9 @@  discard block
 block discarded – undo
125 126
 		$actions = array();
126 127
 
127 128
 		//return $item->name();
128
-		if ( !defined('REG_ADMIN_URL') )
129
-			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
129
+		if ( !defined('REG_ADMIN_URL') ) {
130
+					define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
131
+		}
130 132
 
131 133
 		$edit_query_args = array(
132 134
 				'action' => 'edit_question_group',
Please login to merge, or discard this patch.
registration_form/espresso_events_Registration_Form_Hooks_Extend.class.php 2 patches
Spacing   +34 added lines, -34 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
 /**
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 class espresso_events_Registration_Form_Hooks_Extend extends espresso_events_Registration_Form_Hooks {
31 31
 
32 32
 
33
-	public function __construct( EE_Admin_Page $admin_page ) {
33
+	public function __construct(EE_Admin_Page $admin_page) {
34 34
 		parent::__construct($admin_page);
35 35
 	}
36 36
 
@@ -54,31 +54,31 @@  discard block
 block discarded – undo
54 54
 				)
55 55
 			);
56 56
 
57
-		$this->_metaboxes = array_merge( $this->_metaboxes, $new_metaboxes);
57
+		$this->_metaboxes = array_merge($this->_metaboxes, $new_metaboxes);
58 58
 	}
59 59
 
60 60
 
61 61
 
62 62
 
63
-	public function modify_callbacks( $callbacks ) {
64
-		$callbacks = parent::modify_callbacks( $callbacks );
65
-		$callbacks[] = array( $this, 'additional_question_group_update' );
63
+	public function modify_callbacks($callbacks) {
64
+		$callbacks = parent::modify_callbacks($callbacks);
65
+		$callbacks[] = array($this, 'additional_question_group_update');
66 66
 		return $callbacks;
67 67
 	}
68 68
 
69 69
 
70 70
 
71
-	public function restore_revision( $post_id, $revision_id ) {
72
-		$post_evt = parent::restore_revision( $post_id, $revision_id );
71
+	public function restore_revision($post_id, $revision_id) {
72
+		$post_evt = parent::restore_revision($post_id, $revision_id);
73 73
 
74 74
 		//restore revision for additional questions
75
-		$post_evt->restore_revision( $revision_id, array('Question_Group'), array('Question_Group' => array('Event_Question_Group.EQG_primary' => 0 ) ) );
75
+		$post_evt->restore_revision($revision_id, array('Question_Group'), array('Question_Group' => array('Event_Question_Group.EQG_primary' => 0)));
76 76
 	}
77 77
 
78 78
 
79 79
 
80 80
 
81
-	public function additional_questions( $post_id, $post ) {
81
+	public function additional_questions($post_id, $post) {
82 82
 		$this->_event = $this->_adminpage_obj->get_event_object();
83 83
 		$event_id = $this->_event->ID();
84 84
 		?>
@@ -95,25 +95,25 @@  discard block
 block discarded – undo
95 95
 			<?php
96 96
 
97 97
 			$qsg_where['QSG_deleted'] = FALSE;
98
-			$query_params = array( $qsg_where, 'order_by' => array( 'QSG_order' => 'ASC' ) );
99
-			$QSGs = EEM_Question_Group::instance()->get_all( $query_params );
100
-			$EQGs = !empty( $event_id ) ? $this->_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0 )) ) : array();
98
+			$query_params = array($qsg_where, 'order_by' => array('QSG_order' => 'ASC'));
99
+			$QSGs = EEM_Question_Group::instance()->get_all($query_params);
100
+			$EQGs = ! empty($event_id) ? $this->_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0))) : array();
101 101
 			$EQGids = array_keys($EQGs);
102 102
 
103
-			if ( ! empty( $QSGs )) {
104
- 				$html = count( $QSGs ) > 10 ? '<div style="height:250px;overflow:auto;">' : '';
105
-				foreach ( $QSGs as $QSG ) {
103
+			if ( ! empty($QSGs)) {
104
+ 				$html = count($QSGs) > 10 ? '<div style="height:250px;overflow:auto;">' : '';
105
+				foreach ($QSGs as $QSG) {
106 106
 
107
-					$checked = in_array( $QSG->ID(), $EQGids ) ? ' checked="checked" ' : '';
108
-					$edit_link = $this->_adminpage_obj->add_query_args_and_nonce( array( 'action' => 'edit_question_group', 'QSG_ID' => $QSG->ID() ), EE_FORMS_ADMIN_URL );
107
+					$checked = in_array($QSG->ID(), $EQGids) ? ' checked="checked" ' : '';
108
+					$edit_link = $this->_adminpage_obj->add_query_args_and_nonce(array('action' => 'edit_question_group', 'QSG_ID' => $QSG->ID()), EE_FORMS_ADMIN_URL);
109 109
 
110 110
 					$html .= '
111
-					<p id="event-question-group-' . $QSG->ID() . '">
112
-						<input value="' . $QSG->ID() . '" type="checkbox" name="add_attendee_question_groups[' . $QSG->ID() . ']"' . $checked . ' />
113
-						<a href="' . $edit_link . '" title="' . sprintf( esc_attr__( 'Edit %s Group', 'event_espresso' ),  $QSG->get('QSG_name') ) . '" target="_blank">' . $QSG->get('QSG_name') . '</a>
111
+					<p id="event-question-group-' . $QSG->ID().'">
112
+						<input value="' . $QSG->ID().'" type="checkbox" name="add_attendee_question_groups['.$QSG->ID().']"'.$checked.' />
113
+						<a href="' . $edit_link.'" title="'.sprintf(esc_attr__('Edit %s Group', 'event_espresso'), $QSG->get('QSG_name')).'" target="_blank">'.$QSG->get('QSG_name').'</a>
114 114
 					</p>';
115 115
 				}
116
-				$html .= count( $QSGs ) > 10 ? '</div>' : '';
116
+				$html .= count($QSGs) > 10 ? '</div>' : '';
117 117
 
118 118
 				echo $html;
119 119
 
@@ -129,31 +129,31 @@  discard block
 block discarded – undo
129 129
 
130 130
 
131 131
 
132
-	public function additional_question_group_update( $evtobj, $data ) {
133
-		$question_groups = !empty( $data['add_attendee_question_groups'] ) ? (array) $data['add_attendee_question_groups'] : array();
132
+	public function additional_question_group_update($evtobj, $data) {
133
+		$question_groups = ! empty($data['add_attendee_question_groups']) ? (array) $data['add_attendee_question_groups'] : array();
134 134
 		$added_qgs = array_keys($question_groups);
135 135
 		$success = array();
136 136
 
137 137
 		//let's get all current question groups associated with this event.
138
-		$current_qgs = $evtobj->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0) ) );
138
+		$current_qgs = $evtobj->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0)));
139 139
 		$current_qgs = array_keys($current_qgs); //we just want the ids
140 140
 
141 141
 		//now let's get the groups selected in the editor and update (IF we have data)
142
-		if ( !empty( $question_groups ) ) {
143
-			foreach ( $question_groups as $id => $val ) {
142
+		if ( ! empty($question_groups)) {
143
+			foreach ($question_groups as $id => $val) {
144 144
 				//add to event
145
-				if ( $val )
146
-					$qg = $evtobj->_add_relation_to( $id, 'Question_Group', array('EQG_primary' => 0) );
147
-				$success[] = !empty($qg) ? 1 : 0;
145
+				if ($val)
146
+					$qg = $evtobj->_add_relation_to($id, 'Question_Group', array('EQG_primary' => 0));
147
+				$success[] = ! empty($qg) ? 1 : 0;
148 148
 			}
149 149
 		}
150 150
 
151 151
 		//wait a minute... are there question groups missing in the saved groups that ARE with the current event?
152
-		$removed_qgs = array_diff( $current_qgs, $added_qgs );
152
+		$removed_qgs = array_diff($current_qgs, $added_qgs);
153 153
 
154
-		foreach ( $removed_qgs as $qgid ) {
155
-			$qg = $evtobj->_remove_relation_to( $qgid, 'Question_Group', array('EQG_primary' => 0 ) );
156
-			$success[] = !empty($qg) ? 1 : 0;
154
+		foreach ($removed_qgs as $qgid) {
155
+			$qg = $evtobj->_remove_relation_to($qgid, 'Question_Group', array('EQG_primary' => 0));
156
+			$success[] = ! empty($qg) ? 1 : 0;
157 157
 		}
158 158
 
159 159
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -142,8 +143,9 @@  discard block
 block discarded – undo
142 143
 		if ( !empty( $question_groups ) ) {
143 144
 			foreach ( $question_groups as $id => $val ) {
144 145
 				//add to event
145
-				if ( $val )
146
-					$qg = $evtobj->_add_relation_to( $id, 'Question_Group', array('EQG_primary' => 0) );
146
+				if ( $val ) {
147
+									$qg = $evtobj->_add_relation_to( $id, 'Question_Group', array('EQG_primary' => 0) );
148
+				}
147 149
 				$success[] = !empty($qg) ? 1 : 0;
148 150
 			}
149 151
 		}
Please login to merge, or discard this patch.
help_tours/Registration_Form_Questions_Overview_Help_Tour.class.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
 /**
@@ -116,42 +116,42 @@  discard block
 block discarded – undo
116 116
 
117 117
 
118 118
 	protected function _start() {
119
-		$content = '<h3>' . __('Questions Overview', 'event_espresso') . '</h3>';
120
-		$content .= '<p>' . __('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
119
+		$content = '<h3>'.__('Questions Overview', 'event_espresso').'</h3>';
120
+		$content .= '<p>'.__('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
121 121
 
122 122
 		return $content;
123 123
 	}
124 124
 
125 125
 	protected function _display_text_stop() {
126
-		return '<p>' . __('View available questions. You can reorder your questions by dragging and dropping them.', 'event_espresso') . '</p>';
126
+		return '<p>'.__('View available questions. You can reorder your questions by dragging and dropping them.', 'event_espresso').'</p>';
127 127
 	}
128 128
 
129 129
 	protected function _admin_label_stop() {
130
-		return '<p>' . __('View the admin label for your questions.', 'event_espresso') . '</p>';
130
+		return '<p>'.__('View the admin label for your questions.', 'event_espresso').'</p>';
131 131
 	}
132 132
 
133 133
 	protected function _type_stop() {
134
-		return '<p>' . __('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', 'event_espresso') . '</p>';
134
+		return '<p>'.__('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', 'event_espresso').'</p>';
135 135
 	}
136 136
 
137 137
 	protected function _values_stop() {
138
-		return '<p>' . __('View stored values for checkboxes, radio buttons, and select boxes.', 'event_espresso') . '</p>';
138
+		return '<p>'.__('View stored values for checkboxes, radio buttons, and select boxes.', 'event_espresso').'</p>';
139 139
 	}
140 140
 
141 141
 	protected function _required_stop() {
142
-		return '<p>' . __('View if a question is required.', 'event_espresso') . '</p>';
142
+		return '<p>'.__('View if a question is required.', 'event_espresso').'</p>';
143 143
 	}
144 144
 
145 145
 	protected function _bulk_actions_stop() {
146
-		return '<p>' . __('Perform bulk actions to multiple questions.', 'event_espresso') . '</p>';
146
+		return '<p>'.__('Perform bulk actions to multiple questions.', 'event_espresso').'</p>';
147 147
 	}
148 148
 
149 149
 	protected function _search_stop() {
150
-		return '<p>' . __('Search through questions. The following sources will be searched: Name of Question (display text).', 'event_espresso') . '</p>';
150
+		return '<p>'.__('Search through questions. The following sources will be searched: Name of Question (display text).', 'event_espresso').'</p>';
151 151
 	}
152 152
 
153 153
 	protected function _add_new_question_stop() {
154
-		return '<p>' . __('Click here to add a new question.', 'event_espresso') . '</p>';
154
+		return '<p>'.__('Click here to add a new question.', 'event_espresso').'</p>';
155 155
 	}
156 156
 
157 157
 }
158 158
\ 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.
registration_form/templates/question_groups_main_meta_box.template.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@
 block discarded – undo
121 121
                     <?php
122 122
 					$question_order = 0;
123 123
 					$question_group_questions = $question_group->questions();
124
-                    foreach( $all_questions as $question_ID => $question ){
124
+					foreach( $all_questions as $question_ID => $question ){
125 125
 						if ( $question instanceof EE_Question ) {
126 126
 							/*@var $question EE_Question*/
127 127
 							$checked = isset( $question_group_questions[ $question_ID ] ) ? ' checked="checked"' : '';
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
 assert($question_group);
10 10
 assert($question_group instanceof EE_Question_Group);
11 11
 /* @var EE_Question[] $all_questions */
12
-assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions)));//list of unused questions
13
-foreach($all_questions as $unused_question){
12
+assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions))); //list of unused questions
13
+foreach ($all_questions as $unused_question) {
14 14
 	assert($unused_question);
15 15
 	assert($unused_question instanceof EE_Question);
16 16
 }
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 
20 20
 $QSG_system = $question_group->system_group();
21 21
 
22
-$disabled = ! empty( $QSG_system ) ? ' disabled="disabled"' : '';
23
-$id =  ! empty( $QST_system ) ? '_disabled' : '';
22
+$disabled = ! empty($QSG_system) ? ' disabled="disabled"' : '';
23
+$id = ! empty($QST_system) ? '_disabled' : '';
24 24
 ?>
25 25
 
26 26
 <div id="group-details" class="edit-group padding">
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 			<tr>
31 31
 				<th>
32 32
 					<label for="QSG_name">
33
-						<?php _e('Group Name','event_espresso');?> <?php echo EEH_Template::get_help_tab_link('group_name_info');?>
33
+						<?php _e('Group Name', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('group_name_info'); ?>
34 34
 					</label>
35 35
 				</th>
36 36
 				<td>
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
 			<tr>
43 43
 				<th>
44 44
 					<label for="QSG_identifier">
45
-						<?php _e('Group Identifier','event_espresso');?> <?php echo EEH_Template::get_help_tab_link('group_identifier_info');?>
45
+						<?php _e('Group Identifier', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('group_identifier_info'); ?>
46 46
 					</label>
47 47
 				</th>
48 48
 				<td>
49 49
 					<input id="QSG_identifier" name="QSG_identifier<?php echo $id; ?>" value="<?php echo $question_group->identifier()?>" type="text" class="regular-text"<?php echo $disabled; ?>>
50
-					<?php if ( ! empty( $QSG_system )) { ?>
50
+					<?php if ( ! empty($QSG_system)) { ?>
51 51
 					<p><span class="description" style="color:#D54E21;">
52
-							<?php _e('System question group! This field cannot be changed.','event_espresso')?>
52
+							<?php _e('System question group! This field cannot be changed.', 'event_espresso')?>
53 53
 					</span><br/></p>
54 54
 					<?php } ?>
55 55
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 			<tr>
59 59
 				<th>
60 60
 					<label for="QSG_desc">
61
-						<?php _e('Description','event_espresso');?> <?php echo EEH_Template::get_help_tab_link('group_description_info');?>
61
+						<?php _e('Description', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('group_description_info'); ?>
62 62
 					</label>
63 63
 				</th>
64 64
 				<td>
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 			<tr>
70 70
 				<th>
71 71
 					<label for="QSG_order">
72
-						<?php _e('Question Group Order','event_espresso');?> <?php echo EEH_Template::get_help_tab_link('group_order_info');?>
72
+						<?php _e('Question Group Order', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('group_order_info'); ?>
73 73
 					</label>
74 74
 				</th>
75 75
 				<td>
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
 			<tr>
81 81
 				<th>
82 82
 					<label>
83
-						<?php _e('Show Name','event_espresso');?> <?php echo EEH_Template::get_help_tab_link('show_group_name_info');?>
83
+						<?php _e('Show Name', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('show_group_name_info'); ?>
84 84
 					</label>
85 85
 				</th>
86 86
 				<td>
87 87
 					<label for="QSG_show_group_name">
88
-                        <?php echo EEH_Form_Fields::select_input( 'QSG_show_group_name', $values, $question_group->show_group_name() ); ?>
89
-						<p class="description"><?php _e('Show Group Name on Registration Page?','event_espresso');?></p>
88
+                        <?php echo EEH_Form_Fields::select_input('QSG_show_group_name', $values, $question_group->show_group_name()); ?>
89
+						<p class="description"><?php _e('Show Group Name on Registration Page?', 'event_espresso'); ?></p>
90 90
 					</label>
91 91
 				</td>
92 92
 			</tr>
@@ -94,13 +94,13 @@  discard block
 block discarded – undo
94 94
 			<tr>
95 95
 				<th>
96 96
 					<label>
97
-						<?php _e(' Show Description','event_espresso');?> <?php echo EEH_Template::get_help_tab_link('show_group_description_info');?>
97
+						<?php _e(' Show Description', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('show_group_description_info'); ?>
98 98
 					</label>
99 99
 				</th>
100 100
 				<td>
101 101
                     <label for="QSG_show_group_order">
102
-                        <?php echo EEH_Form_Fields::select_input( 'QSG_show_group_desc', $values, $question_group->show_group_desc() ); ?>
103
-                        <p class="description"><?php _e(' Show Group Description on Registration Page?','event_espresso');?></p>
102
+                        <?php echo EEH_Form_Fields::select_input('QSG_show_group_desc', $values, $question_group->show_group_desc()); ?>
103
+                        <p class="description"><?php _e(' Show Group Description on Registration Page?', 'event_espresso'); ?></p>
104 104
 					</label>
105 105
                     <input type="hidden" name="QSG_system" value="<?php echo $question_group->system_group(); ?>">
106 106
                 </td>
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 </div>
112 112
 
113 113
 <div id="group-questions" class="edit-group padding question-group-questions-container postbox">
114
-    <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'event_espresso' ); ?>"><br></div>
115
-    <h2 class="handle"><?php _e('Questions','event_espresso');?></h2>
114
+    <div class="handlediv" title="<?php esc_attr_e('Click to toggle', 'event_espresso'); ?>"><br></div>
115
+    <h2 class="handle"><?php _e('Questions', 'event_espresso'); ?></h2>
116 116
 	<div class="form-table question-group-questions inside">
117 117
         <div class="padding">
118 118
             <p><span class="description"><?php _e('Select which questions should be shown in this group by checking or unchecking boxes. You can drag and drop questions to reorder them. Your changes will be updated when you save.', 'event_espresso'); ?></span></p>
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
                     <?php
122 122
 					$question_order = 0;
123 123
 					$question_group_questions = $question_group->questions();
124
-                    foreach( $all_questions as $question_ID => $question ){
125
-						if ( $question instanceof EE_Question ) {
124
+                    foreach ($all_questions as $question_ID => $question) {
125
+						if ($question instanceof EE_Question) {
126 126
 							/*@var $question EE_Question*/
127
-							$checked = isset( $question_group_questions[ $question_ID ] ) ? ' checked="checked"' : '';
127
+							$checked = isset($question_group_questions[$question_ID]) ? ' checked="checked"' : '';
128 128
 							// disable questions from the personal information question group
129 129
 							$disabled = $question->is_system_question() && $QSG_system == EEM_Question_Group::system_personal ? ' disabled="disabled"' : '';
130 130
 							// make sure phone checkbox is enabled
@@ -134,14 +134,14 @@  discard block
 block discarded – undo
134 134
 									$QSG_system === EEM_Question_Group::system_personal
135 135
 									&& $question->is_system_question()
136 136
 									&& (
137
-										empty( $checked )
137
+										empty($checked)
138 138
 										&& $question->ID() != EEM_Attendee::phone_question_id
139 139
 									)
140 140
 								)
141 141
 								||
142 142
 								(
143 143
 									$QSG_system == EEM_Question_Group::system_address
144
-									&& in_array( $question_ID, array( EEM_Attendee::fname_question_id, EEM_Attendee::lname_question_id, EEM_Attendee::email_question_id ))
144
+									&& in_array($question_ID, array(EEM_Attendee::fname_question_id, EEM_Attendee::lname_question_id, EEM_Attendee::email_question_id))
145 145
 								)
146 146
 								||
147 147
 								(
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
 						?>
155 155
                     <li class="ee-question-sortable">
156 156
                         <label for="question-<?php echo $question_ID?>">
157
-                            <input type="checkbox" name="questions[<?php echo $question_ID;?>]" id="question-<?php echo $question_ID; ?>" value="<?php echo $question_ID;?>"<?php echo $disabled; ?><?php echo $checked; ?>/>
157
+                            <input type="checkbox" name="questions[<?php echo $question_ID; ?>]" id="question-<?php echo $question_ID; ?>" value="<?php echo $question_ID; ?>"<?php echo $disabled; ?><?php echo $checked; ?>/>
158 158
                             <span class="question-text">
159
-								<?php echo trim( $question->display_text() ) . ( 95 <= strlen( trim( $question->display_text() ) ) ? "&hellip;" : '' ); ?>
159
+								<?php echo trim($question->display_text()).(95 <= strlen(trim($question->display_text())) ? "&hellip;" : ''); ?>
160 160
 							</span>
161 161
                             <input class="question-group-QGQ_order" type="hidden" name="question_orders[<?php echo $question_ID; ?>]" value="<?php echo $question_order; ?>">
162 162
                         </label>
Please login to merge, or discard this patch.
extend/registration_form/templates/questions_in_group_meta_box.template.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@
 block discarded – undo
1 1
 <?php
2 2
 //required variables for template:
3 3
 assert($question_group instanceof EE_Question_Group);
4
-assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions)));//list of unused questions
5
-foreach($all_questions as $question_option){
4
+assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions))); //list of unused questions
5
+foreach ($all_questions as $question_option) {
6 6
 	assert($question_option);
7 7
 	assert($question_option instanceof EE_Question);
8 8
 }
9 9
 ?>
10
-<h4><?php _e('Check off all questions that you wish to appear in this group.','event_espresso');?></h4>
10
+<h4><?php _e('Check off all questions that you wish to appear in this group.', 'event_espresso'); ?></h4>
11 11
 <ul>
12 12
 	<?php 
13
-	foreach( $all_questions as $question_ID=>$question ){
13
+	foreach ($all_questions as $question_ID=>$question) {
14 14
 		/*@var $question EE_Question*/
15
-		$checked = array_key_exists( $question_ID, $question_group->questions() ) ? ' checked="checked"' : '';
15
+		$checked = array_key_exists($question_ID, $question_group->questions()) ? ' checked="checked"' : '';
16 16
 	?>
17 17
 	<li>
18 18
 		<label for="question-<?php echo $question_ID?>">
19
-			<input type="checkbox" name="questions[<?php echo $question_ID;?>]" id="question-<?php echo $question_ID;?>" value="<?php echo $question_ID;?>"<?php echo $checked;?>/>
19
+			<input type="checkbox" name="questions[<?php echo $question_ID; ?>]" id="question-<?php echo $question_ID; ?>" value="<?php echo $question_ID; ?>"<?php echo $checked; ?>/>
20 20
 			<?php echo $question->display_text()?>				
21 21
 		</label>
22 22
 	</li>
Please login to merge, or discard this patch.
admin/extend/registration_form/templates/reg_form_settings.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,3 @@
 block discarded – undo
1 1
 <div class="padding">
2
-		<?php do_action( 'AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template' ); ?>
2
+		<?php do_action('AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template'); ?>
3 3
 </div>
Please login to merge, or discard this patch.
admin/extend/registrations/EE_Event_Registrations_List_Table.class.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
 	/**
186 186
 	 * 		column_REG_att_checked_in
187
-	*/
187
+	 */
188 188
 	function column__REG_att_checked_in(EE_Registration $item){
189 189
 		$DTT_ID = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : 0;
190 190
 		$checkinstatus = $item->check_in_status_for_datetime($DTT_ID);
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 
234 234
 	/**
235 235
 	 * 		column_REG_count
236
-	*/
236
+	 */
237 237
 	function column__REG_count(EE_Registration $item){
238 238
 		return sprintf(__( '%s of %s', 'event_espresso' ),$item->count(), $item->group_size());
239 239
 	}
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 
276 276
 	/**
277 277
 	 * 		column_REG_final_price
278
-	*/
278
+	 */
279 279
 	function column__REG_final_price(EE_Registration $item){
280 280
 		return '<span class="reg-pad-rght">' .  ' ' . $item->pretty_final_price() . '</span>';
281 281
 	}
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 
287 287
 	/**
288 288
 	 * 		column_TXN_paid
289
-	*/
289
+	 */
290 290
 	function column_TXN_paid(EE_Registration $item){
291 291
 
292 292
 		if ( $item->count() == 1 ) {
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 
314 314
 	/**
315 315
 	 * 		column_TXN_total
316
-	*/
316
+	 */
317 317
 	function column_TXN_total(EE_Registration $item){
318 318
 		$txn = $item->transaction();
319 319
 		$view_txn_url = add_query_arg( array('action' => 'view_transaction', 'TXN_ID' => $txn->ID() ), TXN_ADMIN_URL );
Please login to merge, or discard this patch.
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	 */
15 15
 	protected $_evt = NULL;
16 16
 
17
-	public function __construct( $admin_page ) {
17
+	public function __construct($admin_page) {
18 18
 		parent::__construct($admin_page);
19 19
 		$this->_status = $this->_admin_page->get_registration_status_array();
20 20
 	}
@@ -23,15 +23,15 @@  discard block
 block discarded – undo
23 23
 
24 24
 
25 25
 	protected function _setup_data() {
26
-		$this->_data = $this->_view != 'trash' ? $this->_admin_page->get_event_attendees( $this->_per_page ) : $this->_admin_page->get_event_attendees( $this->_per_page, FALSE, TRUE );
27
-		$this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_event_attendees(  $this->_per_page, TRUE ) : $this->_admin_page->get_event_attendees(  $this->_per_page, TRUE, TRUE);
26
+		$this->_data = $this->_view != 'trash' ? $this->_admin_page->get_event_attendees($this->_per_page) : $this->_admin_page->get_event_attendees($this->_per_page, FALSE, TRUE);
27
+		$this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_event_attendees($this->_per_page, TRUE) : $this->_admin_page->get_event_attendees($this->_per_page, TRUE, TRUE);
28 28
 	}
29 29
 
30 30
 
31 31
 
32 32
 
33 33
 	protected function _set_properties() {
34
-		$evt_id = isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : NULL;
34
+		$evt_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : NULL;
35 35
 
36 36
 		$this->_wp_list_args = array(
37 37
 			'singular' => __('registrant', 'event_espresso'),
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 			);
42 42
 
43 43
 		$columns['_Reg_Status'] = '';
44
-		if ( !empty( $evt_id ) )
45
-			$columns['cb'] =  '<input type="checkbox" />'; //Render a checkbox instead of text
44
+		if ( ! empty($evt_id))
45
+			$columns['cb'] = '<input type="checkbox" />'; //Render a checkbox instead of text
46 46
 
47 47
 		$this->_columns = array(
48 48
 				'_REG_att_checked_in' => '<span class="dashicons dashicons-yes ee-icon-size-18"></span>',
@@ -50,36 +50,36 @@  discard block
 block discarded – undo
50 50
 				'ATT_name' =>  __('Registrant', 'event_espresso'),
51 51
 				'ATT_email' =>  __('Email Address', 'event_espresso'),
52 52
 				'Event' => __('Event', 'event_espresso'),
53
-				'_REG_code' => __( 'Reg Code', 'event_espresso' ),
53
+				'_REG_code' => __('Reg Code', 'event_espresso'),
54 54
 				'PRC_name' => __('TKT Option', 'event_espresso'),
55 55
 				'_REG_final_price' => __('Price', 'event_espresso'),
56 56
 				'TXN_paid' => __('Paid', 'event_espresso'),
57 57
 				'TXN_total' => __('Total', 'event_espresso')
58 58
 			);
59 59
 
60
-		$this->_columns = array_merge( $columns, $this->_columns);
60
+		$this->_columns = array_merge($columns, $this->_columns);
61 61
 
62
-		if ( !empty( $evt_id ) && EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'espresso_registrations_registrations_reports', $evt_id )  ) {
62
+		if ( ! empty($evt_id) && EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'espresso_registrations_registrations_reports', $evt_id)) {
63 63
 			$this->_bottom_buttons = array(
64 64
 				'report'=> array(
65 65
 					'route' => 'registrations_report',
66
-					'extra_request' => !empty($evt_id) ? array('EVT_ID'=>$evt_id) : NULL
66
+					'extra_request' => ! empty($evt_id) ? array('EVT_ID'=>$evt_id) : NULL
67 67
 				)
68 68
 			);
69 69
 		}
70 70
 
71 71
 		$this->_sortable_columns = array(
72 72
 			 //true means its already sorted
73
-			'ATT_name' => array( 'ATT_name' => TRUE ),
74
-			'_REG_code' => array( '_REG_code' => TRUE ),
75
-			'Event' => array( 'Event.EVT.Name' => FALSE )
73
+			'ATT_name' => array('ATT_name' => TRUE),
74
+			'_REG_code' => array('_REG_code' => TRUE),
75
+			'Event' => array('Event.EVT.Name' => FALSE)
76 76
 		);
77 77
 
78 78
 		$this->_hidden_columns = array();
79 79
 
80 80
 
81 81
 		$this->_evt = EEM_Event::instance()->get_one_by_ID($evt_id);
82
-		$this->_dtts_for_event = !empty($evt_id) ? $this->_evt->datetimes_ordered() : array();
82
+		$this->_dtts_for_event = ! empty($evt_id) ? $this->_evt->datetimes_ordered() : array();
83 83
 
84 84
 
85 85
 	}
@@ -91,36 +91,36 @@  discard block
 block discarded – undo
91 91
 	protected function _get_table_filters() {
92 92
 		$filters = $where = array();
93 93
 
94
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
94
+		EE_Registry::instance()->load_helper('Form_Fields');
95 95
 
96
-		if ( empty( $this->_dtts_for_event ) ) {
96
+		if (empty($this->_dtts_for_event)) {
97 97
 			//this means we don't have an event so let's setup a filter dropdown for all the events to select
98 98
 			//note possible capability restrictions
99
-			if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_events', 'get_events') ) {
100
-				$where['status**'] =  array( '!=', 'private' );
99
+			if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
100
+				$where['status**'] = array('!=', 'private');
101 101
 			}
102 102
 
103
-			if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) {
104
-				$where['EVT_wp_user'] =  get_current_user_id();
103
+			if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
104
+				$where['EVT_wp_user'] = get_current_user_id();
105 105
 			}
106 106
 
107
-			$events = EEM_Event::instance()->get_all(array( $where, 'order_by' => array( 'EVT_name' => 'asc' ) ) );
108
-			$evts[] = array('id' => 0, 'text' => __('To toggle Check-in status, select an event', 'event_espresso') );
109
-			foreach ( $events as $evt ) {
107
+			$events = EEM_Event::instance()->get_all(array($where, 'order_by' => array('EVT_name' => 'asc')));
108
+			$evts[] = array('id' => 0, 'text' => __('To toggle Check-in status, select an event', 'event_espresso'));
109
+			foreach ($events as $evt) {
110 110
 				//any registrations for this event?
111
-				if ( ! $evt->get_count_of_all_registrations() )
111
+				if ( ! $evt->get_count_of_all_registrations())
112 112
 					continue;
113
-				$evts[] = array( 'id' => $evt->ID(), 'text' => $evt->get('EVT_name') );
113
+				$evts[] = array('id' => $evt->ID(), 'text' => $evt->get('EVT_name'));
114 114
 			}
115
-			$filters[] = EEH_Form_Fields::select_input( 'event_id', $evts );
115
+			$filters[] = EEH_Form_Fields::select_input('event_id', $evts);
116 116
 
117 117
 		} else {
118 118
 			//DTT datetimes filter
119
-			$cur_dtt = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : $this->_evt->primary_datetime()->ID();
119
+			$cur_dtt = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : $this->_evt->primary_datetime()->ID();
120 120
 			$dtts = array();
121
-			foreach ( $this->_dtts_for_event as $dtt ) {
122
-				$datetime_string = $dtt->start_date_and_time() . ' - ' . $dtt->end_date_and_time();
123
-				$dtts[] = array('id' => $dtt->ID(), 'text' => $datetime_string );
121
+			foreach ($this->_dtts_for_event as $dtt) {
122
+				$datetime_string = $dtt->start_date_and_time().' - '.$dtt->end_date_and_time();
123
+				$dtts[] = array('id' => $dtt->ID(), 'text' => $datetime_string);
124 124
 			}
125 125
 			$filters[] = EEH_Form_Fields::select_input('DTT_ID', $dtts, $cur_dtt);
126 126
 		}
@@ -141,19 +141,19 @@  discard block
 block discarded – undo
141 141
 
142 142
 
143 143
 	protected function _get_total_event_attendees() {
144
-		$EVT_ID = isset($this->_req_data['event_id']) ? absint( $this->_req_data['event_id'] ) : FALSE;
145
-		$DTT_ID = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL;
144
+		$EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE;
145
+		$DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL;
146 146
 		$query_params = array();
147
-		if ($EVT_ID){
148
-			$query_params[0]['EVT_ID']=$EVT_ID;
147
+		if ($EVT_ID) {
148
+			$query_params[0]['EVT_ID'] = $EVT_ID;
149 149
 		}
150 150
 		//if DTT is included we do multiple datetimes.  Otherwise we just do primary datetime
151
-		if ( $DTT_ID ) {
151
+		if ($DTT_ID) {
152 152
 			$query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID;
153 153
 		}
154
-		$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 ) );
154
+		$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));
155 155
 
156
-		$query_params[0]['STS_ID']= array('IN', $status_ids_array );
156
+		$query_params[0]['STS_ID'] = array('IN', $status_ids_array);
157 157
 		return EEM_Registration::instance()->count($query_params);
158 158
 	}
159 159
 
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
 
164 164
 
165 165
 
166
-	function column__Reg_Status( EE_Registration $item ) {
167
-		return '<span class="ee-status-strip ee-status-strip-td reg-status-' . $item->status_ID() . '"></span>';
166
+	function column__Reg_Status(EE_Registration $item) {
167
+		return '<span class="ee-status-strip ee-status-strip-td reg-status-'.$item->status_ID().'"></span>';
168 168
 	}
169 169
 
170 170
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 
173 173
 
174 174
 	function column_cb($item) {
175
-		return sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID() );
175
+		return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID());
176 176
 	}
177 177
 
178 178
 
@@ -185,14 +185,14 @@  discard block
 block discarded – undo
185 185
 	/**
186 186
 	 * 		column_REG_att_checked_in
187 187
 	*/
188
-	function column__REG_att_checked_in(EE_Registration $item){
189
-		$DTT_ID = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : 0;
188
+	function column__REG_att_checked_in(EE_Registration $item) {
189
+		$DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0;
190 190
 		$checkinstatus = $item->check_in_status_for_datetime($DTT_ID);
191 191
 		$nonce = wp_create_nonce('checkin_nonce');
192
-		$evt_id = isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : NULL;
193
-		$toggle_active = !empty ( $evt_id ) && EE_Registry::instance()->CAP->current_user_can( 'ee_edit_checkin', 'espresso_registrations_toggle_checkin_status', $item->ID() ) ? ' clickable trigger-checkin' : '';
192
+		$evt_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : NULL;
193
+		$toggle_active = ! empty ($evt_id) && EE_Registry::instance()->CAP->current_user_can('ee_edit_checkin', 'espresso_registrations_toggle_checkin_status', $item->ID()) ? ' clickable trigger-checkin' : '';
194 194
 
195
-		 return '<span class="checkin-icons checkedin-status-' . $checkinstatus . $toggle_active . '" data-_regid="' . $item->ID() . '" data-dttid="' . $DTT_ID . '" data-nonce="' . $nonce . '"></span>';
195
+		 return '<span class="checkin-icons checkedin-status-'.$checkinstatus.$toggle_active.'" data-_regid="'.$item->ID().'" data-dttid="'.$DTT_ID.'" data-nonce="'.$nonce.'"></span>';
196 196
 	}
197 197
 
198 198
 
@@ -201,30 +201,30 @@  discard block
 block discarded – undo
201 201
 
202 202
 	function column_ATT_name(EE_Registration $item) {
203 203
 		$attendee = $item->attendee();
204
-		if ( ! $attendee instanceof EE_Attendee ) {
204
+		if ( ! $attendee instanceof EE_Attendee) {
205 205
 			return __('No contact record for this registration.', 'event_espresso');
206 206
 		}
207 207
 
208 208
 		// edit attendee link
209
-		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
210
-		$name_link = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_contacts', 'espresso_registrations_edit_attendee' ) ?  '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' . $item->attendee()->full_name() . '</a>' : $item->attendee()->full_name();
209
+		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
210
+		$name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">'.$item->attendee()->full_name().'</a>' : $item->attendee()->full_name();
211 211
 		$name_link .= $item->count() == 1 ? '&nbsp;<sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>	' : '';
212 212
 
213 213
 		$actions = array();
214
-		$DTT_ID = !empty( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL;
215
-		$DTT_ID = empty( $DTT_ID ) && !empty( $this->_req_data['event_id'] ) ? EEM_Event::instance()->get_one_by_ID( $this->_req_data['event_id'] )->primary_datetime()->ID() : $DTT_ID;
214
+		$DTT_ID = ! empty($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL;
215
+		$DTT_ID = empty($DTT_ID) && ! empty($this->_req_data['event_id']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['event_id'])->primary_datetime()->ID() : $DTT_ID;
216 216
 
217
-		if ( !empty($DTT_ID) && EE_Registry::instance()->CAP->current_user_can( 'ee_read_checkins', 'espresso_registrations_registration_checkins' ) ) {
218
-			$checkin_list_url = EE_Admin_Page::add_query_args_and_nonce( array('action' => 'registration_checkins', '_REGID' => $item->ID(), 'DTT_ID' => $DTT_ID));
219
-			$actions['checkin'] = '<a href="' . $checkin_list_url . '" title="' . esc_attr__('View all the check-ins/checkouts for this registrant', 'event_espresso' ) . '">' . __('View', 'event_espresso') . '</a>';
217
+		if ( ! empty($DTT_ID) && EE_Registry::instance()->CAP->current_user_can('ee_read_checkins', 'espresso_registrations_registration_checkins')) {
218
+			$checkin_list_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'registration_checkins', '_REGID' => $item->ID(), 'DTT_ID' => $DTT_ID));
219
+			$actions['checkin'] = '<a href="'.$checkin_list_url.'" title="'.esc_attr__('View all the check-ins/checkouts for this registrant', 'event_espresso').'">'.__('View', 'event_espresso').'</a>';
220 220
 		}
221 221
 
222
-		return !empty( $DTT_ID ) ? sprintf( '%1$s %2$s', $name_link, $this->row_actions($actions) ) : $name_link;
222
+		return ! empty($DTT_ID) ? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions)) : $name_link;
223 223
 	}
224 224
 
225 225
 
226 226
 
227
-	function column_ATT_email( EE_Registration $item ) {
227
+	function column_ATT_email(EE_Registration $item) {
228 228
 		$attendee = $item->attendee();
229 229
 		return $attendee instanceof EE_Attendee ? $attendee->email() : '';
230 230
 		return $item->get_first_related('Attendee')->email();
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
 	/**
235 235
 	 * 		column_REG_count
236 236
 	*/
237
-	function column__REG_count(EE_Registration $item){
238
-		return sprintf(__( '%s of %s', 'event_espresso' ),$item->count(), $item->group_size());
237
+	function column__REG_count(EE_Registration $item) {
238
+		return sprintf(__('%s of %s', 'event_espresso'), $item->count(), $item->group_size());
239 239
 	}
240 240
 
241 241
 
@@ -244,9 +244,9 @@  discard block
 block discarded – undo
244 244
 	 * @param  EE_Registration $item EE_Registration object
245 245
 	 * @return string                Registration code
246 246
 	 */
247
-	function column__REG_code(EE_Registration $item){
248
-		$link = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $item->ID() ), REG_ADMIN_URL );
249
-		return EE_Registry::instance()->instance()->CAP->current_user_can('ee_read_registration', 'view_registration', $item->ID() ) ? '<a href="' . $link . '" title="' . esc_attr__('View Registration Details', 'event_espresso') .'">' . $item->get('REG_code') . '</a>' : $item->get('REG_code');
247
+	function column__REG_code(EE_Registration $item) {
248
+		$link = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $item->ID()), REG_ADMIN_URL);
249
+		return EE_Registry::instance()->instance()->CAP->current_user_can('ee_read_registration', 'view_registration', $item->ID()) ? '<a href="'.$link.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">'.$item->get('REG_code').'</a>' : $item->get('REG_code');
250 250
 	}
251 251
 
252 252
 
@@ -255,8 +255,8 @@  discard block
 block discarded – undo
255 255
 
256 256
 	function column_Event(EE_Registration $item) {
257 257
 		$event = $this->_evt instanceof EE_Event ? $this->_evt : $item->event();
258
-		$chkin_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'event_registrations', 'event_id'=>$event->ID() ), REG_ADMIN_URL );
259
-		$event_label = EE_Registry::instance()->CAP->current_user_can( 'ee_read_checkins', 'espresso_registrations_registration_checkins' ) ?  '<a href="'.$chkin_lnk_url.'" title="' . esc_attr__( 'View Checkins for this Event', 'event_espresso' ) . '">' . $event->name() . '</a>' : $event->name();
258
+		$chkin_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'event_registrations', 'event_id'=>$event->ID()), REG_ADMIN_URL);
259
+		$event_label = EE_Registry::instance()->CAP->current_user_can('ee_read_checkins', 'espresso_registrations_registration_checkins') ? '<a href="'.$chkin_lnk_url.'" title="'.esc_attr__('View Checkins for this Event', 'event_espresso').'">'.$event->name().'</a>' : $event->name();
260 260
 		return $event_label;
261 261
 	}
262 262
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 
265 265
 
266 266
 
267
-	function column_PRC_name(EE_Registration $item){
267
+	function column_PRC_name(EE_Registration $item) {
268 268
 		return $item->ticket() instanceof EE_Ticket ? $item->ticket()->name() : __("Unknown", "event_espresso");
269 269
 	}
270 270
 
@@ -276,8 +276,8 @@  discard block
 block discarded – undo
276 276
 	/**
277 277
 	 * 		column_REG_final_price
278 278
 	*/
279
-	function column__REG_final_price(EE_Registration $item){
280
-		return '<span class="reg-pad-rght">' .  ' ' . $item->pretty_final_price() . '</span>';
279
+	function column__REG_final_price(EE_Registration $item) {
280
+		return '<span class="reg-pad-rght">'.' '.$item->pretty_final_price().'</span>';
281 281
 	}
282 282
 
283 283
 
@@ -287,20 +287,20 @@  discard block
 block discarded – undo
287 287
 	/**
288 288
 	 * 		column_TXN_paid
289 289
 	*/
290
-	function column_TXN_paid(EE_Registration $item){
290
+	function column_TXN_paid(EE_Registration $item) {
291 291
 
292
-		if ( $item->count() == 1 ) {
292
+		if ($item->count() == 1) {
293 293
 
294
-			if ( $item->transaction()->paid() >= $item->transaction()->total() ) {
294
+			if ($item->transaction()->paid() >= $item->transaction()->total()) {
295 295
 				return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>';
296 296
 			} else {
297
-				$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID() ), TXN_ADMIN_URL );
298
-				return EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction' ) ?  '
297
+				$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID()), TXN_ADMIN_URL);
298
+				return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '
299 299
 				<span class="reg-pad-rght">
300
-					<a class="status-'. $item->transaction()->status_ID() .'" href="'.$view_txn_lnk_url.'"  title="' . esc_attr__( 'View Transaction', 'event_espresso' ) . '">
301
-						' . $item->transaction()->pretty_paid(). '
300
+					<a class="status-'. $item->transaction()->status_ID().'" href="'.$view_txn_lnk_url.'"  title="'.esc_attr__('View Transaction', 'event_espresso').'">
301
+						' . $item->transaction()->pretty_paid().'
302 302
 					</a>
303
-				<span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>';
303
+				<span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_paid().'</span>';
304 304
 			}
305 305
 		} else {
306 306
 			return '<span class="reg-pad-rght"></span>';
@@ -314,13 +314,13 @@  discard block
 block discarded – undo
314 314
 	/**
315 315
 	 * 		column_TXN_total
316 316
 	*/
317
-	function column_TXN_total(EE_Registration $item){
317
+	function column_TXN_total(EE_Registration $item) {
318 318
 		$txn = $item->transaction();
319
-		$view_txn_url = add_query_arg( array('action' => 'view_transaction', 'TXN_ID' => $txn->ID() ), TXN_ADMIN_URL );
320
-		if ( $item->get('REG_count') == 1 ) {
319
+		$view_txn_url = add_query_arg(array('action' => 'view_transaction', 'TXN_ID' => $txn->ID()), TXN_ADMIN_URL);
320
+		if ($item->get('REG_count') == 1) {
321 321
 			$line_total_obj = $txn->total_line_item();
322 322
 			$txn_total = $line_total_obj instanceof EE_Line_Item ? $line_total_obj->get_pretty('LIN_total') : __('View Transaction', 'event_espresso');
323
-			return EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction' ) ?  '<a href="' . $view_txn_url . '" title="' . esc_attr__('View Transaction', 'event_espresso') . '"><span class="reg-pad-rght">'. $txn_total  .'</span></a>' : '<span class="reg-pad-rght">' . $txn_total . '</span>';
323
+			return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a href="'.$view_txn_url.'" title="'.esc_attr__('View Transaction', 'event_espresso').'"><span class="reg-pad-rght">'.$txn_total.'</span></a>' : '<span class="reg-pad-rght">'.$txn_total.'</span>';
324 324
 		} else {
325 325
 			return '<span class="reg-pad-rght"></span>';
326 326
 		}
Please login to merge, or discard this patch.
Braces   +10 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
 class EE_Event_Registrations_List_Table extends EE_Admin_List_Table {
@@ -41,8 +43,10 @@  discard block
 block discarded – undo
41 43
 			);
42 44
 
43 45
 		$columns['_Reg_Status'] = '';
44
-		if ( !empty( $evt_id ) )
45
-			$columns['cb'] =  '<input type="checkbox" />'; //Render a checkbox instead of text
46
+		if ( !empty( $evt_id ) ) {
47
+					$columns['cb'] =  '<input type="checkbox" />';
48
+		}
49
+		//Render a checkbox instead of text
46 50
 
47 51
 		$this->_columns = array(
48 52
 				'_REG_att_checked_in' => '<span class="dashicons dashicons-yes ee-icon-size-18"></span>',
@@ -108,8 +112,9 @@  discard block
 block discarded – undo
108 112
 			$evts[] = array('id' => 0, 'text' => __('To toggle Check-in status, select an event', 'event_espresso') );
109 113
 			foreach ( $events as $evt ) {
110 114
 				//any registrations for this event?
111
-				if ( ! $evt->get_count_of_all_registrations() )
112
-					continue;
115
+				if ( ! $evt->get_count_of_all_registrations() ) {
116
+									continue;
117
+				}
113 118
 				$evts[] = array( 'id' => $evt->ID(), 'text' => $evt->get('EVT_name') );
114 119
 			}
115 120
 			$filters[] = EEH_Form_Fields::select_input( 'event_id', $evts );
Please login to merge, or discard this patch.