Completed
Branch FET-9413-questions-refactor (bd7ded)
by
unknown
85:35 queued 75:04
created
admin_pages/registration_form/RegistrationFormEditorForm.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 
4 4
 use EventEspresso\core\libraries\form_sections\strategies\validation\ValidationStrategiesLoader;
5 5
 
6
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
7
-	exit( 'No direct script access allowed' );
6
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
7
+	exit('No direct script access allowed');
8 8
 }
9 9
 
10 10
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 *
46 46
 	 * @param \EEM_Question $EEM_Question
47 47
 	 */
48
-	public function __construct( \EEM_Question $EEM_Question) {
48
+	public function __construct(\EEM_Question $EEM_Question) {
49 49
 		$this->form_input_config_fields = $EEM_Question->field_settings();
50 50
 	}
51 51
 
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
 	 * @return \EE_Form_Section_Proper
57 57
 	 * @throws \EE_Error
58 58
 	 */
59
-	public function rawForm( array $available_form_inputs ) {
59
+	public function rawForm(array $available_form_inputs) {
60 60
 		$subsections = array();
61
-		foreach ( $available_form_inputs as $form_input => $form_input_class_name ) {
62
-			$subsections[ $form_input ] = $this->rawFormInput( $form_input, $form_input_class_name );
61
+		foreach ($available_form_inputs as $form_input => $form_input_class_name) {
62
+			$subsections[$form_input] = $this->rawFormInput($form_input, $form_input_class_name);
63 63
 		}
64 64
 		return new \EE_Form_Section_Proper(
65 65
 			array(
@@ -79,24 +79,24 @@  discard block
 block discarded – undo
79 79
 	 * @return string
80 80
 	 * @throws \EE_Error
81 81
 	 */
82
-	public function rawFormInput( $form_input, $form_input_class_name, $identifier = 'clone' ) {
83
-		if ( ! is_subclass_of( $form_input_class_name, 'EE_Form_Input_Base' ) ) {
82
+	public function rawFormInput($form_input, $form_input_class_name, $identifier = 'clone') {
83
+		if ( ! is_subclass_of($form_input_class_name, 'EE_Form_Input_Base')) {
84 84
 			throw new \EE_Error(
85 85
 				sprintf(
86
-					__( 'The class "%1$s" needs to be a sub class of  EE_Form_Input_Base.', 'event_espresso' ),
86
+					__('The class "%1$s" needs to be a sub class of  EE_Form_Input_Base.', 'event_espresso'),
87 87
 					$form_input_class_name
88 88
 				)
89 89
 			);
90 90
 		}
91
-		$this->form_input = $this->formInput( $form_input, $form_input_class_name );
91
+		$this->form_input = $this->formInput($form_input, $form_input_class_name);
92 92
 		$subsections = array();
93
-		if ( $this->form_input instanceof \EE_Form_Input_With_Options_Base ) {
94
-			$subsections = $this->getInputOptions( $form_input, $this->form_input->options() );
93
+		if ($this->form_input instanceof \EE_Form_Input_With_Options_Base) {
94
+			$subsections = $this->getInputOptions($form_input, $this->form_input->options());
95 95
 		}
96 96
 		$subsections = array_merge(
97 97
 			$subsections,
98
-			$this->getBasicSettingsSubsections( $form_input ),
99
-			$this->getValidationStrategies( $form_input, $form_input_class_name )
98
+			$this->getBasicSettingsSubsections($form_input),
99
+			$this->getValidationStrategies($form_input, $form_input_class_name)
100 100
 		);
101 101
 		return new \EE_Form_Section_Proper(
102 102
 			array(
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 * @return \EE_Form_Section_Proper (
117 117
 	 * @throws \EE_Error
118 118
 	 */
119
-	public function formInputForm( $form_input, $identifier = 'clone' ) {
119
+	public function formInputForm($form_input, $identifier = 'clone') {
120 120
 		return new \EE_Form_Section_Proper(
121 121
 			array(
122 122
 				'name'            => "reg_form[{$identifier}]",
@@ -139,10 +139,10 @@  discard block
 block discarded – undo
139 139
 	 * @param array        $options
140 140
 	 * @return \EE_Form_Input_Base
141 141
 	 */
142
-	public function formInput( $form_input, $form_input_class_name, \EE_Question $question = null, $options = array() ) {
142
+	public function formInput($form_input, $form_input_class_name, \EE_Question $question = null, $options = array()) {
143 143
 		$is_question = $question instanceof \EE_Question;
144
-		if ( is_subclass_of( $form_input_class_name, 'EE_Form_Input_With_Options_Base' ) ) {
145
-			$options = ! empty( $options )
144
+		if (is_subclass_of($form_input_class_name, 'EE_Form_Input_With_Options_Base')) {
145
+			$options = ! empty($options)
146 146
 				? $options
147 147
 				: array(
148 148
 					'option 1' => 'option 1 description',
@@ -175,15 +175,15 @@  discard block
 block discarded – undo
175 175
 	 * @return \EE_Form_Section_Proper
176 176
 	 * @throws \EE_Error
177 177
 	 */
178
-	public function getInputOptionsForm( $form_input, $identifier = 'clone' ) {
179
-		if ( ! $this->form_input instanceof \EE_Form_Input_With_Options_Base ) {
178
+	public function getInputOptionsForm($form_input, $identifier = 'clone') {
179
+		if ( ! $this->form_input instanceof \EE_Form_Input_With_Options_Base) {
180 180
 			throw new \EE_Error(
181 181
 				sprintf(
182 182
 					__(
183 183
 						'The class "%1$s" needs to be a sub class of EE_Form_Input_With_Options_Base to have options.',
184 184
 						'event_espresso'
185 185
 					),
186
-					get_class( $this->form_input )
186
+					get_class($this->form_input)
187 187
 				)
188 188
 			);
189 189
 		}
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 				'name'            => "input_options[{$identifier}]",
193 193
 				'html_id'         => "input-options-{$identifier}",
194 194
 				'layout_strategy' => new \EE_Admin_Two_Column_Layout(), // EE_Div_Per_Section_Layout
195
-				'subsections'     => $this->getInputOptions( $form_input, $this->form_input->options() )
195
+				'subsections'     => $this->getInputOptions($form_input, $this->form_input->options())
196 196
 			)
197 197
 		);
198 198
 	}
@@ -205,26 +205,26 @@  discard block
 block discarded – undo
205 205
 	 * @param array  $options
206 206
 	 * @return array
207 207
 	 */
208
-	public function getInputOptions( $form_input, $options, $identifier = 'clone' ) {
208
+	public function getInputOptions($form_input, $options, $identifier = 'clone') {
209 209
 		//if ( $form_input == 'checkbox_multi' ) {
210 210
 		//	\EEH_Debug_Tools::printr( $options, '$options', __FILE__, __LINE__ );
211 211
 		//}
212 212
 		$order = 0;
213 213
 		$subsections = array();
214
-		foreach ( $options as $key => $value ) {
214
+		foreach ($options as $key => $value) {
215 215
 			$order++;
216
-			$subsections[ 'value-' . $key ] = new \EE_Text_Input(
216
+			$subsections['value-'.$key] = new \EE_Text_Input(
217 217
 				array(
218 218
 					'html_name'  => "input_options[{$identifier}][{$order}][value]",
219 219
 					'html_id'    => "input-options-{$form_input}-{$identifier}-{$order}-value",
220 220
 					'html_class' => "ee-reg-form-option-label-text-js",
221 221
 					'default'    => $key,
222 222
 					'other_html_attributes' => "data-target=\"reg-form-{$identifier}-"
223
-					                           . str_replace( '_', '-', $form_input ) . '-'
224
-					                           . sanitize_key( $key ) . '-option-lbl"',
223
+					                           . str_replace('_', '-', $form_input).'-'
224
+					                           . sanitize_key($key).'-option-lbl"',
225 225
 				)
226 226
 			);
227
-			$subsections[ 'desc-' . $key ] = new \EE_Text_Input(
227
+			$subsections['desc-'.$key] = new \EE_Text_Input(
228 228
 				array(
229 229
 					'html_name' => "input_options[{$identifier}][{$order}][desc]",
230 230
 					'html_id'   => "input-options-{$form_input}-{$identifier}-{$order}-desc",
@@ -244,13 +244,13 @@  discard block
 block discarded – undo
244 244
 	 * @return \EE_Form_Section_Proper
245 245
 	 * @throws \EE_Error
246 246
 	 */
247
-	public function getBasicSettings( $form_input, $identifier = 'clone', \EE_Question $question = null ) {
247
+	public function getBasicSettings($form_input, $identifier = 'clone', \EE_Question $question = null) {
248 248
 		return new \EE_Form_Section_Proper(
249 249
 			array(
250 250
 				'name'            => "settings[{$identifier}]",
251 251
 				'html_id'         => "settings-{$identifier}",
252 252
 				'layout_strategy' => new \EE_Admin_Two_Column_Layout(),
253
-				'subsections'     => $this->getBasicSettingsSubsections( $form_input, $identifier, $question )
253
+				'subsections'     => $this->getBasicSettingsSubsections($form_input, $identifier, $question)
254 254
 			)
255 255
 		);
256 256
 	}
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 	 * @param \EE_Question $question
264 264
 	 * @return array
265 265
 	 */
266
-	protected function getBasicSettingsSubsections( $form_input, $identifier = 'clone', \EE_Question $question = null ) {
266
+	protected function getBasicSettingsSubsections($form_input, $identifier = 'clone', \EE_Question $question = null) {
267 267
 		$subsections = array(
268 268
 			'identifier' => new \EE_Fixed_Hidden_Input(
269 269
 				array(
@@ -272,11 +272,11 @@  discard block
 block discarded – undo
272 272
 				)
273 273
 			)
274 274
 		);
275
-		foreach ( $this->form_input_config_fields as $field_name => $form_input_config_field ) {
276
-			$config_input = $this->getBasicConfigInput( $form_input, $identifier, $field_name, $question );
277
-			if ( $config_input instanceof \EE_Form_Input_Base ) {
278
-				$field_name = (string) str_replace( 'QST_', '', $field_name );
279
-				$subsections[ $field_name ] = $config_input;
275
+		foreach ($this->form_input_config_fields as $field_name => $form_input_config_field) {
276
+			$config_input = $this->getBasicConfigInput($form_input, $identifier, $field_name, $question);
277
+			if ($config_input instanceof \EE_Form_Input_Base) {
278
+				$field_name = (string) str_replace('QST_', '', $field_name);
279
+				$subsections[$field_name] = $config_input;
280 280
 			}
281 281
 		}
282 282
 		return $subsections;
@@ -298,14 +298,14 @@  discard block
 block discarded – undo
298 298
 		\EE_Question $question = null
299 299
 	) {
300 300
 		// what kind of field is it ?
301
-		switch ( $field_name ) {
301
+		switch ($field_name) {
302 302
 
303 303
 			case 'QST_display_text' :
304 304
 				return new \EE_Text_Input(
305 305
 					array(
306
-						'html_label_text'       => __( 'Label Text', 'event_espresso' ),
306
+						'html_label_text'       => __('Label Text', 'event_espresso'),
307 307
 						'html_class'            => 'ee-reg-form-label-text-js',
308
-						'other_html_attributes' => "data-target=\"reg-form-{$identifier}-" . str_replace( '_', '-', $form_input ) . '-lbl"',
308
+						'other_html_attributes' => "data-target=\"reg-form-{$identifier}-".str_replace('_', '-', $form_input).'-lbl"',
309 309
 						'default'               => $question instanceof \EE_Question ? $question->display_text() : ''
310 310
 					)
311 311
 				);
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 			case 'QST_desc' :
314 314
 				return new \EE_Text_Area_Input(
315 315
 					array(
316
-						'html_label_text' => __( 'Description', 'event_espresso' ),
316
+						'html_label_text' => __('Description', 'event_espresso'),
317 317
 						'default'         => $question instanceof \EE_Question ? $question->desc() : "",
318 318
 					)
319 319
 				);
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 			case 'QST_html_class' :
322 322
 				return new \EE_Text_Input(
323 323
 					array(
324
-						'html_label_text' => __( 'Input CSS Classes', 'event_espresso' ),
324
+						'html_label_text' => __('Input CSS Classes', 'event_espresso'),
325 325
 						'default'         => $question instanceof \EE_Question ? $question->html_class() : "{$form_input}",
326 326
 					)
327 327
 				);
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 			case 'QST_html_label_class' :
330 330
 				return new \EE_Text_Input(
331 331
 					array(
332
-						'html_label_text' => __( 'Label CSS Classes', 'event_espresso' ),
332
+						'html_label_text' => __('Label CSS Classes', 'event_espresso'),
333 333
 						'default'         => $question instanceof \EE_Question ? $question->html_label_class() : "{$form_input}-lbl",
334 334
 					)
335 335
 				);
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 				'name'    => "settings[{$identifier}]",
360 360
 				'html_id' => "settings-{$identifier}",
361 361
 				'layout_strategy' => new \EE_Admin_Two_Column_Layout(),
362
-				'subsections'     => $this->getValidationStrategies( $form_input, $form_input_class_name, $question ),
362
+				'subsections'     => $this->getValidationStrategies($form_input, $form_input_class_name, $question),
363 363
 			)
364 364
 		);
365 365
 	}
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 	 * @param \EE_Question $question
373 373
 	 * @return array
374 374
 	 */
375
-	protected function getValidationStrategies( $form_input, $form_input_class_name, \EE_Question $question = null ) {
375
+	protected function getValidationStrategies($form_input, $form_input_class_name, \EE_Question $question = null) {
376 376
 		// get validations strategies but only include those that are optional
377 377
 		$validation_strategies = ValidationStrategiesLoader::get(
378 378
 			/** @var \EE_Form_Input_Base $form_input_class_name */
@@ -380,22 +380,22 @@  discard block
 block discarded – undo
380 380
 			true
381 381
 		);
382 382
 		$subsections = array();
383
-		foreach ( $validation_strategies as $validation_key => $validation_strategy ) {
383
+		foreach ($validation_strategies as $validation_key => $validation_strategy) {
384 384
 			//\EEH_Debug_Tools::printr( $key, '$key', __FILE__, __LINE__ );
385 385
 			//\EEH_Debug_Tools::printr( $validation_strategy, '$validation_strategy', __FILE__, __LINE__ );
386 386
 			/** @var \EE_Validation_Strategy_Base $validation_strategy */
387 387
 			//\EEH_Debug_Tools::printr( $validation_strategy::generally_applicable(), '$validation_strategy::generally_applicable()', __FILE__, __LINE__ );
388
-			unset( $validation_strategies[ $validation_key ] );
389
-			if ( ! $validation_strategy::generally_applicable() ) {
388
+			unset($validation_strategies[$validation_key]);
389
+			if ( ! $validation_strategy::generally_applicable()) {
390 390
 				continue;
391 391
 			}
392
-			$validation_strategies[ ucwords( str_replace( '_', ' ', $validation_key ) ) ] = $validation_strategy;
392
+			$validation_strategies[ucwords(str_replace('_', ' ', $validation_key))] = $validation_strategy;
393 393
 		}
394
-		$subsections['validation_strategies' ] = $this->getValidationStrategiesInput(
394
+		$subsections['validation_strategies'] = $this->getValidationStrategiesInput(
395 395
 			$validation_strategies,
396 396
 			$question
397 397
 		);
398
-		$subsections['validation_message' ] = $this->getFailedValidationMessage();
398
+		$subsections['validation_message'] = $this->getFailedValidationMessage();
399 399
 		// convert underscores in labels to spaces
400 400
 		//$validation_strategies = array_map(
401 401
 		//	function( $value ) {
@@ -414,11 +414,11 @@  discard block
 block discarded – undo
414 414
 	 * @param \EE_Question $question
415 415
 	 * @return \EE_Checkbox_Multi_Input
416 416
 	 */
417
-	protected function getValidationStrategiesInput( array $validation_strategies, \EE_Question $question = null ) {
417
+	protected function getValidationStrategiesInput(array $validation_strategies, \EE_Question $question = null) {
418 418
 		return new \EE_Checkbox_Multi_Input(
419
-			array_flip( $validation_strategies ),
419
+			array_flip($validation_strategies),
420 420
 			array(
421
-				'html_label_text' =>  __( 'Apply Validation Rules', 'event_espresso' ),
421
+				'html_label_text' =>  __('Apply Validation Rules', 'event_espresso'),
422 422
 				'default' => $question instanceof \EE_Question ? $question->validation_strategies() : '',
423 423
 			)
424 424
 		);
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 	protected function getFailedValidationMessage() {
433 433
 		return new \EE_Text_Area_Input(
434 434
 			array(
435
-				'html_label_text' =>  __( 'Failed Validation Message', 'event_espresso' ),
435
+				'html_label_text' =>  __('Failed Validation Message', 'event_espresso'),
436 436
 			)
437 437
 		);
438 438
 	}
Please login to merge, or discard this patch.
admin_pages/registration_form/RegistrationFormEditorFormDisplay.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\admin_pages\registration_form;
3 3
 
4
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-	exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 *
45 45
 	 * @param RegistrationFormEditorForm $RegistrationFormEditorFormInputForm
46 46
 	 */
47
-	public function __construct( RegistrationFormEditorForm $RegistrationFormEditorFormInputForm) {
47
+	public function __construct(RegistrationFormEditorForm $RegistrationFormEditorFormInputForm) {
48 48
 		$this->reg_form_editor_form = $RegistrationFormEditorFormInputForm;
49 49
 	}
50 50
 
@@ -57,23 +57,23 @@  discard block
 block discarded – undo
57 57
 	 * @return string
58 58
 	 * @throws \EE_Error
59 59
 	 */
60
-	public function formHTML( $form_input, $form_input_class_name, \EE_Question $question = null ) {
61
-		if ( ! is_subclass_of( $form_input_class_name, 'EE_Form_Input_Base' ) ) {
60
+	public function formHTML($form_input, $form_input_class_name, \EE_Question $question = null) {
61
+		if ( ! is_subclass_of($form_input_class_name, 'EE_Form_Input_Base')) {
62 62
 			throw new \EE_Error(
63 63
 				sprintf(
64
-					__( 'The class "%1$s" needs to be a sub class of  EE_Form_Input_Base.', 'event_espresso' ),
64
+					__('The class "%1$s" needs to be a sub class of  EE_Form_Input_Base.', 'event_espresso'),
65 65
 					$form_input_class_name
66 66
 				)
67 67
 			);
68 68
 		}
69 69
 		$identifier = $question instanceof \EE_Question ? $question->identifier() : 'clone';
70
-		$this->form_input = $this->reg_form_editor_form->formInput( $form_input, $form_input_class_name, $question );
71
-		$this->input_has_options = $this->form_input instanceof \EE_Form_Input_With_Options_Base ? true :false;
72
-		$html = \EEH_HTML::div( '', '', 'ee-reg-form-editor-form-new-input-form' );
73
-		$html .= $this->reg_form_editor_form->formInputForm( $form_input, $identifier )->get_html();
74
-		$html .= \EEH_HTML::div( '', '', 'ee-new-form-input-settings-dv' );
75
-		$html .= $this->getTabs( $form_input, $identifier );
76
-		if ( $this->input_has_options ) {
70
+		$this->form_input = $this->reg_form_editor_form->formInput($form_input, $form_input_class_name, $question);
71
+		$this->input_has_options = $this->form_input instanceof \EE_Form_Input_With_Options_Base ? true : false;
72
+		$html = \EEH_HTML::div('', '', 'ee-reg-form-editor-form-new-input-form');
73
+		$html .= $this->reg_form_editor_form->formInputForm($form_input, $identifier)->get_html();
74
+		$html .= \EEH_HTML::div('', '', 'ee-new-form-input-settings-dv');
75
+		$html .= $this->getTabs($form_input, $identifier);
76
+		if ($this->input_has_options) {
77 77
 			// form input settings
78 78
 			$html .= \EEH_HTML::div(
79 79
 				'',
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 				'ee-reg-form-input-settings-tab-panel-dv'
82 82
 			);
83 83
 			$html .= $this->getInputOptionsFormHeader();
84
-			$html .= $this->getInputOptionsForm( $form_input, $identifier );
84
+			$html .= $this->getInputOptionsForm($form_input, $identifier);
85 85
 			//$html .= $this->reg_form_editor_form->getInputOptions( $form_input )->get_html();
86 86
 			$html .= $this->getInputOptionsFormFooter();
87 87
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 			"ee-reg-form-input-settings-tab-panel-1-{$identifier}-{$form_input}",
94 94
 			'ee-reg-form-input-settings-tab-panel-dv'
95 95
 		);
96
-		$html .= $this->reg_form_editor_form->getBasicSettings( $form_input, $identifier, $question )->get_html();
96
+		$html .= $this->reg_form_editor_form->getBasicSettings($form_input, $identifier, $question)->get_html();
97 97
 		$html .= \EEH_HTML::divx(); // end 'ee-reg-form-input-settings-tab-panel-dv'
98 98
 		// validation settings
99 99
 		$html .= \EEH_HTML::div(
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 			'ee-reg-form-input-settings-tab-panel-dv'
103 103
 		);
104 104
 		$html .= $this->reg_form_editor_form
105
-			->getValidationSettings( $form_input, $identifier, $form_input_class_name, $question )
105
+			->getValidationSettings($form_input, $identifier, $form_input_class_name, $question)
106 106
 			->get_html();
107 107
 		$html .= \EEH_HTML::divx(); // end 'ee-reg-form-input-settings-tab-panel-dv'
108 108
 		$html .= \EEH_HTML::divx(); // end 'ee-new-form-input-settings-dv'
@@ -117,18 +117,18 @@  discard block
 block discarded – undo
117 117
 	 * @param string  $identifier
118 118
 	 * @return string
119 119
 	 */
120
-	public function getTabs( $form_input, $identifier = 'clone' ) {
120
+	public function getTabs($form_input, $identifier = 'clone') {
121 121
 		$tabs = array(
122 122
 			0 => 'Input Options',
123 123
 			1 => 'Basic Settings',
124 124
 			2 => 'Validation Rules',
125 125
 		);
126
-		if ( ! $this->input_has_options ) {
127
-			unset( $tabs[0] );
126
+		if ( ! $this->input_has_options) {
127
+			unset($tabs[0]);
128 128
 		}
129
-		$html = \EEH_HTML::ul( '', 'ee-reg-form-input-settings-tab-ul');
129
+		$html = \EEH_HTML::ul('', 'ee-reg-form-input-settings-tab-ul');
130 130
 		$order = 1;
131
-		foreach ( $tabs as $panel => $tab_label ) {
131
+		foreach ($tabs as $panel => $tab_label) {
132 132
 			$active = $order === 1 ? ' ee-reg-form-input-settings-tab-active' : '';
133 133
 			$html .= \EEH_HTML::li(
134 134
 				\EEH_HTML::link(
@@ -153,24 +153,24 @@  discard block
 block discarded – undo
153 153
 	 * @return string
154 154
 	 * @throws \EE_Error
155 155
 	 */
156
-	public function getInputOptionsForm( $form_input, $identifier = 'clone' ) {
156
+	public function getInputOptionsForm($form_input, $identifier = 'clone') {
157 157
 		$html = '';
158
-		if ( $this->form_input instanceof \EE_Form_Input_With_Options_Base ) {
159
-			$options = $this->reg_form_editor_form->getInputOptions( $form_input, $this->form_input->options(), $identifier );
158
+		if ($this->form_input instanceof \EE_Form_Input_With_Options_Base) {
159
+			$options = $this->reg_form_editor_form->getInputOptions($form_input, $this->form_input->options(), $identifier);
160 160
 			$order = 2;
161
-			foreach( (array)$options as $key => $input ) {
162
-				if ( $input instanceof \EE_Form_Input_Base ) {
163
-					$html .= $this->getInputOptionsInputs( $key, $input );
161
+			foreach ((array) $options as $key => $input) {
162
+				if ($input instanceof \EE_Form_Input_Base) {
163
+					$html .= $this->getInputOptionsInputs($key, $input);
164 164
 					$order++;
165 165
 				}
166 166
 			}
167
-			$order = floor( $order /2 );
167
+			$order = floor($order / 2);
168 168
 			$hidden = $order > 2 ? true : false;
169
-			$html .= $this->addEmptyInputOptionsInputs( $form_input, $identifier, 0, $hidden );
169
+			$html .= $this->addEmptyInputOptionsInputs($form_input, $identifier, 0, $hidden);
170 170
 			//if ( $order <= 2 ) {
171 171
 			//	$html .= $this->addEmptyInputOptionsInputs( $form_input, 0, true );
172 172
 			//}
173
-			$html .= $this->getNewInputOptionOrderInput( $order );
173
+			$html .= $this->getNewInputOptionOrderInput($order);
174 174
 		}
175 175
 		return $html;
176 176
 	}
@@ -184,13 +184,13 @@  discard block
 block discarded – undo
184 184
 	 * @return array
185 185
 	 * @throws \EE_Error
186 186
 	 */
187
-	protected function getInputOptionsInputs( $key, \EE_Form_Input_Base $input, $hidden = false ) {
187
+	protected function getInputOptionsInputs($key, \EE_Form_Input_Base $input, $hidden = false) {
188 188
 		$html = '';
189 189
 		$hide_row = $hidden ? 'display:none;' : '';
190 190
 		$new_row = $hidden ? 'ee-input-option-new-row' : 'ee-input-option-sortable-row';
191
-		switch ( substr( $key, 0, 4 ) ) {
191
+		switch (substr($key, 0, 4)) {
192 192
 			case 'valu' :
193
-				$html .= \EEH_HTML::tr( '', '', $new_row, $hide_row );
193
+				$html .= \EEH_HTML::tr('', '', $new_row, $hide_row);
194 194
 				$html .= \EEH_HTML::td();
195 195
 				$html .= $input->get_html_for_input();
196 196
 				$html .= \EEH_HTML::tdx();
@@ -206,25 +206,25 @@  discard block
 block discarded – undo
206 206
 						'',
207 207
 						'ee-input-option-add dashicons dashicons-plus-alt',
208 208
 						'',
209
-						'title="' . __( 'Click to Add a New Option', 'event_espresso' ) . '"'
210
-					) . \EEH_HTML::span(
209
+						'title="'.__('Click to Add a New Option', 'event_espresso').'"'
210
+					).\EEH_HTML::span(
211 211
 						'',
212 212
 						'',
213 213
 						'ee-input-option-delete dashicons dashicons-trash',
214 214
 						'',
215
-						'title="' . __( 'Click to Delete This Option', 'event_espresso' ) . '"'
216
-					) . \EEH_HTML::span(
215
+						'title="'.__('Click to Delete This Option', 'event_espresso').'"'
216
+					).\EEH_HTML::span(
217 217
 						'',
218 218
 						'',
219 219
 						'ee-input-option-sort dashicons dashicons-arrow-up-alt2',
220 220
 						'',
221
-						'title="' . __( 'Drag to Sort', 'event_espresso' ) . '"'
222
-					) . \EEH_HTML::span(
221
+						'title="'.__('Drag to Sort', 'event_espresso').'"'
222
+					).\EEH_HTML::span(
223 223
 						'',
224 224
 						'',
225 225
 						'ee-input-option-sort dashicons dashicons-arrow-down-alt2', //list-view
226 226
 						'',
227
-						'title="' . __( 'Drag to Sort', 'event_espresso' ) . '"'
227
+						'title="'.__('Drag to Sort', 'event_espresso').'"'
228 228
 					),
229 229
 					'',
230 230
 					'ee-input-option-controls'
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	 * @return string
247 247
 	 * @throws \EE_Error
248 248
 	 */
249
-	protected function addEmptyInputOptionsInputs( $form_input, $identifier = 'clone', $order = 0, $hidden = true ) {
249
+	protected function addEmptyInputOptionsInputs($form_input, $identifier = 'clone', $order = 0, $hidden = true) {
250 250
 		$order = $order !== 0 ? $order : 'order';
251 251
 		$html = $this->getInputOptionsInputs(
252 252
 			'value',
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	 * @return string
281 281
 	 * @throws \EE_Error
282 282
 	 */
283
-	public function getNewInputOptionOrderInput( $order ) {
283
+	public function getNewInputOptionOrderInput($order) {
284 284
 		$order_input = new \EE_Hidden_Input(
285 285
 			array(
286 286
 				'html_name' => 'ee_new_input_option_order',
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 				'default'   => $order,
289 289
 			)
290 290
 		);
291
-		$html = \EEH_HTML::tr( '', '', 'ee_new_input_option_order', 'display:none;' );
291
+		$html = \EEH_HTML::tr('', '', 'ee_new_input_option_order', 'display:none;');
292 292
 		$html .= \EEH_HTML::td();
293 293
 		$html .= $order_input->get_html_for_input();
294 294
 		$html .= \EEH_HTML::tdx();
@@ -302,18 +302,18 @@  discard block
 block discarded – undo
302 302
 	 * @return string
303 303
 	 */
304 304
 	public function getInputOptionsFormHeader() {
305
-		$html = \EEH_HTML::table( '', '', 'input-options-table form-table' );
305
+		$html = \EEH_HTML::table('', '', 'input-options-table form-table');
306 306
 		$html .= \EEH_HTML::thead(
307 307
 			\EEH_HTML::tr(
308
-				\EEH_HTML::th( __( 'Value', 'event_espresso' ), '', 'option-value-header' ) .
308
+				\EEH_HTML::th(__('Value', 'event_espresso'), '', 'option-value-header').
309 309
 				\EEH_HTML::th(
310
-					__( 'Description (optional, only shown on registration form)', 'event_espresso' ),
310
+					__('Description (optional, only shown on registration form)', 'event_espresso'),
311 311
 					'',
312 312
 					'option-desc-header'
313 313
 				)
314 314
 			)
315 315
 		);
316
-		$html .= \EEH_HTML::tbody( '', '', 'ee-input-options-table-body' );
316
+		$html .= \EEH_HTML::tbody('', '', 'ee-input-options-table-body');
317 317
 		return $html;
318 318
 	}
319 319
 
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 	 * @return string
326 326
 	 */
327 327
 	public function getInputOptionsFormFooter() {
328
-		return \EEH_HTML::tbodyx() . \EEH_HTML::tablex( '', 'question-options-table' );
328
+		return \EEH_HTML::tbodyx().\EEH_HTML::tablex('', 'question-options-table');
329 329
 	}
330 330
 
331 331
 
Please login to merge, or discard this patch.