Completed
Branch BUG-9514-non-translating-txn-t... (bd9fae)
by
unknown
446:27 queued 430:25
created
admin_pages/registration_form/Registration_Form_Admin_Page.core.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 					),
140 140
 				'list_table' => 'Registration_Form_Questions_Admin_List_Table',
141 141
 				'metaboxes' => $this->_default_espresso_metaboxes,
142
-                'help_tabs' => array(
142
+				'help_tabs' => array(
143 143
 					'registration_form_questions_overview_help_tab' => array(
144 144
 						'title' => __('Questions Overview', 'event_espresso'),
145 145
 						'filename' => 'registration_form_questions_overview'
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 						'filename' => 'registration_form_edit_question'
191 191
 						),
192 192
 					),
193
-                'help_tour' => array( 'Registration_Form_Edit_Question_Help_Tour'),
193
+				'help_tour' => array( 'Registration_Form_Edit_Question_Help_Tour'),
194 194
 				'require_nonce' => FALSE
195 195
 				),
196 196
 			);
Please login to merge, or discard this patch.
Braces   +9 added lines, -13 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
@@ -330,14 +331,9 @@  discard block
 block discarded – undo
330 331
 			else if ( $fieldName == 'QST_admin_label' && ( isset( $this->_req_data['QST_admin_label'] ) && empty( $this->_req_data['QST_admin_label'] )  )) {
331 332
 				$QST_text = isset( $this->_req_data['QST_display_text'] ) ? $this->_req_data['QST_display_text'] : '' ;
332 333
 				$set_column_values[$fieldName] = sanitize_title(wp_trim_words($QST_text,10));
333
-			}
334
-
335
-
336
-			else if ( $fieldName == 'QST_admin_only' && ( !isset( $this->_req_data['QST_admin_only'] ) ) ) {
334
+			} else if ( $fieldName == 'QST_admin_only' && ( !isset( $this->_req_data['QST_admin_only'] ) ) ) {
337 335
 				$set_column_values[$fieldName] = 0;
338
-			}
339
-
340
-			else if ( $fieldName == 'QST_max' ) {
336
+			} else if ( $fieldName == 'QST_max' ) {
341 337
 				$qst_system = EEM_Question::instance()->get_var(
342 338
 					array(
343 339
 						array(
@@ -390,7 +386,7 @@  discard block
 block discarded – undo
390 386
 			$question=$this->_question_model->get_one_by_ID($ID);
391 387
 			$additional_hidden_fields=array('QST_ID'=>array('type'=>'hidden','value'=>$ID));
392 388
 			$this->_set_add_edit_form_tags('update_question', $additional_hidden_fields);
393
-		}else{
389
+		} else{
394 390
 			$question= EE_Question::new_instance();
395 391
 			$question->set_order_to_latest();
396 392
 			$this->_set_add_edit_form_tags('insert_question');
@@ -421,7 +417,7 @@  discard block
 block discarded – undo
421 417
 			$ID=$this->_question_model->insert($set_column_values);
422 418
 			$success = $ID ? true : false;
423 419
 			$action_desc = 'added';
424
-		}else{
420
+		} else{
425 421
 			$ID=absint($this->_req_data['QST_ID']);
426 422
 			$pk=$this->_question_model->primary_key_name();
427 423
 			$wheres=array($pk=>$ID);
@@ -442,7 +438,7 @@  discard block
 block discarded – undo
442 438
 					$option_req_index=$this->_get_option_req_data_index($option_ID);
443 439
 					if($option_req_index!==FALSE){
444 440
 						$option->save($this->_req_data['question_options'][$option_req_index]);
445
-					}else{
441
+					} else{
446 442
 						//not found, remove it
447 443
 						$option->delete();
448 444
 					}
@@ -519,7 +515,7 @@  discard block
 block discarded – undo
519 515
 						'QSG_name'=>array('LIKE',"%$search_string%"),
520 516
 						'QSG_desc'=>array('LIKE',"%$search_string%"))
521 517
 					);
522
-			}else{
518
+			} else{
523 519
 				$query_params[0]=array(
524 520
 					'QST_display_text'=>array('LIKE',"%$search_string%")
525 521
 					);
@@ -575,7 +571,7 @@  discard block
 block discarded – undo
575 571
 		if ($count){
576 572
 			$where = isset( $query_params[0] ) ? array( $query_params[0] ) : array();
577 573
 			$results = $QST->count($where);
578
-		}else{
574
+		} else{
579 575
 			$results = $QST->get_all($query_params);
580 576
 		}
581 577
 		return $results;
Please login to merge, or discard this patch.
Spacing   +145 added lines, -145 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
 /**
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 
59 59
 
60 60
 
61
-	public function __construct( $routing = TRUE ) {
62
-		require_once( EE_MODELS . 'EEM_Question.model.php' );
63
-		require_once( EE_MODELS . 'EEM_Question_Group.model.php' );
64
-		$this->_question_model=  EEM_Question::instance();
65
-		$this->_question_group_model=EEM_Question_Group::instance();
66
-		parent::__construct( $routing );
61
+	public function __construct($routing = TRUE) {
62
+		require_once(EE_MODELS.'EEM_Question.model.php');
63
+		require_once(EE_MODELS.'EEM_Question_Group.model.php');
64
+		$this->_question_model = EEM_Question::instance();
65
+		$this->_question_group_model = EEM_Question_Group::instance();
66
+		parent::__construct($routing);
67 67
 	}
68 68
 
69 69
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
 
99 99
 	protected function _set_page_routes() {
100
-		$qst_id = ! empty( $this->_req_data['QST_ID'] ) ? $this->_req_data['QST_ID'] : 0;
100
+		$qst_id = ! empty($this->_req_data['QST_ID']) ? $this->_req_data['QST_ID'] : 0;
101 101
 		$this->_page_routes = array(
102 102
 			'default' => array(
103 103
 				'func' => '_questions_overview_list_table',
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
 			'update_question' => array(
120 120
 				'func' => '_insert_or_update_question',
121
-				'args' => array('new_question' => FALSE ),
121
+				'args' => array('new_question' => FALSE),
122 122
 				'capability' => 'ee_edit_question',
123 123
 				'obj_id' => $qst_id,
124 124
 				'noheader' => TRUE,
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 						'filename' => 'registration_form_questions_overview_views_bulk_actions_search'
154 154
 						)
155 155
 					),
156
-				'help_tour' => array( 'Registration_Form_Questions_Overview_Help_Tour'),
156
+				'help_tour' => array('Registration_Form_Questions_Overview_Help_Tour'),
157 157
 				'require_nonce' => FALSE,
158 158
 				'qtips' => array(
159 159
 					'EE_Registration_Form_Tips'
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 						'filename' => 'registration_form_question_groups'
173 173
 						),
174 174
 					),
175
-				'help_tour' => array( 'Registration_Form_Question_Groups_Help_Tour'),
175
+				'help_tour' => array('Registration_Form_Question_Groups_Help_Tour'),
176 176
 				'require_nonce' => FALSE
177 177
 				),
178 178
 
@@ -181,16 +181,16 @@  discard block
 block discarded – undo
181 181
 					'label' => __('Edit Question', 'event_espresso'),
182 182
 					'order' => 15,
183 183
 					'persistent' => FALSE,
184
-					'url' => isset($this->_req_data['question_id']) ? add_query_arg(array('question_id' => $this->_req_data['question_id'] ), $this->_current_page_view_url )  : $this->_admin_base_url
184
+					'url' => isset($this->_req_data['question_id']) ? add_query_arg(array('question_id' => $this->_req_data['question_id']), $this->_current_page_view_url) : $this->_admin_base_url
185 185
 					),
186
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ),
186
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
187 187
 				'help_tabs' => array(
188 188
 					'registration_form_edit_question_group_help_tab' => array(
189 189
 						'title' => __('Edit Question', 'event_espresso'),
190 190
 						'filename' => 'registration_form_edit_question'
191 191
 						),
192 192
 					),
193
-                'help_tour' => array( 'Registration_Form_Edit_Question_Help_Tour'),
193
+                'help_tour' => array('Registration_Form_Edit_Question_Help_Tour'),
194 194
 				'require_nonce' => FALSE
195 195
 				),
196 196
 			);
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	//none of the below group are currently used for Event Categories
219 219
 	protected function _add_feature_pointers() {}
220 220
 	public function load_scripts_styles() {
221
-		wp_register_style( 'espresso_registration', REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.css', array(), EVENT_ESPRESSO_VERSION );
221
+		wp_register_style('espresso_registration', REGISTRATION_FORM_ASSETS_URL.'espresso_registration_form_admin.css', array(), EVENT_ESPRESSO_VERSION);
222 222
 		wp_enqueue_style('espresso_registration');
223 223
 	}
224 224
 	public function admin_init() {}
@@ -234,20 +234,20 @@  discard block
 block discarded – undo
234 234
 
235 235
 	public function load_scripts_styles_add_question() {
236 236
 		$this->load_scripts_styles_forms();
237
-		wp_register_script( 'espresso_registration_form_single', REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, TRUE );
238
-		wp_enqueue_script( 'espresso_registration_form_single' );
237
+		wp_register_script('espresso_registration_form_single', REGISTRATION_FORM_ASSETS_URL.'espresso_registration_form_admin.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, TRUE);
238
+		wp_enqueue_script('espresso_registration_form_single');
239 239
 	}
240 240
 	public function load_scripts_styles_edit_question() {
241 241
 		$this->load_scripts_styles_forms();
242
-		wp_register_script( 'espresso_registration_form_single', REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, TRUE );
243
-		wp_enqueue_script( 'espresso_registration_form_single' );
242
+		wp_register_script('espresso_registration_form_single', REGISTRATION_FORM_ASSETS_URL.'espresso_registration_form_admin.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, TRUE);
243
+		wp_enqueue_script('espresso_registration_form_single');
244 244
 	}
245 245
 
246 246
 
247 247
 
248 248
 
249 249
 	public function recaptcha_info_help_tab() {
250
-		$template = REGISTRATION_FORM_TEMPLATE_PATH . 'recaptcha_info_help_tab.template.php';
250
+		$template = REGISTRATION_FORM_TEMPLATE_PATH.'recaptcha_info_help_tab.template.php';
251 251
 		EEH_Template::display_template($template, array());
252 252
 	}
253 253
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 				)
280 280
 		);
281 281
 
282
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_questions', 'espresso_registration_form_trash_questions' ) ) {
282
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_questions', 'espresso_registration_form_trash_questions')) {
283 283
 			$this->_views['trash'] = array(
284 284
 				'slug' => 'trash',
285 285
 				'label' => __('Trash', 'event_espresso'),
@@ -297,9 +297,9 @@  discard block
 block discarded – undo
297 297
 	 */
298 298
 	protected function _questions_groups_preview() {
299 299
 		$this->_admin_page_title = __('Question Groups (Preview)', 'event_espresso');
300
-		$this->_template_args['preview_img'] = '<img src="' . REGISTRATION_FORM_ASSETS_URL . 'caf_reg_form_preview.jpg" alt="' . esc_attr__( 'Preview Question Groups Overview List Table screenshot', 'event_espresso' ) . '" />';
301
-		$this->_template_args['preview_text'] = '<strong>'.__( 'Question Groups is a feature that is only available in the Caffeinated version of Event Espresso.  With the Question Groups feature you are able to: create new question groups, edit existing question groups, and also create and edit new questions and add them to question groups.', 'event_espresso' ).'</strong>';
302
-		$this->display_admin_caf_preview_page( 'question_groups_tab' );
300
+		$this->_template_args['preview_img'] = '<img src="'.REGISTRATION_FORM_ASSETS_URL.'caf_reg_form_preview.jpg" alt="'.esc_attr__('Preview Question Groups Overview List Table screenshot', 'event_espresso').'" />';
301
+		$this->_template_args['preview_text'] = '<strong>'.__('Question Groups is a feature that is only available in the Caffeinated version of Event Espresso.  With the Question Groups feature you are able to: create new question groups, edit existing question groups, and also create and edit new questions and add them to question groups.', 'event_espresso').'</strong>';
302
+		$this->display_admin_caf_preview_page('question_groups_tab');
303 303
 	}
304 304
 
305 305
 
@@ -310,58 +310,58 @@  discard block
 block discarded – undo
310 310
 	 * @param \EEM_Base $model
311 311
 	 * @return array where each key is the name of a model's field/db column, and each value is its value.
312 312
 	 */
313
-	protected function _set_column_values_for(EEM_Base $model){
314
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
315
-		$set_column_values=array();
313
+	protected function _set_column_values_for(EEM_Base $model) {
314
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
315
+		$set_column_values = array();
316 316
 
317 317
 		//some initial checks for proper values.
318 318
 		//if QST_admin_only, then no matter what QST_required is we disable.
319
-		if ( !empty( $this->_req_data['QST_admin_only'] ) ) {
319
+		if ( ! empty($this->_req_data['QST_admin_only'])) {
320 320
 			$this->_req_data['QST_required'] = 0;
321 321
 		}
322
-		foreach($model->field_settings() as $fieldName=>$settings){
322
+		foreach ($model->field_settings() as $fieldName=>$settings) {
323 323
 			// basically if QSG_identifier is empty or not set
324
-			if ( $fieldName == 'QSG_identifier' && ( isset( $this->_req_data['QSG_identifier'] ) && empty( $this->_req_data['QSG_identifier'] ) )) {
325
-				$QSG_name = isset( $this->_req_data['QSG_name'] ) ? $this->_req_data['QSG_name'] : '' ;
326
-				$set_column_values[$fieldName] = sanitize_title($QSG_name ) . '-' . uniqid();
324
+			if ($fieldName == 'QSG_identifier' && (isset($this->_req_data['QSG_identifier']) && empty($this->_req_data['QSG_identifier']))) {
325
+				$QSG_name = isset($this->_req_data['QSG_name']) ? $this->_req_data['QSG_name'] : '';
326
+				$set_column_values[$fieldName] = sanitize_title($QSG_name).'-'.uniqid();
327 327
 //				dd($set_column_values);
328 328
 			}
329 329
 			//if the admin label is blank, use a slug version of the question text
330
-			else if ( $fieldName == 'QST_admin_label' && ( isset( $this->_req_data['QST_admin_label'] ) && empty( $this->_req_data['QST_admin_label'] )  )) {
331
-				$QST_text = isset( $this->_req_data['QST_display_text'] ) ? $this->_req_data['QST_display_text'] : '' ;
332
-				$set_column_values[$fieldName] = sanitize_title(wp_trim_words($QST_text,10));
330
+			else if ($fieldName == 'QST_admin_label' && (isset($this->_req_data['QST_admin_label']) && empty($this->_req_data['QST_admin_label']))) {
331
+				$QST_text = isset($this->_req_data['QST_display_text']) ? $this->_req_data['QST_display_text'] : '';
332
+				$set_column_values[$fieldName] = sanitize_title(wp_trim_words($QST_text, 10));
333 333
 			}
334 334
 
335 335
 
336
-			else if ( $fieldName == 'QST_admin_only' && ( !isset( $this->_req_data['QST_admin_only'] ) ) ) {
336
+			else if ($fieldName == 'QST_admin_only' && ( ! isset($this->_req_data['QST_admin_only']))) {
337 337
 				$set_column_values[$fieldName] = 0;
338 338
 			}
339 339
 
340
-			else if ( $fieldName == 'QST_max' ) {
340
+			else if ($fieldName == 'QST_max') {
341 341
 				$qst_system = EEM_Question::instance()->get_var(
342 342
 					array(
343 343
 						array(
344
-							'QST_ID' => isset( $this->_req_data[ 'QST_ID' ] ) ? $this->_req_data[ 'QST_ID' ] : 0
344
+							'QST_ID' => isset($this->_req_data['QST_ID']) ? $this->_req_data['QST_ID'] : 0
345 345
 						)
346 346
 					),
347 347
 					'QST_system' );
348
-				$max_max = EEM_Question::instance()->absolute_max_for_system_question( $qst_system );
349
-				if( empty( $this->_req_data[ 'QST_max' ] ) ||
350
-					 $this->_req_data[ 'QST_max' ] > $max_max ) {
351
-					$set_column_values[ $fieldName ] = $max_max;
348
+				$max_max = EEM_Question::instance()->absolute_max_for_system_question($qst_system);
349
+				if (empty($this->_req_data['QST_max']) ||
350
+					 $this->_req_data['QST_max'] > $max_max) {
351
+					$set_column_values[$fieldName] = $max_max;
352 352
 				}
353 353
 			}
354 354
 
355 355
 
356 356
 			//only add a property to the array if it's not null (otherwise the model should just use the default value)
357
-			if(
358
-				! isset( $set_column_values[ $fieldName ] ) &&
359
-				isset($this->_req_data[$fieldName] ) ){
360
-				$set_column_values[$fieldName]=$this->_req_data[$fieldName];
357
+			if (
358
+				! isset($set_column_values[$fieldName]) &&
359
+				isset($this->_req_data[$fieldName]) ) {
360
+				$set_column_values[$fieldName] = $this->_req_data[$fieldName];
361 361
 			}
362 362
 
363 363
 		}
364
-		return $set_column_values;//validation fo this data to be performed by the model before insertion.
364
+		return $set_column_values; //validation fo this data to be performed by the model before insertion.
365 365
 	}
366 366
 
367 367
 
@@ -379,30 +379,30 @@  discard block
 block discarded – undo
379 379
 	/**
380 380
 	 * @param string $action
381 381
 	 */
382
-	protected function _edit_question( $action= 'add' ) {
383
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
384
-		$ID=isset( $this->_req_data['QST_ID'] ) && ! empty( $this->_req_data['QST_ID'] ) ? absint( $this->_req_data['QST_ID'] ) : FALSE;
382
+	protected function _edit_question($action = 'add') {
383
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
384
+		$ID = isset($this->_req_data['QST_ID']) && ! empty($this->_req_data['QST_ID']) ? absint($this->_req_data['QST_ID']) : FALSE;
385 385
 
386
-		$this->_admin_page_title = ucwords( str_replace( '_', ' ', $this->_req_action ));
386
+		$this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action));
387 387
 		// add PRC_ID to title if editing
388
-		$this->_admin_page_title = $ID ? $this->_admin_page_title . ' # ' . $ID : $this->_admin_page_title;
389
-		if($ID){
390
-			$question=$this->_question_model->get_one_by_ID($ID);
391
-			$additional_hidden_fields=array('QST_ID'=>array('type'=>'hidden','value'=>$ID));
388
+		$this->_admin_page_title = $ID ? $this->_admin_page_title.' # '.$ID : $this->_admin_page_title;
389
+		if ($ID) {
390
+			$question = $this->_question_model->get_one_by_ID($ID);
391
+			$additional_hidden_fields = array('QST_ID'=>array('type'=>'hidden', 'value'=>$ID));
392 392
 			$this->_set_add_edit_form_tags('update_question', $additional_hidden_fields);
393
-		}else{
394
-			$question= EE_Question::new_instance();
393
+		} else {
394
+			$question = EE_Question::new_instance();
395 395
 			$question->set_order_to_latest();
396 396
 			$this->_set_add_edit_form_tags('insert_question');
397 397
 		}
398
-		$question_types = $question->has_answers() ?  $this->_question_model->question_types_in_same_category( $question->type() ) : $this->_question_model->allowed_question_types();
399
-		$this->_template_args['QST_ID']=$ID;
400
-		$this->_template_args['question']=$question;
401
-		$this->_template_args['question_types']= $question_types;
402
-		$this->_template_args['max_max'] = EEM_Question::instance()->absolute_max_for_system_question( $question->system_ID() );
398
+		$question_types = $question->has_answers() ? $this->_question_model->question_types_in_same_category($question->type()) : $this->_question_model->allowed_question_types();
399
+		$this->_template_args['QST_ID'] = $ID;
400
+		$this->_template_args['question'] = $question;
401
+		$this->_template_args['question_types'] = $question_types;
402
+		$this->_template_args['max_max'] = EEM_Question::instance()->absolute_max_for_system_question($question->system_ID());
403 403
 
404
-		$this->_set_publish_post_box_vars( 'id', $ID );
405
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( REGISTRATION_FORM_TEMPLATE_PATH . 'questions_main_meta_box.template.php', $this->_template_args, TRUE );
404
+		$this->_set_publish_post_box_vars('id', $ID);
405
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(REGISTRATION_FORM_TEMPLATE_PATH.'questions_main_meta_box.template.php', $this->_template_args, TRUE);
406 406
 
407 407
 		// the details template wrapper
408 408
 		$this->display_admin_page_with_sidebar();
@@ -414,58 +414,58 @@  discard block
 block discarded – undo
414 414
 	 * @param bool|true $new_question
415 415
 	 * @throws \EE_Error
416 416
 	 */
417
-	protected function _insert_or_update_question( $new_question = TRUE) {
418
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
419
-		$set_column_values=$this->_set_column_values_for($this->_question_model);
420
-		if($new_question){
421
-			$ID=$this->_question_model->insert($set_column_values);
417
+	protected function _insert_or_update_question($new_question = TRUE) {
418
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
419
+		$set_column_values = $this->_set_column_values_for($this->_question_model);
420
+		if ($new_question) {
421
+			$ID = $this->_question_model->insert($set_column_values);
422 422
 			$success = $ID ? true : false;
423 423
 			$action_desc = 'added';
424
-		}else{
425
-			$ID=absint($this->_req_data['QST_ID']);
426
-			$pk=$this->_question_model->primary_key_name();
427
-			$wheres=array($pk=>$ID);
424
+		} else {
425
+			$ID = absint($this->_req_data['QST_ID']);
426
+			$pk = $this->_question_model->primary_key_name();
427
+			$wheres = array($pk=>$ID);
428 428
 			unset($set_column_values[$pk]);
429
-			$success= $this->_question_model->update($set_column_values,array($wheres));
430
-			$action_desc='updated';
429
+			$success = $this->_question_model->update($set_column_values, array($wheres));
430
+			$action_desc = 'updated';
431 431
 		}
432 432
 
433
-		if ($ID){
433
+		if ($ID) {
434 434
 			//save the related options
435 435
 			//trash removed options, save old ones
436 436
 			//get list of all options
437 437
 			/** @type EE_Question $question */
438
-			$question=$this->_question_model->get_one_by_ID($ID);
439
-			$options=$question->options();
440
-			if(! empty($options)){
441
-				foreach($options as $option_ID=>$option){
442
-					$option_req_index=$this->_get_option_req_data_index($option_ID);
443
-					if($option_req_index!==FALSE){
438
+			$question = $this->_question_model->get_one_by_ID($ID);
439
+			$options = $question->options();
440
+			if ( ! empty($options)) {
441
+				foreach ($options as $option_ID=>$option) {
442
+					$option_req_index = $this->_get_option_req_data_index($option_ID);
443
+					if ($option_req_index !== FALSE) {
444 444
 						$option->save($this->_req_data['question_options'][$option_req_index]);
445
-					}else{
445
+					} else {
446 446
 						//not found, remove it
447 447
 						$option->delete();
448 448
 					}
449 449
 				}
450 450
 			}
451 451
 			//save new related options
452
-			foreach($this->_req_data['question_options'] as $index=>$option_req_data){
453
-				if( empty($option_req_data['QSO_ID'] ) && (  ( isset( $option_req_data['QSO_value'] ) && $option_req_data['QSO_value'] !== '' ) || ! empty( $option_req_data['QSO_desc'] ) ) ) {//no ID! save it!
454
-					if( ! isset( $option_req_data['QSO_value'] ) || $option_req_data['QSO_value'] === ''  ){
455
-						$option_req_data['QSO_value']=$option_req_data['QSO_desc'];
452
+			foreach ($this->_req_data['question_options'] as $index=>$option_req_data) {
453
+				if (empty($option_req_data['QSO_ID']) && ((isset($option_req_data['QSO_value']) && $option_req_data['QSO_value'] !== '') || ! empty($option_req_data['QSO_desc']))) {//no ID! save it!
454
+					if ( ! isset($option_req_data['QSO_value']) || $option_req_data['QSO_value'] === '') {
455
+						$option_req_data['QSO_value'] = $option_req_data['QSO_desc'];
456 456
 					}
457
-					$new_option=EE_Question_Option::new_instance( array( 'QSO_value' => $option_req_data['QSO_value'], 'QSO_desc' => $option_req_data['QSO_desc'], 'QSO_order' => $option_req_data['QSO_order'], 'QST_ID' => $question->ID()));
457
+					$new_option = EE_Question_Option::new_instance(array('QSO_value' => $option_req_data['QSO_value'], 'QSO_desc' => $option_req_data['QSO_desc'], 'QSO_order' => $option_req_data['QSO_order'], 'QST_ID' => $question->ID()));
458 458
 					$new_option->save();
459 459
 				}
460 460
 			}
461 461
 		}
462
-		$query_args = array( 'action' => 'edit_question', 'QST_ID' => $ID );
463
-		if ( $success !== FALSE ) {
464
-			$msg = $new_question ? sprintf( __('The %s has been created', 'event_espresso'), $this->_question_model->item_name() ) : sprintf( __('The %s has been updated', 'event_espresso' ), $this->_question_model->item_name() );
465
-			EE_Error::add_success( $msg );
462
+		$query_args = array('action' => 'edit_question', 'QST_ID' => $ID);
463
+		if ($success !== FALSE) {
464
+			$msg = $new_question ? sprintf(__('The %s has been created', 'event_espresso'), $this->_question_model->item_name()) : sprintf(__('The %s has been updated', 'event_espresso'), $this->_question_model->item_name());
465
+			EE_Error::add_success($msg);
466 466
 		}
467 467
 
468
-		$this->_redirect_after_action( FALSE, '', $action_desc, $query_args, TRUE);
468
+		$this->_redirect_after_action(FALSE, '', $action_desc, $query_args, TRUE);
469 469
 	}
470 470
 
471 471
 
@@ -478,10 +478,10 @@  discard block
 block discarded – undo
478 478
 	 * @param int $ID of the question option to find
479 479
 	 * @return int index in question_options array if successful, FALSE if unsuccessful
480 480
 	 */
481
-	protected function _get_option_req_data_index($ID){
482
-		$req_data_for_question_options=$this->_req_data['question_options'];
483
-		foreach($req_data_for_question_options as $num=>$option_data){
484
-			if(array_key_exists('QSO_ID',$option_data) && intval($option_data['QSO_ID'])==$ID){
481
+	protected function _get_option_req_data_index($ID) {
482
+		$req_data_for_question_options = $this->_req_data['question_options'];
483
+		foreach ($req_data_for_question_options as $num=>$option_data) {
484
+			if (array_key_exists('QSO_ID', $option_data) && intval($option_data['QSO_ID']) == $ID) {
485 485
 				return $num;
486 486
 			}
487 487
 		}
@@ -503,25 +503,25 @@  discard block
 block discarded – undo
503 503
 	 * @param int      $current_page
504 504
 	 * @return array lik EEM_Base::get_all's $query_params parameter
505 505
 	 */
506
-	protected function get_query_params($model, $per_page=10,$current_page=10){
506
+	protected function get_query_params($model, $per_page = 10, $current_page = 10) {
507 507
 		$query_params = array();
508
-		$offset=($current_page-1)*$per_page;
509
-		$query_params['limit']=array($offset,$per_page);
510
-		$order = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
508
+		$offset = ($current_page - 1) * $per_page;
509
+		$query_params['limit'] = array($offset, $per_page);
510
+		$order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
511 511
 		$orderby_field = $model instanceof EEM_Question ? 'QST_ID' : 'QSG_order';
512 512
 		$field_to_order_by = empty($this->_req_data['orderby']) ? $orderby_field : $this->_req_data['orderby'];
513
-		$query_params['order_by']=array( $field_to_order_by => $order );
514
-		$search_string = array_key_exists('s',$this->_req_data) ? $this->_req_data['s'] : null;
515
-		if(! empty($search_string)){
516
-			if($model instanceof EEM_Question_Group){
517
-				$query_params[0]=array(
513
+		$query_params['order_by'] = array($field_to_order_by => $order);
514
+		$search_string = array_key_exists('s', $this->_req_data) ? $this->_req_data['s'] : null;
515
+		if ( ! empty($search_string)) {
516
+			if ($model instanceof EEM_Question_Group) {
517
+				$query_params[0] = array(
518 518
 					'OR'=>array(
519
-						'QSG_name'=>array('LIKE',"%$search_string%"),
520
-						'QSG_desc'=>array('LIKE',"%$search_string%"))
519
+						'QSG_name'=>array('LIKE', "%$search_string%"),
520
+						'QSG_desc'=>array('LIKE', "%$search_string%"))
521 521
 					);
522
-			}else{
523
-				$query_params[0]=array(
524
-					'QST_display_text'=>array('LIKE',"%$search_string%")
522
+			} else {
523
+				$query_params[0] = array(
524
+					'QST_display_text'=>array('LIKE', "%$search_string%")
525 525
 					);
526 526
 			}
527 527
 		}
@@ -569,13 +569,13 @@  discard block
 block discarded – undo
569 569
 	 * @param bool|false $count
570 570
 	 * @return \EE_Soft_Delete_Base_Class[]|int
571 571
 	 */
572
-	public function get_questions( $per_page=10, $current_page = 1, $count = FALSE ) {
572
+	public function get_questions($per_page = 10, $current_page = 1, $count = FALSE) {
573 573
 		$QST = EEM_Question::instance();
574 574
 		$query_params = $this->get_query_params($QST, $per_page, $current_page);
575
-		if ($count){
576
-			$where = isset( $query_params[0] ) ? array( $query_params[0] ) : array();
575
+		if ($count) {
576
+			$where = isset($query_params[0]) ? array($query_params[0]) : array();
577 577
 			$results = $QST->count($where);
578
-		}else{
578
+		} else {
579 579
 			$results = $QST->get_all($query_params);
580 580
 		}
581 581
 		return $results;
@@ -590,10 +590,10 @@  discard block
 block discarded – undo
590 590
 	 * @param bool|false $count
591 591
 	 * @return \EE_Soft_Delete_Base_Class[]|int
592 592
 	 */
593
-	public function get_trashed_questions( $per_page, $current_page = 1, $count = FALSE ) {
594
-		$query_params =$this->get_query_params( EEM_Question::instance(), $per_page, $current_page);
595
-		$where        = isset( $query_params[0] ) ? array($query_params[0]) : array();
596
-		$questions    =$count ? EEM_Question::instance()->count_deleted($where) : EEM_Question::instance()->get_all_deleted($query_params);
593
+	public function get_trashed_questions($per_page, $current_page = 1, $count = FALSE) {
594
+		$query_params = $this->get_query_params(EEM_Question::instance(), $per_page, $current_page);
595
+		$where        = isset($query_params[0]) ? array($query_params[0]) : array();
596
+		$questions    = $count ? EEM_Question::instance()->count_deleted($where) : EEM_Question::instance()->get_all_deleted($query_params);
597 597
 		return $questions;
598 598
 	}
599 599
 
@@ -605,11 +605,11 @@  discard block
 block discarded – undo
605 605
 	 * @param bool|false $count
606 606
 	 * @return \EE_Soft_Delete_Base_Class[]
607 607
 	 */
608
-	public function get_question_groups( $per_page, $current_page = 1, $count = FALSE ) {
608
+	public function get_question_groups($per_page, $current_page = 1, $count = FALSE) {
609 609
 		/** @type EEM_Question_Group $questionGroupModel */
610
-		$questionGroupModel=EEM_Question_Group::instance();
611
-		$query_params=$this->get_query_params( $questionGroupModel, $per_page, $current_page );
612
-		$questionGroups=$questionGroupModel->get_all($query_params);//note: this a subclass of EEM_Soft_Delete_Base, so this is actually only getting non-trashed items
610
+		$questionGroupModel = EEM_Question_Group::instance();
611
+		$query_params = $this->get_query_params($questionGroupModel, $per_page, $current_page);
612
+		$questionGroups = $questionGroupModel->get_all($query_params); //note: this a subclass of EEM_Soft_Delete_Base, so this is actually only getting non-trashed items
613 613
 		return $questionGroups;
614 614
 	}
615 615
 
@@ -626,36 +626,36 @@  discard block
 block discarded – undo
626 626
 
627 627
 		$this->_template_args['values'] = $this->_yes_no_values;
628 628
 
629
-		$this->_template_args['use_captcha'] = isset( EE_Registry::instance()->CFG->registration->use_captcha ) ? EE_Registry::instance()->CFG->registration->use_captcha : FALSE;
630
-		$this->_template_args['show_captcha_settings'] = $this->_template_args['use_captcha'] ? 'style="display:table-row;"': '';
629
+		$this->_template_args['use_captcha'] = isset(EE_Registry::instance()->CFG->registration->use_captcha) ? EE_Registry::instance()->CFG->registration->use_captcha : FALSE;
630
+		$this->_template_args['show_captcha_settings'] = $this->_template_args['use_captcha'] ? 'style="display:table-row;"' : '';
631 631
 
632
-		$this->_template_args['recaptcha_publickey'] = isset( EE_Registry::instance()->CFG->registration->recaptcha_publickey ) ? stripslashes( EE_Registry::instance()->CFG->registration->recaptcha_publickey ) : '';
633
-		$this->_template_args['recaptcha_privatekey'] = isset( EE_Registry::instance()->CFG->registration->recaptcha_privatekey ) ? stripslashes( EE_Registry::instance()->CFG->registration->recaptcha_privatekey ) : '';
634
-		$this->_template_args['recaptcha_width'] = isset( EE_Registry::instance()->CFG->registration->recaptcha_width ) ? absint( EE_Registry::instance()->CFG->registration->recaptcha_width ) : 500;
632
+		$this->_template_args['recaptcha_publickey'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_publickey) ? stripslashes(EE_Registry::instance()->CFG->registration->recaptcha_publickey) : '';
633
+		$this->_template_args['recaptcha_privatekey'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_privatekey) ? stripslashes(EE_Registry::instance()->CFG->registration->recaptcha_privatekey) : '';
634
+		$this->_template_args['recaptcha_width'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_width) ? absint(EE_Registry::instance()->CFG->registration->recaptcha_width) : 500;
635 635
 
636 636
 		$this->_template_args['recaptcha_theme_options'] = array(
637
-				array('id'  => 'red','text'=> __('Red', 'event_espresso')),
638
-				array('id'  => 'white','text'=> __('White', 'event_espresso')),
639
-				array('id'  => 'blackglass','text'=> __('Blackglass', 'event_espresso')),
640
-				array('id'  => 'clean','text'=> __('Clean', 'event_espresso'))
637
+				array('id'  => 'red', 'text'=> __('Red', 'event_espresso')),
638
+				array('id'  => 'white', 'text'=> __('White', 'event_espresso')),
639
+				array('id'  => 'blackglass', 'text'=> __('Blackglass', 'event_espresso')),
640
+				array('id'  => 'clean', 'text'=> __('Clean', 'event_espresso'))
641 641
 			);
642
-		$this->_template_args['recaptcha_theme'] = isset( EE_Registry::instance()->CFG->registration->recaptcha_theme ) ? EE_Registry::instance()->CFG->registration->get_pretty( 'recaptcha_theme' ) : 'clean';
642
+		$this->_template_args['recaptcha_theme'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_theme) ? EE_Registry::instance()->CFG->registration->get_pretty('recaptcha_theme') : 'clean';
643 643
 
644 644
 		$this->_template_args['recaptcha_language_options'] = array(
645
-				array('id'  => 'en','text'=> __('English', 'event_espresso')),
646
-				array('id'  => 'es','text'=> __('Spanish', 'event_espresso')),
647
-				array('id'  => 'nl','text'=> __('Dutch', 'event_espresso')),
648
-				array('id'  => 'fr','text'=> __('French', 'event_espresso')),
649
-				array('id'  => 'de','text'=> __('German', 'event_espresso')),
650
-				array('id'  => 'pt','text'=> __('Portuguese', 'event_espresso')),
651
-				array('id'  => 'ru','text'=> __('Russian', 'event_espresso')),
652
-				array('id'  => 'tr','text'=> __('Turkish', 'event_espresso'))
645
+				array('id'  => 'en', 'text'=> __('English', 'event_espresso')),
646
+				array('id'  => 'es', 'text'=> __('Spanish', 'event_espresso')),
647
+				array('id'  => 'nl', 'text'=> __('Dutch', 'event_espresso')),
648
+				array('id'  => 'fr', 'text'=> __('French', 'event_espresso')),
649
+				array('id'  => 'de', 'text'=> __('German', 'event_espresso')),
650
+				array('id'  => 'pt', 'text'=> __('Portuguese', 'event_espresso')),
651
+				array('id'  => 'ru', 'text'=> __('Russian', 'event_espresso')),
652
+				array('id'  => 'tr', 'text'=> __('Turkish', 'event_espresso'))
653 653
 			);
654
-		$this->_template_args['recaptcha_language'] = isset( EE_Registry::instance()->CFG->registration->recaptcha_language ) ? EE_Registry::instance()->CFG->registration->recaptcha_language : 'en';
654
+		$this->_template_args['recaptcha_language'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_language) ? EE_Registry::instance()->CFG->registration->recaptcha_language : 'en';
655 655
 
656
-		$this->_set_add_edit_form_tags( 'update_reg_form_settings' );
657
-		$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
658
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( REGISTRATION_FORM_TEMPLATE_PATH . 'reg_form_settings.template.php', $this->_template_args, TRUE );
656
+		$this->_set_add_edit_form_tags('update_reg_form_settings');
657
+		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
658
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(REGISTRATION_FORM_TEMPLATE_PATH.'reg_form_settings.template.php', $this->_template_args, TRUE);
659 659
 		$this->display_admin_page_with_sidebar();
660 660
 	}
661 661
 
Please login to merge, or discard this patch.
admin_pages/registration_form/Registration_Form_Admin_Page_Init.core.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -33,16 +33,16 @@  discard block
 block discarded – undo
33 33
 
34 34
 	public function __construct() {
35 35
 		//define some constants
36
-		define( 'REGISTRATION_FORM_PG_SLUG', 'espresso_registration_form' );
37
-		define( 'REGISTRATION_FORM_LABEL', __('Registration Form', 'event_espresso'));
38
-		define( 'REGISTRATION_FORM_PG_NAME', REGISTRATION_FORM_LABEL );
39
-		define( 'REGISTRATION_FORM_ADMIN', EE_ADMIN_PAGES . 'registration_form' . DS );
40
-		define( 'REGISTRATION_FORM_ADMIN_URL', admin_url( 'admin.php?page=' . REGISTRATION_FORM_PG_SLUG ));
41
-		define( 'EE_FORMS_ADMIN_URL', admin_url('admin.php?page=' . REGISTRATION_FORM_PG_SLUG ));
42
-		define( 'REGISTRATION_FORM_ASSETS_PATH', REGISTRATION_FORM_ADMIN . 'assets' . DS );
43
-		define( 'REGISTRATION_FORM_ASSETS_URL', EE_ADMIN_PAGES_URL . 'registration_form/assets/' );
44
-		define( 'REGISTRATION_FORM_TEMPLATE_PATH', REGISTRATION_FORM_ADMIN . 'templates' . DS );
45
-		define( 'REGISTRATION_FORM_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'registration_form/templates/' );
36
+		define('REGISTRATION_FORM_PG_SLUG', 'espresso_registration_form');
37
+		define('REGISTRATION_FORM_LABEL', __('Registration Form', 'event_espresso'));
38
+		define('REGISTRATION_FORM_PG_NAME', REGISTRATION_FORM_LABEL);
39
+		define('REGISTRATION_FORM_ADMIN', EE_ADMIN_PAGES.'registration_form'.DS);
40
+		define('REGISTRATION_FORM_ADMIN_URL', admin_url('admin.php?page='.REGISTRATION_FORM_PG_SLUG));
41
+		define('EE_FORMS_ADMIN_URL', admin_url('admin.php?page='.REGISTRATION_FORM_PG_SLUG));
42
+		define('REGISTRATION_FORM_ASSETS_PATH', REGISTRATION_FORM_ADMIN.'assets'.DS);
43
+		define('REGISTRATION_FORM_ASSETS_URL', EE_ADMIN_PAGES_URL.'registration_form/assets/');
44
+		define('REGISTRATION_FORM_TEMPLATE_PATH', REGISTRATION_FORM_ADMIN.'templates'.DS);
45
+		define('REGISTRATION_FORM_TEMPLATE_URL', EE_ADMIN_PAGES_URL.'registration_form/templates/');
46 46
 		parent::__construct();
47 47
 	}
48 48
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
 
55 55
 	protected function _set_menu_map() {
56
-		$this->_menu_map = new EE_Admin_Page_Sub_Menu( array(
56
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(array(
57 57
 			'menu_group' => 'management',
58 58
 			'menu_order' => 30,
59 59
 			'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
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/Registration_Form_Questions_Admin_List_Table.class.php 2 patches
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -42,7 +43,7 @@  discard block
 block discarded – undo
42 43
 	protected function _setup_data() {
43 44
 		if(isset($this->_req_data['status'] ) && $this->_req_data['status'] == 'trash'){
44 45
 			$this->_data = $this->_admin_page->get_trashed_questions( $this->_per_page,$this->_current_page, FALSE );
45
-		}else{
46
+		} else{
46 47
 			$this->_data = $this->_admin_page->get_questions( $this->_per_page,$this->_current_page, FALSE );
47 48
 		}
48 49
 		$this->_all_data_count = $this->_admin_page->get_questions( $this->_per_page,$this->_current_page, TRUE );
@@ -117,8 +118,9 @@  discard block
 block discarded – undo
117 118
 	public function column_display_text(EE_Question $item) {
118 119
 		$system_question = $item->is_system_question();
119 120
 
120
-		if ( !defined('REG_ADMIN_URL') )
121
-			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
121
+		if ( !defined('REG_ADMIN_URL') ) {
122
+					define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
123
+		}
122 124
 
123 125
 		$edit_query_args = array(
124 126
 				'action' => 'edit_question',
@@ -152,7 +154,7 @@  discard block
 block discarded – undo
152 154
 		$options= $item->options();
153 155
 		if(empty($options)){
154 156
 			return "N/A";
155
-		}else{
157
+		} else{
156 158
 			foreach($options as $optionID=>$option){
157 159
 				/* @var $option EE_Question_Option */
158 160
 				$optionNames[]=$option->value();
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 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
 /**
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 class Registration_Form_Questions_Admin_List_Table extends EE_Admin_List_Table {
33 33
 
34 34
 
35
-	public function __construct( $admin_page ) {
35
+	public function __construct($admin_page) {
36 36
 		parent::__construct($admin_page);
37 37
 	}
38 38
 
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
 
41 41
 
42 42
 	protected function _setup_data() {
43
-		if(isset($this->_req_data['status'] ) && $this->_req_data['status'] == 'trash'){
44
-			$this->_data = $this->_admin_page->get_trashed_questions( $this->_per_page,$this->_current_page, FALSE );
45
-		}else{
46
-			$this->_data = $this->_admin_page->get_questions( $this->_per_page,$this->_current_page, FALSE );
43
+		if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'trash') {
44
+			$this->_data = $this->_admin_page->get_trashed_questions($this->_per_page, $this->_current_page, FALSE);
45
+		} else {
46
+			$this->_data = $this->_admin_page->get_questions($this->_per_page, $this->_current_page, FALSE);
47 47
 		}
48
-		$this->_all_data_count = $this->_admin_page->get_questions( $this->_per_page,$this->_current_page, TRUE );
48
+		$this->_all_data_count = $this->_admin_page->get_questions($this->_per_page, $this->_current_page, TRUE);
49 49
 	}
50 50
 
51 51
 
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 
55 55
 	protected function _set_properties() {
56 56
 		$this->_wp_list_args = array(
57
-			'singular' => __('question', 'event_espresso' ),
58
-			'plural' => __('questions', 'event_espresso' ),
57
+			'singular' => __('question', 'event_espresso'),
58
+			'plural' => __('questions', 'event_espresso'),
59 59
 			'ajax' => TRUE, //for now,
60 60
 			'screen' => $this->_admin_page->get_current_screen()->id
61 61
 			);
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 			);
72 72
 
73 73
 		$this->_sortable_columns = array(
74
-			'id' => array( 'QST_ID' => FALSE ),
75
-			'display_text' => array( 'QST_display_text' => FALSE )
74
+			'id' => array('QST_ID' => FALSE),
75
+			'display_text' => array('QST_display_text' => FALSE)
76 76
 			);
77 77
 
78 78
 		$this->_hidden_columns = array(
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 
91 91
 
92 92
 	protected function _add_view_counts() {
93
-		$this->_views['all']['count'] = $this->_admin_page->get_questions( $this->_per_page,$this->_current_page, TRUE );
94
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_questions', 'espresso_registration_form_trash_question' ) ) {
93
+		$this->_views['all']['count'] = $this->_admin_page->get_questions($this->_per_page, $this->_current_page, TRUE);
94
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_questions', 'espresso_registration_form_trash_question')) {
95 95
 			$this->_views['trash']['count'] = $this->_admin_page->get_trashed_questions( -1, $this->_current_page, TRUE);
96 96
 		}
97 97
 	}
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 	public function column_cb($item) {
102 102
 		$system_question = $item->is_system_question();
103 103
 		$related_answer_count = $item->count_related('Answer');
104
-		$lock_icon = ( !$system_question && $related_answer_count > 0 && $this->_view == 'trash' ) ? 'ee-lock-icon ee-alternate-color' : 'ee-lock-icon ee-system-lock';
105
-		return $system_question || (!$system_question && $related_answer_count > 0 && $this->_view == 'trash' ) ? '<span class="' . $lock_icon . '"></span>' . sprintf( '<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />', $item->ID() )  : sprintf( '<input type="checkbox" class="QST_ID" name="checkbox[%1$d]" value="%1$d" />', $item->ID() );
104
+		$lock_icon = ( ! $system_question && $related_answer_count > 0 && $this->_view == 'trash') ? 'ee-lock-icon ee-alternate-color' : 'ee-lock-icon ee-system-lock';
105
+		return $system_question || ( ! $system_question && $related_answer_count > 0 && $this->_view == 'trash') ? '<span class="'.$lock_icon.'"></span>'.sprintf('<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />', $item->ID()) : sprintf('<input type="checkbox" class="QST_ID" name="checkbox[%1$d]" value="%1$d" />', $item->ID());
106 106
 	}
107 107
 
108 108
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 	public function column_id(EE_Question $item) {
112 112
 		$content = $item->ID();
113
-		$content .= '  <span class="show-on-mobile-view-only">' . $item->display_text() . '</span>';
113
+		$content .= '  <span class="show-on-mobile-view-only">'.$item->display_text().'</span>';
114 114
 		return $content;
115 115
 	}
116 116
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	public function column_display_text(EE_Question $item) {
120 120
 		$system_question = $item->is_system_question();
121 121
 
122
-		if ( !defined('REG_ADMIN_URL') )
122
+		if ( ! defined('REG_ADMIN_URL'))
123 123
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
124 124
 
125 125
 		$edit_query_args = array(
@@ -127,16 +127,16 @@  discard block
 block discarded – undo
127 127
 				'QST_ID' => $item->ID()
128 128
 			);
129 129
 
130
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question', 'espresso_registration_form_edit_question', $item->ID() ) ) {
131
-			$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_FORMS_ADMIN_URL );
130
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_question', 'espresso_registration_form_edit_question', $item->ID())) {
131
+			$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
132 132
 
133 133
 			$actions = array(
134
-				'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Event', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>'
134
+				'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Event', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'
135 135
 				);
136 136
 		}
137 137
 
138 138
 
139
-		$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();
139
+		$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();
140 140
 		$content .= $this->row_actions($actions);
141 141
 		return $content;
142 142
 	}
@@ -150,16 +150,16 @@  discard block
 block discarded – undo
150 150
 
151 151
 
152 152
 	public function column_values(EE_Question $item) {
153
-		$optionNames=array();
154
-		$options= $item->options();
155
-		if(empty($options)){
153
+		$optionNames = array();
154
+		$options = $item->options();
155
+		if (empty($options)) {
156 156
 			return "N/A";
157
-		}else{
158
-			foreach($options as $optionID=>$option){
157
+		} else {
158
+			foreach ($options as $optionID=>$option) {
159 159
 				/* @var $option EE_Question_Option */
160
-				$optionNames[]=$option->value();
160
+				$optionNames[] = $option->value();
161 161
 			}
162
-			return implode(', ',$optionNames);
162
+			return implode(', ', $optionNames);
163 163
 		}
164 164
 	}
165 165
 
Please login to merge, or discard this patch.
registration_form/espresso_events_Registration_Form_Hooks.class.php 2 patches
Spacing   +36 added lines, -36 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
 /**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
 
37 37
 
38
-	public function __construct( EE_Admin_Page $admin_page ) {
38
+	public function __construct(EE_Admin_Page $admin_page) {
39 39
 		parent::__construct($admin_page);
40 40
 	}
41 41
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		$this->_name = 'registration_form';
47 47
 		$this->_metaboxes = array(
48 48
 			0 => array(
49
-				'page_route' => array( 'edit', 'create_new' ),
49
+				'page_route' => array('edit', 'create_new'),
50 50
 				'func' => 'primary_questions',
51 51
 				'label' => __('Questions for Primary Registrant', 'event_espresso'),
52 52
 				'priority' => 'default',
@@ -55,28 +55,28 @@  discard block
 block discarded – undo
55 55
 		);
56 56
 
57 57
 		//hook into the handler for saving question groups
58
-		add_filter( 'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array( $this, 'modify_callbacks'), 10 );
58
+		add_filter('FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array($this, 'modify_callbacks'), 10);
59 59
 
60 60
 		//hook into revision restores (we're hooking into the global action because EE_Admin_Hooks classes are already restricted by page)
61
-		add_action( 'AHEE_EE_Admin_Page_CPT__restore_revision', array($this, 'restore_revision' ), 10, 2 );
61
+		add_action('AHEE_EE_Admin_Page_CPT__restore_revision', array($this, 'restore_revision'), 10, 2);
62 62
 	}
63 63
 
64 64
 
65 65
 
66 66
 
67 67
 
68
-	public function modify_callbacks( $callbacks ) {
68
+	public function modify_callbacks($callbacks) {
69 69
 		//now let's add the question group callback
70
-		$callbacks[] = array( $this, 'primary_question_group_update' );
70
+		$callbacks[] = array($this, 'primary_question_group_update');
71 71
 		return $callbacks;
72 72
 	}
73 73
 
74 74
 
75
-	public function restore_revision( $post_id, $revision_id ) {
75
+	public function restore_revision($post_id, $revision_id) {
76 76
 		$EVT_MDL = EE_Registry::instance()->load_model('Event');
77
-		$post_evt = $EVT_MDL->get_one_by_ID( $post_id );
77
+		$post_evt = $EVT_MDL->get_one_by_ID($post_id);
78 78
 		//restore revision for primary questions
79
-		$post_evt->restore_revision($revision_id, array('Question_Group'), array('Question_Group' => array('Event_Question_Group.EQG_primary' => 1 ) ) );
79
+		$post_evt->restore_revision($revision_id, array('Question_Group'), array('Question_Group' => array('Event_Question_Group.EQG_primary' => 1)));
80 80
 		return $post_evt; //for any caffeinated functionality extending.
81 81
 	}
82 82
 
@@ -100,35 +100,35 @@  discard block
 block discarded – undo
100 100
 			<?php
101 101
 
102 102
 			$qsg_where['QSG_deleted'] = FALSE;
103
-			$query_params = array( $qsg_where, 'order_by' => array( 'QSG_order' => 'ASC' ) );
104
-			$QSGs = EEM_Question_Group::instance()->get_all( $query_params );
105
-			$EQGs = !empty( $event_id ) ? $this->_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 1 )) ) : array();
103
+			$query_params = array($qsg_where, 'order_by' => array('QSG_order' => 'ASC'));
104
+			$QSGs = EEM_Question_Group::instance()->get_all($query_params);
105
+			$EQGs = ! empty($event_id) ? $this->_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 1))) : array();
106 106
 			$EQGids = array_keys($EQGs);
107 107
 
108 108
 			//EEH_Debug_Tools::printr( $QSGs, '$QSGs  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
109 109
 
110
-			if ( ! empty( $QSGs )) {
111
- 				$html = count( $QSGs ) > 10 ? '<div style="height:250px;overflow:auto;">' : '';
112
-				foreach ( $QSGs as $QSG ) {
110
+			if ( ! empty($QSGs)) {
111
+ 				$html = count($QSGs) > 10 ? '<div style="height:250px;overflow:auto;">' : '';
112
+				foreach ($QSGs as $QSG) {
113 113
 
114
-					$checked = ( in_array( $QSG->ID(), $EQGids ) || $QSG->get('QSG_system') == 1 ) ? ' checked="checked"' : '';
114
+					$checked = (in_array($QSG->ID(), $EQGids) || $QSG->get('QSG_system') == 1) ? ' checked="checked"' : '';
115 115
 					$visibility = $QSG->get('QSG_system') == 1 ? ' style="visibility:hidden"' : '';
116
-					$edit_query_args = $this->_adminpage_obj->is_caf() ? array( 'action' => 'edit_question_group', 'QSG_ID' => $QSG->ID() ) : array( 'action' => 'question_groups' );
117
-					$edit_link = $this->_adminpage_obj->add_query_args_and_nonce( $edit_query_args, EE_FORMS_ADMIN_URL );
116
+					$edit_query_args = $this->_adminpage_obj->is_caf() ? array('action' => 'edit_question_group', 'QSG_ID' => $QSG->ID()) : array('action' => 'question_groups');
117
+					$edit_link = $this->_adminpage_obj->add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
118 118
 
119 119
 					$html .= '
120
-					<p id="event-question-group-' . $QSG->ID() . '">
121
-						<input value="' . $QSG->ID() . '" type="checkbox"' . $visibility . ' name="question_groups[' . $QSG->ID() . ']"' . $checked . ' />
122
-						<a href="' . $edit_link . '" title="' . sprintf( esc_attr__('Edit %s Group', 'event_espresso'),  $QSG->get('QSG_name') ) . '" target="_blank">' . $QSG->get('QSG_name') . '</a>
120
+					<p id="event-question-group-' . $QSG->ID().'">
121
+						<input value="' . $QSG->ID().'" type="checkbox"'.$visibility.' name="question_groups['.$QSG->ID().']"'.$checked.' />
122
+						<a href="' . $edit_link.'" title="'.sprintf(esc_attr__('Edit %s Group', 'event_espresso'), $QSG->get('QSG_name')).'" target="_blank">'.$QSG->get('QSG_name').'</a>
123 123
 					</p>';
124 124
 				}
125
-				$html .= count( $QSGs ) > 10 ? '</div>' : '';
125
+				$html .= count($QSGs) > 10 ? '</div>' : '';
126 126
 
127 127
 				echo $html;
128 128
 			} else {
129 129
 				echo __('There seems to be a problem with your questions. Please contact [email protected]', 'event_espresso');
130 130
 			}
131
-			do_action( 'AHEE_event_editor_questions_notice' );
131
+			do_action('AHEE_event_editor_questions_notice');
132 132
 			?>
133 133
 		</div>
134 134
 		<?php
@@ -138,31 +138,31 @@  discard block
 block discarded – undo
138 138
 
139 139
 
140 140
 
141
-	public function primary_question_group_update( $evtobj, $data ) {
142
-		$question_groups = !empty( $data['question_groups'] ) ? (array) $data['question_groups'] : array();
141
+	public function primary_question_group_update($evtobj, $data) {
142
+		$question_groups = ! empty($data['question_groups']) ? (array) $data['question_groups'] : array();
143 143
 		$added_qgs = array_keys($question_groups);
144 144
 		$success = array();
145 145
 
146 146
 		//let's get all current question groups associated with this event.
147
-		$current_qgs = $evtobj->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 1) ));
147
+		$current_qgs = $evtobj->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 1)));
148 148
 		$current_qgs = array_keys($current_qgs); //we just want the ids
149 149
 
150 150
 		//now let's get the groups selected in the editor and update (IF we have data)
151
-		if ( !empty( $question_groups ) ) {
152
-			foreach ( $question_groups as $id => $val ) {
151
+		if ( ! empty($question_groups)) {
152
+			foreach ($question_groups as $id => $val) {
153 153
 				//add to event
154
-				if ( $val )
155
-					$qg = $evtobj->_add_relation_to( $id, 'Question_Group', array('EQG_primary' => 1) );
156
-				$success[] = !empty($qg) ? 1 : 0;
154
+				if ($val)
155
+					$qg = $evtobj->_add_relation_to($id, 'Question_Group', array('EQG_primary' => 1));
156
+				$success[] = ! empty($qg) ? 1 : 0;
157 157
 			}
158 158
 		}
159 159
 
160 160
 		//wait a minute... are there question groups missing in the saved groups that ARE with the current event?
161
-		$removed_qgs = array_diff( $current_qgs, $added_qgs );
161
+		$removed_qgs = array_diff($current_qgs, $added_qgs);
162 162
 
163
-		foreach ( $removed_qgs as $qgid ) {
164
-			$qg = $evtobj->_remove_relation_to( $qgid, 'Question_Group', array('EQG_primary' => 1 ) );
165
-			$success[] = !empty($qg) ? 1 : 0;
163
+		foreach ($removed_qgs as $qgid) {
164
+			$qg = $evtobj->_remove_relation_to($qgid, 'Question_Group', array('EQG_primary' => 1));
165
+			$success[] = ! empty($qg) ? 1 : 0;
166 166
 		}
167 167
 
168 168
 
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
@@ -151,8 +152,9 @@  discard block
 block discarded – undo
151 152
 		if ( !empty( $question_groups ) ) {
152 153
 			foreach ( $question_groups as $id => $val ) {
153 154
 				//add to event
154
-				if ( $val )
155
-					$qg = $evtobj->_add_relation_to( $id, 'Question_Group', array('EQG_primary' => 1) );
155
+				if ( $val ) {
156
+									$qg = $evtobj->_add_relation_to( $id, 'Question_Group', array('EQG_primary' => 1) );
157
+				}
156 158
 				$success[] = !empty($qg) ? 1 : 0;
157 159
 			}
158 160
 		}
Please login to merge, or discard this patch.
registration_form/help_tabs/registration_form_add_question.help_tab.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
 <?php _e('This shows the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', 'event_espresso'); ?>
27 27
 </li>
28 28
 <li>
29
-<strong><?php _e('Answer Options (for applicable question types)', 'event_espresso');?></strong><br/>
30
-<?php _e('Values do not allow any HTML, however, descriptions do allow HTML.', 'event_espresso');?>
29
+<strong><?php _e('Answer Options (for applicable question types)', 'event_espresso'); ?></strong><br/>
30
+<?php _e('Values do not allow any HTML, however, descriptions do allow HTML.', 'event_espresso'); ?>
31 31
 </li>
32 32
 <li>
33 33
 <strong><?php _e('Required Question', 'event_espresso'); ?></strong><br />
Please login to merge, or discard this patch.
registration_form/help_tabs/registration_form_edit_question.help_tab.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@
 block discarded – undo
30 30
 <?php _e('This shows the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', 'event_espresso'); ?>
31 31
 </li>
32 32
 <li>
33
-<strong><?php _e('Answer Options (for applicable question types)', 'event_espresso');?></strong>
34
-<strong><?php _e('Values do not allow any HTML, however, descriptions do allow HTML.', 'event_espresso');?></strong>
33
+<strong><?php _e('Answer Options (for applicable question types)', 'event_espresso'); ?></strong>
34
+<strong><?php _e('Values do not allow any HTML, however, descriptions do allow HTML.', 'event_espresso'); ?></strong>
35 35
 </li>
36 36
 <li>
37 37
 <strong><?php _e('Required Question', 'event_espresso'); ?></strong><br />
Please login to merge, or discard this patch.
help_tours/Registration_Form_Add_Question_Group_Help_Tour.class.php 2 patches
Spacing   +9 added lines, -9 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
 /**
@@ -98,34 +98,34 @@  discard block
 block discarded – undo
98 98
 
99 99
 
100 100
 	protected function _start() {
101
-		$content = '<h3>' . __('Add Question Group', 'event_espresso') . '</h3>';
102
-		$content .= '<p>' . __('This tour of the Add Question Group page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
101
+		$content = '<h3>'.__('Add Question Group', 'event_espresso').'</h3>';
102
+		$content .= '<p>'.__('This tour of the Add Question Group page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
103 103
 		
104 104
 		return $content;
105 105
 	}
106 106
 
107 107
 	protected function _qsg_name_stop() {
108
-		return '<p>' . __('The name of the question group.', 'event_espresso') . '</p>';
108
+		return '<p>'.__('The name of the question group.', 'event_espresso').'</p>';
109 109
 	}
110 110
 
111 111
 	protected function _qsg_identifier_stop() {
112
-		return '<p>' . __('A unique name for your question group.', 'event_espresso') . '</p>';
112
+		return '<p>'.__('A unique name for your question group.', 'event_espresso').'</p>';
113 113
 	}
114 114
 
115 115
 	protected function _qsg_desc_stop() {
116
-		return '<p>' . __('A description of the question group.', 'event_espresso') . '</p>';
116
+		return '<p>'.__('A description of the question group.', 'event_espresso').'</p>';
117 117
 	}
118 118
 
119 119
 	protected function _qsg_order_stop() {
120
-		return '<p>' . __('Set the order that you want your question group to appear in.', 'event_espresso') . '</p>';
120
+		return '<p>'.__('Set the order that you want your question group to appear in.', 'event_espresso').'</p>';
121 121
 	}
122 122
 
123 123
 	protected function _qsg_show_group_name_stop() {
124
-		return '<p>' . __('Specify whether the group name should be shown on the registration page.', 'event_espresso') . '</p>';
124
+		return '<p>'.__('Specify whether the group name should be shown on the registration page.', 'event_espresso').'</p>';
125 125
 	}
126 126
 
127 127
 	protected function _qsg_show_group_desc_stop() {
128
-		return '<p>' . __('Specify whether the group description should be shown on the registration page.', 'event_espresso') . '</p>';
128
+		return '<p>'.__('Specify whether the group description should be shown on the registration page.', 'event_espresso').'</p>';
129 129
 	}
130 130
 
131 131
 }
132 132
\ 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.
help_tours/Registration_Form_Add_Question_Help_Tour.class.php 2 patches
Spacing   +9 added lines, -9 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
 /**
@@ -98,34 +98,34 @@  discard block
 block discarded – undo
98 98
 
99 99
 
100 100
 	protected function _start() {
101
-		$content = '<h3>' . __('Add New Question', 'event_espresso') . '</h3>';
102
-		$content .= '<p>' . __('This tour of the Add New Question page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
101
+		$content = '<h3>'.__('Add New Question', 'event_espresso').'</h3>';
102
+		$content .= '<p>'.__('This tour of the Add New Question page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
103 103
 		
104 104
 		return $content;
105 105
 	}
106 106
 
107 107
 	protected function _qst_display_text_stop() {
108
-		return '<p>' . __('This is the question that is displayed to registrants who are signing up for events.', 'event_espresso') . '</p>';
108
+		return '<p>'.__('This is the question that is displayed to registrants who are signing up for events.', 'event_espresso').'</p>';
109 109
 	}
110 110
 
111 111
 	protected function _qst_admin_label_stop() {
112
-		return '<p>' . __('Helps you understand the difference between questions that may appear similar but are actually different.', 'event_espresso') . '</p>';
112
+		return '<p>'.__('Helps you understand the difference between questions that may appear similar but are actually different.', 'event_espresso').'</p>';
113 113
 	}
114 114
 
115 115
 	protected function _qst_admin_only_stop() {
116
-		return '<p>' . __('Specify whether this question should be shown only to admins.', 'event_espresso') . '</p>';
116
+		return '<p>'.__('Specify whether this question should be shown only to admins.', 'event_espresso').'</p>';
117 117
 	}
118 118
 
119 119
 	protected function _qst_type_stop() {
120
-		return '<p>' . __('Select the type of question. Available options are Text, Textarea, Single, Multiple, Dropdown, and Date.', 'event_espresso') . '</p>';
120
+		return '<p>'.__('Select the type of question. Available options are Text, Textarea, Single, Multiple, Dropdown, and Date.', 'event_espresso').'</p>';
121 121
 	}
122 122
 
123 123
 	protected function _qst_required_stop() {
124
-		return '<p>' . __('Specify whether this question should be required.', 'event_espresso') . '</p>';
124
+		return '<p>'.__('Specify whether this question should be required.', 'event_espresso').'</p>';
125 125
 	}
126 126
 
127 127
 	protected function _qst_required_text_stop() {
128
-		return '<p>' . __('Text to display when registrant does not answer question but is required to.', 'event_espresso') . '</p>';
128
+		return '<p>'.__('Text to display when registrant does not answer question but is required to.', 'event_espresso').'</p>';
129 129
 	}
130 130
 
131 131
 }
132 132
\ 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.
help_tours/Registration_Form_Edit_Question_Group_Help_Tour.class.php 2 patches
Spacing   +9 added lines, -9 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
 /**
@@ -98,34 +98,34 @@  discard block
 block discarded – undo
98 98
 
99 99
 
100 100
 	protected function _start() {
101
-		$content = '<h3>' . __('Edit Question Group', 'event_espresso') . '</h3>';
102
-		$content .= '<p>' . __('This tour of the Edit Question Group page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
101
+		$content = '<h3>'.__('Edit Question Group', 'event_espresso').'</h3>';
102
+		$content .= '<p>'.__('This tour of the Edit Question Group page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
103 103
 		
104 104
 		return $content;
105 105
 	}
106 106
 
107 107
 	protected function _qsg_name_stop() {
108
-		return '<p>' . __('The name of the question group.', 'event_espresso') . '</p>';
108
+		return '<p>'.__('The name of the question group.', 'event_espresso').'</p>';
109 109
 	}
110 110
 
111 111
 	protected function _qsg_identifier_stop() {
112
-		return '<p>' . __('A unique name for your question group.', 'event_espresso') . '</p>';
112
+		return '<p>'.__('A unique name for your question group.', 'event_espresso').'</p>';
113 113
 	}
114 114
 
115 115
 	protected function _qsg_desc_stop() {
116
-		return '<p>' . __('A description of the question group.', 'event_espresso') . '</p>';
116
+		return '<p>'.__('A description of the question group.', 'event_espresso').'</p>';
117 117
 	}
118 118
 
119 119
 	protected function _qsg_order_stop() {
120
-		return '<p>' . __('Set the order that you want your question group to appear in.', 'event_espresso') . '</p>';
120
+		return '<p>'.__('Set the order that you want your question group to appear in.', 'event_espresso').'</p>';
121 121
 	}
122 122
 
123 123
 	protected function _qsg_show_group_name_stop() {
124
-		return '<p>' . __('Specify whether the group name should be shown on the registration page.', 'event_espresso') . '</p>';
124
+		return '<p>'.__('Specify whether the group name should be shown on the registration page.', 'event_espresso').'</p>';
125 125
 	}
126 126
 
127 127
 	protected function _qsg_show_group_desc_stop() {
128
-		return '<p>' . __('Specify whether the group description should be shown on the registration page.', 'event_espresso') . '</p>';
128
+		return '<p>'.__('Specify whether the group description should be shown on the registration page.', 'event_espresso').'</p>';
129 129
 	}
130 130
 
131 131
 }
132 132
\ 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.